Rotasi Lua
Rotasi Lua
Rotasi Lua
PosPnb = blockid + 1
seedid = blockid + 1
name = (GetLocal().name:gsub("`.",''))
function drop()
SendPacket(2,"action|drop\n|itemID|"..seedid)
end
function inv(itemid)
for _, item in pairs(GetInventory()) do
if item.id == itemid then
return item.amount
end
end
return 0
end
function trash(trashing)
SendPacket(2,"action|trash\n|itemID|"..trashing.."")
SendPacket(2,"action|dialog_return\ndialog_name|trash_item\
nitemID|"..trashing.."|\ncount|180")
end
function plants(x,y)
pkt = {}
pkt.px = x;
pkt.py = y;
pkt.x = x*32
pkt.y = y*32
pkt.type = 3;
pkt.value = seedid;
SendPacketRaw (false, pkt);
end
function place(x,y,itemID)
pkt = {}
pkt.x = GetLocal().posX
pkt.y = GetLocal().posY
pkt.px = x;
pkt.py = y;
pkt.type = 3
pkt.value = itemID;
SendPacketRaw(false, pkt)
Sleep(150)
end
function punchs(x,y)
pkt = {}
pkt.x = GetLocal().posX
pkt.y = GetLocal().posY pkt.px = x;
pkt.py = y;
pkt.type = 3;
pkt.value = 18
SendPacketRaw(false, pkt)
Sleep(220)
end
function pnb()
while inv(blockid) > 10 do
place(math.floor(GetLocal().posX/32-1), math.floor(GetLocal().posY/32),blockid)
for i = 1, hitcounts do
punchs(math.floor(GetLocal().posX/32-1), math.floor(GetLocal().posY/32))
end
end
end
function baris()
for _,tile in pairs(GetTiles()) do
if tile.fg == PosPnb or tile.bg == PosPnb then
Sleep(300)
FindPath(tile.x,tile.y+6)
return false
end
end
end
function punch(x, y)
local packet = {}
packet.px = math.floor(GetLocal().posX / 32) + x
packet.py = math.floor(GetLocal().posY / 32) + y
packet.type = 3
packet.value = 18
packet.x = GetLocal().posX
packet.y = GetLocal().posY
SendPacketRaw(false, packet)
end
function harvest(itemid)
for _, tile in pairs(GetTiles()) do
if(tile.fg == itemid) and (tile.readyharvest == true) and inv(blockid) <=
180 then
Sleep(500)
FindPath(tile.x,tile.y)
Sleep(1000)
punchs(math.floor(GetLocal().posX/32),math.floor(GetLocal().posY/32))
end
end
end
function plant()
for _, tile in pairs (GetTiles()) do
if tile.fg == 0 and GetTile(tile.x, tile.y + 1).fg ~= 0 and
GetTile(tile.x, tile.y + 1).fg % 2 == 0 then
if inv(seedid) > 0 then
Sleep(delay)
FindPath(tile.x, tile.y)
Sleep(delay)
plants(math.floor(GetLocal().posX/32), math.floor(GetLocal().posY/32))
end
end
end
end
function main()
if inv(trashslot1) >= 180 then
trash(trashslot1)
elseif inv(trashslot2) >= 180 then
trash(trashslot2)
elseif inv(seedid) >= 190 then
Sleep(300)
Sleep(300)
drop()
elseif inv(blockid) > 10 then
Sleep(500)
baris()
Sleep(500)
pnb()
plant()
elseif inv(blockid) <= 10 then
harvest(seedid)
end
end
function AvoidError()
if pcall(function()
main()
end) == false then
Sleep(100)
AvoidError()
end
Sleep(100)
AvoidError()
end
var = {}
var.v1 = "OnTextOverlay"
var.v2 = "Rotasi by Rhy Universe"
SendPacket(2,"action|input\n|text|Rotation Start")
SendVariant(var)
AvoidError()