Jump to content
Sign in to follow this  
BluhBlah

How do i use more than 3loops

Recommended Posts

BluhBlah

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]

Share this post


Link to post
Share on other sites
rudi

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!

Share this post


Link to post
Share on other sites
BluhBlah

Sorry i dont get it.. How to have etc 5pixelsearch in 1script? .S

Share this post


Link to post
Share on other sites
BluhBlah

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

Share this post


Link to post
Share on other sites
BluhBlah

Ah thanks alot!'

And what's

$coord =

oo

Edited by Xoriaz

Share this post


Link to post
Share on other sites
jvanegmond

$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

Share this post


Link to post
Share on other sites
BluhBlah

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 by Xoriaz

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.