Sign in to follow this  
Followers 0
Malse

Script keeps turning off before it starts

7 posts in this topic

Ok, So I'm needing a script, That turns on when i hit Home, and turns off when i hit End.

Now for the most part i think it got it, but its not working and i don't see anything like it anywhere, So, Can you please help me with it. Thanks

Here is my code

Hotkeyset("{HOME}","start")
Hotkeyset("{END}","stop")


Func start()
Send("{TAB}")
Send("3")
Sleep(10000)
Send("{SPACE}")
Send("{SPACE}")
Send("{SPACE}")
Send("{SPACE}") 
Send("8")
Sleep(10000)
Send("{LEFT}")
MouseMove (300,500)      
MouseMove (400,400)
EndFunc

Func stop()
    exit
EndFunc

I need the Start to Loops over and over, and then the Stop, is of coarse to stop the loop.

>>Here is the script file.<<

Any ideas or help would be much appreciated.

Cya!

Share this post


Link to post
Share on other sites

Hi!

Try this worked fine for me:

Hotkeyset("{HOME}","start")

Hotkeyset("{END}","stop")

While 1

Sleep(10)

WEnd

Func start()

Send("{TAB}")

Send("3")

Sleep(10000)

Send("{SPACE}")

Send("{SPACE}")

Send("{SPACE}")

Send("{SPACE}")

Send("8")

Sleep(10000)

Send("{LEFT}")

MouseMove (300,500)

MouseMove (400,400)

EndFunc

Func stop()

exit

EndFunc

Share this post


Link to post
Share on other sites

Ok, I just tried that, Works great, But it doesn't loop the start... it stops after one pass, How do i loop it?

Share this post


Link to post
Share on other sites

While 1

start()

Sleep(10)

WEnd

Share this post


Link to post
Share on other sites

Ok, I just tried that, Works great, But it doesn't loop the start... it stops after one pass, How do i loop it?

Are you wanting this to sit idle until you press the HOME or END keys? If so then what you have should work fine. The reason it stops after one pass is because you pressed END which says to Exit (stop/kill/end/exit script). On the other hand if you want the script to loop the start() function without pressing the HOME key, then what weaponx gave you is on target. However then it doesn't really make much sense to have the start() function tied to a hotkey... if you know what I mean.

Here's your script cleaned up just a bit. Read the Send command help file and you'll understand my changes better.

Hotkeyset("{HOME}","start")
Hotkeyset("{END}","stop")

While 1
    Sleep(10)
WEnd

Func start()
    Send("{TAB}3")
    Sleep(10000)
    Send("{SPACE 4}8")
    Sleep(10000)
    Send("{LEFT}")
    MouseMove (300,500) 
    MouseMove (400,400)
EndFunc

Func stop()
    exit
EndFunc

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I don't really understand you...

do you want to loop the startfunction?

1 way is to press {Home} more often or to put a do-loop in like weaponx or this

Func start()
    Do
    Send("{TAB}3")
    Sleep(10000)
    Send("{SPACE 4}8")
    Sleep(10000)
    Send("{LEFT}")
    MouseMove (300,500)
    MouseMove (400,400)
$func = $func + 1
Until $func = 10
EndFunc

Or do you want to only stop the startfunction with the {End} button and not the script?

Edited by Arterie

Share this post


Link to post
Share on other sites

While 1

start()

Sleep(10)

WEnd

Works Thanks champ!

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