You are on page 1of 2

EditToggle("ModFly" , true)

id = 102
delay_put = 50
delay_path = 50

local function HookVariant(var)


if var.v1 == "OnDialogRequest" then
return true
end
end
AddHook(HookVariant , "OnVariant")

function ptp(x,y)
pkt = {}
pkt.type = 3
pkt.value = id
pkt.x = GetLocal().posX
pkt.y = GetLocal().posY
pkt.px = x
pkt.py = y
SendPacketRaw(false , pkt)
end

function inv(itemid)
for _, item in pairs(GetInventory()) do
if item.id == itemid then
return item.amount
end
end
return 0
end

function antimissplat()
if inv(id) < 10 then
Sleep(1000)
SendPacket (2,"action|dialog_return\ndialog_name|item_search\n"..id.."|1")
Sleep(150)
end
if GetTile(GetLocal().posX//32 , GetLocal().posY//32 - 1).fg == 0 then
ptp(GetLocal().posX//32 , GetLocal().posY//32 - 1)
Sleep(delay_put)
end
if GetTile(GetLocal().posX//32 , GetLocal().posY//32 + 1).fg == 0 then
ptp(GetLocal().posX//32 , GetLocal().posY//32 + 1)
Sleep(delay_put)
end
end

function antimisspath(x , y)
if GetTile(GetLocal().posX//32 , GetLocal().posY//32 - 1).fg == id and
GetTile(GetLocal().posX//32 , GetLocal().posY//32 + 1).fg == id then
FindPath(x , y)
Sleep(delay_path)
end
end

function puta()
while GetLocal().posX//32 < 198 do
antimissplat()
Sleep(10)
antimisspath(GetLocal().posX//32 + 1 , GetLocal().posY//32)
Sleep(10)
end
if GetLocal().posX//32 == 198 then
antimissplat()
Sleep(350)
FindPath(GetLocal().posX//32 , GetLocal().posY//32 - 4 , 100)
Sleep(50)
end
end

function putb()
while GetLocal().posX//32 > 1 do
antimissplat()
Sleep(10)
antimisspath(GetLocal().posX//32 - 1 , GetLocal().posY//32)
Sleep(10)
end
if GetLocal().posX//32 == 1 then
antimissplat()
Sleep(350)
FindPath(GetLocal().posX//32 , GetLocal().posY//32 - 4 , 100)
Sleep(50)
end
end

while true do
puta()
Sleep(50)
putb()
Sleep(50)
end

You might also like