Autoplant Nextworld - Lua
Autoplant Nextworld - Lua
pathId = "takedirt"
worldGudang = "WORLD TO TAKE SEEDS"
worldList = {"WORLDPLANT1","WORLDPLANT2",}
function warp(world,id)
sendPacket(3, "action|join_request\nname|"..world)
--sleep(3000)
for x=1,10 do
sleep(400)
end
while true do
if string.upper(getworld()) == string.upper(world) then
break
else
sleep(1000)
end
end
sendPacket(3, "action|joinrequest\nname|"..world.."|"..id)
for x=1,3 do
sleep(500)
end
if getTile(math.floor(getposx()/32),math.floor(getposy()/32)).fg == 6 then
sendPacket(3, "action|joinrequest\nname|"..world.."|"..id)
for x=1,3 do
sleep(500)
end
end
end
function take(id)
for _,object in pairs(getObjects()) do
if object.id == id then
findPath(math.floor(object.x / 32),math.floor(object.y / 32))
sleep(500)
collect(2)
sleep(500)
if findItem(id) > 0 then
break
end
end
end
end
function plant(id,world)
for _,tile in pairs(getTiles()) do
if tile.fg ~= 0 and tile.fg ~= id and getTile(tile.x,tile.y - 1).fg == 0
then
findPath(tile.x,tile.y - 1)
sleep(100)
place(id,0,0)
sleep(100)
if findItem(id) == 0 then
warp(worldGudang,pathId)
sleep(100)
take(id)
sleep(100)
warp(world,pathId)
sleep(100)
end
end
end
end
jmlBot = #getBots()
for i = 0, jmlBot do
if string.upper(getBots()[i].name) == string.upper(getBot().name) then
indexBot = i
end
end
while true do
for i,list in pairs(worldList) do
if ((i - 1) % (jmlBot + 1)) == indexBot then
warp(list,pathId)
sleep(100)
plant(itemId,list)
sleep(100)
end
end
end