0% found this document useful (0 votes)
39 views3 pages

PTHT

The document contains Lua code for automating tasks in a game. It defines functions for moving to locations, interacting with objects, checking conditions, and contains the main logic loop to call these functions in sequence to harvest and replant crops.

Uploaded by

ficodian07
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)
39 views3 pages

PTHT

The document contains Lua code for automating tasks in a game. It defines functions for moving to locations, interacting with objects, checking conditions, and contains the main logic loop to call these functions in sequence to harvest and replant crops.

Uploaded by

ficodian07
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/ 3

-- DONT CHANGE ANYTHING IDIOT

world = "island"
plantid = 5640
harvestid = 13905

delayPT = 100
delayHT = 50

EditToggle("ModFly", true)
EditToggle("Anti Lag", true)
EditToggle("Antibounce", true)

if world == "island" then


ex = 199
ey = 198
elseif world == "clear" then
ex = 199
ey = 198
end
function path(x, y, state)
SendPacketRaw(false, {state = state,
px = x,
py = y,
x = x*32,
y = y*32})
end
function h2(x, y, id)
SendPacketRaw(false,{type = 3,
value = id,
px = x,
py = y,
x = x*32,
y= y*32})
end
function getTree()
local count = 0
for y = ey, 0, -1 do
for x = 0, ex, 1 do
if GetTile(x, y).fg == 0 and (GetTile(x, y + 1).fg ~= 0 and
GetTile(x, y + 1).fg % 2 == 0) then
count = count + 1
end
end
end
return count
end
function getReady()
local ready = 0
for y = ey, 0, -1 do
for x = 0, ex, 1 do
if GetTile(x, y).fg == harvestid and GetTile(x, y).readyharvest
then
ready = ready + 1
end
end
end
return ready
end
function harvest()
if getReady() > 0 then
for y = ey, 0, -1 do
for x = 0, ex, 1 do
if (GetTile(x, y).fg == harvestid and GetTile(x,
y).readyharvest) then
path(x, y, plantid)
Sleep(450)
h2(x, y, 18)
Sleep(delayHT)
end
end
end
end
end

function uws()
if getTree() == 0 then
Sleep(500)
SendPacket(2, "action|dialog_return\ndialog_name|ultraworldspray")
Sleep(2000)
harvest()
elseif getTree() ~= 0 then
plant()
Sleep(1000)
end
end
function plant()
if getReady() < 20000 then
for y = ey, 0, -1 do
for x = 0, ex, 10 do
if GetTile(x,y).fg == 0 and (GetTile(x,y+1).fg ~= 0 and
GetTile(x,y+1).fg %2 == 0) then
path(x, y, 32)
Sleep(1)
h2(x, y, plantid)
Sleep(delayPT)
end
end
for x = ex, 0, -1 do
if GetTile(x,y).fg == 0 and (GetTile(x,y+1).fg ~= 0 and
GetTile(x,y+1).fg %2 == 0) then
path(x, y, 48)
Sleep(1)
h2(x, y, plantid)
Sleep(delayPT)
end
end
end
end
uws()
end

function main()
Sleep(200)
harvest()
Sleep(200)
plant()
end

function AvoidError()
if pcall(function()
main()
end) == false then
Sleep(100)
AvoidError()
end
Sleep(100)
AvoidError()
end

for i = 1, 5 do
SendPacket(2, [[action|input
|text|`2 Ptht `4 dr.tristi `0 Start ]])
Sleep(1000)
end
AvoidError()

You might also like