Is it possible to make my character go to differend farm position if he notices PK death? It would be IMO better than choosing the path randomly. I can't think how it could be done.
I tried to create a function that would randomly choose the path when comming back after death.
Code: Select all
function Randompath()
local min = 1;
local numberOfPaths = 2;
local rand = math.random(min, numberOfPaths);
printf("Choosing path: %s \n", rand);
if( rand == 1 ) then
__WPL:load(getExecutionPath() .. "/waypoints/Waypoints1.xml");
__RPL:load(getExecutionPath() .. "/waypoints/back_to_Waypoints1.xml");
elseif( rand == 2 ) then
__WPL:load(getExecutionPath() .. "/waypoints/Waypoints2.xml");
__RPL:load(getExecutionPath() .. "/waypoints/back_to_Waypoints2.xml");
end;
--Print the changes made
cprintf(cli.green, language[0], __WPL:getFileName());
cprintf(cli.green, language[1], __RPL:getFileName());
return rand;
end
I was thinking of placing
it in bot.lua right after this:
I am not sure how this would work since I'm not planning to die. How can I easily test the function? When I enable the bot it will just go with the pathpoints. I dun wanna xp debt :/.
BTW is the
necessary or should I just use