function findPath(x,y) px = math.floor(GetLocal().posX/32) py = math.floor(GetLocal().posY/32) jarax = x-px jaray = y-py if jaray > 6 then for i = 1, math.floor(jaray/6)do py = py + 6 Sleep(200) FindPath(px,py)Sleep(200) end elseif jaray <-6 then for i = 1, math.floor(jaray/-6) do py = py - 6 Sleep(200) FindPath(px,py)Sleep(200) end end if jarax > 8 then for i = 1, math.floor(jarax/6) do px = px + 6 Sleep(200) FindPath(px,py)Sleep(200) end elseif jarax <-6 then for i = 1, math.floor(jarax/-6) do px = px - 6 Sleep(200) FindPath(px,py)Sleep(200) end end Sleep(50) FindPath(x,y) Sleep(100)
end
function punch(x,y)
if GetTile(x,y).fg ~= 0 then
pkt = {} pkt.px = x pkt.py = y pkt.type = 3 pkt.value = 18 pkt.x = GetLocal().posX pkt.y = GetLocal().posY
SendPacketRaw(false, pkt)
state = {4196896,16779296}
for _, st in ipairs(state) do
hld = {} hld.px = x hld.py = y hld.type = 0 hld.value = 0 hld.x = GetLocal().posX hld.y = GetLocal().posY hld.state = st
SendPacketRaw(false,hld)
Sleep(200)
end
end
end
function getTiles()
tile = {}
for XS = 197,0,-6 do
XE = XS-5
for px = 0,199,1 do
for py = XE,XS do
int = GetTile(px,py)
table.insert(tile,int)
end
end
end
return tile
end
for _, tile in pairs(getTiles()) do
if tile.readyharvest and tile.fg%2 == 1 then
if tile.x < math.floor(GetLocal().posX/32) then
py = math.floor(GetLocal().posY/32)
if tile.y-py > 6 or tile.y-py < -6 then
if GetTile(199,tile.y+1) == 544 then
findPath(199,tile.y+1)
Sleep(200)
while GetLocal().posX > 6000 do
door = {}
door.type = 7
door.px = math.floor(GetLocal().posX/32)
door.py = math.floor(GetLocal().posY/32)
SendPacketRaw(false,door)
Sleep(1000)
end
end
end
end
if GetTile(tile.x,tile.y).fg ~= 0 then
findPath(tile.x,tile.y)
punch(tile.x,tile.y)
end
end
end
EditToggle("ModFly",true) EditToggle("Anti Portal/Door",true)
function findPath(x,y) px = math.floor(GetLocal().posX/32) py = math.floor(GetLocal().posY/32) jarax = x-px jaray = y-py if jaray > 6 then for i = 1, math.floor(jaray/6)do py = py + 6 Sleep(200) FindPath(px,py)Sleep(200) end elseif jaray <-6 then for i = 1, math.floor(jaray/-6) do py = py - 6 Sleep(200) FindPath(px,py)Sleep(200) end end if jarax > 8 then for i = 1, math.floor(jarax/6) do px = px + 6 Sleep(200) FindPath(px,py)Sleep(200) end elseif jarax <-6 then for i = 1, math.floor(jarax/-6) do px = px - 6 Sleep(200) FindPath(px,py)Sleep(200) end end Sleep(50) FindPath(x,y) Sleep(100) end
function punch(x,y) if GetTile(x,y).fg ~= 0 then pkt = {} pkt.px = x pkt.py = y pkt.type = 3 pkt.value = 18 pkt.x = GetLocal().posX pkt.y = GetLocal().posY SendPacketRaw(false, pkt) state = {4196896,16779296} for _, st in ipairs(state) do hld = {} hld.px = x hld.py = y hld.type = 0 hld.value = 0 hld.x = GetLocal().posX hld.y = GetLocal().posY hld.state = st SendPacketRaw(false,hld) Sleep(200) end end end
function getTiles() tile = {} for XS = 197,0,-6 do XE = XS-5 for px = 0,199,1 do for py = XE,XS do int = GetTile(px,py) table.insert(tile,int) end end end return tile end
for _, tile in pairs(getTiles()) do if tile.readyharvest and tile.fg%2 == 1 then if tile.x < math.floor(GetLocal().posX/32) then py = math.floor(GetLocal().posY/32) if tile.y-py > 6 or tile.y-py < -6 then if GetTile(199,tile.y+1) == 544 then findPath(199,tile.y+1) Sleep(200) while GetLocal().posX > 6000 do door = {} door.type = 7 door.px = math.floor(GetLocal().posX/32) door.py = math.floor(GetLocal().posY/32) SendPacketRaw(false,door) Sleep(1000) end end end end if GetTile(tile.x,tile.y).fg ~= 0 then findPath(tile.x,tile.y) punch(tile.x,tile.y) end end end