100% found this document useful (1 vote)
116 views1 page

Auto Harvest

This document contains Lua code for automating harvest tasks on islands or the main world map. It defines functions to check if a tile is ready for harvesting, send a punch packet to harvest a tile, find a harvesting path on an island or world map, and contains a main loop to repeatedly call the island or world harvesting functions based on the "Island" setting.
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
100% found this document useful (1 vote)
116 views1 page

Auto Harvest

This document contains Lua code for automating harvest tasks on islands or the main world map. It defines functions to check if a tile is ready for harvesting, send a punch packet to harvest a tile, find a harvesting path on an island or world map, and contains a main loop to repeatedly call the island or world harvesting functions based on the "Island" setting.
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/ 1

Delay_Ht = 1 --delay harvest

Island = true --world type

function IsReady(tile)
if tile and tile.extra and tile.extra.progress and tile.extra.progress == 1.0 then
return true
end
return false
end

function punch(x,y)
local pkt = {}
pkt.type = 3
pkt.value = 18
pkt.x = GetLocal().pos.x
pkt.y = GetLocal().pos.y
pkt.px = math.floor(GetLocal().pos.x / 32 + x)
pkt.py = math.floor(GetLocal().pos.y / 32 + y)
SendPacketRaw(false,pkt)
end

function HtIsland()
for y = 0, 193 do
for x = 0, 199 do
if IsReady(GetTile(x,y)) then
FindPath(x,y,100)
Sleep(Delay_Ht)
punch(0,0)
Sleep(Delay_Ht)
end
end
end
end

function HtWorld()
for y = 0, 53 do
for x = 0, 99 do
if IsReady(GetTile(x,y)) then
FindPath(x,y,100)
Sleep(Delay_Ht)
punch(0,0)
Sleep(Delay_Ht)
end
end
end
end

while true do
if Island == true then
HtIsland()
elseif Island == false then
HtWorld()
end
end

You might also like