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)
[ autoit ]
HotKeySet("{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.