local _, n1, n2, time, minutes, text, S, V, pl, payd, result, next
function onGameText(text)
if text:match("Played") then
_ = text:match("Played (%d+) min.")
n1, n2 = _:match("."), _:match(".(.)")
if tonumber(n1) > 0 then
time = tonumber(_)
else
if tonumber(n2) > 0 then
time = tonumber(n2)
else
time = 0
end
end
minutes = tonumber(os.date("%M"))
if time < 20 then
result = 20 - time
t = 60 - (minutes + result + 5)
next = 1000*(60*t)
else
t = 60 - (minutes + 5)
next = 1000*(60*t)
end
if t > 0 then
printLog("PayDay waited. Reconnect after ".. t .."m.")
reconnect(next)
end
end
if text:match("PAYDAY") then
printLog("PayDay catched. Reconnect after 35m.")
reconnect(2100000)
end
end
function onScriptStart()
defCallAdd(3000, true, function()
S = tonumber(os.date("%M"))
V = tonumber(os.date("%S"))
if S < 35 and S > 1 and V > 15 and not pl then
if isBotSpawned() then
sendInput('/time')
end
end
end)
end
function onSpawned()
minutes = tonumber(os.date("%M"))
pl = true
if minutes < 4 then
printLog("PayDay losed.")
payd = false
end
if not payd then
defCallAdd(10000, false, function()
sendInput('/time')
payd = true
end)
end
pl = false
end