|
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.
|