GUI Help: Checkbox trouble Topic is solved

Ask gaming related questions (AHK v1.1 and older)
suffix
Posts: 8
Joined: 07 Jun 2023, 13:12

GUI Help: Checkbox trouble

Post by suffix » 07 Jun 2023, 13:18

I am making a simple valorant triggerbot and decided to add a gui to it (while never having any experience with ahk gui creation) but quickly ran into some trouble after looking around youtube and some forums i couldnt quite find what i needed so i came to the official ahk forum as a last resort. i am trying to check whether the checkbox is checked and if it is run the loop but it doesnt seem to be working. if you are able to help me get this working i would greatly appreciate it!

Code: Select all

Gui, Add, CheckBox, x12 y29 w100 h30 vTBCheckFR gValueFR , Not Moving Only
; Gui, Add, CheckBox, x12 y59 w100 h30 , Key Press Only
; Gui, Add, CheckBox, x12 y-1 w100 h30 , TriggerBot
Gui, Font, S8 CDefault Bold, Poppins
Gui, Font, S8 CDefault Bold Underline, Poppins
Gui, Font, S8 CDefault, Poppins
Gui, Font, S8 CDefault, Poppins
Gui, Font, S8 CDefault, Poppins
Gui, Add, Text, x142 y139 w0 h0 , Text
Gui, Font, S8 CDefault Strike, Poppins
Gui, Add, Text, x172 y69 w-40 h70 , Text
Gui, Font, , 
Gui, Add, Text, x12 y109 w370 h470 +Center, Make sure VALORANT is in windowed fullscreen mode!
Gui, Font, S12, Poppins
Gui, Submit, NoHide
Gui, Show, h131 w402, basic 4ss triggerbot
Return

ValueFR:
Gui, Submit, NoHide
Return

Loop
{
    if (TBCheckFR=1) {
        PixelSearch, Px, Py, scan1, scan2, scan3, scan4, 0xA5A528, 20, Fast RGB
        if (ErrorLevel=0) {
            PixelSearch, Px, Py, scan1, scan2, scan3, scan4, 0xA5A528, 20, Fast RGB
            Loop, 1 {
                Random, rand, 2, 9
                Sleep, rand
                Send, {LButton Down}
                Sleep, 1
                Send, {LButton Up}
            }
        }
    }
}

end::
exitapp
return

Quitter:
ExitApp

GuiClose:
ExitApp

User avatar
mikeyww
Posts: 26856
Joined: 09 Sep 2014, 18:38

Re: GUI Help: Checkbox trouble  Topic is solved

Post by mikeyww » 07 Jun 2023, 18:49

Welcome to this AutoHotkey forum!

The Return command does something rather than nothing! The Return command ends your subroutine. Unlabeled code following Return is unreachable and will never execute. You could remove the Return command if that makes sense to you. Do you see which one I mean?

To understand your script, follow it line by line.

suffix
Posts: 8
Joined: 07 Jun 2023, 13:12

Re: GUI Help: Checkbox trouble

Post by suffix » 07 Jun 2023, 23:40

RIghto, so i should remove the return that is under the ValueFR: label function? or do you mean the one under the gui?
mikeyww wrote:
07 Jun 2023, 18:49
Welcome to this AutoHotkey forum!

The Return command does something rather than nothing! The Return command ends your subroutine. Unlabeled code following Return is unreachable and will never execute. You could remove the Return command if that makes sense to you. Do you see which one I mean?

To understand your script, follow it line by line.

suffix
Posts: 8
Joined: 07 Jun 2023, 13:12

Re: GUI Help: Checkbox trouble

Post by suffix » 07 Jun 2023, 23:50

thank you so much man! i removed the return under Gui, Show and moved the label function under the loop and it worked perfectly! you were a great help and if there is a reputation system on this site then you just gained some.

Post Reply

Return to “Gaming Help (v1)”