deponame, depoid = "", "" -- dont touch it
worlds = {} -- dont touch it
howmuchJar = 50 -- how much jar u want to give bot
bots = {
{botname = "", botpass = "", botproxy = "", worlds =
{"mrdbn","mrdnj","mrdnb","mrdmu","mrdmp","mrdml","mrdmz","mrdmv"}, deponame = "",
depoid = ""},
{botname = "", botpass = "", botproxy = "", worlds =
{"maynht1","maynht2","maynht3","maynht4","maynht5","maynht7","maynht10","maynht12"}
, deponame = "", depoid = ""},
saveWorld = "" -- bot drop items to here
saveWorldID = "" -- u need id or not gonna work!
function checkJar(bot,currentWorld,types)
if types == "a" then
while bot:getWorld().name:lower() ~= deponame:lower() do
bot:sendPacket(3,"action|join_request\nname|" .. deponame .. "|" ..
depoid .."\ninvitedWorld|0")
sleep(8000)
end
while getTile(bot:getWorld():getLocal().posx//32,
bot:getWorld():getLocal().posy//32).fg == 6 do
bot:sendPacket(3,"action|join_request\nname|" .. deponame .. "|" ..
depoid .."\ninvitedWorld|0")
sleep(8000)
end
sleep(1500)
local abc = 0
while bot:getInventory():getItemCount(3720) < howmuchJar do
bot:collect(4,400)
sleep(200)
if abc >= 20 then
sleep(120000)
end
end
while bot:getInventory():getItemCount(3720) > howmuchJar do
bot:sendPacket(2,"action|drop\n|itemID|3720")
sleep(bot:getPing()*40)
bot:sendPacket(2,"action|dialog_return\ndialog_name|drop_item\nitemID|
3720|\ncount|"..bot:getInventory():getItemCount(3720) - howmuchJar)
sleep(bot:getPing()*40)
end
sleep(2000)
while bot:getWorld().name:lower() ~= currentWorld:lower() do
bot:sendPacket(3,"action|join_request\nname|" .. currentWorld .."\
ninvitedWorld|0")
sleep(8000)
end
sleep(2000)
else
while bot:getWorld().name:lower() ~= deponame:lower() do
bot:sendPacket(3,"action|join_request\nname|" .. deponame .. "|" ..
depoid .."\ninvitedWorld|0")
sleep(8000)
end
while getTile(bot:getWorld():getLocal().posx//32,
bot:getWorld():getLocal().posy//32).fg == 6 do
bot:sendPacket(3,"action|join_request\nname|" .. deponame .. "|" ..
depoid .."\ninvitedWorld|0")
sleep(8000)
end
sleep(1500)
local abc = 0
while bot:getInventory():getItemCount(3720) == 0 do
bot:collect(4,400)
sleep(200)
if abc >= 20 then
sleep(120000)
end
end
while bot:getInventory():getItemCount(3720) > howmuchJar do
bot:sendPacket(2,"action|drop\n|itemID|3720")
sleep(bot:getPing()*40)
bot:sendPacket(2,"action|dialog_return\ndialog_name|drop_item\nitemID|
3720|\ncount|"..bot:getInventory():getItemCount(3720) - howmuchJar)
sleep(bot:getPing()*40)
end
sleep(2000)
while bot:getWorld().name:lower() ~= currentWorld:lower() do
bot:sendPacket(3,"action|join_request\nname|" .. currentWorld .."\
ninvitedWorld|0")
sleep(8000)
end
sleep(2000)
end
end
function IsTileHitable(x, y)
local localPosX = getBot():getWorld():getLocal().posx
local localPosY = getBot():getWorld():getLocal().posy
local tileRadius = 5
if x >= math.floor(localPosX / 32) - tileRadius and x <= math.floor(localPosX /
32) + tileRadius and y >= math.floor(localPosY / 32) - tileRadius and y <=
math.floor(localPosY / 32) + tileRadius then
return true
end
return false
end
function detectNpcPositionAndPunch(botX, botY, npcX, npcY)
local punchX, punchY = 0, 0
if npcX > botX then
punchX = 1
elseif npcX < botX then
punchX = -1
elseif npcX == botX then
punchX = 0
end
if npcY < botY then
punchY = -1
elseif npcY > botY then
punchY = 1
elseif npcY == botY then
punchY = 0
end
return punchX, punchY
end
function fastPuncher(bot,botX,botY,npcX,npcY,afterX, afterY)
local x,y = detectNpcPositionAndPunch(botX, botY, npcX, npcY)
if IsTileHitable((npcX+afterX)/2 +x,(npcY+afterY)/2 +y) then
bot:hit((npcX+afterX)/2 +x,(npcY+afterY)/2 +y)
sleep(150)
return true
else
return false
end
end
function aiPlace(bot)
if getTile(bot:getWorld():getLocal().posx//32,
bot:getWorld():getLocal().posy//32 + 1).fg ~=0 and
getTile(bot:getWorld():getLocal().posx//32, bot:getWorld():getLocal().posy//32 +
1).fg ~= 546 then
bot:place( bot:getWorld():getLocal().posx//32,
bot:getWorld():getLocal().posy//32 + 2, 3720)
elseif getTile(bot:getWorld():getLocal().posx//32,
bot:getWorld():getLocal().posy//32 + 2).fg ~=0 and
getTile(bot:getWorld():getLocal().posx//32, bot:getWorld():getLocal().posy//32 +
2).fg ~= 546 then
bot:place( bot:getWorld():getLocal().posx//32,
bot:getWorld():getLocal().posy//32 +1, 3720)
elseif getTile(bot:getWorld():getLocal().posx//32,
bot:getWorld():getLocal().posy//32 + 3).fg ~=0 and
getTile(bot:getWorld():getLocal().posx//32, bot:getWorld():getLocal().posy//32 +
3).fg ~= 546 then
bot:place( bot:getWorld():getLocal().posx//32,
bot:getWorld():getLocal().posy//32 +2, 3720)
elseif getTile(bot:getWorld():getLocal().posx//32,
bot:getWorld():getLocal().posy//32).fg ~=0 and
getTile(bot:getWorld():getLocal().posx//32, bot:getWorld():getLocal().posy//32).fg
~= 546 then
bot:place( bot:getWorld():getLocal().posx//32,
bot:getWorld():getLocal().posy//32 +1, 3720)
end
end
counter = 0
function checkCounter(bot)
local ghost = 0
if bot:isInWorld() then
for _, npc in pairs(getNPCs()) do
if npc.type == 1 then
ghost = ghost + 1
end
end
end
return ghost
end
function nextWorld(bot, currentWorld)
while bot:getWorld().name:lower() ~= currentWorld:lower() do
bot:sendPacket(3,"action|join_request\nname|" .. currentWorld .."\
ninvitedWorld|0")
sleep(8000)
end
end
function findGhost(bot, worldname)
if getBot():getWorld().name:lower() ~= worldname:lower() then
nextWorld(bot,worldname)
end
local npcs = getNPCs()
bot.move_interval = 150
bot.move_range = 8
if checkCounter(bot) > bot:getInventory():getItemCount(3720) then
checkJar(bot, bot:getWorld().name, "a")
sleep(2500)
end
if bot:isInWorld() then
for _, npc in pairs(npcs) do
if npc.type == 1 then
::YENIDEN::
local founded = false
local foundedghostinsameplace = false
if bot:findPath(getNPC(npc.id).destx // 32, getNPC(npc.id).desty // 32)
then
for _, tile in pairs(getTiles()) do
local distance = math.sqrt((tile.x - getNPC(npc.id).destx //
32) ^ 2 + (tile.y - getNPC(npc.id).desty // 32) ^ 2)
if distance <= 2 then
if #bot:getPath(tile.x, tile.y) > 0 and ((getTile(tile.x,
tile.y + 1).fg ~= 0 and getTile(tile.x, tile.y + 3).fg ~= 0) or (getTile(tile.x,
tile.y + 2).fg ~= 0 and getTile(tile.x, tile.y).fg ~= 0)) then
bot:findPath(tile.x, tile.y)
sleep(150)
founded = true
end
if getTile(bot:getWorld():getLocal().posx//32 ,
bot:getWorld():getLocal().posy//32).fg == 0 and
getTile(bot:getWorld():getLocal().posx//32 , bot:getWorld():getLocal().posy//32
+1 ).fg == 0 and getTile(bot:getWorld():getLocal().posx//32 ,
bot:getWorld():getLocal().posy//32 +2).fg == 0 and
getTile(bot:getWorld():getLocal().posx//32 , bot:getWorld():getLocal().posy//32
+3).fg == 0 then
founded = false;goto YENIDEN
end
end
if founded then break end
end
local jammerBug = -10
beforeJmmr = getBot():getInventory():getItemCount(3720)
while getNPC(npc.id) ~= nil and
fastPuncher(bot,bot:getWorld():getLocal().posx//32 ,
bot:getWorld():getLocal().posy//32, getNPC(npc.id).x//32 , getNPC(npc.id).y//32,
getNPC(npc.id).destx//32, getNPC(npc.id).desty//32) do
if not foundedghostinsameplace and getNPC(npc.id) ~= nil and
(getNPC(npc.id).x // 32 == bot:getWorld():getLocal().posx // 32) and
(getNPC(npc.id).y // 32 == bot:getWorld():getLocal().posy // 32) then
aiPlace(bot)
sleep(200)
getBot():getLog():append("Place atiom : " .. getBot().name)
foundedghostinsameplace = true
end
sleep(10)
jammerBug = jammerBug + 1
if jammerBug >= 25 and foundedghostinsameplace and beforeJmmr
== getBot():getInventory():getItemCount(3720) then
foundedghostinsameplace = false
jammerBug = 0
end
end
sleep(500)
bot:collect(4, 250)
sleep(500)
foundedghostinsameplace = false
counter = counter + 1
end
end
end
end
end
function goDepoToDrop(bot)
while bot:getWorld().name:lower() ~= saveWorld:lower() do
bot:sendPacket(3,"action|join_request\nname|" .. saveWorld .. "|" ..
saveWorldID .."\ninvitedWorld|0")
sleep(8000)
end
while getTile(bot:getWorld():getLocal().posx//32,
bot:getWorld():getLocal().posy//32).fg == 6 do
bot:sendPacket(3,"action|join_request\nname|" .. saveWorld .. "|" ..
saveWorldID .."\ninvitedWorld|0")
sleep(8000)
end
while bot:getInventory():getItemCount(3721) > 0 do
bot:sendPacket(2,"action|drop\n|itemID|3721")
sleep(bot:getPing()*40)
bot:sendPacket(2,"action|dialog_return\ndialog_name|drop_item\nitemID|
3721|\ncount|"..bot:getInventory():getItemCount(3721))
sleep(bot:getPing()*40)
end
while bot:getInventory():getItemCount(3722) > 0 do
bot:sendPacket(2,"action|drop\n|itemID|3722")
sleep(bot:getPing()*40)
bot:sendPacket(2,"action|dialog_return\ndialog_name|drop_item\nitemID|
3722|\ncount|"..bot:getInventory():getItemCount(3722))
sleep(bot:getPing()*40)
end
end
function start(worlds, bot)
while true do
for i = 1,#worlds do
checkJar(bot, worlds[i])
findGhost(bot, worlds[i])
nextWorld(bot, worlds[i])
end
goDepoToDrop(bot)
end
end
function getsize(T)
local count = 0
for _ in pairs(T) do count = count + 1 end
return count
end
if getsize(getBots()) ~= #bots then
for i = 1,#bots do
addBot(bots[i].botname, bots[i].botpass)
addProxy(bots[i].botproxy)
end
else
for i = 1,#bots do
if getBot().name:lower() == bots[i].botname:lower() then
deponame, depoid = bots[i].deponame , bots[i].depoid
getBot():getLog():append(deponame .. ":" .. depoid)
for t = 1,#bots[i].worlds do
table.insert(worlds, bots[i].worlds[t]:lower())
end
break
end
end
start(worlds, getBot())
end