BluhBlah Posted October 15, 2009 Share Posted October 15, 2009 Someone can tell me how to put like 10 loops in 1script? Want all loops to start /stop when i press F4 Thanks alot! Dim $stop = 0 HotKeySet("{F4}", "toggel") HotKeySet("{F5}", "off") While 1 If $stop = 1 Then EndIf EndIf WEnd Func toggel() If $stop = 0 Then $stop = 1 Else $stop = 0 EndIf EndFunc Func off() Exit EndFunc [/Codebox] Link to comment Share on other sites More sharing options...
rudi Posted October 15, 2009 Share Posted October 15, 2009 Hi. Right from the Help Files: ; Press Esc to terminate script, Pause/Break to "pause" Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("+!d", "ShowMessage") ;Shift-Alt-d ;;;; 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 Func Terminate() Exit 0 EndFunc Func ShowMessage() MsgBox(4096,"","This is a message.") EndFunc See the difference between this and your script. (while loop in func togglepause()... ) Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
BluhBlah Posted October 16, 2009 Author Share Posted October 16, 2009 Sorry i dont get it.. How to have etc 5pixelsearch in 1script? .S Link to comment Share on other sites More sharing options...
jvanegmond Posted October 16, 2009 Share Posted October 16, 2009 You do them one after the other, in one loop, very fast. github.com/jvanegmond Link to comment Share on other sites More sharing options...
BluhBlah Posted October 16, 2009 Author Share Posted October 16, 2009 Yeh but i like want 5pixelsearch in 1script and if it fins pixelsearch number 1 then it will do 1thing/number 2=another thing and so on Link to comment Share on other sites More sharing options...
jvanegmond Posted October 16, 2009 Share Posted October 16, 2009 So why can't you do that in one loop? github.com/jvanegmond Link to comment Share on other sites More sharing options...
BluhBlah Posted October 16, 2009 Author Share Posted October 16, 2009 I dont know how :S Link to comment Share on other sites More sharing options...
jvanegmond Posted October 16, 2009 Share Posted October 16, 2009 Then ask! While 1 If PixelSearch(...) Then ; ... Do the first thing EndIf If PixelSearch(...) Then ; ... Do the second thing EndIf Wend github.com/jvanegmond Link to comment Share on other sites More sharing options...
BluhBlah Posted October 16, 2009 Author Share Posted October 16, 2009 (edited) Ah thanks alot!' And what's $coord = oo Edited October 16, 2009 by Xoriaz Link to comment Share on other sites More sharing options...
jvanegmond Posted October 16, 2009 Share Posted October 16, 2009 $coord stands for coördinate. See the help file examples of PixelSearch. This is a better example for you: While 1 $coord = PixelSearch(...) If Not @error Then ; ... Do the first thing with $coord EndIf $coord = PixelSearch(...) If Not @error Then ; ... Do the second thing with $coord EndIf Wend github.com/jvanegmond Link to comment Share on other sites More sharing options...
BluhBlah Posted October 16, 2009 Author Share Posted October 16, 2009 (edited) While 1 If PixelSearch(821, 257, 821, 257, 0x9CB8EA) Then ; Bnet screen Send ("B") EndIf If PixelSearch(124, 446, 124, 446, 0x2742B0) Then ; Login screen Send ("Password") Send ("{ENTER}") Sleep (10000) EndIf If PixelSearch(124, 446, 124, 446, 0x2742B0) Then ; See if its logged in Send ("!Q") EndIf If PixelSearch(477, 358, 477, 358, 0x620776) Then ; Makes it quit if it find victory screen Send ("!Q") EndIf If PixelSearch(64, 9, 64, 9, 0x181410) Then ; Makes it leave the scoreboard Send ("{ENTER}") If PixelSearch(477, 358, 477, 358, 0x620776) Then ; See if its in game Sleep (300000) Then If PixelSearch(477, 358, 477, 358, 0x620776) Then Send ("!Q") EndIf If PixelSearch(463, 218, 463, 218, 0xFFDEFF) Then ; If it finds quitscreen it will quit game! Send ("Q") EndIf Wend How do i add hotkey on/Off And If WinActive("PRogram!") Then If it isnt active how do i make it open it? Edited October 16, 2009 by Xoriaz Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now