package.path = getRakBotPath().."/scripts/libs/?.lua;"..getRakBotPath().."/scripts/libs/?/init.lua;";
package.cpath = getRakBotPath().."/scripts/libs/?.dll";
require("getrpc")
grx = -1891,67
gry = -1677,37
grz = 23
gr = 0
payment = 1
i = 2
function onRunCommand(cmd)
defCallAdd(1000, false, function ()
if cmd:find("!mn%s+(.+)") then
number = cmd:match('!mn%s+(.+)')
number = tonumber(number)
coordMasterStart(grx, gry, grz)
gr = 1
end
end)
if cmd == "!dfs" then
gr = 0
end end
function onTextDrawSetString(textid, text)
if textid == 2191 and (gr >= 1) then
local payment = text:find("PAYMENT:_~Y~$(.+)")
printLog('text'..text)
payment = text:match('$(.+)')
payment = tonumber(payment)
printLog("Заработано: $"..payment)
if (payment > number) and (gr == 3) then
printLog('Закончил, иду сдавать')
runCommand('!stop')
sendPickup(pick1318, false)
defCallAdd(2000, false, function()
sendPickup(pic1275, false)
gr = 0
end)
else
printLog('Работаю дальше')
end
end
end
function onCoordMasterComplete()
local botskin = getSkin()
local pic1275 = getPick1275()
local x, y, z = getPosition()
local drx = -1891
local dry = -1681
local drz = -5,6
local mx = -1968
local my = -1555
local mz = 7
px = -1893,90
py = -1675,20
pz = 23
local pick1318 = getPick1318()
if (botskin ~= 16) and (gr == 1) then
sendPickup(pic1275, false)
botskin = 16
teleport(px, py, pz)
end
if gr == 3 then
runCommand('!play min')
runCommand('!loop')
end
end
function onSetSkin(playerid, skinid)
local botid = getBotId()
local pick1318 = getPick1318()
if (playerid == botid) and (skinid == 16) and (gr == 1) then
defCallAdd(1000, false, function()
sendPickup(pick1318, false)
gr = 2
end)
end
end
function onPrintLog(str)
if str:find('Администратор (.+) ответил') and (gr >= 1) then
defCallAdd(5000, false, function()
runCommand("!quit")
end)
end
function onSetInterior(InteriorId)
inter = getInteriorId()
local drx = -1891
local dry = -1681
local drz = -5
if (gr == 2) and (inter == 1) then
coordMasterStart(drx, dry, drz)
gr = 3
end
end
end