• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Functions for logging out when if we get stuck or the nav mesh crash
Im back leveling with this bot and since I've been having problems with the nav mesh crashing I dont wanna get banned standing still forever... So I made some functions for detection this...

Add these functions and run: StopIfStuck(); on every iteration.

function SavePos()
    local x, y, z = GetUnitsPosition(GetLocalPlayer());
    SetVar('myX', x);
    SetVar('myY', y);
    SetVar('myZ', z);  
    SetVar('myTime', GetTimeX());

function GetSavedX() if (GetVar('myX') ~= 0) then return GetVar('myX'); else return 0; end end
function GetSavedY() if (GetVar('myY') ~= 0) then return GetVar('myY'); else return 0; end end
function GetSavedZ() if (GetVar('myZ') ~= 0) then return GetVar('myZ'); else return 0; end end
function GetSavedTime() if (GetVar('myTime') ~= 0) then return GetVar('myTime'); else return 0; end end

function GetDistanceDif()
    local x, y, z = GetUnitsPosition(GetLocalPlayer());
    local xV = GetSavedX()-x;
    local yV = GetSavedY()-y;
    local zV = GetSavedZ()-z;
    return math.sqrt(xV^2 + yV^2 + zV^2);

function StopIfStuck()
    -- Draw functions
    DrawText('Stuck feature:', 250, 240, 255, 255, 0);
    DrawText('Current distance to last saved coordinates: ' .. math.floor(GetDistanceDif()) .. ' yards...', 250, 250, 255, 255, 255);
    DrawText('Logging out in' .. ' ' .. math.floor(30-((GetTimeX()-GetSavedTime())/1000)) .. ' s if we do not move or save a new position...', 250, 260, 255, 255, 255);
    DrawText('New position is saved if we move more than 20 yards or when we are in combat or eating...', 250, 270, 255, 255, 255);

    -- Save our pos if we moved more then 20 yards or if we are in combat or eating
    if (GetDistanceDif() > 20 or IsInCombat() == 1 or IsEating() == 1) then

    -- Check if we are stuck/standing still (moved less than 20 yards) since 30 sec since last saved position
    if (GetDistanceDif() < 20 and ((GetTimeX()-GetSavedTime())/1000) > 30) then
        if (logOutIfStuck) then Logout(); end
hi, nice to see you are at it again!
Maybe swing by discord, it is kind of busy there Smile
Beniamin and i are writing a resurrection logic that avoids mobs and its 99% done
Also darklinux said he will soon push a update that fixes some bugs

have a look at this thread for some functions that need to be coded (whichwould be useful in all rotations)

lasix ohne rezept bestellen furosemid rezeptfrei kaufen furosemid 40 rezeptfrei kaufen
lasix rezeptfrei deutschland lasix ohne rezept lasix rezeptfrei österreich
lasix kaufen ohne rezept lasix kaufen apotheke lasix rezeptfrei
lasix rezeptfrei schweiz lasix kaufen apotheke lasix ohne rezept kaufen
furosemid ohne rezept kaufen lasix rezeptfrei lasix rezeptfrei bestellen
lasix rezeptfrei kaufen lasix kaufen apotheke furosemid rezeptfrei apotheke

Forum Jump:

Users browsing this thread: 1 Guest(s)