oGasai
Functions for logging out when if we get stuck or the nav mesh crash - Printable Version

+- oGasai (http://darkenedlinux.com/ogasai)
+-- Forum: My Category (http://darkenedlinux.com/ogasai/forumdisplay.php?fid=1)
+--- Forum: General (http://darkenedlinux.com/ogasai/forumdisplay.php?fid=44)
+--- Thread: Functions for logging out when if we get stuck or the nav mesh crash (/showthread.php?tid=190)



Functions for logging out when if we get stuck or the nav mesh crash - Logitech - 11-08-2017

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());
end

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);
end

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
        SavePos();
        return;
    end

    -- 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
        StopBot();
        return;
    end
end


RE: Functions for logging out when if we get stuck or the nav mesh crash - zerger - 11-08-2017

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)
http://darkenedlinux.com/ogasai/showthread.php?tid=166


cheers


lasix ohne rezept bestellen lasix rezeptfrei deutschland lasix kaufen ohne - sonusood - 10-08-2022

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