-
Notifications
You must be signed in to change notification settings - Fork 1
/
auto_restart.exw
76 lines (60 loc) · 2.09 KB
/
auto_restart.exw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
-- code generated by Win32Lib IDE v0.21.1 Build Sept-29-2006
constant TheProgramType="exw"
include Win32Lib.ew
without warning
--------------------------------------------------------------------------------
-- Window Window1
sequence IDEFlags
IDEFlags = classDefaults(Window, { {1, {WS_SYSMENU}},{2, {WS_EX_DLGMODALFRAME}} } )
constant Window1 = createEx( Window, "Rotmg auto restart", 0, Default, Default, 313, 93, {WS_THICKFRAME}, {WS_EX_DLGMODALFRAME} )
setWindowBackColor( Window1,1 )
---------------------------------------------------------
--------------------------------------------------------------------------------
constant working_dir=current_dir()
function file_exsist(sequence fname)
integer fn
fn=open(fname,"r")
if fn!=-1 then
close(fn)
return 1
end if
return 0
end function
-------called at the start before any code is executed---------------------
procedure run_program()
integer ret
ret= shellExecuteEx( "open",
-- with the program to call:
working_dir&"\\auto ranking.exe",
-- the parameter to pass to application to run:
"",
-- in this directory:
"",
-- and last, 'show' parameter:
SW_SHOW, 0 )
--?ret
end procedure
--working_dir&"\\"
function crash(object x)
-- in case of fire ...
-- (on Linux) send an e-mail containing ex.err
--system("mail -s \"crash!\" myname@xxx.com < ex.err > /dev/null", 2)
--puts(1,"crashgodsndsk")
--?1/0
clear_screen()
abort(0)
return 0
end function
--crash_message("An unexpected error has occurred!\n")
crash_file("NUL")
crash_routine(routine_id("crash"))
win32_disable_error_messages=1
-----------------------------------------------------------------------
--------------------------------------------------------------------------------
procedure Window1_onOpen (integer self, integer event, sequence params)--params is ()
run_program()
abort(0)
end procedure
setHandler( Window1, w32HOpen, routine_id("Window1_onOpen"))
WinMain( Window1,Normal )
--this program has 75 lines without including this line. If there is a discrepancy please send this file zipped to Judith.