Waypoints and combat

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
ellamental
Posts: 27
Joined: Mon Mar 23, 2009 4:49 am

Waypoints and combat

#1 Post by ellamental » Mon Mar 23, 2009 4:54 am

Wanted to say thanks for the hard work, and set up donations to help with bandwidth cost.



Was wondering if there was a way to loop waypoints.

Example

I have a set of way points I want to run to x level, bot starts in town runs to these waypoints, then checks level.

IF level is under X it loops next set of waypoints, then check level again, if n< X rinse and repeat till > X

IF > X it runs next set of waypoints.

Also can I add hide to the looting function somehow, that way when it loots it also uses hide?

If this can be done, please direct me in the right direction on how to do it.

Also how do I set up death waypoints, to run back to my hunting grounds after ressing.

Edit:Found answer to one of my questions.

Code: Select all

<onLeaveCombat>
   -- cast hide, lets assume hide is hotkeyed to KEY_7
   yrest(1000);
   keyboardPress(key.VK_7);
   yrest(500);
</onLeaveCombat>
Notice that the movement looks really bottish, anyway to fix this? While moving when it gets to a way point it uses q and e to position itself, but almost every few secs.

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

Re: Waypoints and combat

#2 Post by Administrator » Mon Mar 23, 2009 12:40 pm

You can set up advanced waypoints by adding some code into the waypoints themselves. You can use this to change which waypoint to move to.

Code: Select all

    <waypoint x="x" z="z" /> <!-- in town -->
    <waypoint x="x" z="z" /> <!-- moving away... -->
    <waypoint x="x" z="z" />

    <waypoint x="1234" z="5678" /> <!-- the start of our actual loop -->
    <waypoint x="1235" z="5432" />
    <waypoint x="1236" z="5000">
        __WPL:setWaypointIndex(4);
    </waypoint>
__WPL:setWaypointIndex() just tells the waypoint list management class which waypoint we will be moving to next. They waypoints go from top to bottom in the XML file starting at 1. Since 4 is our loop start of the waypoints, we set the waypoint index to 4 once we reach the end.

onDeath waypoints can be set up the same way (but you would probably want to put them at the, and have the last waypoint in the loop return to waypoint index 1). There may be some problems with the onDeath stuff right now, so I would avoid using it until the next version rolls out.
Notice that the movement looks really bottish, anyway to fix this? While moving when it gets to a way point it uses q and e to position itself, but almost every few secs.
It will be worked on, but it's not a main priority. Just try to not get caught.

ellamental
Posts: 27
Joined: Mon Mar 23, 2009 4:49 am

Re: Waypoints and combat

#3 Post by ellamental » Mon Mar 23, 2009 11:01 pm

Ok thanks for the info, can I also cause keystrokes at said way point?

ciraco
Posts: 15
Joined: Mon Mar 23, 2009 1:37 pm

Re: Waypoints and combat

#4 Post by ciraco » Mon Mar 23, 2009 11:18 pm

I was about to make a post with a similar question.
Would it be possible to have it check your characters level and if LVL >= X that it would execute a new waypoint.xml and have an option to not loop or somthing.

for example:
- lvl 1 char, uses waypont 1to6.xml
- at lvl 6 the bot changes waypoints and uses go6to10.xml
- then at the last stop in the waypoint it uses 6to10.xml
- at lvl 10 the bot changes waypoints and uses go10-15.xml
- then at the last stop in the waypoint it uses 10to15.xml
etc.

If something like that was possible people could start a new character before bed or before work/school and start it then it will just keep going instead of grinding on lvl 1-5's as a lvl 10+ (if bot ran long enough).

Just an idea tho.

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

Re: Waypoints and combat

#5 Post by Administrator » Mon Mar 23, 2009 11:51 pm

ellamental wrote:Ok thanks for the info, can I also cause keystrokes at said way point?
Sure. Just use the functions that induce keyboard input.

Code: Select all

keyboardPress(key.VK_SPACE); -- Jump. Why? I don't know.
If something like that was possible people could start a new character before bed or before work/school and start it then it will just keep going instead of grinding on lvl 1-5's as a lvl 10+ (if bot ran long enough).
Although a simple solution for this is not in place yet, it can be done if you are willing to put in the time to do it. You could have the bot check at specific waypoints whether it has met the level requirement to move on, then switch waypoint lists.

So, start with the level 1-5 waypoints. At level 5, load the waypoints to move to a 6-10 area. Now load the 6-10 loop. Once level 10, move to the next area, and repeat.

To load a new set of waypoints, use this code:

Code: Select all

	__WPL:load(getExecutionPath() .. "/waypoints/myWaypointList.xml");
	__WPL:setWaypointIndex(1);

ciraco
Posts: 15
Joined: Mon Mar 23, 2009 1:37 pm

Re: Waypoints and combat

#6 Post by ciraco » Tue Mar 24, 2009 12:26 am

How would you go about having it check if the level has been met at a specific waypoint?

I assume it would be something like

Code: Select all

<waypoints>
	<waypoint x="-2012" z="-8056" />
	<waypoint x="-1926" z="-8063" />
	<waypoint x="-1827" z="-8070" />
	<waypoint x="-1731" z="-8078" />
	<waypoint x="-1629" z="-8085" />
	<waypoint x="-1530" z="-8118" />
	<waypoint x="-1429" z="-8151" />
	<waypoint x="-1329" z="-8188" />
	<waypoint x="-1222" z="-8215" />
	<waypoint x="-1121" z="-8202" />
	<waypoint x="-1155" z="-8095" />
	<waypoint x="-1187" z="-7992" />
	<waypoint x="-1246" z="-7923" />
	<waypoint x="-1332" z="-7892" />
	<waypoint x="-1424" z="-7877" />
	<waypoint x="-1530" z="-7866" />
	<waypoint x="-1607" z="-7863" />
	<waypoint x="-1686" z="-7870" />
	<waypoint x="-1752" z="-7904" />
	<waypoint x="-1819" z="-7963" />
	<waypoint x="-1856" z="-8023" />
	<waypoint x="-1882" z="-8103" />
	<waypoint x="-1891" z="-8187" />
	<waypoint x="-1896" z="-8259" /> if level >= 6, change waypoint
</waypoints>
As you can see im not 100% familiar with the language / syntax lol.

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

Re: Waypoints and combat

#7 Post by Administrator » Tue Mar 24, 2009 1:08 am

Code: Select all

    <waypoint x="-1896" z="-8259">
        if( player.Level >= 6 ) then
            __WPL:load(getExecutionPath() .. "/waypoints/6to10.xml");
            __WPL:setWaypointIndex(1);
        end;
    </waypoint>

ellamental
Posts: 27
Joined: Mon Mar 23, 2009 4:49 am

Re: Waypoints and combat

#8 Post by ellamental » Mon Mar 30, 2009 6:24 pm

Ok now my next question is, can your bot send mouse clicks to the screen at X,Y position?

Or does the client block out mouse strokes?

Reason I ask, is then I can set this bot up to quest.

Also can you have the bot check and sell if it has x amount of items in it's inventory? and if s to move onto next set of way points such as the level example above?

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

Re: Waypoints and combat

#9 Post by Administrator » Mon Mar 30, 2009 7:17 pm

ellamental wrote:Ok now my next question is, can your bot send mouse clicks to the screen at X,Y position?

Or does the client block out mouse strokes?

Code: Select all

detach();
mouseSet(x, y);
mouseLClick();
attach(getWin());
Reason I ask, is then I can set this bot up to quest.

Also can you have the bot check and sell if it has x amount of items in it's inventory? and if s to move onto next set of way points such as the level example above?
No, not at this time.

ellamental
Posts: 27
Joined: Mon Mar 23, 2009 4:49 am

Re: Waypoints and combat

#10 Post by ellamental » Mon Mar 30, 2009 7:59 pm

Well let me rephrase 2nd question there.

Can the bot detect what item is in what slot (I think this is can be done with the lua for addons), then if so check count? then if count is == run waypoints?

With the right addons, and mouse clicks to screen can make this bot run quests, Sell and repair, and farm materials ( I have an idea for doing this with waypoints and mouse clicks.)

P.S Is there a donations page? IF not consider making one. I would like to see this bot progress and donations can help with bandwith cost.

P.S.S Is therea way to toggle combat on/off? That way I can make it run waypoints with out looking to check for targets to fight.

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

Re: Waypoints and combat

#11 Post by Administrator » Mon Mar 30, 2009 11:19 pm

ellamental wrote:Well let me rephrase 2nd question there.

Can the bot detect what item is in what slot (I think this is can be done with the lua for addons), then if so check count? then if count is == run waypoints?

With the right addons, and mouse clicks to screen can make this bot run quests, Sell and repair, and farm materials ( I have an idea for doing this with waypoints and mouse clicks.)

P.S Is there a donations page? IF not consider making one. I would like to see this bot progress and donations can help with bandwith cost.

P.S.S Is therea way to toggle combat on/off? That way I can make it run waypoints with out looking to check for targets to fight.
The bot cannot do that yet, no. It can be done with addons, but you wouldn't be able to set a different set of waypoints afterward through the same addon. Just collect all the items at one time, then turn them in manually.

No, there is currently not a donation page, but I do intend to create one soon. Thanks for considering donating.

ellamental
Posts: 27
Joined: Mon Mar 23, 2009 4:49 am

Re: Waypoints and combat

#12 Post by ellamental » Wed Apr 01, 2009 3:45 am

Ok I cant get it to work the way I want it to, but how do I get it to do a mouse click at x waypoint?

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

Re: Waypoints and combat

#13 Post by Administrator » Wed Apr 01, 2009 4:18 am

By putting the mouse clicking code inside waypoint code, similar to as shown here: http://solarimpact.servegame.com/phpBB3 ... 2993#p2993

But remember, RoM doesn't work with attached mouse input, so the RoM window must be kept on top.

ellamental
Posts: 27
Joined: Mon Mar 23, 2009 4:49 am

Re: Waypoints and combat

#14 Post by ellamental » Wed Apr 01, 2009 4:31 am

Code: Select all

<waypoints>
	<waypoint x="-4838" z="5983" />
	<waypoint x="-4710" z="6010"/>
	detach(runes of magic);
			mouseSet(675,752);
			mouseRClick();
			attach(getWin(runes of magic));
			end;
</waypoints>
Like this?, All its doing is moving back and forth from the 2 waypoints.

ciraco
Posts: 15
Joined: Mon Mar 23, 2009 1:37 pm

Re: Waypoints and combat

#15 Post by ciraco » Wed Apr 01, 2009 4:26 pm

Are you trying to modify this to work as a gathering bot?

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

Re: Waypoints and combat

#16 Post by Administrator » Wed Apr 01, 2009 6:48 pm

ellamental wrote:

Code: Select all

<waypoints>
	<waypoint x="-4838" z="5983" />
	<waypoint x="-4710" z="6010"/>
	detach(runes of magic);
			mouseSet(675,752);
			mouseRClick();
			attach(getWin(runes of magic));
			end;
</waypoints>
Like this?, All its doing is moving back and forth from the 2 waypoints.
Close, but no. You are generating a few errors (which aren't shown or logged), so it's not doing anything.

Code: Select all

	<waypoint x="-4838" z="5983" />
	<waypoint x="-4710" z="6010"/>
		detach();
		mouseSet(675,752);
		mouseRClick();
		attach(getWin());
</waypoints>

ellamental
Posts: 27
Joined: Mon Mar 23, 2009 4:49 am

Re: Waypoints and combat

#17 Post by ellamental » Thu Apr 02, 2009 10:09 pm

Code: Select all

<waypoints>
	<waypoint x="-11458" z="-1524" />
	<waypoint x="-11470" z="-1418" />
	      detach();
      mouseSet(675,752);
      mouseRClick();
      attach(getWin());
</waypoints>
Still only moves between 2 waypoints.

@ ciraco

Yes, The way I have thought is, by disabling the attack hot key, and staying in stealth 100% of the time, I could make a way point, then note where all the nodes could be, then have it pause and click 6-7 times before moving onto the next waypoint.

But by just adding this code into the waypoints nothing is happening. it still just moves from waypoint 1 to 2

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

Re: Waypoints and combat

#18 Post by Administrator » Thu Apr 02, 2009 10:36 pm

You're right, I didn't look at the code properly. The problem is now that it's not a value inside the waypoint, but rather a value inside the waypoints. That is, the code is being attributed to the root XML object rather than that specific waypoint.

Code: Select all

<waypoints>
   <waypoint x="-11458" z="-1524" />
   <waypoint x="-11470" z="-1418">
         detach();
      mouseSet(675,752);
      mouseRClick();
      attach(getWin());
   </waypoint>
</waypoints>

ellamental
Posts: 27
Joined: Mon Mar 23, 2009 4:49 am

Re: Waypoints and combat

#19 Post by ellamental » Thu Apr 02, 2009 11:08 pm

Ok now I have a new problem that I need to fix 1st, My bot no longer wants to move to waypoints. it keeps getting stuck, then doing nothing >.<

Edit: haha I must of changed some of my keybindings by mistake, reverted to orginal and works fine, thanks for the mouse click, going to test it out now.

ellamental
Posts: 27
Joined: Mon Mar 23, 2009 4:49 am

Re: Waypoints and combat

#20 Post by ellamental » Thu Apr 02, 2009 11:19 pm

Administrator wrote:You're right, I didn't look at the code properly. The problem is now that it's not a value inside the waypoint, but rather a value inside the waypoints. That is, the code is being attributed to the root XML object rather than that specific waypoint.

Code: Select all

<waypoints>
   <waypoint x="-11458" z="-1524" />
   <waypoint x="-11470" z="-1418">
         detach();
      mouseSet(675,752);
      mouseRClick();
      attach(getWin());
   </waypoint>
</waypoints>

Yes this works, now the next part is, Can I add a pause at the way point before moving to the next?

Tried to add
wait(10000)

And get [string" detach<>;..."]:5: attempt to call global 'wait' <a nil value>

Never mind found my answer yrest()

Ok now with this useful info, im going to see if I can get this thing to gather!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 4 guests