Page 5 of 10
Re: Anyone have minigames Waypoints?
Posted: Fri Oct 21, 2011 9:36 pm
by lisa
Hmm I never checked chest stance, I'll try that next.
There was no difference in that offset I usually have a look at.
ID stays the same.
Yeah if you get interupted while opening chest then it doesn't open it, without an indicator for it to be opened we don't have a way to tell open and not open chests apart.
My code just opens all tiles, then does the chests afterwards.
Re: Anyone have minigames Waypoints?
Posted: Fri Oct 21, 2011 10:19 pm
by lisa
I can't seem to get a value for stance of the pawn. Tested it on character with this.
Code: Select all
function tilelog(_name,_comment)
local found = false
local objectList = CObjectList();
objectList:update();
local objSize = objectList:size()
filename = getExecutionPath() .. "/logs/tilelog.txt";
file, err = io.open(filename, "a+");
if( not file ) then
error(err, 0);
end
for i = 0,objSize do
obj = objectList:getObject(i);
if obj.Name == _name then
_stance = memoryReadRepeat("byteptr", getProc(), obj.Address, addresses.charStance_offset);
_stance2 = memoryReadRepeat("byteptr", getProc(), obj.Address, addresses.charStance_offset + 2);
if _comment ~= nil then
file:write(obj.X.." "..obj.Z.." "..obj.Stance.." ".._comment.."\n")
else
file:write(obj.X.." "..obj.Z.." ".._stance.." ".._stance2.."\n")
end
end
end
file:close();
end
using commandline and using character name as _name.
it always just printed 64 0 regardless of if I was standing sitting, sleeping, it never changed from 64 0.
If I did with comment so it used obj.Stance it said
Code: Select all
attempt to concatenate field 'Stance' (a nil value)
I even added the code to pawn.lua so that it updated the self.Stance with pawn:update(), same result.
Either way it doesn't seem Stance will hold the key =(
Re: Anyone have minigames Waypoints?
Posted: Fri Oct 21, 2011 11:57 pm
by rock5
It looks like the stance offsets are offsets of 'addresses.staticbase_char' which is not the same as the players address. So I don't expect the offset to work off other pawn or object addresses.
Sorry for the confusion.
Re: Anyone have minigames Waypoints?
Posted: Sat Oct 22, 2011 1:54 am
by lisa
Ok finally had a break through with chests, after extensive searching found an offset that indicates if it has been looted or not.
How are you guys going with the start of the WP?
Killing the trash.
Re: Anyone have minigames Waypoints?
Posted: Sat Oct 22, 2011 2:10 am
by Nero
TBH, I tried a few things and nothing seems to work - some of it works partially, some of it doesn't at all. Just now I've thought about a simple check for target's HP in onPreSkillCast - it shouldn't take that much resources, and bot never really casts skills when target's HP = 0 anyway. What's left to see is whether after checking this, bot won't just stay and try to attack this mob with 0 HP anyway, and be blocked on onPreSkillCast instead of targeting another one. Will check whether it works in an hour or so.
Edit - another thing would be to make WP near each mob, target nearest mob in each one, and then make a check if his HP is full or not - if it is, it would cast one skill and proceed. Because the bot doesn't really go to the exact coords, I'm not sure how effective it would be - but if at least 3/4 of the mobs would be killed correctly, the rest of them shouldn't be that big of a time-waster. I'll check that first, as it seems better to me.
Edit2 - realized that on page 3, both of those ideas were already present. Didn't see any feedback about one of them, and I figure that it's worth a try. One thing that I need is
Code: Select all
player:moveTo(waypoint, ignoreCycleTargets);
but I've no idea how to use it. Just how do I define to which waypoint to move in this function?
Re: Anyone have minigames Waypoints?
Posted: Sat Oct 22, 2011 4:34 am
by Nero
Lots of trial and error, but I've sacrificed today's survival shells on mages, as they're also able to 1-hit those mechanisms at the beginning. Turns out that the distance gets measured correctly after small jumps with teleport, and with some short rests, it works.
Code: Select all
function physatt()
local bmhp = player:findNearestNameOrId(101489)
if bmhp and (bmhp.HP == bmhp.MaxHP) then
player:target_Object (101489)
yrest(200);
-- player:cast("spammable skill"); -- change it to your skill
-- yrest(120);
teleportToWP();
yrest(800);
else
player:clearTarget();
yrest(200);
teleportToWP();
yrest(500);
end
end
Even using some skill once isn't probably needed - my staff on all of those mages got 3,5 attack speed, so even the slowest 2h axes are only 12.5% slower. Every time when it's found the mob, it would target it, and by targeting automatically go to it and make one 'white' hit - if 51 lvl mage did enough DMG, then all other classes will do the same.
I've left the code for casting some skill commented out in case that 2h axe would turn out to be too slow, but I doubt it.
I've never had it teleport before that one 'white' hit - don't know why, as it should target the mechanism and 0,2 sec later teleport without the use of any skill - but on 5 characters it's worked every time, so I assume that for some reason it works. If not - well, we can always uncomment the skillcast part, and it'll work.
There is some occasional mistake, and the code might miss one or two mobs - on two runs one mob was left, on one run two of them. This waste of time seems negligible to me, although some change at the beginning to attack mobs with any lvl inside this waypoint will be needed in case that some mechanisms will be still around after one 'round'.
I might also map the way on which the spirit guardians, or whatever they're called, will aggro on our char if noone will do it today - but that's kid's stuff, and I'm out of characters ATM. Then, after one round of attacking bizarre mechanisms, WP should be turned into type="RUN", and basically, this part is finished.
I'll also add zone_id check, so that it might be started in Varanas, and not already inside malatina's survival. Will have it in a few hours as I'm about to get busy, and the chest-looting part isn't here yet anyway.
Also, I've included the file that I've been using to check whether that function works (coords by Kanta if anyone wants to know ;] ) - feel free to test it on your own
Re: Anyone have minigames Waypoints?
Posted: Sat Oct 22, 2011 7:29 am
by lisa
This WP includes the chest checking, it only teleports to chests that can be opened. No wasting of time at all.
I still want to tweak the tile opening but for now it effectively does from after trash to opening last chest.
My theory at the moment for how I want the WP to function is like this.
Start WP in avranas, chat to malatina and do choices to go to survival, chat to the guy and start it. walk with waypoint coords into the room, at that last set of coords do a check.
Code: Select all
first = player:findNearestNameOrId() --what ever the id is for first mob
second = player:findNearestNameOrId() --what ever the id is for spawns of first mob
tiles = player:findNearestNameOrId("Treasure Tile", nil, clicktile) -- checkif any tiles need opening
if first then
first() -- do function that clears trash
end
if second then
second() -- do function that kills spawns
end
if first == nil and second == nil and tiles ~= nil then
tiles()
end
if tiles == nil then
chests() -- open chests
end
so at the end of first() function make it call second function() and so on.
That way you can start the WP at any stage of the event and it will automatically pick up from where it should be up to.
Any thoughts?
Re: Anyone have minigames Waypoints?
Posted: Sat Oct 22, 2011 8:06 am
by lisa
Decided to go with Rock's really complex table thing because it will be very very useful =)
so to double check, I did the table and orderlist and then this should work?
Code: Select all
function tiles1()
orderlist = {1,4,7,10,13,16,19,22,25,28,31,34,2,5,8,11,14,17,20,23,26,29,32,35,3,6,9,12,15,18,21,24,27,30,33,36}
for i = 1,36 do
local tile = tiles[orderlist[i]]
--teleport(tile.X,tile.Z,14)
--local disttile = distance(player.X, player.Z, tile.X, tile.Z)
repeat
teleport(tile.X,tile.Z,14)
player:target_Object(tile.Id, nil, nil, true, clicktile);
until clicktile(tile.Address) == false
end
end
because tile is the actual pawn? local tile = tiles[orderlist
]
So going with this usage we can now to this for the first mobs.
Code: Select all
orderlist = {31, 32, 33, 34, 35, 36, 30, 24, 18, 12, 6, 5, 4, 3, 2, 1, 7, 13, 19, 25}
Which will be all the outside tiles in order from closest to where you enter room.
Re: Anyone have minigames Waypoints?
Posted: Sat Oct 22, 2011 8:22 am
by lisa
so first round of trash would look like this for melee
Code: Select all
function trashmelee()
local orderlist = {31, 32, 33, 34, 35, 36, 30, 24, 18, 12, 6, 5, 4, 3, 2, 1, 7, 13, 19, 25}
for i = 1,36 do
local tile = tiles[orderlist[i]]
teleport(tile.X + 10,tile.Z +10,14)
trash = player:findNearestNameOrId(101489)
player:target(trash)
RoMScript("UseSkill(1,1);");
player:clearTarget();
end
end
I did an offset of + 10 from coords, that will no doubt have to be tweaked to get to range 50 for melee. This would only be for fast melee weapons but you get the idea.
Re: Anyone have minigames Waypoints?
Posted: Sat Oct 22, 2011 8:29 am
by Nero
TBH, if you don't want it to run from WP to WP manually, won't it be better to just add mobs positions, and then use teleport to specific coordinates? Second wave, those mobs that spawn from mechanisms, should be easy enough - just tele to tile1, and then go on foot to tiles 1>6>31>36>1 in 'RUN' setting
Re: Anyone have minigames Waypoints?
Posted: Sat Oct 22, 2011 8:34 am
by rock5
lisa wrote:because tile is the actual pawn? local tile = tiles[orderlist]
Yes, although it's an object, not a pawn. A pawn has hp,class,level etc. Objects in objectlists only have a few values.
lisa wrote:So going with this usage we can now to this for the first mobs.
Code: Select all
orderlist = {31, 32, 33, 34, 35, 36, 30, 24, 18, 12, 6, 5, 4, 3, 2, 1, 7, 13, 19, 25}
Which will be all the outside tiles in order from closest to where you enter room.
That would give you their location but not necesarily the best location to attack from.
lisa wrote:I did an offset of + 10 from coords
Wouldn't you want to make sure you are on the outside so that posibly you would miss the knock over waves? How about getting th coords of the center and say
Code: Select all
if tile.X > center.X then Xoffset = 10 else Xoffset = -10 end
if tile.Y > center.Y then Yoffset = 10 else Yoffset = -10 end
teleport(tile.X + Xoffset,tile.Z +Yoffset,14)
Not ideal but it's better than nothing.
Re: Anyone have minigames Waypoints?
Posted: Sat Oct 22, 2011 9:35 am
by lisa
center coords should be easy, the wand is always in the middle, I can get those coords easy enough.
I'll give it a go tomorrow =)
Re: Anyone have minigames Waypoints?
Posted: Sat Oct 22, 2011 1:18 pm
by ctrlaltdelete
lisa wrote:This WP includes the chest checking, it only teleports to chests that can be opened. No wasting of time at all.
I still want to tweak the tile opening but for now it effectively does from after trash to opening last chest.
My theory at the moment for how I want the WP to function is like this.
Start WP in avranas, chat to malatina and do choices to go to survival, chat to the guy and start it. walk with waypoint coords into the room, at that last set of coords do a check.
Code: Select all
first = player:findNearestNameOrId() --what ever the id is for first mob
second = player:findNearestNameOrId() --what ever the id is for spawns of first mob
tiles = player:findNearestNameOrId("Treasure Tile", nil, clicktile) -- checkif any tiles need opening
if first then
first() -- do function that clears trash
end
if second then
second() -- do function that kills spawns
end
if first == nil and second == nil and tiles ~= nil then
tiles()
end
if tiles == nil then
chests() -- open chests
end
so at the end of first() function make it call second function() and so on.
That way you can start the WP at any stage of the event and it will automatically pick up from where it should be up to.
Any thoughts?
I gave this WP a shot and here are some points:
1) Do not use it outside Malatinas... It was making port all over the place, I stopped it immediately.
2) Start Malatina, then start bot... I wouldn't attack the green things (probably a profile error, no biggy)... I stopped killed all the green things and started bot.
3) Bot appeared to be working up until a "special monster spawned"... The bot teleport and got stuck at x:2624 z:3001 y:14... It looks like I fell under the earth and was stuck. Lots of lag... and No way of undoing the damage...
4) Ctrl+alt+delete...
Good luck, hope you get it to work.
Re: Anyone have minigames Waypoints?
Posted: Sat Oct 22, 2011 8:51 pm
by lisa
the last WP I posted doesn't have the actual waypoint coords for outside the event. It is purely from after the trash has been killed.
The code/theory I posted is how I though the end result should work.
Re: Anyone have minigames Waypoints?
Posted: Sun Oct 23, 2011 12:34 am
by kanta
@ctrlaltdelete
A bit of advice. You should really read the whole topic when it comes to waypoint files. It has been said a few times in this one that it is not ready to be run from outside the mini game. That, in fact, fighting the mobs hasn't even been coded into it yet. That this script is still a work in progress. It's a bad idea to just download files and not know what's going on with them. So, in short: Read the whole thread or at least the last 20 or so posts.
Re: Anyone have minigames Waypoints?
Posted: Sun Oct 23, 2011 1:29 am
by lisa
Ok so wand is dead middle of tiles, wand coords are
2574.2619628906 3002.0290527344
so
Code: Select all
if tile.X > 2574.2619628906 then Xoffset = 10 else Xoffset = -10 end
if tile.Z > 3002.0290527344 then Zoffset = 10 else Zoffset = -10 end
teleport(tile.X + Xoffset,tile.Z +Zoffset,14)
or is that to accurate and I should remove the decimal to be
2574 3002
??
Re: Anyone have minigames Waypoints?
Posted: Sun Oct 23, 2011 2:39 am
by lisa
lol you through me off, our idea of how to order the tile table was different, after your code it looks like this =)
Code: Select all
--=== Table numbering system ===--
--[[
1 7 13 19 25 31
2 8 14 20 26 32
3 9 15 21 27 33
4 10 16 22 28 34
5 11 17 23 29 35
6 12 18 24 30 36
* -- entrance to room.
]]
Re: Anyone have minigames Waypoints?
Posted: Sun Oct 23, 2011 3:46 am
by lisa
I have the melee moving pretty smoothly now.
Need to make an adjustment though,
we do + or - 10 to each which moves it at an angle, would be better if moved it out in the same direction as tiles rather then an angle to nsew.
Code: Select all
/\
|
1 7 13 19 25 31
2 8 14 20 26 32
3 9 15 21 27 33
<-- 4 10 16 22 28 34 -->
5 11 17 23 29 35
6 12 18 24 30 36
|
\/
Not hugely important if it is a pain.
If grid was aligned with X Z axis it would be very easy lol
Re: Anyone have minigames Waypoints?
Posted: Sun Oct 23, 2011 4:23 am
by rock5
I never made any claims about the orientation, I only put them in order. I expected you to work out which corner is which. lol. If it matters to you I think it can be changed by just switching the sortfunc around.
Code: Select all
-- Sort function
local function sortfunc(a,b)
if NEsize(a.X,a.Z) == NEsize(b.X,b.Z) then
return SEsize(b.X,b.Z) > SEsize(a.X,a.Z)
else
return NEsize(b.X,b.Z) > NEsize(a.X,a.Z)
end
end
I never really thought that +/- 10 idea would be good enough because of the angle. A more complex solution will have to include those 2 functions I included NEsize and SEsize. I'll look into it. How do you want to be placed in the corners?
Re: Anyone have minigames Waypoints?
Posted: Sun Oct 23, 2011 4:53 am
by lisa
Order is fine, I just adjusted the numbers in my orderlists, all good.
Hmm corners would be great if further away from wand(middle) but to be honest even if they went outwards same as the others it would still work just as well. I am trying not to make it to complicated lol
I am still getting my head round the coord stuff you did earlier lol.
I have a fully functional melee version at this stage, just need to give it another run through as test before posting it.
Had issue on last char of not attacking the spawns.