snoopy Posted January 29, 2009 Share Posted January 29, 2009 (edited) Hi all me again -.- Such anoob but still need help expandcollapse popup#include <GUIConstants.au3> #include<WindowsConstants.au3> Global $f_Run = False, $f_AnyChecked = False Global $Form1 = GUICreate("Form1", 625, 444, 189, 146) $Pic1 = GUICtrlCreatePic("C:\Users\Snoopy\Desktop\toontown%20awesome%20picture.jpg", 0, 0, 625, 441, 0) GUISetState($GUI_DISABLE) GuiCtrlSetState($pic1, $GUI_DISABLE) Global $Credits = GUICtrlCreateButton("Credits", 0, 0, 153, 65, 0) GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif") Global $MyButton1 = GUICtrlCreateButton("Start", 520, 0, 100, 30, 0) GUICtrlSetFont(-1, 15, 800, 0, "MS Serif") GUICtrlSetBkColor(-1, 0xFFFFE1) $checkbox_dummy_start = GUICtrlCreateDummy() Global $CheckBox1 = GUICtrlCreateCheckbox("Jump", 520, 32, 100, 30, 0) Global $CheckBox2 = GUICtrlCreateCheckbox("Beg", 520, 72, 100, 30, 0) Global $CheckBox3 = GUICtrlCreateCheckbox("Say", 520, 112, 100, 30, 0) Global $CheckBox4 = GUICtrlCreateCheckbox("Roallover", 520, 160, 100, 30, 0) $checkbox_dummy_end = GUICtrlCreateDummy() GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Credits MsgBox(64, "Credits", "Matthew Povolotski, Toon:Sniffy Macnose") Case $MyButton1 HotKeySet("{F5}", "_StopIt") $f_Run = True While $f_Run $f_AnyChecked = False If BitAND(GUICtrlRead($CheckBox1), $GUI_CHECKED) Then $f_AnyChecked = True Local $randomcoords[7][2] = [[210,62],[200,77],[200,93],[200,108],[200,124],[200,139],[200,156]] $pixelSearch=PixelSearch(57,45,@DesktopWidth,@DesktopHeight,0xB4EC8F) If IsArray($pixelSearch)=1 Then MouseClick("left",$pixelSearch[0],$pixelSearch[1],1,0) EndIf sleep( 100) $pixelSearch=PixelSearch(153,62,@DesktopWidth,@DesktopHeight,0x080999) If IsArray($pixelSearch)=1 Then MouseClick("left",$pixelSearch[0],$pixelSearch[1],1,0) EndIf $r = Random(0,6,1) MouseClick("left", $randomcoords[$r][0], $randomcoords[$r][1], 1) EndIf Case $MyButton2 HotKeySet("{F5}", "_StopIt") $f_Run = True While $f_Run $f_AnyChecked = False If BitAND(GUICtrlRead($CheckBox2), $GUI_CHECKED) Then $f_AnyChecked = True Local $randomcoords[7][2] = [[289,83],[200,77],[200,93],[200,108],[200,124],[200,139],[200,156]] $pixelSearch=PixelSearch(57,45,@DesktopWidth,@DesktopHeight,0xB4EC8F) If IsArray($pixelSearch)=1 Then MouseClick("left",$pixelSearch[0],$pixelSearch[1],1,0) EndIf sleep( 100) $pixelSearch=PixelSearch(153,62,@DesktopWidth,@DesktopHeight,0x080999) If IsArray($pixelSearch)=1 Then MouseClick("left",$pixelSearch[0],$pixelSearch[1],1,0) EndIf $r = Random(0,6,1) MouseClick("left", $randomcoords[$r][0], $randomcoords[$r][1], 1) EndIf If BitAND(GUICtrlRead($CheckBox3), $GUI_CHECKED) Then $f_AnyChecked = True MsgBox(64, "Checkbox 3", "CheckBox 3 is checked", 1) EndIf If BitAND(GUICtrlRead($CheckBox4), $GUI_CHECKED) Then $f_AnyChecked = True MsgBox(64, "Checkbox 4", "CheckBox 4 is checked", 1) EndIf If Not $f_AnyChecked Then ExitLoop WEnd HotKeySet("{F5}") EndSwitch WEnd Func _StopIt() $f_Run = False EndFunc Func WM_COMMAND($hWnd, $Msg, $wParam, $lParam) Local $iIDFrom = BitAND($wParam, 0xFFFF) ;LoWord Switch $iIDFrom Case $checkbox_dummy_start to $checkbox_dummy_end for $i = $checkbox_dummy_start to $checkbox_dummy_end if $i <> $iIDFrom then GUICtrlSetState($i,4) Next EndSwitch EndFunc what is wrong with my script? where do i add Wend? -.-?-.-? Edited January 29, 2009 by snoopy Link to comment Share on other sites More sharing options...
snoopy Posted January 29, 2009 Author Share Posted January 29, 2009 it Shows off Erorr when i try and Run but cant figure out where the error acures Link to comment Share on other sites More sharing options...
Developers Jos Posted January 29, 2009 Developers Share Posted January 29, 2009 Where did you find the script ? Use tidy and or au3check to help you show your issues: expandcollapse popup#include <GUIConstants.au3> #include<WindowsConstants.au3> Global $f_Run = False, $f_AnyChecked = False Global $Form1 = GUICreate("Form1", 625, 444, 189, 146) $Pic1 = GUICtrlCreatePic("C:\Users\Snoopy\Desktop\toontown%20awesome%20picture.jpg", 0, 0, 625, 441, 0) GUISetState($GUI_DISABLE) GUICtrlSetState($Pic1, $GUI_DISABLE) Global $Credits = GUICtrlCreateButton("Credits", 0, 0, 153, 65, 0) GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif") Global $MyButton1 = GUICtrlCreateButton("Start", 520, 0, 100, 30, 0) GUICtrlSetFont(-1, 15, 800, 0, "MS Serif") GUICtrlSetBkColor(-1, 0xFFFFE1) $checkbox_dummy_start = GUICtrlCreateDummy() Global $CheckBox1 = GUICtrlCreateCheckbox("Jump", 520, 32, 100, 30, 0) Global $CheckBox2 = GUICtrlCreateCheckbox("Beg", 520, 72, 100, 30, 0) Global $CheckBox3 = GUICtrlCreateCheckbox("Say", 520, 112, 100, 30, 0) Global $CheckBox4 = GUICtrlCreateCheckbox("Roallover", 520, 160, 100, 30, 0) $checkbox_dummy_end = GUICtrlCreateDummy() GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Credits MsgBox(64, "Credits", "Matthew Povolotski, Toon:Sniffy Macnose") Case $MyButton1 HotKeySet("{F5}", "_StopIt") $f_Run = True While $f_Run $f_AnyChecked = False If BitAND(GUICtrlRead($CheckBox1), $GUI_CHECKED) Then $f_AnyChecked = True Local $randomcoords[7][2] = [[210, 62],[200, 77],[200, 93],[200, 108],[200, 124],[200, 139],[200, 156]] $pixelSearch = PixelSearch(57, 45, @DesktopWidth, @DesktopHeight, 0xB4EC8F) If IsArray($pixelSearch) = 1 Then MouseClick("left", $pixelSearch[0], $pixelSearch[1], 1, 0) EndIf Sleep(100) $pixelSearch = PixelSearch(153, 62, @DesktopWidth, @DesktopHeight, 0x080999) If IsArray($pixelSearch) = 1 Then MouseClick("left", $pixelSearch[0], $pixelSearch[1], 1, 0) EndIf $r = Random(0, 6, 1) MouseClick("left", $randomcoords[$r][0], $randomcoords[$r][1], 1) EndIf Case $MyButton2 HotKeySet("{F5}", "_StopIt") $f_Run = True While $f_Run $f_AnyChecked = False If BitAND(GUICtrlRead($CheckBox2), $GUI_CHECKED) Then $f_AnyChecked = True Local $randomcoords[7][2] = [[289, 83],[200, 77],[200, 93],[200, 108],[200, 124],[200, 139],[200, 156]] $pixelSearch = PixelSearch(57, 45, @DesktopWidth, @DesktopHeight, 0xB4EC8F) If IsArray($pixelSearch) = 1 Then MouseClick("left", $pixelSearch[0], $pixelSearch[1], 1, 0) EndIf Sleep(100) $pixelSearch = PixelSearch(153, 62, @DesktopWidth, @DesktopHeight, 0x080999) If IsArray($pixelSearch) = 1 Then MouseClick("left", $pixelSearch[0], $pixelSearch[1], 1, 0) EndIf $r = Random(0, 6, 1) MouseClick("left", $randomcoords[$r][0], $randomcoords[$r][1], 1) EndIf If BitAND(GUICtrlRead($CheckBox3), $GUI_CHECKED) Then $f_AnyChecked = True MsgBox(64, "Checkbox 3", "CheckBox 3 is checked", 1) EndIf If BitAND(GUICtrlRead($CheckBox4), $GUI_CHECKED) Then $f_AnyChecked = True MsgBox(64, "Checkbox 4", "CheckBox 4 is checked", 1) EndIf If Not $f_AnyChecked Then ExitLoop WEnd HotKeySet("{F5}") ;### Tidy Error -> "endswitch" is closing previous "case" on line 25 EndSwitch ;### Tidy Error -> "wend" is closing previous "switch" on line 24 WEnd ;### Tidy Error -> while Not closed before "Func" statement. ;### Tidy Error -> "func" cannot be inside any IF/Do/While/For/Case/Func statement. Func _StopIt() $f_Run = False EndFunc ;==>_StopIt ;### Tidy Error -> while Not closed before "Func" statement. ;### Tidy Error -> "func" cannot be inside any IF/Do/While/For/Case/Func statement. Func WM_COMMAND($hWnd, $Msg, $wParam, $lParam) Local $iIDFrom = BitAND($wParam, 0xFFFF);LoWord Switch $iIDFrom Case $checkbox_dummy_start To $checkbox_dummy_end For $i = $checkbox_dummy_start To $checkbox_dummy_end If $i <> $iIDFrom Then GUICtrlSetState($i, 4) Next EndSwitch EndFunc ;==>WM_COMMAND;### Tidy Error -> while is never closed in your script. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
will88 Posted January 29, 2009 Share Posted January 29, 2009 (edited) add a wend to line 59 and then need to declare MyButton2 expandcollapse popup#include <GUIConstants.au3> #include<WindowsConstants.au3> Dim $MyButton2; need to declare MyButton2 Global $f_Run = False, $f_AnyChecked = False Global $Form1 = GUICreate("Form1", 625, 444, 189, 146) $Pic1 = GUICtrlCreatePic("C:\Users\Snoopy\Desktop\toontown%20awesome%20picture.jpg", 0, 0, 625, 441, 0) GUISetState($GUI_DISABLE) GuiCtrlSetState($pic1, $GUI_DISABLE) Global $Credits = GUICtrlCreateButton("Credits", 0, 0, 153, 65, 0) GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif") Global $MyButton1 = GUICtrlCreateButton("Start", 520, 0, 100, 30, 0) GUICtrlSetFont(-1, 15, 800, 0, "MS Serif") GUICtrlSetBkColor(-1, 0xFFFFE1) $checkbox_dummy_start = GUICtrlCreateDummy() Global $CheckBox1 = GUICtrlCreateCheckbox("Jump", 520, 32, 100, 30, 0) Global $CheckBox2 = GUICtrlCreateCheckbox("Beg", 520, 72, 100, 30, 0) Global $CheckBox3 = GUICtrlCreateCheckbox("Say", 520, 112, 100, 30, 0) Global $CheckBox4 = GUICtrlCreateCheckbox("Roallover", 520, 160, 100, 30, 0) $checkbox_dummy_end = GUICtrlCreateDummy() GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Credits MsgBox(64, "Credits", "Matthew Povolotski, Toon:Sniffy Macnose") Case $MyButton1 HotKeySet("{F5}", "_StopIt") $f_Run = True While $f_Run $f_AnyChecked = False If BitAND(GUICtrlRead($CheckBox1), $GUI_CHECKED) Then $f_AnyChecked = True Local $randomcoords[7][2] = [[210,62],[200,77],[200,93],[200,108],[200,124],[200,139],[200,156]] $pixelSearch=PixelSearch(57,45,@DesktopWidth,@DesktopHeight,0xB4EC8F) If IsArray($pixelSearch)=1 Then MouseClick("left",$pixelSearch[0],$pixelSearch[1],1,0) EndIf sleep( 100) $pixelSearch=PixelSearch(153,62,@DesktopWidth,@DesktopHeight,0x080999) If IsArray($pixelSearch)=1 Then MouseClick("left",$pixelSearch[0],$pixelSearch[1],1,0) EndIf $r = Random(0,6,1) MouseClick("left", $randomcoords[$r][0], $randomcoords[$r][1], 1) EndIf WEnd;needed to add a wend here Case $MyButton2 HotKeySet("{F5}", "_StopIt") $f_Run = True While $f_Run $f_AnyChecked = False If BitAND(GUICtrlRead($CheckBox2), $GUI_CHECKED) Then $f_AnyChecked = True Local $randomcoords[7][2] = [[289,83],[200,77],[200,93],[200,108],[200,124],[200,139],[200,156]] $pixelSearch=PixelSearch(57,45,@DesktopWidth,@DesktopHeight,0xB4EC8F) If IsArray($pixelSearch)=1 Then MouseClick("left",$pixelSearch[0],$pixelSearch[1],1,0) EndIf sleep( 100) $pixelSearch=PixelSearch(153,62,@DesktopWidth,@DesktopHeight,0x080999) If IsArray($pixelSearch)=1 Then MouseClick("left",$pixelSearch[0],$pixelSearch[1],1,0) EndIf $r = Random(0,6,1) MouseClick("left", $randomcoords[$r][0], $randomcoords[$r][1], 1) EndIf If BitAND(GUICtrlRead($CheckBox3), $GUI_CHECKED) Then $f_AnyChecked = True MsgBox(64, "Checkbox 3", "CheckBox 3 is checked", 1) EndIf If BitAND(GUICtrlRead($CheckBox4), $GUI_CHECKED) Then $f_AnyChecked = True MsgBox(64, "Checkbox 4", "CheckBox 4 is checked", 1) EndIf If Not $f_AnyChecked Then ExitLoop WEnd HotKeySet("{F5}") EndSwitch WEnd Func _StopIt() $f_Run = False EndFunc Func WM_COMMAND($hWnd, $Msg, $wParam, $lParam) Local $iIDFrom = BitAND($wParam, 0xFFFF);LoWord Switch $iIDFrom Case $checkbox_dummy_start to $checkbox_dummy_end for $i = $checkbox_dummy_start to $checkbox_dummy_end if $i <> $iIDFrom then GUICtrlSetState($i,4) Next EndSwitch EndFunc Edited January 29, 2009 by will88 Password-Keeper Link to comment Share on other sites More sharing options...
snoopy Posted January 29, 2009 Author Share Posted January 29, 2009 "where did you find the script" answer=Made it my self -.- Link to comment Share on other sites More sharing options...
snoopy Posted January 29, 2009 Author Share Posted January 29, 2009 add a wend to line 59 and then need to declare MyButton2tnx Taara declare you mean?Dec? Link to comment Share on other sites More sharing options...
will88 Posted January 29, 2009 Share Posted January 29, 2009 you need to Declare the $MyButton2 variable Password-Keeper Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 29, 2009 Share Posted January 29, 2009 "where did you find the script"answer=Made it my self -.-You wrote this yourself, but don't know what "declare" means...? Riiiiiiiiight! Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
snoopy Posted January 29, 2009 Author Share Posted January 29, 2009 Man, if you see forum i asked lots of quistions, like pixel and stuff and gatherd info and cam up with this.. -.- what do you mean yeah?? Link to comment Share on other sites More sharing options...
Developers Jos Posted January 29, 2009 Developers Share Posted January 29, 2009 (edited) Man, if you see forum i asked lots of quistions, like pixel and stuff and gatherd info and cam up with this.. -.- what do you mean yeah??Yeah really means in this case: "You could have fooled me....." by the way... count me in to that one. Edited January 29, 2009 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
snoopy Posted January 29, 2009 Author Share Posted January 29, 2009 (edited) Yeah really means in this case: "You could have fooled me....." by the way... count me in to that one.-.- when i tick the check box , it starts to run right away and without even pressing the START on it,and F5(short cut for stop) doesent seem to work when i try it....any tips?however it doesent aply to Jump, and thats what i exacly need, I want it to be ticked and than press start and than it will act , but doesent seem to be what i want it to be like .... Edited January 29, 2009 by snoopy Link to comment Share on other sites More sharing options...
Developers Jos Posted January 29, 2009 Developers Share Posted January 29, 2009 Sure... debug it.... Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
snoopy Posted January 29, 2009 Author Share Posted January 29, 2009 Sure... debug it....JosCould I use Auto Debugger? would it work? Link to comment Share on other sites More sharing options...
Developers Jos Posted January 29, 2009 Developers Share Posted January 29, 2009 Could I use Auto Debugger? would it work?Sure... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
snoopy Posted January 29, 2009 Author Share Posted January 29, 2009 Sure...man.....I would like to learn to use debbuger.can anyone give me 1st tips of how debbugging through auto dibbuger? 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