Suggestion for waitForLoadingScreen function
Posted: Tue Jan 25, 2011 11:01 am
I have been farming instance for some time now and have noticed that sometimes my alt might disconnect. So when my char is in instance it can't get out cause it is not in party and mobs will spawn back after certain time and kills me. So my temporary solution was logout if we wait more than 180 seconds while waiting loading screen. It could do something else if someone has better solution.
Code: Select all
local currentTime = os.time();
-- wait for loading screen to appear
if memoryReadBytePtr(getProc(), addresses.loadingScreenPtr, addresses.loadingScreen_offset) == 0 then
repeat
yrest(1000)
-- Timeout in seconds
if( os.difftime(os.time(), currentTime) > 180 ) then
player:logout(false, false);
end
until memoryReadBytePtr(getProc(), addresses.loadingScreenPtr, addresses.loadingScreen_offset) == 1
end