Difference between revisions of "RoM Functions"
(→Functionlist) |
|||
Line 1: | Line 1: | ||
− | = | + | == Player functions == |
− | < | + | player:harvest(); |
+ | Scan that waypoint for a harverst node and harvest that (at the moment only working if the RoM window is in foreground). | ||
+ | |||
+ | |||
+ | player:restrnd([probability [, minrest [, maxrest]]]); | ||
+ | e.g. 'player:restrnd(30, 3, 10);' Rest with a probability from 30% at that waypoint for between 3 and 10 seconds. The bot will fight back if attacked while resting and continue after that. Similar functions are 'stopPE()' and 'player:sleep()'. | ||
+ | |||
+ | |||
+ | player:rest( minrest [, maxrest[, time|full[, restaddrnd]]]); | ||
+ | |||
+ | minrest ( min time to rest in sec) | ||
+ | maxrest ( max time to in sec) | ||
+ | resttype ( time | full ) time = rest the given time | full = stop resting after being full / default = time | ||
+ | restaddrnd ( max random addition after being full in sec) | ||
+ | |||
+ | If using type 'full', the bot will only rest if HP or MP is below a defined level. You define that level in your profile with the options: | ||
+ | Code: | ||
+ | <option name="HP_REST" value="15" /> | ||
+ | <option name="MP_REST" value="15" /> | ||
+ | |||
+ | Default value if not defined is 15% each. | ||
+ | |||
+ | examples: | ||
+ | player:rest(20) will rest for 20 seconds. | ||
+ | player:rest(60, 20) will rest between 60 and 80 seconds. | ||
+ | player:rest(90, 40, "full") will rest up to between 90 and 130 seconds, and stop resting if being full | ||
+ | player:rest(90, 40, "time") will rest up to between 90 and 130 seconds, and not stop resting if being full | ||
+ | player:rest(20, 40, "full, 20") will rest up to between 20 and 60 seconds, and stop resting if being full, and wait after that between 1-20 seconds | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | == General Functions == | ||
+ | loadPaths( [path] [,returnpath] ); | ||
+ | Load a new waypoint file and if available the default return path to that file. e.g. 'loadPaths("l7-9");' will load the waypoint path 'l7-9.xml' and if available the return path 'l7-9_return.xml'. | ||
+ | |||
+ | |||
+ | changeProfileOption(_option, _value); | ||
change profile options and print values in MM protocol | change profile options and print values in MM protocol | ||
− | + | ||
+ | |||
+ | openGiftbag( [[_player_level] , _maxslot] ); | ||
open giftbag (at the moment level 1-10), items for mage and priest | open giftbag (at the moment level 1-10), items for mage and priest | ||
− | + | ||
+ | |||
+ | addMessage( message ); | ||
Send a message to the ingame system chat channel. | Send a message to the ingame system chat channel. | ||
+ | |||
+ | |||
<source lang="lua">RoMScript( _script ); | <source lang="lua">RoMScript( _script ); | ||
− | example: | + | example: |
− | local ret1, ret2 = RoMScript( "GetPlayerWorldMapPos();" );</source> | + | local ret1, ret2 = RoMScript( "GetPlayerWorldMapPos();" );</source> |
− | Send a macro to the client and execute it ingame by pressing the MACRO hotkey. There are up to 10 return values possible. | + | Send a macro to the client and execute it ingame by pressing the MACRO hotkey. There are up to 10 return values possible. |
− | + | ||
+ | |||
+ | sendMacro( _script ); | ||
Same as "RoMScript. Additionally you will see a message in the MM window. | Same as "RoMScript. Additionally you will see a message in the MM window. |
Revision as of 07:59, 10 September 2009
Player functions
player:harvest();
Scan that waypoint for a harverst node and harvest that (at the moment only working if the RoM window is in foreground).
player:restrnd([probability [, minrest [, maxrest]]]);
e.g. 'player:restrnd(30, 3, 10);' Rest with a probability from 30% at that waypoint for between 3 and 10 seconds. The bot will fight back if attacked while resting and continue after that. Similar functions are 'stopPE()' and 'player:sleep()'.
player:rest( minrest [, maxrest[, time|full[, restaddrnd]]]);
minrest ( min time to rest in sec) maxrest ( max time to in sec) resttype ( time | full ) time = rest the given time | full = stop resting after being full / default = time restaddrnd ( max random addition after being full in sec)
If using type 'full', the bot will only rest if HP or MP is below a defined level. You define that level in your profile with the options: Code:
<option name="HP_REST" value="15" /> <option name="MP_REST" value="15" />
Default value if not defined is 15% each.
examples: player:rest(20) will rest for 20 seconds. player:rest(60, 20) will rest between 60 and 80 seconds. player:rest(90, 40, "full") will rest up to between 90 and 130 seconds, and stop resting if being full player:rest(90, 40, "time") will rest up to between 90 and 130 seconds, and not stop resting if being full player:rest(20, 40, "full, 20") will rest up to between 20 and 60 seconds, and stop resting if being full, and wait after that between 1-20 seconds
General Functions
loadPaths( [path] [,returnpath] );
Load a new waypoint file and if available the default return path to that file. e.g. 'loadPaths("l7-9");' will load the waypoint path 'l7-9.xml' and if available the return path 'l7-9_return.xml'.
changeProfileOption(_option, _value);
change profile options and print values in MM protocol
openGiftbag( [[_player_level] , _maxslot] );
open giftbag (at the moment level 1-10), items for mage and priest
addMessage( message );
Send a message to the ingame system chat channel.
RoMScript( _script );
example:
local ret1, ret2 = RoMScript( "GetPlayerWorldMapPos();" );
Send a macro to the client and execute it ingame by pressing the MACRO hotkey. There are up to 10 return values possible.
sendMacro( _script );
Same as "RoMScript. Additionally you will see a message in the MM window.