Page 3 of 3
Re: Official home of Madman Addon
Posted: Sun Oct 14, 2012 8:20 am
by runegolemsentry
there is a problem still. With this code it works fine, but sometimes my char still dies.. because once he does the clear target function, he start moving to the next waypoint, and since i'm using teleport it gets stuck in the gates and killer after.
Once stucked it targets madman again, is there a way to reduce casualities to 0?
I tryed something like that
Code: Select all
if getZoneId() == 127 or getZoneId() == 128 then
target = player:getTarget();
if target.Id == 103857 or target.Id == 103169 then
if RoMScript("madman.Time") >= 1 then
unregisterTimer("timedAttack");
player:clearTarget();
printf("Running\n")
rest(5000)
local okander = player:findNearestNameOrId("103169")
player:target(okander)
end
end
end
but something goes wrong, because it runs for 5 seconds, then runs again for 5 seconds and gets stuck to a corner, so on a eventual second jump it dies.
Before, after the player:target i added this code
Code: Select all
if not (okander)
repeat
yrest(1000)
until false
end
but with this, the addon wasn't working at all, again the problem of running back to the position.
Re: Official home of Madman Addon
Posted: Sun Oct 14, 2012 10:09 am
by rock5
Was that the right id that you tried to retarget?
Assuming that the address for Okander doesn't change, which I think it doesn't, you could also try
instead of
Code: Select all
local okander = player:findNearestNameOrId("103169")
player:target(okander)
So it just targets what you had targeted before.
Re: Official home of Madman Addon
Posted: Sun Oct 14, 2012 11:12 am
by runegolemsentry
well now it works, both with my code and with yours (my id is fine since i do normal mode always, for easy it should be changed), the only problem happeans in case of an eventual second jump as i said, but so far i won't need to worry about it since the fight it self lasts 5-6 seconds normally.
Re: Official home of Madman Addon
Posted: Wed Oct 17, 2012 2:31 pm
by nightclaw
ya if fight over by 1st jump or just after seams to be NP but if it last longer tell second jump it goes all crazy 4 some reason not had chance test rocks idea yet been bit busy with other things but i try test it soon thax
Re: Official home of Madman Addon
Posted: Wed Oct 17, 2012 4:07 pm
by noobbotter
It seems like no matter what I tried, for some reason my bot wanted to run back to where Okander is going to land. Not every time, but often enough that it wasn't working for me. I implemented a teleport instead of a run so that my bot would get far away from Okander and not be able to run back under him. As an extra added precaution, I also have me bot do a holy aura (priest skill, immune to all damage for 5 seconds, instant cast) prior to teleporting out of the way. To do this I went into my madman addon script and commented out the moveForwardStart() and MoveForewardStop() commands and then in my waypoint file, I have the following code in the function that's called when the timer goes off:
Code: Select all
if RoMScript("madman.Time") >= 1 then
player:cast("PRIEST_HOLY_AURA");
DOD_HA_CASTED = true --this is so I can know I casted holy aura and can wait longer before my next entance into the instance so my cooldown will expire.
printf("lost my Okander target... teleporting \n");
local madx = nil
local madz = nil
if (player.X > 2300) and (player.Z > 2323) then
-- go to left side
madx = 2151;
madz = 2313;
elseif (player.X > 2300) and (2323 > player.Z) then
-- go to near entrance:
madx = 2198;
madz = 2507;
elseif (2300 > player.X) and (player.Z > 2323) then
-- go to far side
madx = 2407;
madz = 2120;
elseif (2300 > player.X) and (2323 > player.Z) then
-- go to right side
madx = 2479;
madz = 2347;
end
teleport(madx, madz);
yrest(1000);
player:update();
yrest(6000)
end
The X and Z coordinates are basically set so that whichever side of the arena I'm on, I will teleport to the opposite side when okander jumps. This works pretty well but every once in a while after jumping the bot can't reacquire Okander as a target. I think it's sticking somewhere on releasing the target and gets stuck in some kind of loop. Anyway, just wanted to share my teleport away from Okander code for anyone that was having the same problem of walking back underneath him before he lands.