Jump to content

Terminating a script


Anferny
 Share

Recommended Posts

Can you post the whole script please?

That code won't work because the program exits before it even has a chance to hit a hotkey.

Pause hotkeys usually just bring up a MsgBox and wait for the user to click it, once the user clicks it the script resumes, so:

HotKeySet("{ESC}", "Quit")
HotKeySet("{PAUSE}", "Pause")
While 1
    Sleep(1)
WEnd

Func Quit()
  Exit
EndFunc

Func Pause()
  MsgBox("","","Press OK to resume script")
EndFunc

Simple as that :lmao:

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to comment
Share on other sites

This is what the whole script should look like:

Msgbox( 0, "AutoIt", 'Press OK To Start The clicking. WARNING:You have 3 seconds to maximize IE!' )
;SplashTextOn ( 'AutoIt SpamBot', 'Hit Esc to stop', 100, 75 )
$coord = PixelSearch( 465, 390, 545, 490, 0x797170 )
If Not @error Then
$o = 0
While $o <29
        MouseClick("Left", $coord[0], $coord[1], 1, 5)
Sleep (8000)
wEnd
Endif

It's not working for some reason, it just flashes the: "Hit Esc to stop" and then ends. What am i doning wrong? It's supposed to click on a pixel with a hex thats listed above (i know for a fact that there is one there) and then click where it found it. It's supposed to do that 28times after sleeping for 8-9 seconds each time. Also is there a way to have it say somthing when it doesn't find that color? Like a If else else?

Edited by Anferny
Link to comment
Share on other sites

...you're exiting the script if the pixel is not found.

It doesn't wait at all unless the right pixel is found.

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...