CORPSERUN

06/14/2005 17:08 gecko67#1
hello,

i found that my bot, druide bot 1.42 from con, has problems with corpserun. when i try to find the problem
i found that the bot controll, if the next corpserunpoint is nearer to corpse then the actual.

i think this could be the problem why my bot stop running very often when iīm dead, because my corpseways are often a littlebit tricky.
or with other words: no chance to walk direct from graveyard to corpse

perhaps somebody could show me how to change the programming of corpserun that the bot run from first point to 2nd point ...to last point and
looks than for best route to corpse

wp_cr_count = 0
while wp_cr_count < GetListItemCount(list_cr_y) do
walk_x = StrToFloat(GetListItemText(list_cr_x, wp_cr_count))
walk_y = StrToFloat(GetListItemText(list_cr_y,wp_cr_count))
PrintConsoleLine("Distance to corpse: "..tn:GetDistance(tn:GetCorpseLoc()))

!!!! if tn:GetDistance(tn:GetCorpseLoc()) < tn:GetDistance(walk_x,walk_y) then break
end

PrintConsoleLine("Corpserun, next waypoint: "..IntToStr(wp_cr_count))
MoveToXY(hWnd,walk_x,walk_y,5)
wp_cr_count = wp_cr_count + 1

I hope that some of our clever developer could solve my/our problem.


thanks in advance
06/15/2005 09:57 n1ce#2
The current corpserun was only a quick hack and needs a full recode.
06/15/2005 11:08 gecko67#3
i count the number of corpsrunpoints. in my case 5. than i amanded the code following way:


wp_cr_count = 0

wp_corpse = 1

while wp_cr_count < GetListItemCount(list_cr_y) do
walk_x = StrToFloat(GetListItemText(list_cr_x, wp_cr_count))
walk_y = StrToFloat(GetListItemText(list_cr_y,wp_cr_count))
PrintConsoleLine("Distance to corpse: "..tn:GetDistance(tn:GetCorpseLoc()))

if wp_corpse = 5 then break

end

PrintConsoleLine("Corpserun, next waypoint: "..IntToStr(wp_cr_count))
MoveToXY(hWnd,walk_x,walk_y,5)
wp_cr_count = wp_cr_count + 1

wp_corpse = wp_corpse + 1


now the corpserun run 5 times through and must follow every point. so i come in the correct way to the end point of corpserun.

if i make a new botrun, i must count the new points and change my if than.


AHHHH!!! as i see now perhaps all this is not necessary, because in the line with:
while wp_cr_count < GetListItemCount(list_cr_y) do

this is included. perhaps this code is good enough and you donīt have to change something for new waypoints:

wp_cr_count = 0

while wp_cr_count < GetListItemCount(list_cr_y) do
walk_x = StrToFloat(GetListItemText(list_cr_x, wp_cr_count))
walk_y = StrToFloat(GetListItemText(list_cr_y,wp_cr_count))
PrintConsoleLine("Distance to corpse: "..tn:GetDistance(tn:GetCorpseLoc()))
PrintConsoleLine("Corpserun, next waypoint: "..IntToStr(wp_cr_count))
MoveToXY(hWnd,walk_x,walk_y,5)
wp_cr_count = wp_cr_count + 1


I will check this version and come back.

as you see i try to solve my problems and perhaps somebody find a good idee for the next edition.
06/15/2005 21:08 gecko67#4
It works perfect. if you have problems with your corpsrun delete this if-then lines