How to: using waypoint files (Examples: DQ running, multi )

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)

Moderators: lisa, rock5

Message
Author
d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

How to: using waypoint files (Examples: DQ running, multi )

#1 Post by d003232 » Mon Jun 29, 2009 4:54 am

Here just some examples how to work with waypoint files. It shows examples for different types of waypoint files and some special solutions.


Functions you can use in a waypoint file
You can use you own lua code within the <waypoint></waypoint> tags. By doing that you can do nearly everything. And there are some prefabricated functions:

To use some of that functions, simply put them into the waypoint tag:

Code: Select all

<!-- #20 --><waypoint x="799" z="-426">player:restrnd(20, 1, 10);</waypoint>
Caution!!! You must place the codes within the '<waypoint></waypoint>' tag. Not before and not after.

Thats wrong:

Code: Select all

<waypoints type="TRAVEL" >player:harvest();
	<!-- # 1 --><waypoint x="-2060" z="-8216"></waypoint>
</waypoints>
Here the assortment:

Code: Select all

player:harvest();
Scan that waypoint for a harverst node and harvest that (at the moment only working if the RoM window is in foreground)

Code: Select all

load_paths( [path] [,returnpath] );
Load a new waypoint file and if available the default return path to that file. e.g. 'load_paths("l7-9");' will load the waypoint path 'l7-9.xml' and if available the return path 'l7-9_return.xml'.

Code: Select all

if( player.Level > 9 ) then
	printf("do some other coding stuff");
end;
Do something only if you have a given level. Can be usefull to load a new waypoint file only after you get that level.

Code: Select all

__WPL:reverse();
Resort the waypoints. Means after running from 1 to 20 you can now run from 20 - 1. It is usefull to put that at the first and at the last waypoint if you want to run between two places.

Code: Select all

__WPL:setForcedWaypointType( [["NORMAL"] | ["TRAVEL"] | ["RUN"]]);
Set a forced waypoint type. The waypoint type overwrites the type settings within the waypoint file. The forced waypoint type is valid until you load a new waypoint file or you call the function '__WPL:setForcedWaypointType();' without argument.

Code: Select all

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()'.

Code: Select all

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: Select all

<option name="HP_REST" value="15" />
<option name="MP_REST" value="15" />
Default value if not defined is 15% each.

e.g.
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

Code: Select all

stopPE();
Pause the bot at that waypoint. The bot will not react anymore. Press DEL if you want to resume the bot. Similar functions are 'player.restrnd()' and 'player.sleep()'.

Code: Select all

player:sleep();
Pause the bot at that waypoint in a sleep mode. The bot will still fight back attackers and sleep again after doing that. Press DEL if you want to continue. Similar functions are 'player.restrnd()' and 'stopPE()'.

Code: Select all

player:logout([true])
Logout from RoM. With 'player:logout(true)' you will also shutdown your pc after loging out.

Code: Select all

if( os.difftime(os.time(), player.BotStartTime) > 3600 ) then
	printf("do some other coding stuff");
end;
Do something, if the bot is running for more then 1 hour (= 3600 seconds). If you pause the bot, the BotStartTime will be reseted.

Code: Select all

player:scan_for_NPC( [npc_name] );
It will scan the area and click the NPC we found. If there are more npc next together, you should define a part of the name to avoid clicking the wrong npc (Example see here).

Code: Select all

player:mouseclickL(x, y [RoM window wide, RoM window high]);
Left click a screen point and by that, interact with a NPC. x, y is relative to the RoM window. So it is your fiddly task to find the right values to click the right buttons. Remember the RoM windows size for that click positions. By doing that, we can later recalculate the mouse click points if we run the bot in a different RoM windows size.

How to use the bot for running between the and NPC <-> blackboard for delivering of daily quests
It starts in Harf. There you have the quest 'Winterspinnenarten' from the blackboard where you deliver 10 winter spider body liquids to the 'Lager im Winternachttal'.

The waypoints are from the blackbard in Harf up to the camp. After each end of the waypoint file is a PAUSE. So you can handle with the NPC/blackboard and after that press 'DEL' to reverse the waypoints and run back.

Code: Select all

<waypoints type="RUN">
	<!-- # 1 --><waypoint x="-14389" z="-380" type="TRAVEL">__WPL:reverse();
	player:sleep();</waypoint>
	<!-- # 2 --><waypoint x="-14531" z="-253"></waypoint>
	...
	<!-- #21 --><waypoint x="-18500" z="-2516 type="TRAVEL" >__WPL:reverse();
	player:sleep();
	</waypoint>
</waypoints>
The type of the waypoints is 'RUN' so the bot will not stop and not fight back, if getting aggro. Only the first an the last WP has type TRAVEL to fight back still sticking mobs.

Some hints: If you deliver the quest with a low level char, than set your loot option (<option name="LOOT" value="true" />) in your profile to 'false'. That will prevent from coming closer to mob groups while looting. It also could be helpful, to reduce your option 'WAYPOINT_DEVIATION' or set it to 0 (and set back to a higher value for normal botting).


How to successive connect different waypoint files
Thats an example how to start with level 1 and change the botting place depending from your level.

We start at the spawn point:

Code: Select all

<waypoints type="TRAVEL" >
	<!-- # 3 --><waypoint x="-3779" z="-8480"></waypoint>
	...
	<!-- # 8 --><waypoint x="-3034" z="-9034">load_paths("l2-3.xml");</waypoint>
</waypoints>
At the last waypoint, we load the waypoint path file 'l2-3.xml' and if available the default returnpath 'l2-3_return.xml" and go to the closest waypoint from that waypoint file. We use waypoint type TRAVEL to not targeting mobs while moving to our area (not really neccessary here :-) )

Now we are at that place:

Code: Select all

<waypoints type="NORMAL" >
	<!-- # 1 --><waypoint x="-2206" z="-9648"></waypoint>
	<!-- # 2 --><waypoint x="-2133" z="-9796">player:restrnd(20, 1, 10);</waypoint>
	<!-- # 3 --><waypoint x="-2224" z="-9882">player:restrnd(20, 1, 10);</waypoint>
	...
	<!-- # 7 --><waypoint x="-2391" z="-9639">
		if( player.Level > 4 ) then
			load_paths("l5_goto_6.xml");
	  	end;
	</waypoint>
</waypoints>
If we reach level 5, we load the next waypoint file.

If you want to autorepair then read here for more informations about that.
Attachments
t_Harf_Lager_Winternachttal.xml
(1.29 KiB) Downloaded 542 times
Last edited by d003232 on Mon Aug 10, 2009 5:11 am, edited 31 times in total.
The RoM Bot Online Wiki needs your help!

User avatar
Administrator
Site Admin
Posts: 4861
Joined: Sat Jan 05, 2008 4:21 pm

Re: Example: How to use the bot as travel bot / D-Quest running

#2 Post by Administrator » Mon Jun 29, 2009 9:32 am

Stickied. There's always people asking about this sort of thing.

aasi888
Posts: 64
Joined: Fri May 15, 2009 5:13 am

Re: Example: How to use the bot as travel bot / D-Quest running

#3 Post by aasi888 » Sun Jul 12, 2009 6:01 am

And how to not fight the mobs back? I just wanna run.

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: Example: How to use the bot as travel bot / D-Quest running

#4 Post by d003232 » Sun Jul 12, 2009 7:07 am

aasi888 wrote:And how to not fight the mobs back? I just wanna run.
Thats not possible at the moment. I think I would be good to not fight back the whole way running, just cast heal spells and only fight back at the end of the waypoint file. That means if the char reaching the NPC still have aggro.

The best way would be some different waypoint type:
  • TRAVEL, no targeting, still fight back, heal spells/potions
  • RUNNING, no targeting, no fight back, heal spells/potions
The RoM Bot Online Wiki needs your help!

aasi888
Posts: 64
Joined: Fri May 15, 2009 5:13 am

Re: Example: How to use the bot as travel bot / D-Quest running

#5 Post by aasi888 » Sat Jul 25, 2009 9:00 pm

Hmm why doesnt this work.

Code: Select all

<waypoints>
	<!-- # 1 --><waypoint x="547" z="5477" type="TRAVEL">__WPL:reverse();</waypoint>
	<!-- # 2 --><waypoint x="777" z="-756" type="TRAVEL"></waypoint>
	<!-- # 1 --><waypoint x="547" z="5747">type="TRAVEL">__WPL:reverse();
	stopPE();
	keyboardPress(key.VK_0);
	yrest(12000);
	</waypoint>
</waypoints>

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: Example: How to use the bot as travel bot / D-Quest running

#6 Post by d003232 » Sun Jul 26, 2009 3:30 am

aasi888 wrote:Hmm why doesnt this work.
Please be more conrecte and write what doesn't work? What ist the result you have and what is the result you want?

And your 1. and 3. waypoint is at the same coordinates?
The RoM Bot Online Wiki needs your help!

aasi888
Posts: 64
Joined: Fri May 15, 2009 5:13 am

Re: Example: How to use the bot as travel bot / D-Quest running

#7 Post by aasi888 » Sun Jul 26, 2009 5:04 am

Did I actually post that? Sry I got it fixed myself.
the problem was here

<!-- # 1 --><waypoint x="547" z="5747">type="TRAVEL">__WPL:reverse();

User avatar
BlackGod
Posts: 53
Joined: Wed Jul 01, 2009 10:05 am

Re: How to: using waypoint files (Examples: DQ running, multi )

#8 Post by BlackGod » Fri Aug 07, 2009 6:31 am

Hey dudes...

Is there a possibility to make the bot change the channel?
Would be handy for harvesting... :)

Thx in advance!

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: How to: using waypoint files (Examples: DQ running, multi )

#9 Post by d003232 » Fri Aug 07, 2009 7:39 am

BlackGod wrote:Hey dudes...

Is there a possibility to make the bot change the channel?
Would be handy for harvesting... :)

Thx in advance!
You could do that by using the 'player:mouseclickL(130, 300, 800, 617);' within a waypoint file, or I suppose much easier by using a ingame macro and let the bot press the key.
The RoM Bot Online Wiki needs your help!

User avatar
BlackGod
Posts: 53
Joined: Wed Jul 01, 2009 10:05 am

Re: How to: using waypoint files (Examples: DQ running, multi )

#10 Post by BlackGod » Fri Aug 07, 2009 9:25 am

Ok
I'll try this...
thank you!

Glopo
Posts: 29
Joined: Tue Aug 11, 2009 9:52 pm

Re: How to: using waypoint files (Examples: DQ running, multi )

#11 Post by Glopo » Sat Aug 15, 2009 1:08 pm

hi again they is a function for reseting

Code: Select all

[if( os.difftime(os.time(), player.BotStartTime) > 3600 ) then
   printf("do some other coding stuff");
end;]
Do something, if the bot is running for more then 1 hour (= 3600 seconds). If you pause the bot, the BotStartTime will be reseted.

exept push Del manualy ?

is

Code: Select all

[player:restrnd([probability [, minrest [, maxrest]]]);]
reset the timer ?

same question for

Code: Select all

player.Fights > 300
thx for answer :)

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: How to: using waypoint files (Examples: DQ running, multi )

#12 Post by d003232 » Sat Aug 15, 2009 1:24 pm

Glopo wrote:hi again they is a function for reseting

Code: Select all

[if( os.difftime(os.time(), player.BotStartTime) > 3600 ) then
   printf("do some other coding stuff");
end;]
Do something, if the bot is running for more then 1 hour (= 3600 seconds). If you pause the bot, the BotStartTime will be reseted.
Just do it by yourselfe:

Code: Select all

if( os.difftime(os.time(), player.BotStartTime) > 3600 ) then
   player.BotStartTime = os.time();
   printf("do some other coding stuff");
end;
But you are right. We should make it more clear which fields could be used and changed.

Same for the other field. Just set it to 0.
The RoM Bot Online Wiki needs your help!

Glopo
Posts: 29
Joined: Tue Aug 11, 2009 9:52 pm

Re: How to: using waypoint files (Examples: DQ running, multi )

#13 Post by Glopo » Sat Aug 15, 2009 1:28 pm

thx,

i try this for autorepair in time

Code: Select all

<!-- # 1 --><waypoint x="-8676" z="7567">
	if( os.difftime(os.time(), player.BotStartTime) > 3600 ) then
  	player.BotStartTime = os.time();
   	load_paths("gorep.xml");
	end;</waypoint>

bot got possibility to reset ?

Code: Select all

player.fight
(i try to learn)

:p

d003232
Posts: 1252
Joined: Wed Jun 03, 2009 4:27 pm

Re: How to: using waypoint files (Examples: DQ running, multi )

#14 Post by d003232 » Sat Aug 15, 2009 2:06 pm

Glopo wrote:thx,

i try this for autorepair in time

Code: Select all

<!-- # 1 --><waypoint x="-8676" z="7567">
	if( os.difftime(os.time(), player.BotStartTime) > 3600 ) then
  	player.BotStartTime = os.time();
   	load_paths("gorep.xml");
	end;</waypoint>

bot got possibility to reset ?

Code: Select all

player.fight
(i try to learn)

:p
You mean

Code: Select all

player.fights = 0;
???
You could also use the user fields:

Code: Select all

		player.free_counter1 = 0;				-- free counter for user use
		player.free_counter2 = 0;				-- free counter for user use
		player.free_counter3 = 0;				-- free counter for user use		
		player.free_flag1 = false;			-- free flag for user use
		player.free_flag2 = false;			-- free flag for user use
		player.free_flag3 = false;			-- free flag for user use		
as an example:

Code: Select all

if( player.free_counter1 == 0 ) then
	player.free_counter1 = player.Fights;
end
if( player.Fights-player.free_counter1 > 300 ) then  	
  	player.free_counter1 = player.Fights;
   	load_paths("gorep.xml");
end;</waypoint>
The RoM Bot Online Wiki needs your help!

Glopo
Posts: 29
Joined: Tue Aug 11, 2009 9:52 pm

Re: How to: using waypoint files (Examples: DQ running, multi )

#15 Post by Glopo » Sat Aug 15, 2009 6:59 pm

mm you give me

Code: Select all

player.BotStartTime = os.time();
for reset the timer

i was to know if they have a similar function for reset the fight counter
somethink like that :

Code: Select all

if( player.Fights >300 ) then
    load_paths("gorep.xml");
Player.Fights=0;
end
</waypoint>

make sens ?

(i think i just undestand)

User avatar
Administrator
Site Admin
Posts: 4861
Joined: Sat Jan 05, 2008 4:21 pm

Re: How to: using waypoint files (Examples: DQ running, multi )

#16 Post by Administrator » Sat Aug 15, 2009 7:36 pm

Glopo wrote: i was to know if they have a similar function for reset the fight counter
somethink like that :

Code: Select all

if( player.Fights >300 ) then
    load_paths("gorep.xml");
player.Fights=0;
end
</waypoint>

make sens ?

(i think i just undestand)
That is correct except that you must use a lowercase 'p' in 'player'. It is case-sensitive.

Glopo
Posts: 29
Joined: Tue Aug 11, 2009 9:52 pm

Re: How to: using waypoint files (Examples: DQ running, multi )

#17 Post by Glopo » Sun Aug 16, 2009 6:09 am

ok thx

depp69
Posts: 30
Joined: Mon Aug 17, 2009 12:46 pm

Re: How to: using waypoint files (Examples: DQ running, multi )

#18 Post by depp69 » Mon Aug 17, 2009 12:52 pm

is it possible to make the runes of magic window the active window after
reaching a specific waypoint? would be nice for increasing skills
or any other things you have to do with the mouse while running
multiple bots

greets

User avatar
droppen
Posts: 179
Joined: Mon Aug 03, 2009 10:32 pm

Re: How to: using waypoint files (Examples: DQ running, multi )

#19 Post by droppen » Tue Aug 18, 2009 6:48 am

depp69 wrote:is it possible to make the runes of magic window the active window after
reaching a specific waypoint? would be nice for increasing skills
or any other things you have to do with the mouse while running
multiple bots

greets
showWindow(getWin(), sw.show);


Most of the questions in the forums are allredy awnsered in other posts. a wiki that anyone could add to would be helpful so that people could check the wiki first.

User avatar
Administrator
Site Admin
Posts: 4861
Joined: Sat Jan 05, 2008 4:21 pm

Re: How to: using waypoint files (Examples: DQ running, multi )

#20 Post by Administrator » Tue Aug 18, 2009 8:31 am

droppen wrote:
depp69 wrote:is it possible to make the runes of magic window the active window after
reaching a specific waypoint? would be nice for increasing skills
or any other things you have to do with the mouse while running
multiple bots

greets
showWindow(getWin(), sw.show);


Most of the questions in the forums are allredy awnsered in other posts. a wiki that anyone could add to would be helpful so that people could check the wiki first.
People don't even bother reading what's already right in front of them. I don't think a wiki would be that much more useful except for those very few who actually bother.

Anyways, showWindow() has it's limitations. It can only force that window to the foreground if 1) MicroMacro created the window 2) MicroMacro created the process that created the window 3) MicroMacro is in the foreground. This largely makes showWindow() useless when dealing with multiple instances.

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests