Jump to content

Loop Function Error


Recommended Posts

My Code

#Region --- ScriptWriter generated code Start ---
Opt("WinWaitDelay", 100)
Opt("WinTitleMatchMode", 4)
Opt("WinDetectHiddenText", 1)
Opt("MouseCoordMode", 0)
HotKeySet("{F1}", "warbot")
HotKeySet("{F2}", "warbot2")
HotKeySet("{F3}", "warbot3")
Func warbot()
        Send("{enter}")
        Send("4")
        MouseMove(1003,767)
        MouseDown ("left")
        Sleep(10000)
        MouseMove(991,767)
        Sleep(10000)
        MouseMove(1023,767)
        Sleep(10000)
        MouseUp ("left")
    EndFunc 
Func warbot2()
   $Exitwarbot = True
    EndFunc 
    Func warbot3()
    Send ( "!{F4}") 
EndFunc 
sleep(9999999999999999999999999999999)
#EndRegion --- ScriptWriter generated code Start ---

Functions

F1: Starts Warbot (A spam like program)

F2: stops warbot

f3: close's current program

how do i make F1 loop until the user hits F2, and when i try to load the program, It close's immiedietly. So i put sleep(88888888888888888) or w.e and it didnt do anything.

Edited by ph34r
Link to comment
Share on other sites

Whats wrong with this code

HotKeySet("{F1}", "_warbot")
HotKeySet("{F2}", "_stop")

Global $Exitfunc = False

Func _Warbot()
   
        Send("{enter}")
        Send("4")
        MouseMove(1003,767)
        MouseDown ("left")
        Sleep(10000)
        MouseMove(991,767)
        Sleep(10000)
        MouseMove(1023,767)
        Sleep(10000)
        MouseUp ("left")
        If $Exitfunc = True then Return
    Next
EndFunc

Func _Stop()
    $Exitfunc = True
EndFunc

Im trying to make it so when the user hits f1, it will preform

Send("{enter}")
        Send("4")
        MouseMove(1003,767)
        MouseDown ("left")
        Sleep(10000)
        MouseMove(991,767)
        Sleep(10000)
        MouseMove(1023,767)
        Sleep(10000)
        MouseUp ("left")

And it will continue it FOREVER

until they hit f2

IDK how to code for infinite loops.

for example next without for

When the words fail... music speaks.

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...