HuwanBisente Posted January 26, 2013 Share Posted January 26, 2013 (edited) Found this RO2 script from a fellow forumer. It got some syntax errors and tidy issues but I am very noob at scripts. Anyone can tidy up the script for me? I've been workating on this for several hours now learning some basics about autoit scripting. I tried ctrl+t with my code and found 10 errors, but I just simply don't know how to fix them. Thanks, I'd really appreciate it if anyone could help. Here is the code (with the tidy codes placed by the editor) expandcollapse popupHotKeySet("{F12}", "Start") HotKeySet("{F11}", "Pause") Func Start() While 1 Sleep(100) Target() WEnd EndFunc ;==>Start Func Target() While 1 PixelSearch(321, 79, 494, 97, 0x140B01, 10) ;Last HP pixel (black) If Not @error Then Pot() Attack() ExitLoop EndIf Sleep(100) Loot() Sleep(100) Send("{TAB}") Send("{TAB}") Sleep(100) ;### Tidy Error -> "endfunc" is closing previous "while" on line 14 EndFunc ;==>Target ;### Tidy Error -> func Not closed before "Func" statement. ;### Tidy Error -> "func" cannot be inside any IF/Do/While/For/Case/Func statement. Func Attack() Send("2") ;Attack skill 2 Send("2") Sleep(3000) Send("3") ;Attack skill 3 Send("3") Sleep(500) EndFunc ;==>Attack ;### Tidy Error -> func Not closed before "Func" statement. ;### Tidy Error -> "func" cannot be inside any IF/Do/While/For/Case/Func statement. Func Pot() While 1 PixelSearch(321, 79, 494, 97, 0x81CB12, 10) ;HP @ % If Not @error Then Send("9") Send("9") EndIf PixelSearch(323, 199, 478, 112, 0x509BC, 10) ;MP @ % If Not @error Then Send("0") Send("0") EndIf WEnd EndFunc ;==>Pot ;### Tidy Error -> func Not closed before "Func" statement. ;### Tidy Error -> "func" cannot be inside any IF/Do/While/For/Case/Func statement. Func Loot() While 1 Send("R") Send("R") Sleep(2000) Send("R") Send("R") PixelSearch(506, 344, 824, 482, 0x897E21, 10) ;Loot menu corner If Not @error Then Sleep(1000) Send("R") Send("R") ExitLoop EndIf Sleep(100) Send("R") Send("R") Sleep(100) WEnd EndFunc ;==>Loot ;### Tidy Error -> func Not closed before "Func" statement. ;### Tidy Error -> "func" cannot be inside any IF/Do/While/For/Case/Func statement. Func Pause() While 1 Sleep(1000) WEnd EndFunc ;==>Pause ;### Tidy Error -> func is never closed in your script. Edited January 26, 2013 by Melba23 Added code tags Link to comment Share on other sites More sharing options...
SadBunny Posted January 26, 2013 Share Posted January 26, 2013 (edited) Couple of things: 1. game automation discussion is prohibited as per the Forum Rules 2. please post autoit code in autoit tags 3. While loops must be ended with a WEnd Edited January 26, 2013 by SadBunny Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
water Posted January 26, 2013 Share Posted January 26, 2013 SadBunny is correct. The link to the forum rules can be found in the lower right corner of this page. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 26, 2013 Moderators Share Posted January 26, 2013 HuwanBisente, Nothing much more to add - so....... 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...
Recommended Posts