Jump to content

Problem with EndFunc & Wend


MrSlo
 Share

Recommended Posts

I made this code and it wont work.

Ithink this is my first problem in this code :) umm and im starter... ( BIG newbie =) ).

If u can help me il be happy!

;----------------------------
; For DriftCity
; Created by Matys
;----------------------------

#include <GUIConstants.au3>

HotkeySet("{F11}", "Quit")
HotkeySet("{F10}", "Pause")
HotKeySet("{F9}", "Go")
AutoItSetOption("TrayIconDebug", 1)

Global $Pause = 1

While 1
Sleep(100)
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func Go()
    $Pause = 1
        While $Pause = 1
    
            ToolTip("BOT Active", 0, 0)
Sleep(1000)

While (True)

    $subject = PixelSearch( 0, 0, 2000, 2000, 0xFFcB00);subject
Sleep(1000)
     Send("{TAB}")
        Send("{Enter}")
     
if (@error=1)Then
    Sleep(10)
    Else
$subject = PixelSearch( 0, 0, 800, 800, 0xFFcB00);subject
sleep(1500)
    Send("{TAB}")
        Send("{Enter}")

EndIf
    Wend
 EndFunc

Func Quit()
ToolTip("Quitting BOT", 0, 0)
Sleep(20)
EndFunc

Func Pause()
    $Pause = 3
    ToolTip("BOT Paused", 0, 0)
EndFunc
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "RegisteredOrganization", "REG_SZ", "DCO")
Link to comment
Share on other sites

Just corrected syntax errors and Tidyed-up

;----------------------------
; For DriftCity
; Created by Matys
;----------------------------

#include <GUIConstants.au3>

HotKeySet("{F11}", "Quit")
HotKeySet("{F10}", "Pause")
HotKeySet("{F9}", "Go")
AutoItSetOption("TrayIconDebug", 1)

Global $Pause = 1

While 1
    Sleep(100)
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func Go()
    $Pause = 1
    While $Pause = 1

        ToolTip("BOT Active", 0, 0)
        Sleep(1000)

        While 1

            $subject = PixelSearch(0, 0, 2000, 2000, 0xFFcB00);subject
            Sleep(1000)
            Send("{TAB}")
            Send("{Enter}")

            If (@error = 1) Then
                Sleep(10)
            Else
                $subject = PixelSearch(0, 0, 800, 800, 0xFFcB00);subject
                Sleep(1500)
                Send("{TAB}")
                Send("{Enter}")

            EndIf
        WEnd
    WEnd
EndFunc   ;==>Go

Func Quit()
    ToolTip("Quitting BOT", 0, 0)
    Sleep(20)
EndFunc   ;==>Quit

Func Pause()
    $Pause = 3
    ToolTip("BOT Paused", 0, 0)
EndFunc   ;==>Pause

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "RegisteredOrganization", "REG_SZ", "DCO")
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...