Justcook90 Posted August 27, 2006 Share Posted August 27, 2006 ok, i have a code, it uses check boxes i want it to where i click the check box the action happens and well that is working, but i want to be able to click more the one check box and have both actions run. but it isn't working out the way i want i click more the one and it is only running the first commaned in the line from the check boxs. this is happening to more the just one of my scripts. here is one of them, please tell me how to fix it to run more the just the first of the checked checkboxs. expandcollapse popup#include <GuiConstants.au3> #include <Color.au3> Opt("GUIOnEventMode",1) HotKeySet("{F5}", "_Start") HotKeySet("{ESC}","Terminate") $ClickIt = 0 GUICreate("Auto-Potter", 200, 150) GUISetOnEvent($GUI_EVENT_CLOSE,"Terminate") $Checkbox_1 = GUICtrlCreateCheckbox("Auto-Pot HP", 20, 40, 150, 20) $Checkbox_2 = GUICtrlCreateCheckbox("Auto-Pot MP", 20, 80, 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 $nColor = ( 0x52617B ) while 1 If $nColor = PixelGetColor( 30, 736 ) Then Send('{F7}') Sleep(1500) EndIf WEnd Sleep(100) EndIf If BitAND(GUICtrlRead($Checkbox_2), $GUI_CHECKED) = $GUI_CHECKED Then $nColor = ( 0x425963 ) while 1 If $nColor = PixelGetColor( 52, 726 ) Then Send('{F8}') Sleep(1500) EndIf WEnd Sleep(100) EndIf WEnd EndFunc ;==>_Start Func Terminate () Exit EndFunc ;==>Terminate Link to comment Share on other sites More sharing options...
Paulie Posted August 27, 2006 Share Posted August 27, 2006 ok, i have a code, it uses check boxes i want it to where i click the check box the action happens and well that is working, but i want to be able to click more the one check box and have both actions run. but it isn't working out the way i want i click more the one and it is only running the first commaned in the line from the check boxs. this is happening to more the just one of my scripts. here is one of them, please tell me how to fix it to run more the just the first of the checked checkboxs. expandcollapse popup#include <GuiConstants.au3> #include <Color.au3> Opt("GUIOnEventMode",1) HotKeySet("{F5}", "_Start") HotKeySet("{ESC}","Terminate") $ClickIt = 0 GUICreate("Auto-Potter", 200, 150) GUISetOnEvent($GUI_EVENT_CLOSE,"Terminate") $Checkbox_1 = GUICtrlCreateCheckbox("Auto-Pot HP", 20, 40, 150, 20) $Checkbox_2 = GUICtrlCreateCheckbox("Auto-Pot MP", 20, 80, 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 $nColor = ( 0x52617B ) while 1 If $nColor = PixelGetColor( 30, 736 ) Then Send('{F7}') Sleep(1500) EndIf WEnd Sleep(100) EndIf If BitAND(GUICtrlRead($Checkbox_2), $GUI_CHECKED) = $GUI_CHECKED Then $nColor = ( 0x425963 ) while 1 If $nColor = PixelGetColor( 52, 726 ) Then Send('{F8}') Sleep(1500) EndIf WEnd Sleep(100) EndIf WEnd EndFunc;==>_Start Func Terminate () Exit EndFunc;==>TerminateYou could use radios 'GuiCtrlCreateRadio' Link to comment Share on other sites More sharing options...
Justcook90 Posted August 27, 2006 Author Share Posted August 27, 2006 You could use radios 'GuiCtrlCreateRadio'could you give me a example of it, becuase i am still a noob at this, i realy don't understand much just want i have and not why it isn't working, that is what i want to know... i hope u understand that Link to comment Share on other sites More sharing options...
Helge Posted August 27, 2006 Share Posted August 27, 2006 (edited) i want to be able to click more the one check box and have both actions run.You could use radios 'GuiCtrlCreateRadio'Justcook90... Look at your checkbox-check. In this check you have added a loop which cannotbe exited. Because of this loop your second checkbox-check is never reached. Remove thosetwo loops in the checks and you might be one step closer to the grail of skill in gaming. Or not. Edited August 27, 2006 by Helge Link to comment Share on other sites More sharing options...
Justcook90 Posted August 28, 2006 Author Share Posted August 28, 2006 i fixed it the "while 1" i had befor each ceckbox-check made it go into a inf loop, i think that is what that other person was trying to say, and a radio isn't the thing for this... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now