Code:
if SScheck then
    local serversavetime = {from = '4:45', to = '5:20'}
serversavetime = {from = tosec(serversavetime.from), to = tosec(serversavetime.to)}
local randdelay = {min = 0, max = 300}
local startlabel = ''
local curchar = 1

--dont change things below

local randomdelay = math.random(randdelay.min, randdelay.max)
local curtime = tosec(time())
 if (__itemcount(manaID) <= manaCheck) or (itemcount(UHP) <= uhp_Check) or (itemcount(GHP) <= ghp_Check) or (cap < CapToLeave) or curtime < servesavetime.from then
      if posz == 9 and (posy < 31136 and posy >= 31079) then 
           setlooting("no")
           setsettings("Settings\\Actions\\List\\Hur\\Enabled","yes")
           setsettings("Settings\\Targeting\\Monsters\\Yielothax\\OnlyIfTrapped","yes")
           gotolabel("LeaveTop") 
           wait(1000)
      end
 end      
end
end