Sign in to follow this  
Followers 0
UnknownWarrior

Checkbox help?

7 posts in this topic

#include <GuiConstants.au3>
Opt("GUIOnEventMode",1)
HotKeySet("{F5}", "_Start")
HotKeySet("{F7}", "_NoClick")
HotKeySet("{ESC}","Terminate")
$ClickIt = 0
GUICreate("Multy-functions", 400, 300)
GUISetOnEvent($GUI_EVENT_CLOSE,"Terminate")
$Checkbox_1 = GUICtrlCreateCheckbox("my function", 20, 40, 150, 20)
$Checkbox_2 = GUICtrlCreateCheckbox("my function", 20, 80, 150, 20)
$Checkbox_3 = GUICtrlCreateCheckbox("my function", 20, 120, 150, 20)
$Checkbox_4 = GUICtrlCreateCheckbox("Right-clicker", 20, 160, 150, 20)
$Checkbox_5 = GUICtrlCreateCheckbox("Left-clicker", 20, 200, 150, 20)
GUISetState()
While 1
    Sleep( 10 )
WEnd
Exit
Func _Start ()
    $ClickIt = 1
    While $ClickIt = 1
        If BitAND(GUICtrlRead($Checkbox_1), $GUI_CHECKED) = $GUI_CHECKED Then
            While 1
                MouseClick("left", 459, 79)
            WEnd
        EndIf
        If BitAND(GUICtrlRead($Checkbox_2), $GUI_CHECKED) = $GUI_CHECKED Then
            MouseClick("left", 429, 443)
            MouseClick("right", 503, 330)
            Sleep(120000)
        EndIf
        If BitAND(GUICtrlRead($Checkbox_3), $GUI_CHECKED) = $GUI_CHECKED Then
            MouseClick("right", 503, 330)
            Sleep(4500)
        EndIf
        If BitAND(GUICtrlRead($Checkbox_4), $GUI_CHECKED) = $GUI_CHECKED Then
            MouseClick("right")
        EndIf
        If BitAND(GUICtrlRead($Checkbox_5), $GUI_CHECKED) = $GUI_CHECKED Then
            MouseClick("left")
        EndIf
    WEnd
EndFunc ;==>_Start
Func _NoClick ()
    ToolTip("")
    $ClickIt = 0
EndFunc ;==>_NoClick
Func Terminate ()
    Exit
EndFunc ;==>Terminate

Alright i got my code to work but can anyone tell me why i cant check 2 checkboxes at a time? Like if i check the first box and the last box they both wont work together... What do i have to do to make it work with multiple functions if checked?

P.S. im new here kind of lol any help be great thx!

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

HI,

why not? Changed it to demonstrate.

Func _Start ()
    $ClickIt = 1
    While $ClickIt = 1
        If BitAND(GUICtrlRead($Checkbox_2), $GUI_CHECKED) And BitAND(GUICtrlRead($Checkbox_1), $GUI_CHECKED)= $GUI_CHECKED Then
        MsgBox(0,"Yeah","Yeah")
            Sleep(120000)
        EndIf
    WEnd
EndFunc ;==>_Start
oÝ÷ ÚãºËZºÚ"µÍ[ÈÔÝ

B   ÌÍÐÛXÚÒ]HBÚ[H    ÌÍÐÛXÚÒ]HBYÕRPÝXY
    ÌÍÐÚXÚØÞÌH[ÕRPÝXY
    ÌÍÐÚXÚØÞÌJOH    ÌÍÑÕRWÐÒPÒÑQ[ÙÐÞ
    ][ÝÖYXZ   ][ÝË  ][ÝÖYXZ   ][ÝÊBÛY
L
B[YÑ[[[ÈÏOIÝ×ÔÝ

So long,

Mega

Edited by th.meger

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

HI,

why not? Changed it to demonstrate.

Func _Start ()
    $ClickIt = 1
    While $ClickIt = 1
        If BitAND(GUICtrlRead($Checkbox_2), $GUI_CHECKED) And BitAND(GUICtrlRead($Checkbox_1), $GUI_CHECKED)= $GUI_CHECKED Then
        MsgBox(0,"Yeah","Yeah")
            Sleep(120000)
        EndIf
    WEnd
EndFunc ;==>_Start
oÝ÷ ÚãºËZºÚ"µÍ[ÈÔÝ

B   ÌÍÐÛXÚÒ]HBÚ[H    ÌÍÐÛXÚÒ]HBYÕRPÝXY
    ÌÍÐÚXÚØÞÌH[ÕRPÝXY
    ÌÍÐÚXÚØÞÌJOH    ÌÍÑÕRWÐÒPÒÑQ[ÙÐÞ
    ][ÝÖYXZ   ][ÝË  ][ÝÖYXZ   ][ÝÊBÛY
L
B[YÑ[[[ÈÏOIÝ×ÔÝ

So long,

Mega

Well i know left and right click cant go together but lets say i want MORE than 2 If bitand checked blah blah, do i put all checks in one thing? Because how do i seperate them also? What if a user wants Just left click but then that same user wants Ctrl+left+my function? Do i do all the checkboxes seperate then do all of them together or what? -.-

Share this post


Link to post
Share on other sites

Im having same problem, anyone know how to do it for multiple checkboxes but still keep the checkboxes seperate for just a 1 check...?

Share this post


Link to post
Share on other sites

Hi,

sorry could you explain it a little more clear? I dont't get your problem. :">

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

I mean like say heres my GUI:::

_

|_| function checkbox 1

_

|_| function check box 2

_

|_| function checkbox 3

Alright say i JUST check function checkbox 1, it does whatever is coded. But now i need 2 things so i check checkbox 1 and checkbox 2. So now they are both checked. So they will both do there approiate job of there checkbox. And if all 3 they all do what they are suppose to do, but together.... Hope this helps and that maybe you can give me some help or a code to work on or something? Thank you so much :D

Share this post


Link to post
Share on other sites

#include <GuiConstants.au3>
Opt("GUIOnEventMode",1)
HotKeySet("{F5}", "_Start")
HotKeySet("{F7}", "_NoClick")
HotKeySet("{ESC}","Terminate")
Dim $mycheckbox1
Dim $mycheckbox2
Dim $mycheckbox3
Dim $mycheckbox4
$ClickIt = 0
GUICreate("CO-MacroBot", 400, 300)
GUISetOnEvent($GUI_EVENT_CLOSE,"Terminate")
$Checkbox_1 = GUICtrlCreateCheckbox("Auto-Follow", 20, 40, 150, 20)
$Checkbox_2 = GUICtrlCreateCheckbox("Move-Miner", 20, 80, 150, 20)
$Checkbox_3 = GUICtrlCreateCheckbox("Fire circle lvler", 20, 120, 150, 20)
$Checkbox_4 = GUICtrlCreateCheckbox("Right-clicker", 20, 160, 150, 20)
GUISetState()
While 1
    Sleep( 10 )
WEnd
Exit
Func _Start ()
    $ClickIt = 1
    While $ClickIt = 1
        If BitAND(GUICtrlRead($Checkbox_1), $GUI_CHECKED) = $GUI_CHECKED Then
            While $mycheckbox1
                $correct_color = PixelGetColor( 57, 742 )
                while 1
                    If $correct_color <> PixelGetColor( 57, 742 ) Then
                        Send('{F8}')
                        Sleep(1500)
                    EndIf
                WEnd
                Sleep(100)
            WEnd
        EndIf
        If BitAND(GUICtrlRead($Checkbox_2), $GUI_CHECKED) = $GUI_CHECKED Then
            While $mycheckbox2
                $correct_color = PixelGetColor( 382, 730 )
                while 1
                    If $correct_color <> PixelGetColor( 382, 730 ) Then
                        Send('{F9}')
                        Sleep(1500)
                    EndIf
                WEnd
                Sleep(100)
            WEnd
        EndIf
        If BitAND(GUICtrlRead($Checkbox_3), $GUI_CHECKED) = $GUI_CHECKED Then
            While $mycheckbox3
                $correct_color = PixelGetColor( 63, 735 )
                while 1
                    If $correct_color <> PixelGetColor( 63, 735 ) Then
                        Send('{F6}')
                        Sleep(1500)
                    EndIf
                WEnd
                Sleep(100)
            WEnd
        EndIf
        If BitAND(GUICtrlRead($Checkbox_4), $GUI_CHECKED) = $GUI_CHECKED Then
            While $mycheckbox4
                $correct_color = PixelGetColor( 300, 730 )
                while 1
                    If $correct_color <> PixelGetColor( 300, 730 ) Then
                        Send('{F7}')
                        Sleep(1500)
                    EndIf
                WEnd
                Sleep(100)
            WEnd
        EndIf
        If GUICtrlRead($Checkbox_1) And GUICtrlRead($Checkbox_2) And GUICtrlRead($Checkbox_3) And GUICtrlRead($Checkbox_4)= $GUI_CHECKED Then
            While $mycheckbox1
                $correct_color = PixelGetColor( 57, 742 )
                while 1
                    If $correct_color <> PixelGetColor( 57, 742 ) Then
                        Send('{F8}')
                        Sleep(1500)
                    EndIf
                WEnd
                Sleep(100)
            WEnd
            While $mycheckbox2
                $correct_color = PixelGetColor( 382, 730 )
                while 1
                    If $correct_color <> PixelGetColor( 382, 730 ) Then
                        Send('{F9}')
                        Sleep(1500)
                    EndIf
                WEnd
                Sleep(100)
            WEnd
            While $mycheckbox3
                $correct_color = PixelGetColor( 63, 735 )
                while 1
                    If $correct_color <> PixelGetColor( 63, 735 ) Then
                        Send('{F6}')
                        Sleep(1500)
                    EndIf
                WEnd
                Sleep(100)
            WEnd
            While $mycheckbox4
                $correct_color = PixelGetColor( 300, 730 )
                while 1
                    If $correct_color <> PixelGetColor( 300, 730 ) Then
                        Send('{F7}')
                        Sleep(1500)
                    EndIf
                WEnd
                Sleep(100)
            WEnd
        EndIf
    WEnd
EndFunc ;==>_Start
Func _NoClick ()
    ToolTip("")
    $ClickIt = 0
EndFunc ;==>_NoClick
Func Terminate ()
    Exit
EndFunc ;==>Terminate

Alright i recoded to actually show you WHAT i am doing. Alright i jsut cannot figure it out. I tried using the Dim and without the Dim still will not work. I want it so that last one If checkbox 1 and checkbox 2 and checkbox 3 and checkbox 4.... If just 1 or 2 of those are checked those other 2 will not run. I hope you can understand what im saying here thanks in advance.

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