AutoHT DropSource - Lua 2
AutoHT DropSource - Lua 2
delay = 500
itemid = 929 -- item id
seedid = 928 -- seed id
posx = 97 -- posx where you want to drop
posy = 23 -- posy where you want to drop
--NO CHANGE--
EditToggle([[Fast Drop "/setcount"]],true)
function blocks(itemid)
for _, item in pairs(GetInventory()) do
if item.id == itemid then
return item.amount
end
end
return 0
end
function drop(itemid)
SendPacket(2,"action|drop\n|itemID|".. itemid)
Sleep(1000)
end
function p(seedid)
for _, tile in pairs (GetTiles()) do
if tile.fg == seedid and GetTiles(tile.x, tile.y)
then
if blocks(itemid) < 200 then
Sleep(20)
FindPath(tile.x , tile.y)
Sleep(delay)
punchs(0,0)
Sleep(30)
elseif blocks(itemid) == 200 then
Sleep(400)
FindPath(posx,posy)
Sleep(700)
drop(itemid)
end
end
end
end
function punchs(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 main()
p(seedid)
FindPath(posx,posy)
drop(itemid)
end
seedid = 929
function punch(x,y)
pkt = {}
pkt.type = 3
pkt.value = 18
pkt.px = math.floor(GetLocal().pos.x / 32 +x)
pkt.py = math.floor(GetLocal().pos.y / 32 +y)
pkt.x = GetLocal().pos.x
pkt.y = GetLocal().pos.y
SendPacketRaw(false, pkt)
end
function harvest()
for _, tile in pairs(GetTiles()) do
if tile.fg == seedid and tile.extra.progress == 1 then
FindPath(tile.x,tile.y)
Sleep(300)
punch(0,0)
Sleep(50)
end
end
end
harvest()
function AvoidError()
if pcall(function()
main()
end) == false then
Sleep(100)
AvoidError()
end
Sleep(100)
AvoidError()
end
AvoidError()