I need a script that actually loots and sits once gotten too the given percentage.\
This is what i currently got.
Code: Select all
-- heal until full HP & MP
function rest_heal()
local last_HP = HP;
keyboardPress(key_sit);
yrest(100);
while( HP < HPmax ) do
if( HP < last_HP ) then
print("Under attack! Exiting rest");
return;
else
last_HP = HP;
end
print("Still resting....");
yrest(100);
coroutine.yield();
end
keyboardPress(key_sit);
yrest(1000);
end
function sit()
if( HP_sit == 0 ) then
return; end
printf("Sitting.\n");
local sitting = false;
while( sitting == false ) do
keyboardPress(key_sit);
yrest(1000);
sitting = memoryReadByte(proc, sitcheck_addr) ~= 0;
end
local lasthp = HP;
while( true ) do
if( HP == MaxHP and MP == MaxMP and SP == MaxSP ) then
switch_target();
break;
end
if( HP < (lasthp - 10) ) then
printf("Exiting rest...under attack\n");
tempDisableSitting(); -- so we don't end up sitting right away again
break;
else
lasthp = HP;
end
yrest(100);
end
sitting = true;
while( sitting ) do
keyboardPress(key_sit);
yrest(1000);
sitting = memoryReadByte(proc, sitcheck_addr) ~= 0;
end
printf("Standing... Resuming bot\n");
yrest(1000);
end
function pickup()
printf("Pickup!\n");
if( key_pickup == 0 ) then return; end
local i;
for i = 0, 5 do
keyboardPress(key_pickup);
yrest(500);
end
yrest(1000);
end
yet it doesn't loot or sit, it just keeps on targeting mobs and attacking them, rapidly moving on.
If anyone could help me out with my problem, or having a good script it would be much appreciated.
Thanks in advance.