Sign in to follow this  
Followers 0
Frit

$Guieventclose - not declared? o.O

4 posts in this topic

I'm still a noob, all my Gui's close buttons doesn't work.

I tested a OnEventMode statement " GUISetOnEvent($GUI_EVENT_CLOSE, "") ".

When I run the script, I see the error: " $GUI_EVENT_CLOSE Variable used without being declared.".

I searched a lot on the forums, but I didn't find anything useful for this situation.

This is the code.

I've marked with ******* the statements.

Global $rod, $water, $msg, $rodlabel, $Paused, $mrdy
HotKeySet( "{F1}", "GetRod" )
HotKeySet( "{F2}", "GetWater" )
HotKeySet( "{F3}", "TogglePause" )

GUICreate("UTFB v.1.0", 290, 130)
GUISetOnEvent($GUI_EVENT_CLOSE, "GuiExit"); ************
GuiSetstate()


Global $rodlabel = GUICtrlCreateLabel('(x,y)', 240, 10, 80, 30)
GUICtrlSetColor ( $rodlabel, 11141120)
GUICtrlCreateLabel('Posição da fishing rod (alterar com F1)', 10, 10)
Func GetRod();get rod position
    $rod = MouseGetPos()
    GUICtrlSetData( $rodlabel, $rod[0] & ',' & $rod[1])
EndFunc

Global $waterlabel = GUICtrlCreateLabel('(x,y)', 240, 30, 80, 30)
GUICtrlSetColor ( $waterlabel, 11141120)
GUICtrlCreateLabel('Posição da água (alterar com F2)', 10, 30)
Func GetWater();get water position
    $water = MouseGetPos()
    GUICtrlSetData( $waterlabel, $water[0] & ',' & $water[1])
EndFunc

;fishing variables
$tempo = GUICtrlCreateInput("Velocidade (quanto menor o valor, mais rapido)", 10, 55, 250, 20)
$rdy = GUICtrlCreateCheckbox ("Ativar", 10, 80)
$mrdy = GUICtrlCreateCheckbox ("Master Fishing", 10, 100)

While 1;fishing actions
    If GUICtrlRead($rdy) = 1 and IsArray($rod) and IsArray($water) Then
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "right", $rod[0], $rod[1], 1, 1)
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "left", $water[0], $water[1], 1, 1)
    ElseIf GUICtrlRead($mrdy) = 1 and IsArray($rod) and IsArray($water) Then ;MASTER FISHING
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "right", $rod[0], $rod[1], 1, 1)
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "left", $water[0], $water[1], 1, 1);
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "right", $rod[0], $rod[1], 1, 1)
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "left", $water[0]-50, $water[1], 1, 1);
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "right", $rod[0], $rod[1], 1, 1)
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "left", $water[0]+50, $water[1], 1, 1);    
    ;
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "right", $rod[0], $rod[1], 1, 1)
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "left", $water[0], $water[1]+50, 1, 1);
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "right", $rod[0], $rod[1], 1, 1)
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "left", $water[0]-50, $water[1]+50, 1, 1);
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "right", $rod[0], $rod[1], 1, 1)
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "left", $water[0]+50, $water[1]+50, 1, 1); 
    ;
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "right", $rod[0], $rod[1], 1, 1)
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "left", $water[0], $water[1]-50, 1, 1);
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "right", $rod[0], $rod[1], 1, 1)
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "left", $water[0]-50, $water[1]-50, 1, 1);
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "right", $rod[0], $rod[1], 1, 1)
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "left", $water[0]+50, $water[1]-50, 1, 1); 
    EndIf 
WEnd

While 1;soltar guis
GuiSetstate()
Wend

Func TogglePause(); func pause
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
    WEnd
    ToolTip("")
EndFunc

Func GuiExit() ;**************
    Exit
Endfunc

p.s.: some part of the code is in portuguese.

thank you.

Share this post


Link to post
Share on other sites



#include <GUICONSTANTS.au3>

Global $rod, $water, $msg, $rodlabel, $Paused, $mrdy
HotKeySet( "{F1}", "GetRod" )
HotKeySet( "{F2}", "GetWater" )
HotKeySet( "{F3}", "TogglePause" )

GUICreate("UTFB v.1.0", 290, 130)
GuiSetstate()


Global $rodlabel = GUICtrlCreateLabel('(x,y)', 240, 10, 80, 30)
GUICtrlSetColor ( $rodlabel, 11141120)
GUICtrlCreateLabel('Posição da fishing rod (alterar com F1)', 10, 10)
Func GetRod();get rod position
    $rod = MouseGetPos()
    GUICtrlSetData( $rodlabel, $rod[0] & ',' & $rod[1])
EndFunc

Global $waterlabel = GUICtrlCreateLabel('(x,y)', 240, 30, 80, 30)
GUICtrlSetColor ( $waterlabel, 11141120)
GUICtrlCreateLabel('Posição da água (alterar com F2)', 10, 30)
Func GetWater();get water position
    $water = MouseGetPos()
    GUICtrlSetData( $waterlabel, $water[0] & ',' & $water[1])
EndFunc

;fishing variables
$tempo = GUICtrlCreateInput("Velocidade (quanto menor o valor, mais rapido)", 10, 55, 250, 20)
$rdy = GUICtrlCreateCheckbox ("Ativar", 10, 80)
$mrdy = GUICtrlCreateCheckbox ("Master Fishing", 10, 100)

While 1;fishing actions
    
    If GuiGetMsg() = $GUI_EVENT_CLOSE Then Exit
    If GUICtrlRead($rdy) = 1 and IsArray($rod) and IsArray($water) Then
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "right", $rod[0], $rod[1], 1, 1)
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "left", $water[0], $water[1], 1, 1)
    ElseIf GUICtrlRead($mrdy) = 1 and IsArray($rod) and IsArray($water) Then;MASTER FISHING
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "right", $rod[0], $rod[1], 1, 1)
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "left", $water[0], $water[1], 1, 1);
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "right", $rod[0], $rod[1], 1, 1)
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "left", $water[0]-50, $water[1], 1, 1);
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "right", $rod[0], $rod[1], 1, 1)
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "left", $water[0]+50, $water[1], 1, 1);    
   ;
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "right", $rod[0], $rod[1], 1, 1)
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "left", $water[0], $water[1]+50, 1, 1);
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "right", $rod[0], $rod[1], 1, 1)
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "left", $water[0]-50, $water[1]+50, 1, 1);
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "right", $rod[0], $rod[1], 1, 1)
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "left", $water[0]+50, $water[1]+50, 1, 1); 
   ;
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "right", $rod[0], $rod[1], 1, 1)
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "left", $water[0], $water[1]-50, 1, 1);
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "right", $rod[0], $rod[1], 1, 1)
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "left", $water[0]-50, $water[1]-50, 1, 1);
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "right", $rod[0], $rod[1], 1, 1)
        Sleep (GUICtrlRead($tempo))
        MouseClick ( "left", $water[0]+50, $water[1]-50, 1, 1); 
    EndIf
WEnd

Func TogglePause(); func pause
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
    WEnd
    ToolTip("")
EndFunc


AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

Oh, so simple!

Thank you :D

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