Sign in to follow this  
Followers 0
intelPiggy

Please Help To Check

2 posts in this topic

i like to know does my coding work for the below script?

I'm new to Autoit and trying to pick up a few things here~

Opt("PixelCoordMode", 2)
Opt("MouseCoordMode", 2)

HotKeySet("^z", "_Pause")
HotKeySet("^x", "_exit")
#include <GUIConstants.au3>
$F1kill = 0
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("GzAuto v1.0 Simple", 206, 263, 193, 115)
GUISetBkColor(0xA6CAF0)
$Group1 = GUICtrlCreateGroup("Enter The Color Code", 8, 0, 193, 49)
GUICtrlSetBkColor(-1, 0xA6CAF0)
$monstercolor = GUICtrlCreateInput("Enter Color Code", 16, 16, 169, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("Time Delay By Seconds", 8, 56, 193, 49)
GUICtrlSetBkColor(-1, 0xA6CAF0)
$timedelay = GUICtrlCreateInput("Enter In Seconds", 16, 72, 169, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group3 = GUICtrlCreateGroup("F1 Key Press After How Many Kills", 8, 112, 193, 49)
GUICtrlSetBkColor(-1, 0xA6CAF0)
$F1kill = GUICtrlCreateInput("Enter A Numbers", 16, 128, 169, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Global $Paused
Func _Pause()
    $Paused = Not $Paused
    While $Paused
        Sleep(100)
        ToolTip("GzAuto Stopped...", 800, 0)
    WEnd
EndFunc  ;==>_Pause

Func _exit()
    Exit
EndFunc  ;==>_exit

If @error = 1 Then Exit

WinWaitActive("GoonZu")

While 1
    ToolTip("GzAuto Running...", 800, 0)
    For $search = 150 To 800 Step 30
        Sleep(100)
        $jp = PixelSearch($search, $search - 150, 810, 660, 15152218)
        If Not @error Then
            $point = PixelGetColor($jp[0], $jp[1] + 67)
            If $point = $monstercolor Then
                MouseClick("Primary", $jp[0], $jp[1] + 67, 1, 0)
                MouseMove(0, 0, 0)
                Sleep($timedelay * 1000)
                $F1kill = $F1kill + 1
                ExitLoop
            EndIf
        EndIf
    Next
WEnd

If $F1kill = $F1kill Then
    Send("{F1}")
    $F1kill = 0
EndIf

Share this post


Link to post
Share on other sites



i like to know does my coding work for the below script?

I'm new to Autoit and trying to pick up a few things here~

1. You have no loop to handle GUI messages. Read the help file on GuiGetMsg().

2. GUICtrlCreateInput() returns a control ID for the input control, not the contents of input. To use the value of these inputs, you'll read the control, using its control ID, into a different variable:

; While creating the gui:
$monstercolor = GUICtrlCreateInput("Enter Color Code", 16, 16, 169, 21)

...

; Read the input
$MonClr = GuiCtrlRead($monstercolor)

3. The If @error Then Exit line is useless, because nothing is happening yet that might set @error.

4. For clarity and sanity's sake put all the #include's at the very top, and Func function declarations at the bottom.

There may be more issues, but the first two above are show stoppers. Fix 'em. Don't give up on it!

:shocked:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  
Followers 0