0% found this document useful (0 votes)
206 views

SC DF - Lua2

This document contains Lua code that defines functions for an automated bot to clear tiles, plant and harvest trees, and place platforms in a Growtopia world. It includes functions to clear dirt, rocks, lava, and tiles on the sides of the world. It will join worlds from a list, call functions to automate tasks, then complete the world and join the next one. The main goal is to fully automate clearing and setting up Growtopia worlds.

Uploaded by

Fikri Arif
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)
206 views

SC DF - Lua2

This document contains Lua code that defines functions for an automated bot to clear tiles, plant and harvest trees, and place platforms in a Growtopia world. It includes functions to clear dirt, rocks, lava, and tiles on the sides of the world. It will join worlds from a list, call functions to automate tasks, then complete the world and join the next one. The main goal is to fully automate clearing and setting up Growtopia worlds.

Uploaded by

Fikri Arif
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/ 7

world = {

"dnjng",
"uxmdz",
"xsqji",
"enrzk",
"jeyct",
"jeycy",
"jeycg",
"jeycj",

} -- unli world

platId = 102 -- plat id

worldPlat = "plat4444k" -- world take plat


idWorldPlat = "monyet12" -- id door world take plat
breakRock = true -- true/false

weebhookUrl = "https:\\"

-- ============================================
-- BIASALAH
efek1 = '| >> __**'..getBot().name..'**__ <<\n'
efek2 = '| >> **'
efek3 = '** \n'
efek4 = '\n|'
function sendMessage(msg)
local script = [[
$webhookUri = "]].. weebhookUrl ..[["
$Body = @{
'username' = 'Zann BoT GT'
'content' = ']]..efek1..efek2..msg..efek3..efek4..[['
'avatar_url' = 'https://www.linkpicture.com/q/LPic62a9894d07fbc126464920.jpg'
}
Invoke-RestMethod -Uri $webhookUri -Method 'post' -Body $Body
]]
local pipe = io.popen("powershell -command -", "w")
pipe:write(script)
pipe:close()
end
-- GROWSCAN
function gs(id)
count = 0
for _, object in pairs(getObjects()) do
if object.id == id then
count = count + object.count
end
end
return count
end

-- MOVE WHEN IN WHITE DOOR


function whiteDoorM()
while getTile(math.floor(getBot().x/32),math.floor(getBot().y/32)).fg == 6 do
move(-2,0)
if getTile(math.floor(getBot().x/32),math.floor(getBot().y/32)).fg == 0
then
break
end
end
end

-- ENTAH WORK APA ENGAK


function recon()
if getBot().status ~= "online" then
sendMessage("BOT DISCONNECTED (RECONNECTING)")
end
while getBot().status ~= "online" do
sleep(1000)
if getBot().status == "online" then
sendMessage("BOT CONNECTED 0_<")
break
end
end
end

-- DROP ITEM WITH AMOUNT


function dropItem(itemID, count)
if findItem(itemID) >= count then
sendPacket(2, "action|drop\nitemID|" .. itemID)
sleep(500)
sendPacket(2,"action|dialog_return\ndialog_name|drop_item\nitemID|" ..
itemID .. "|\ncount|" .. count)
sleep(1000)
end
end

-- AUTO TRASH
trashs = { 5, 11, 4, 10, 2914, 5024, 5026, 5028, 5030, 5032, 5034, 5036, 5038,
5040, 5042, 5044 }
function trashh()
for i, trash in ipairs(trashs) do
if findItem(trash) > 0 then
sendPacket(2, "action|trash\n|itemID|" .. trash)
sleep(2000)
sendPacket(2, "action|dialog_return\ndialog_name|trash_item\
nitemID|" .. trash .. "|\ncount|" .. findItem(trash))
sleep(2000)
end
end
TrashF = { 2, 3, 14, 15 }
for i, trash in ipairs(TrashF) do
if findItem(trash) > 195 then
sendPacket(2, "action|trash\n|itemID|" .. trash)
sleep(2000)
sendPacket(2, "action|dialog_return\ndialog_name|trash_item\
nitemID|" .. trash .. "|\ncount|" .. 20)
sleep(2000)
end
end
end

-- CLEAR SIDE WORLD


function clearSide()
for i=24,53 do
if getTile(1,i).bg == 14 or getTile(1,i).fg == 2 or getTile(0,i).bg == 14
or getTile(0,i).fg == 2 then
while getTile(1,i).bg == 14 or getTile(1,i).fg == 2 do
recon()
whiteDoorM()
findPath(1,i-1)
punch(0,1)
sleep(190)
if getTile(1,i).bg == 0 then
collect(2)
end
trashh()
end
while getTile(0,i).bg == 14 or getTile(0,i).fg == 2 do
recon()
whiteDoorM()
findPath(1,i-1)
punch(-1,1)
sleep(190)
if getTile(1,i).bg == 0 then
collect(2)
end
trashh()
end
end
end
for i=24,53 do
if getTile(98,i).bg == 14 or getTile(98,i).fg == 2 or getTile(99,i).bg ==
14 or getTile(99,i).fg == 2 then
while getTile(98,i).bg == 14 or getTile(98,i).fg == 2 do
recon()
whiteDoorM()
findPath(98,i-1)
punch(0,1)
sleep(190)
if getTile(1,i).bg == 0 then
collect(2)
end
trashh()
end
while getTile(99,i).bg == 14 or getTile(99,i).fg == 2 do
recon()
whiteDoorM()
findPath(98,i-1)
punch(1,1)
sleep(190)
if getTile(1,i).bg == 0 then
collect(2)
end
trashh()
end
end
end
end

-- TAKE AND PUT PLATFORM


function platform(retun)
if findItem(platId) < 52 then
recon()
sendPacket(3,"action|join_request\nname|" .. worldPlat)
sleep(10000)
recon()
sendPacket(3,"action|join_request\nname|" .. worldPlat .. "|" ..
idWorldPlat)
sleep(5000)
recon()
collect(2)
sleep(4500)
recon()
-- sendMessage("TAKE PLATFORM".."%0A".."*PLATFORM REMAINING:* " ..
gs(platId))
if findItem(platId) > 52 then
move(-1,0)
dropItem(platId,findItem(platId) - 52)
end
sendPacket(3,"action|join_request\nname|" .. retun)
sleep(10000)
recon()
whiteDoorM()
end
for i = 2, 52, 2 do
while getTile(1,i).fg == 0 do
recon()
if findItem(platId) == 0 then
break
end
whiteDoorM()
findPath(1,i-1)
place(platId,0,1)
sleep(190)
end
end
for i = 2, 52, 2 do
while getTile(98,i).fg == 0 do
recon()
if findItem(platId) == 0 then
break
end
whiteDoorM()
findPath(98,i-1)
place(platId,0,1)
sleep(190)
end
end
end

-- CLEAR DIRT
function clearDirt()
for i = 1, 54, 2 do
for j = 2,97 do
if getTile(j,i).bg == 14 then
while getTile(j,i).bg == 14 or getTile(j,i).fg == 2 do
recon()
whiteDoorM()
findPath(j-1,i)
punch(1,0)
sleep(190)
if getTile(j,i).bg == 0 or getTile(j,i+1).fg == 0 then
collect(2)
end
trashh()
end
end
end
end
end

-- CLEAR ROCK
function clearRock()
if breakRock then
for _, tile in pairs(getTiles()) do
while tile.fg == 10 do
recon()
whiteDoorM()
findPath(tile.x,tile.y-1)
punch(0,1)
sleep(190)
if getTile(tile.x,tile.y).fg == 0 then
collect(2)
break
end
trashh()
end
end
end
end

-- clear lava
function clearLava()
for _, tile in pairs(getTiles()) do
while tile.fg == 4 do
recon()
whiteDoorM()
findPath(tile.x,tile.y-1)
punch(0,1)
sleep(190)
if getTile(tile.x,tile.y).fg == 0 then
collect(2)
break
end
trashh()
end
end
end

-- PLANT AND HARVEST DIRT TREE


function plantHv()
while findItem(2) == 0 do
for x = 2, 22 do
recon()
if findItem(2) > 180 then
break
end
if findItem(3) == 0 then
sendMessage("NEED DIRT SEED in WORLD: "..getBot().world)
sleep(30000)
break
end
while getTile(x, 23).fg == 3 and getTile(x, 23).ready == true do
recon()
whiteDoorM()
findPath(x, 23)
punch(0, 0)
sleep(190)
collect(2)
end
while getTile(x, 23).fg == 0 and findItem(3) > 0 do
recon()
whiteDoorM()
findPath(x, 23)
place(3, 0, 0)
sleep(90)
end
end
end
end

-- PLACE DIRT
function placeDirt()
for y = 52, 2, -2 do
for x = 2, 97 do
if getTile(x, y).fg == 0 then
plantHv()
whiteDoorM()
findPath(x, y - 1)
recon()
while getTile(x, y).fg == 0 and findItem(2) > 0 do
place(2, 0, 1)
sleep(190)
end
end
end
end
end

-- BREAK DIRT TREE WHEN DONE


function allDone()
for x = 2, 22 do
while getTile(x,23).fg == 3 do
recon()
whiteDoorM()
findPath(x,23)
punch(0,0)
sleep(190)
trashh()
if getTile(x,23).fg == 0 then
collect(2)
sleep(40)
end
end
end
end
-- MAIN FUNCTION
for i, listW in ipairs(world) do
if getBot().world ~= string.upper(listW) then
sendMessage("JOINING WORLD: "..string.upper(listW))
sendPacket(3,"action|join_request\nname|" .. listW)
sleep(10000)
else
sendMessage("BOT ALREADY IN THE WORLD: "..string.upper(listW))
end
whiteDoorM()
-- sendMessage("*CLEARING SIDE*")
clearSide()
platform(listW)
clearDirt()
clearRock()
clearLava()
-- sendMessage("*PLACING AND PLANT DIRT*")
placeDirt()
sendMessage("WORLD "..getBot().world.." COMPLETE")
allDone()
end
-- END

You might also like