Jump to content
Sign in to follow this  
HuwanBisente

Please Help Me with this script

Recommended Posts

HuwanBisente

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)

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.
Edited by Melba23
Added code tags

Share this post


Link to post
Share on other sites
SadBunny

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 :graduated:

Edited by SadBunny

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites
water

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 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
Melba23

HuwanBisente,

Nothing much more to add - so....... :naughty:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×