Anyone have minigames Waypoints?

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: Anyone have minigames Waypoints?

#41 Post by kanta » Wed Oct 19, 2011 6:01 am

Nero wrote: No idea about people who don't have spammable AOE though, as almost all of my characters do, and it helps immensely at the beginning.
As a rogue/scout (or scout/rogue) I don't have a spammable AoE. Even with basic gear statting this isn't a problem. I typically finish Survival with approximately 2 minutes left.

Glad my idea of teleporting sparked ideas from others. I'll try to see if I can figure something out. Like Nero, I depend heavily on reverse engineering from other scripts to make my own.

I've been using the following code to harvest the tiles

Code: Select all

player:target_Object(111812, nil, nil, true);
As for the possibility of missing some tiles during the waypoints, maybe do a check with player:findNearestNameOrId(111812) until player:target() ~= true after it reaches the last waypoint? Again, I'm not sure how to implement this, it's just an idea.
Scout/Knight/Rogue 70/66/66

User avatar
Nero
Posts: 98
Joined: Wed Aug 10, 2011 9:07 am

Re: Anyone have minigames Waypoints?

#42 Post by Nero » Wed Oct 19, 2011 6:47 am

I went out with my dog, got a bit of fresh air, and realized that it wasn't really well thought - out. Function might as well check those three things, get knocked further away, and start harvesting different tile altogether.

For now, I'll just try to add harvesting into each waypoint manually, and it will proceed to the next WP when it will harvest that tile. It's a bit of copy&paste, but at least should be easy to do. Even if one tile will be missed, I could make it teleport into the middle of the room, make harvest range high, and target any tiles that have been omitted. It would be a far cry from such a polished script as CoT, but whatever works for now.

In one hour I should have a working beta of it - for now, only with aoe.


Although, here's an idea for killing one by one - we could add some table with all bizarre mechanisms, then sort them out into a few groups, as in if position X equals 2700>x>2900, 2900>x>3000 etc - and then, it will target one mob from each different group - with three groups at once it should constantly have target whose hp isn't 0. Here, your character should have some ranged attacks.
Or, if that script will turn out to be fast enough, bot could simply be type="NORMAL" at the beginning, and those 30 seconds or so wasted wouldn't matter.

Anyway, I'll test last few things in an hour or so, as I've got only last 3 characters that I can try survival today. Later

User avatar
Nero
Posts: 98
Joined: Wed Aug 10, 2011 9:07 am

Re: Anyone have minigames Waypoints?

#43 Post by Nero » Wed Oct 19, 2011 9:11 am

Okay, I've finished the alpha version for today, as I have no more characters to check the code. It doesn't really work as of yet, but I hope that you people could provide some feedback. For now, problems:

- you need some kind of spammable AOE, as it's hardly 'optimised' as of yet. Default is set to mage's purgatory, you can change it though in onLoad
- if you're harvesting the tile, and it gets disrupted by the red wave, character will immediately teleport to the next waypoint, thus leaving one tile lying around
- biggest problem as of yet - I'm unable to determine what happens to those tiles that do get harvested. It seems like they go underground or something, as the four waypoints in the end that are supposed to loot any left-over tiles try to loot in places that were harvested already. This is the major problem right now, as it prevents from finishing the tiles - bot keeps trying to loot nonexisting tiles. You might try to change tag="gettiles" from wp#64 to wp#29 - there's about 90% chance that all tiles will be looted, but still - bot still targets some tiles when there are none, so the check is an infinite loop.
Tried both ID's of tiles - both don't work as they're supposed to.



If we could eliminate the third problem, then it's basically working as long as you've got spammable aoe. I'll think about what to do when that's not possible, but someone should take this part over - I've got only one physical DPS at the moment, so my testing abilities leave alot to be desired, so it'll probably take awhile.

Last part when the bot tries to loot chests isn't tested yet, but should work.



If you pick the last few tiles manually, it's done in about 7-8 mins, so it's good enough. Once we'll fix this tile targeting issue, and add one by one killing, it can be considered final.


Oh - for the moment it's starting AFTER you enter malatina's survival. Will fix it tomorrow.


So, feedback?
Attachments
SURVIVAL alpha.xml
(6.36 KiB) Downloaded 133 times

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Anyone have minigames Waypoints?

#44 Post by lisa » Wed Oct 19, 2011 9:45 am

found how to determine which tiles to click.

in your WP onload add this.

Code: Select all

function clicktile(address)
	local tmp = memoryReadRepeat("int", proc, address + addresses.pawnAttackable_offset) or 0;
	if bitAnd(tmp,0x8) then
		return true
	else
		return false
	end
end
then when trying to target the tile use the function as 5th argument.

Code: Select all

player:target_Object(111812, nil, nil, true, clicktile);
Now it will only click the tiles that can actually be clicked.
The function name might not be good, just come up with something more appropriate if you want.

Ok since it's 6 X 6 that makes it easy

Code: Select all

1  2  3 4  5  6
7  8  9 10 11 12
13 14 15 16 17 18
do
1, 4, 7, 10, 13, 16, 19, 22 and so on.
so it does row 1 and 4 together then do 2 and 5 together then 3 and 6. easy as.
Far enough away to not get bombed and small enough to teleport easily.


I am sure there is more to do, I will help as I can =)
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Anyone have minigames Waypoints?

#45 Post by lisa » Wed Oct 19, 2011 10:17 am

Not sure if this will help or not but here are the coords for the tiles.

X Z
2613 2971
2644 2960
2482 2984
2501 2943
2512 2973
2624 3001
2534 3034
2564 3023
2594 3012
2622 2900
2471 2954
2572 2952
2603 2941
2633 2930
2542 2963
2523 3004
2583 2982
2553 2993
2493 3014
2592 2911
2531 2932
2562 2922
2575 3053
2635 3031
2504 3045
2605 3042
2654 2990
2526 3105
2676 3050
2556 3094
2646 3061
2586 3083
2616 3072
2515 3075
2665 3020
2545 3064
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Anyone have minigames Waypoints?

#46 Post by lisa » Wed Oct 19, 2011 10:40 am

The thing in the middle that casts the knockdown is
"Malatina's Magic Wand"

There is always 1 present but when you see it start glowing before it casts the knockdown there becomes another with same name, so there is then 2 of them. There is also an indicator to tell the difference between the 2 but I doubt it is needed as you can't kill it. Knowing the second appears means if necessary you could detect when there is 2 and teleport out of harms way and then back in after it vanishes. Probably not necessary but the option is there if you feel it is needed later.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
Nero
Posts: 98
Joined: Wed Aug 10, 2011 9:07 am

Re: Anyone have minigames Waypoints?

#47 Post by Nero » Wed Oct 19, 2011 12:26 pm

...are you a wizard?

Honestly, how do you KNOW all this stuff? ^^

Teleport works as intended, it's actually as you've said here (I've included a picture how it works on the 2nd page), and when you're knocked down, it still can do it - so it's actually faster this way, even if you don't avoid the wave - hence I don't think that 'evading' it each time that it blows up is the way to go.

Next, I've dug up my ancient mage on an account from ~8 months ago, changed the code a little, and went to test it. When it's gone to the place where it's supposed to target the leftover tiles, I've gotten an error. Seeing as I've had almost 5 minutes left, I've quickly cut down the code to try it by itself.

There have been 4 tiles left, so I wanted it to harvest 3 tiles, and then check whether player:findNearestNameOrId(); will work with the extra argument.

This was the 'short' waypoint

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>

<onload>

	function clicktile(address)
  		local tmp = memoryReadRepeat("int", proc, address + addresses.pawnAttackable_offset) or 0;
  	 	if bitAnd(tmp,0x8) then
   	  	  return true
  	 	else
  	   	  return false
   		end
	end

</onload>

	<!-- # 64 --><waypoint x="2602" z="2941" y="10"	>
		changeProfileOption("HARVEST_DISTANCE", 400);
		yrest(500);
		player:target_Object(111812, nil, nil, true, clicktile);
	</waypoint>
	<!-- # 65 --><waypoint x="2510" z="2975" y="10">	
		player:target_Object(111812, nil, nil, true, clicktile);
	</waypoint>
	<!-- # 66 --><waypoint x="2638" z="3030" y="10">	
		player:target_Object(111812, nil, nil, true, clicktile);
	</waypoint>
	<!-- # 67 --><waypoint x="2548" z="3064" y="10">
		player:findNearestNameOrId(111812, clicktile) 	
	</waypoint>
</waypoints>
Every time that the bot approached the target_Object, micromacro printed

[time] - [string "..."]:4: Invalid proc


Since I don't really know about all those addresses, and even what does your function do, I have no clue what's wrong with it.

Oh well, I've had enough for today - I'll get back to it tomorrow. Cheers

@Edit - come to think of it, if it's function clicktile(address), then wouldn't it need to be player:target_Object(111812, nil, nil, true, clicktile() ); ? Maybe I'm grasping at straws, but that's the only thing I can think of on top of my head.

kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: Anyone have minigames Waypoints?

#48 Post by kanta » Wed Oct 19, 2011 6:16 pm

Well, doing a search through the forum, I found a similar function line.

Code: Select all

   local tmpp = memoryReadRepeat("int", proc, self.Address + addresses.pawnAttackable_offset) or 0;
   if bitAnd(tmpp,0x80000000) then
Is this completely off base? But if it's complaining about a string, wouldn't the "int" be the string in question? I really don't know but trying to help.

One other question. When it comes to the Bizarre Mechanisms, would the following code work to skip the 0 HP mobs and retarget on a full HP mob? Putting it in my <onPreSkillCast> profile section.

Code: Select all

		if RoMScript("GetZoneID()") == 351 then
			local bmhp = player:findNearestNameOrId(101489)
			if bmhp and (target.HP == target.MaxHP) then
				player:fight()
					elseif( 5 > target.HP/target.MaxHP*100 ) then
					player:clearTarget()
				 	player:target(bmhp) and (target.HP == target.MaxHP)
				end
			end
		end
EDIT

Ok, answered my own question. HP check doesn't work. Grrr. Also, the line of code I found didn't work of course. I think it should have been player.Address and not self.Address?
8:58pm - [string "..."]:3: attempt to index global 'self' (a nil value)
Scout/Knight/Rogue 70/66/66

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Anyone have minigames Waypoints?

#49 Post by lisa » Wed Oct 19, 2011 9:42 pm

my bad, instead of proc use getProc()

Code: Select all

function clicktile(address)
	local tmp = memoryReadRepeat("int", getProc(), address + addresses.pawnAttackable_offset) or 0;
	if bitAnd(tmp,0x8) then
		return true
	else
		return false
	end
end
I keep forgeting some places already have it defined and some don't.

and

Code: Select all

player:target_Object(111812, nil, nil, true, clicktile);
is correct.


@kanta
I probably wouldn't add this to onpreskillcast.
Is there a reason targeting mob to kill isn't working in the WP ?
bot should attack until it is dead, if you did the similar code in WP then it should work.

Code: Select all

local bmhp = player:findNearestNameOrId(101489)
if bmhp and (bmhp.HP == bmhp.MaxHP) then
player:fight()
end
player:fight() will make it attack that mob until it is dead, so then when it does the same check for mob and hp it shouldn't try to attack that mob again as it's hp isn't at max.
You could probably add in a loop for it to kill them all.
Not sure if there is a range limitation on the attacking, so maybe add in an increased range in the onload of WP to make sure it attacks all of them.

--=== after thought ===--
On second thought don't check for if hp is at max, check if it is not less then 5%
So even if a mob got partly attacked and is at 90% the bot should still kill it.

Code: Select all

local bmhp = player:findNearestNameOrId(101489)
if bmhp and ( bmhp.HP/bmhp.MaxHP*100 > 5 ) then
player:fight()
end
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
Nero
Posts: 98
Joined: Wed Aug 10, 2011 9:07 am

Re: Anyone have minigames Waypoints?

#50 Post by Nero » Thu Oct 20, 2011 12:05 am

Will check it in about 2 hours.


Had a thought about one by one killing - how about making a different 'way' for melee at the beginning? They're very weak anyways, so one hit will suffice. Coords would be next to every bizarre mechanism, fight range would be really short so that it will only target the closest one, and it will hit it once, clear target, and teleport straight to next mob. After bizarre mechanisms will be killed, next mobs will aggro by themself and you're able to kill them as usual. Seeing as teleport works very precisely (have still big trouble with aoe at the right place, might also add tp here), it should work flawlessly, and will actually be faster than random targeting, as those various paralysis etc won't matter.

Sure, it's a hackjob, but in theory it should work surprisingly well

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Anyone have minigames Waypoints?

#51 Post by lisa » Thu Oct 20, 2011 12:22 am

At the start I would probably just teleport to each outside tile and findnearest enemy and kill it, then teleport next spot. it will be just as fast as trying to organise an aoe attack and just use attack skill, useskill(1,1) that way characters won't stand there trying to use skills with cast times, ie flame. Only issue with that is slow weapons, if big 2 handed with 4 second attack speed it would be slower then just using actual skills.

Then second time round with the mobs that spawn use normal skills. ie player:fight() for no aoe and do a different function for aoe.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
Nero
Posts: 98
Joined: Wed Aug 10, 2011 9:07 am

Re: Anyone have minigames Waypoints?

#52 Post by Nero » Thu Oct 20, 2011 12:54 am

Couldn't hold my curiosity so went to test those changes.First run didn't change anything, but the code didn't give me an error. Next try, I've changed it to look both for id 111812 AND 111811, and all tiles got harvested after a few rounds. So this works!

One WP further, another problem -.-

Code: Select all

	<!-- # 68 --><waypoint x="2563" z="3022" y="10">
		player:findNearestNameOrId(111812, clicktile) ;
		local checktiles1 = player:findNearestNameOrId(111811, clicktile); 
		player:findNearestNameOrId(111811, clicktile) ;
		local checktiles2 = player:findNearestNameOrId(111812, clicktile); 
			if checktiles1 ~= nil   and   checktiles2 ~= nil then
				__WPL:setWaypointIndex(__WPL:findWaypointTag("gettiles"));	
		end
 	</waypoint>
It's supposed to check whether there are any 'valid' tiles that need to be clicked. Should check both ID's, and if they return something other than nil, it should go to the 'gettiles' tag. I assume that the code is correct? Or the 'clicktile' check in findNearestNameOrId makes it return something different than nil when there are no tiles left?

Next run, I'll print what does those checktiles 1 and 2 contain - should shed some light


Edit - yeah, not sure WHAT does those things return, but it sure as hell isn't nil. [string "..."]:6: attempt to concatenate local 'checktiles1' (a table value). Even if there WERE some tiles around, shouldn't it return true? I assume that change is brought by the clicktile argument?

And it appears that there are more problems with it that things working. When I've tried to collect chests, it has yet again tried to loot those that were already open. I'll try to add the same code as to the tiles, but I doubt it'll work.


Edit2 - it appears that every single time that you finish harvesting the tile, a new message in your chat appears, and "Hehehe..." is in every single one at least once. I assume that we could make an onEvent where every time that 'Hehehe..." would be registered, it will add one to our hyphotetical 'tilesHarvested', and when tilesHarvested would equal 36, it will go loot chests?
One problem that I see is that there's sometimes more than one 'Hehehe...' in that text - but we could simply use a longer message check. As I've never done something like that, I'll better ask first - is it viable?


Edit3 - Just as I've thought, targeting chests with clicktile didn't work. Gave me error
... /rom/classes/player.lua:3598: attempt to compare function with number.

kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: Anyone have minigames Waypoints?

#53 Post by kanta » Thu Oct 20, 2011 2:21 am

lisa wrote: @kanta
I probably wouldn't add this to onpreskillcast.
Is there a reason targeting mob to kill isn't working in the WP ?
bot should attack until it is dead, if you did the similar code in WP then it should work.
It's not a problem with attacking the mobs. It's the fact that it doesn't stop attacking the bizarre mechanisms until they despawn and the guardians take their place. Typically I wouldn't really care about this but it's a big time waster in Survival. I need some way for it to see that when the HP is 0 it needs to stop attacking, clear target and retargets on a full HP mob.

EDIT

Thinking of the following code

Code: Select all

	function killbm()
		while(true) do
			local bmhp = player:findNearestNameOrId(101489)
				if bmhp and ( bmhp.HP/bmhp.MaxHP*100 > 5 ) then
					player:cast("ROGUE_SHADOWSTAB")
					else teleportToWP()
				end
	end
Scout/Knight/Rogue 70/66/66

kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: Anyone have minigames Waypoints?

#54 Post by kanta » Thu Oct 20, 2011 3:39 am

@Nero

How about trying

Code: Select all

   <!-- # 68 --><waypoint x="2563" z="3022" y="10">
      local checktiles1 = player:findNearestNameOrId(111811);
      local checktiles2 = player:findNearestNameOrId(111812);
         if checktiles1 or checktiles2 then
            __WPL:setWaypointIndex(__WPL:findWaypointTag("gettiles"));
         else __WPL:setWaypointIndex(__WPL:findWaypointTag("getchests"));
      end
   </waypoint>
Scout/Knight/Rogue 70/66/66

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Anyone have minigames Waypoints?

#55 Post by lisa » Thu Oct 20, 2011 3:43 am

I'll have a look later tonight.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
Nero
Posts: 98
Joined: Wed Aug 10, 2011 9:07 am

Re: Anyone have minigames Waypoints?

#56 Post by Nero » Thu Oct 20, 2011 3:55 am

Yeah, I've had it like that initially, but it finds tiles that have been already harvested. This is what's lisa's code does - checks whether you can still harvest them. Without that, that loop will always return some value different from nil.

As I've said, it could be subverted by starting an onEvent at the beginning of tile harvesting that would monitor chat for any messages, and it will work. I can't find anything like that on forums ATM, though, so it might take a bit to do it myself, if that's even possible (thought that GMDetect would have something similar like that, but it doesn't check WHAT is whispered, only pawn's name).

Other solution I've thought of is to start a timer every time the bot starts harvesting, and check it approx. 4,8 sec later to see whether the castbar is still on - this would have very small error margin, but will really slow the bot down (it would wait that 5 sec every time, even if after 0,5 sec we got knocked down). Still, even a very small lag might change the result, so it's a no-go.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Anyone have minigames Waypoints?

#57 Post by lisa » Thu Oct 20, 2011 4:05 am

the second part of the GM detect checks messages, so there is code in it for checking messages to look at. Personally I wouldn't do that.

I would check if cast bar stops, so not player.Casting, then check the same pawn you clicked to see if that bit has changed or not.

I will have a look later tonight anyway, should be able to come up with a reliable solution.

I figured you would get interupted maybe 5 times out of whole run, once done all 36 just do a check for any tiles left with the bit, so basically just do the exact same check you did and then teleport to that tile and click it.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
Nero
Posts: 98
Joined: Wed Aug 10, 2011 9:07 am

Re: Anyone have minigames Waypoints?

#58 Post by Nero » Thu Oct 20, 2011 4:22 am

Would be much appreciated. Just found http://www.solarstrike.net/phpBB3/viewt ... 089#p23089 that I could probably twist into event monitor, but I think that I'd get even more problems to solve.

Every time I'm interrupted, it goes into nearest WP after 0,3 sec - so if there has been a bomb in the latest tile, it's knocked down and goes to the next one AGAIN. Right now, anywhere from 3 to even 10 tiles have been left. I've thought that after one round of 1-36 tile we could do another, that will take only around 30 sec if no tiles were present (about 1 sec on each tile), and then very few should be still left. Then I could just do the targetNPC with clicktile around 10 times, one after another, and it would work 99% of the time - but it's so unrefined so any other solution is probably better.

Well, I'll wait for now then, as I've got only 3 chars left to test the code out for today. GL


Just for the record - when you try to write one harder WP by yourself you learn ALOT. Just now I know almost exacly how this eventmonitor should work. So, if you thought about some WP that would be useful, try it yourself people ;]

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Anyone have minigames Waypoints?

#59 Post by lisa » Thu Oct 20, 2011 4:30 am

hmm mine killed the mechanisms and kept going, 2 attacks on it and then moved on

Code: Select all

Fight finished. Killed 1 Bizarre Mechanism. (fight #3 / runtime 0 minutes)
Fight finished. Killed 2 Bizarre Mechanism. (fight #5 / runtime 1 minutes)
Fight finished. Killed 3 Bizarre Mechanism. (fight #7 / runtime 1 minutes)
I just had it on wander, so it paused the rando pause then killed the spawned mob aswell lol

Need to add Malatina's Magic Wand to an ignore list, friend list won't be good enough as bot will try to defend itself and kill the wand even if on friend list.

Code: Select all

Engaging enemy [Malatina's Magic Wand] in combat.

attack skills blah blah

Taking too long to damage target, breaking sequence...
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Anyone have minigames Waypoints?

#60 Post by lisa » Thu Oct 20, 2011 4:35 am

ok have some info on the ID's

111812 and 111811, they are like a chess board alternating like the black and white squares do.

Code: Select all

811 812 811 812 811 812
812 811 812 811 812 811
811 812 811 812 811 812
812 811 812 811 812 811
811 812 811 812 811 812
812 811 812 811 812 811
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

Post Reply

Who is online

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