0% found this document useful (0 votes)
18 views2 pages

Auto Put Plat GL

This document contains Lua code that defines functions for placing tiles in a grid pattern automatically. It checks inventory, places tiles in forward and backward paths, and contains logic to avoid missed placements.

Uploaded by

zikonotrelz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views2 pages

Auto Put Plat GL

This document contains Lua code that defines functions for placing tiles in a grid pattern automatically. It checks inventory, places tiles in forward and backward paths, and contains logic to avoid missed placements.

Uploaded by

zikonotrelz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 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