Jump to content
Sign in to follow this  
toothyXdip

Disable/Enable using same hot key

Recommended Posts

toothyXdip

(ac script at bottem)

ok im just working on making my ac a little better and i thought you shouldnt be able to click diff speeds when you are in the clicking process.

My problem it will disable the other 2 radios when i start it and keep the selected one enabled but when i press the hot key again the acing stops but the other 2 are still disabled.

And yes i did try to get this to work before i posted i tried setting up an else in the if tried having a func that enables them and checks if they are disabled ive tried a lot of stuff so yeah...i probably just did the write thing just in the wrong way.

(and im trying something write now that i thought of so i might get it to work)

nope that did work i tried a different way of doing the check state if state then change state...still same problem >.<

And im not asking for a script im asking for you to give me and Idea of what i need to do

Global $F10OnOff

HotKeySet('{F10}', '_Sendleftclick')

#include <GUIConstants.au3>
$main = GUICreate("Toothydip Ac", 230, 300)
GUISetBkColor(0x0000ff)
$user = GUICtrlCreateDummy()
GUICtrlSetOnEvent ($GUI_EVENT_CLOSE, 'onclick')
$group = XSkinGroup("Speed Setting", 40, 80, 130, 130, $SS_CENTER)
GUISetFont(16, "", "", "Alien Encounters")
;Labels-------------------------------------------
$title = GUICtrlCreateLabel("Toothydip" & @CRLF & "AutoClicker", 40, 40)
guisetfont(9)
; Buttons & Checkboxes----------------------------
$fast_speed_checkbox = GUICtrlCreateRadio("  Fast Speed", 50, 100,90,20)
$medium_speed_checkbox = GUICtrlCreateRadio("  Medium Speed", 50, 130,110,20)
$slow_speed_checkbox = GUICtrlCreateRadio("  Slow Speed", 50, 160,90,20)
; Color Sets -------------------------------------
guictrlsetcolor($title, 0x000000)

$clicksetting_helper = 0
$defalt_delay = 10
$speed_setting = 0


GUISetState(@SW_SHOW)



While True
    $msg = GUIGetMsg()
    Sleep(10)
    $clicksetting_helper = $clicksetting_helper + $speed_setting
    If (($clicksetting_helper * $defalt_delay) / 500) >= 1 Then
        Sendleftclick()
        $clicksetting_helper = 0
        EndIf
    Switch $msg
        Case $GUI_EVENT_CLOSE
            OnExit()
    EndSwitch
WEnd

; Functions -------------------------------------

Func OnExit()
   Exit
EndFunc

Func onclick()
    GUICtrlSendToDummy($user)
EndFunc

Func Sendleftclick()
    If $F10OnOff Then MouseClick("Left")
EndFunc

Func _Sendleftclick()
    $F10OnOff = Not $F10OnOff
    If _IsChecked($fast_speed_checkbox) Then 
        $speed_setting = 50
    GUICtrlSetState($medium_speed_checkbox, $GUI_DISABLE)
    GUICtrlSetState($slow_speed_checkbox, $GUI_DISABLE)
    
    ElseIf _IsChecked($medium_speed_checkbox) Then 
        $speed_setting = 30
    GUICtrlSetState($fast_speed_checkbox, $GUI_DISABLE)
    GUICtrlSetState($slow_speed_checkbox, $GUI_DISABLE)
    
    ElseIf _IsChecked($slow_speed_checkbox) Then 
        $speed_setting = 10
    GUICtrlSetState($medium_speed_checkbox, $GUI_DISABLE)
    GUICtrlSetState($fast_speed_checkbox, $GUI_DISABLE)
EndIf
EndFunc


Func _IsChecked($control)
    Return BitAnd(GUICtrlRead($control),$GUI_CHECKED) = $GUI_CHECKED
EndFunc

Func XSkinGroup($text, $Pleft, $Ptop, $Pwidth, $Pheight, $color)
    $color = 0Xffffff
    Local $XS_n, $PControl
    If StringInStr(@OSTYPE, "WIN32_NT") Then
        $XS_n = DllCall("uxtheme.dll", "int", "GetThemeAppProperties")
        DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)
    EndIf
    $PControl = GUICtrlCreateGroup($text, $Pleft, $Ptop, $Pwidth, $Pheight)
    ;GUICtrlSetBkColor($PControl, $color1)
    GUICtrlSetColor($PControl, $color)
    If StringInStr(@OSTYPE, "WIN32_NT") And IsArray($XS_n) Then
        DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $XS_n[0])
    EndIf
    Return $PControl
EndFunc   ;==>XSkinGroup
Edited by toothyXdip

---╔╦═╗╔╗'''╔╗╔═╦═╗╔╦═╗---╝╠═╣╝║'''║╝╝''''''╝╝║'''......''''''''''''''''''''''''''''''---╔╩═╩═╩═╩═══╩═╦═╩═╩══╦══════╗''''╔╩════════════╩══╗╔══╩══╗╔══╝ ''''''''''''''''''''''''''''''''''''''''''''''''''''║║'''''''''''''''║║ ''''''''''''''''''''''''''''''''''''''''''''''╔══╝╚══╗''''''║║''''''''''''''''''''''''''''''''''''''''''''''╚══════╝''''''╚╝

Share this post


Link to post
Share on other sites
Nahuel

Global $F10OnOff
Global $Disabled=False

HotKeySet('{F10}', '_Sendleftclick')

#include <GUIConstants.au3>
$main = GUICreate("Toothydip Ac", 230, 300)
GUISetBkColor(0x0000ff)
$user = GUICtrlCreateDummy()
GUICtrlSetOnEvent ($GUI_EVENT_CLOSE, 'onclick')
$group = XSkinGroup("Speed Setting", 40, 80, 130, 130, $SS_CENTER)
GUISetFont(16, "", "", "Alien Encounters")
;Labels-------------------------------------------
$title = GUICtrlCreateLabel("Toothydip" & @CRLF & "AutoClicker", 40, 40)
guisetfont(9)
; Buttons & Checkboxes----------------------------
$fast_speed_checkbox = GUICtrlCreateRadio("  Fast Speed", 50, 100,90,20)
$medium_speed_checkbox = GUICtrlCreateRadio("  Medium Speed", 50, 130,110,20)
$slow_speed_checkbox = GUICtrlCreateRadio("  Slow Speed", 50, 160,90,20)
; Color Sets -------------------------------------
guictrlsetcolor($title, 0x000000)

$clicksetting_helper = 0
$defalt_delay = 10
$speed_setting = 0


GUISetState(@SW_SHOW)



While True
    $msg = GUIGetMsg()
    Sleep(10)
    $clicksetting_helper = $clicksetting_helper + $speed_setting
    If (($clicksetting_helper * $defalt_delay) / 500) >= 1 Then
        Sendleftclick()
        $clicksetting_helper = 0
        EndIf
    Switch $msg
        Case $GUI_EVENT_CLOSE
            OnExit()
    EndSwitch
WEnd

; Functions -------------------------------------

Func OnExit()
   Exit
EndFunc

Func onclick()
    GUICtrlSendToDummy($user)
EndFunc

Func Sendleftclick()
    If $F10OnOff Then MouseClick("Left")
EndFunc

Func _Sendleftclick()
    $F10OnOff = Not $F10OnOff
    If $Disabled Then
        GUICtrlSetState($fast_speed_checkbox, $GUI_ENABLE)
        GUICtrlSetState($medium_speed_checkbox, $GUI_ENABLE)
        GUICtrlSetState($slow_speed_checkbox, $GUI_ENABLE)
        $Disabled = Not $Disabled
        Return
    EndIf
    If _IsChecked($fast_speed_checkbox) Then 
        $speed_setting = 50
        GUICtrlSetState($medium_speed_checkbox, $GUI_DISABLE)
        GUICtrlSetState($slow_speed_checkbox, $GUI_DISABLE)
        $Disabled=True
        ElseIf _IsChecked($medium_speed_checkbox) Then 
            $speed_setting = 30
            GUICtrlSetState($fast_speed_checkbox, $GUI_DISABLE)
            GUICtrlSetState($slow_speed_checkbox, $GUI_DISABLE)
            $Disabled=True
        ElseIf _IsChecked($slow_speed_checkbox) Then 
            $speed_setting = 10
            GUICtrlSetState($medium_speed_checkbox, $GUI_DISABLE)
            GUICtrlSetState($fast_speed_checkbox, $GUI_DISABLE)
            $Disabled=True
    EndIf
        
EndFunc


Func _IsChecked($control)
    Return BitAnd(GUICtrlRead($control),$GUI_CHECKED) = $GUI_CHECKED
EndFunc

Func XSkinGroup($text, $Pleft, $Ptop, $Pwidth, $Pheight, $color)
    $color = 0Xffffff
    Local $XS_n, $PControl
    If StringInStr(@OSTYPE, "WIN32_NT") Then
        $XS_n = DllCall("uxtheme.dll", "int", "GetThemeAppProperties")
        DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)
    EndIf
    $PControl = GUICtrlCreateGroup($text, $Pleft, $Ptop, $Pwidth, $Pheight)
    ;GUICtrlSetBkColor($PControl, $color1)
    GUICtrlSetColor($PControl, $color)
    If StringInStr(@OSTYPE, "WIN32_NT") And IsArray($XS_n) Then
        DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $XS_n[0])
    EndIf
    Return $PControl
EndFunc   ;==>XSkinGroup

Share this post


Link to post
Share on other sites
toothyXdip

thanks bro =)

HOLY SHIZZ 34,727 POST VIEWS almost as much as the sticky

Edited by toothyXdip

---╔╦═╗╔╗'''╔╗╔═╦═╗╔╦═╗---╝╠═╣╝║'''║╝╝''''''╝╝║'''......''''''''''''''''''''''''''''''---╔╩═╩═╩═╩═══╩═╦═╩═╩══╦══════╗''''╔╩════════════╩══╗╔══╩══╗╔══╝ ''''''''''''''''''''''''''''''''''''''''''''''''''''║║'''''''''''''''║║ ''''''''''''''''''''''''''''''''''''''''''''''╔══╝╚══╗''''''║║''''''''''''''''''''''''''''''''''''''''''''''╚══════╝''''''╚╝

Share this post


Link to post
Share on other sites
Al Jones

thanks bro =)

HOLY SHIZZ 34,727 POST VIEWS almost as much as the sticky

I believe it; for some reason there isn't anything directly pointing to how to enable / disable a GUI control - I've spent the better part of an hour looking - and of course, now that I've found it, it's obvious!

//al

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  

×