Sign in to follow this  
Followers 0
Busser

Start run for 4 times then stop ect....

4 posts in this topic

hi im making a macro to do a few things im looking to do a Start when i press a key i know how to do that but i want it to run 4 times then stop until i press the start button again

but i also would like a button in there that if i pres?????? it will stop it but if i press ???? it will start from the beginning again not a pause

i think that is all

thank you for all the read this and help

BUsser

Share this post


Link to post
Share on other sites



Kinda like...

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

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("{F9}", "ShowMe")

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

Func TogglePause()
    $Paused = Not $Paused
    While $Paused
        Sleep(100)
        ToolTip('Script is "Paused"', 0, 0)
    WEnd
    ToolTip("")
EndFunc   ;==>TogglePause

Func Terminate()
    Exit 0
EndFunc   ;==>Terminate

Func ShowMe()
    For $x = 1 To 4
        MsgBox(4096, $x, "This is message #" & $x, 2)
    Next
EndFunc   ;==>ShowMessage

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Kinda like...

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

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("{F9}", "ShowMe")

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

Func TogglePause()
    $Paused = Not $Paused
    While $Paused
        Sleep(100)
        ToolTip('Script is "Paused"', 0, 0)
    WEnd
    ToolTip("")
EndFunc   ;==>TogglePause

Func Terminate()
    Exit 0
EndFunc   ;==>Terminate

Func ShowMe()
    For $x = 1 To 4
        MsgBox(4096, $x, "This is message #" & $x, 2)
    Next
EndFunc   ;==>ShowMessage

8)

CODE
HotKeySet("{HOME}","StartScript")

HotKeySet("{END}","StopScript")

HotKeySet("{PAUSE}", "TogglePause")

While 1

sleep("10000"); Idle, will start when you press HOME

WEnd

Func StartScript()

While 1

MouseMove(1409, 470) ; Talic in bag

MouseClick("left")

MouseMove(804, 439) ; Talic In combation winodw

MouseClick("left")

Sleep (100) ;--------------------------20 20

Send("{2}") ; Enters 20 then hits enter

Sleep (100) ;

Send("{0} {Enter}") ;--------------------------

MouseMove(803, 541) ; Start Button

MouseClick("left")

MouseMove(870, 564) ; Saying Yes to pay money

MouseClick("left")

Sleep (3750) ; Sleeps 5 secs while it does it stuff

MouseMove(963, 630) ; Clicks Continue

MouseClick("left")

Sleep (2000)

WEnd

EndFunc

Func StopScript()

Exit

EndFunc

Func TogglePause()

$Paused = NOT $Paused

While $Paused

sleep(100)

ToolTip('Script is "Paused"',0,0)

WEnd

ToolTip("")

EndFunc

ok that is wat i have and i have it so it will start when i press HOME stop when i hit END pause when i hit PAUSE but i would like it so that says PAGEUP stops it but doesn't stop the whole script and if i hit PAGE DOWN or HOME it will restart the whole prgram again

i don't want to have to log out and restart it every time

and pause pause it and starts it from last stop i want it to start from 1 again

thanx

Share this post


Link to post
Share on other sites

In the function StartScript() there is a while/wend loop and it does not exit. look at mine and you can see I used for $x = 1 to 4. 4 is the couynt you wanted and it leaves the loop

8)


NEWHeader1.png

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