Sign in to follow this  
Followers 0
wootn0w

Help with a program restarter

5 posts in this topic

Sup guys, here is my problem: Half Life dedicated server doesnt restart automatically, so when ever i want to restart it for a password reset over rcon, the server will just shut down. I got the movement and clicks and repeating code done (just need to put in specific values) but i cant figure out a methode (looked at some other posts) to wait until a specific window closes... any hints ? ill search on maybe i find something but help is appriciated.

here is my current code:

;wait for the window to close hlds

;do until window = 0 then

;move mouse to hlds.exe and double click

MouseMove(x, y)

MouseClick("left")

MouseClick("left")

;wait 10 seconds until server boot's then click once to start

Sleep(10000)

MouseMove(x, y)

MouseClick("left")

;repeat from beginning

Share this post


Link to post
Share on other sites



maybe this ???

; Press Esc to terminate script, Pause/Break to "pause"

Global $Paused
HotKeySet("{F!}", "Set_Run")
HotKeySet("{ESC}", "Terminate")
HotKeySet("+!d", "ShowMessage") ;Shift-Alt-d

;;;; Body of program would go here;;;;
While 1
    Sleep(100)
WEnd
;;;;;;;;


Func Terminate()
    Exit 0
EndFunc

Func ShowMessage()
    MsgBox(4096,"by  QTasc","This is a message. ")
EndFunc


Func Set_Run()

Do
    $win = WinWaitClose("?TITLE of WINDOW?") ;wait for the window to close hlds
Until $win = 0  


;move mouse to hlds.exe and double click
MouseMove(x, y)
MouseClick("left")
MouseClick("left")

;wait 10 seconds until server boot's then click once to start
Sleep(10000)
MouseMove(x, y)
MouseClick("left")


;repeat from beginning
EndFunc

hope that helps

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

K i got the part of the if window is closed do this im working on my own version now ;) thx for the info. I got one question though. Is there a Goto command ? cause that would be sweeeet

for instance if x = x do this else goto beginning of script

EDIT:I just searched and noticed some post about there not being a goto command too bad would make life easier well here is my code so far, im trying to find another way with a conditional statement of some sort. if you could lead me ahead plz thx

CODE:

Do

$win = WinWaitClose("window title here") ;wait for the window to close hlds

Until $win = 0

$win = $win

If $win = 0 Then

;move mouse to hlds.exe and double click

MouseMove(574, 22)

MouseClick("left")

MouseClick("left")

;wait 10 seconds until server boot's then click once to start

Sleep(10000)

MouseMove(527, 520)

MouseClick("left")

Sleep(100000)

Else

EndIf

Edited by wootn0w

Share this post


Link to post
Share on other sites

yes... formated like this

If $x = 1 then Call("More")

Func More()

msgbox(0,"test", " by QTasc ")

EndFunc

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

alright i shall try that 2nite ill let you know if it works thx so far ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0