Sign in to follow this  
Followers 0
Mazdryk

Limit to only one function ran at a time

2 posts in this topic

#1 ·  Posted (edited)

MY script is below.  Basically I do not want Func _fight2 to interrupt or insert itself in Func _Bash If I hit the hotkey for it before the other ends.  Is there a command to let only one function run at a time?

 

 
Func _Bash()
 HotKeySet("{F4}")
$Swap = PixelSearch(800, 1037, 800, 1037, $color1,1, 1, $wgh)  ;#1CD
If (IsArray($Swap) = 1) Then
MouseClick ("LEFT")
Sleep (150)
Send ("{0}")
Sleep (500)
else
MouseClick ("LEFT")
Sleep (200)
Send ("{1}")
Sleep (1000)
endif
HotKeySet("{F4}","_Bash")
EndFunc
 
Func _Fight2()
 HotKeySet("{F8}")
$Swap = PixelSearch(800, 1037, 800, 1037, $color1,1, 1, $wgh)  ;#1CD
If (IsArray($Swap) = 1) Then
MouseClick ("LEFT")
Sleep (150)
Send ("{2}")
Sleep (500)
else
MouseClick ("LEFT")
Sleep (200)
Send ("{2}")
Sleep (1000)
endif
HotKeySet("{F8}","_Fight2")
EndFunc
Edited by Melba23
Added code tags

Share this post


Link to post
Share on other sites



Mazdryk,

When you last posted a gamebot script I warned you what would happen - so take a week off to read the Forum rules (there is also a link at bottom right of each page) and understand that we enforce them rigidly. Thread locked. :naughty:

M23

P.S. And if you do return, learn that when you post code you should use Code tags - see here how to do it. Then you get a scrolling box and syntax colouring as you can see above now I have added the tags. ;)

1 person likes this

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0