SjaakTV Posted March 11, 2010 Share Posted March 11, 2010 Hi, I'm learning about GUICtrlCreateRadio but i have one problem. When i click a radio button then it will start that function. I have 4 radio buttons. Everybutton does something els. But i want to select a radio button then press start. The start function is something and then after that it needs to start the selected radio button. I have no idea what or how to do. A sample script. expandcollapse popupHotkeySet ("{0}", "Stop") Func Stop () Exit 0 EndFunc #include <GUIConstantsEx.au3> #include <windowsconstants.au3> MENU() Func MENU() GUICreate("Stop spam", 400, 288) GUISetBkColor(0xaaaaaa) GUICtrlCreateLabel((@MON & "/" & @MDAY & "/" & @YEAR), 325, 10) $Mouse1 = GUICtrlCreateRadio("Mouse1", 30, 110, 150, 15) $Mouse2 = GUICtrlCreateRadio("Mouse2", 30, 130, 150, 15) $Mouse3 = GUICtrlCreateRadio("Mouse3", 30, 150, 150, 15) $Mouse4 = GUICtrlCreateRadio("Mouse4", 30, 170, 150, 15) $start = GUICtrlCreateButton("Start", 100, 200, 75, 45) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $start then starter() If $msg = $Mouse1 Then Mouse1() If $msg = $Mouse2 Then Mouse2() If $msg = $Mouse3 Then Mouse3() If $msg = $Mouse4 Then Mouse4() wend GUIDelete() EndFunc Func starter() MouseClick ("left",77,777) sleep (50) MouseClick ("left",552,413) Sleep (500) EndFunc Func Mouse1() MouseClick ("left", 80,287) sleep (50) MouseClick ("left", 500,183) Sleep (500) EndFunc Func Mouse2() MouseClick ("left", 94,302) sleep (50) MouseClick ("left", 500,183) Sleep (500) EndFunc Func Mouse3() MouseClick ("left", 77,335) sleep (50) MouseClick ("left", 500,183) Sleep (500) EndFunc Func Mouse4() MouseClick ("left", 94,412) sleep (50) MouseClick ("left", 500,183) Sleep (500) EndFunc thnx for helping. Link to comment Share on other sites More sharing options...
SjaakTV Posted March 11, 2010 Author Share Posted March 11, 2010 bumper i real would like a push in the back. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 11, 2010 Moderators Share Posted March 11, 2010 SjaakTV, Please do not bump your own posts within 24hrs. If I understand you correctly, this should do what you want: expandcollapse popup#include <GUIConstantsEx.au3> #include <windowsconstants.au3> Global $Mouse1, $Mouse2, $Mouse3, $Mouse4 HotKeySet("{0}", "Stop") Func Stop() Exit 0 EndFunc ;==>Stop MENU() Func MENU() GUICreate("Stop spam", 400, 288) GUISetBkColor(0xaaaaaa) GUICtrlCreateLabel((@MON & "/" & @MDAY & "/" & @YEAR), 325, 10) GUIStartGroup() ; Starta group so only 1 radio at a time can be selected $Mouse1 = GUICtrlCreateRadio("Mouse1", 30, 110, 150, 15) $Mouse2 = GUICtrlCreateRadio("Mouse2", 30, 130, 150, 15) $Mouse3 = GUICtrlCreateRadio("Mouse3", 30, 150, 150, 15) $Mouse4 = GUICtrlCreateRadio("Mouse4", 30, 170, 150, 15) $start = GUICtrlCreateButton("Start", 100, 200, 75, 45) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $start ; Start button pressed, so run function starter() starter() EndSwitch WEnd GUIDelete() EndFunc ;==>MENU Func starter() ; Do this each time the start button is pressed MouseClick("left", 77, 777) Sleep(50) MouseClick("left", 552, 413) Sleep(500) ; Now check and see which Radio is pressed and run the corresponding function If GUICtrlRead($Mouse1) = 1 Then Mouse1() If GUICtrlRead($Mouse2) = 1 Then Mouse2() If GUICtrlRead($Mouse3) = 1 Then Mouse3() If GUICtrlRead($Mouse4) = 1 Then Mouse4() EndFunc ;==>starter Func Mouse1() MouseClick("left", 80, 287) Sleep(50) MouseClick("left", 500, 183) Sleep(500) EndFunc ;==>Mouse1 Func Mouse2() MouseClick("left", 94, 302) Sleep(50) MouseClick("left", 500, 183) Sleep(500) EndFunc ;==>Mouse2 Func Mouse3() MouseClick("left", 77, 335) Sleep(50) MouseClick("left", 500, 183) Sleep(500) EndFunc ;==>Mouse3 Func Mouse4() MouseClick("left", 94, 412) Sleep(50) MouseClick("left", 500, 183) Sleep(500) EndFunc ;==>Mouse4 If it does not, please explain again! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
SjaakTV Posted March 16, 2010 Author Share Posted March 16, 2010 thnx for helping. 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