Jump to content

How do i use more than 3loops


 Share

Recommended Posts

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

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

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