breakRune = true
worldSave = "IHUFOWE3|PLER123"
local blastPos = {}
local wlPos = {}
local runePos = {}
local mapPos = {}
local eggPos = {}
function breaks(x,y)
if getTile(x,y).fg ~= 6 and getTile(x,y).fg ~= 8 then
while getTile(x,y).fg ~= 0 do
local pkt = {}
pkt.type = 3
pkt.value = 18
pkt.px = x
pkt.py = y
pkt.x = GetLocal().posX
pkt.y = GetLocal().posY
SendPacketRaw(false,pkt)
sleep(200)
end
end
end
function faceSide(side)
if side == 1 then
local pkt = {}
pkt.type = 0
pkt.pos_x = getLocal().pos
pkt.pos_y = getLocal().posY
pkt.flags = 48
SendPacketRaw(false,pkt)
return
end
if side == 2 then
local pkt = {}
pkt.type = 0
pkt.pos_x = getLocal().pos
pkt.pos_y = getLocal().posY
pkt.flags = 32
SendPacketRaw(false,pkt)
return
end
end
function cariTreasure(x,y)
local z = 1
if math.floor(getLocal().posX/32) > x then z = -1 end
for ex = math.floor(getLocal().posX/32),x,z do
if getTile(ex,math.floor(getLocal().posY/32)).fg ~= 0 then
findPath(ex-z,math.floor(getLocal().posY/32))
breaks(ex,math.floor(getLocal().posY/32))
sleep(200)
elseif getTile(ex,math.floor(getLocal().posY/32)).fg == 0 then
findPath(ex,math.floor(getLocal().posY/32))
sleep(50)
end
if ex == x then
findPath(ex,math.floor(getLocal().posY/32))
sleep(50)
end
end
z = 1
if math.floor(getLocal().posY/32) > y then z = -1 end
for ye = math.floor(getLocal().posY/32),y,z do
if getTile(math.floor(getLocal().posX/32),ye).fg ~= 0 then
findPath(math.floor(getLocal().posX/32),ye-z)
breaks(math.floor(getLocal().posX/32),ye)
sleep(200)
elseif getTile(math.floor(getLocal().posX/32),ye).fg == 0 then
findPath(math.floor(getLocal().posX/32),ye)
sleep(50)
end
if ye == y then
findPath(math.floor(getLocal().posX/32),ye)
sleep(50)
end
end
end
addHook(function(var)
if var.v1 == "OnDialogRequest" then
if var.v2:find("sign_text") then
if var.v2:find("map") then
mapPos = {x = math.floor(getLocal().posX/32),y =
math.floor(getLocal().posY/32)}
elseif var.v2:find("wl") then
wlPos = {x = math.floor(getLocal().posX/32),y =
math.floor(getLocal().posY/32)}
elseif var.v2:find("blast") then
blastPos = {x = math.floor(getLocal().posX/32),y =
math.floor(getLocal().posY/32)}
elseif var.v2:find("rune") then
runePos = {x = math.floor(getLocal().posX/32),y =
math.floor(getLocal().posY/32)}
elseif var.v2:find("egg") then
eggPos = {x = math.floor(getLocal().posX/32),y =
math.floor(getLocal().posY/32)}
end
return true
end
return true
end
end,"onVariant")
function drop(id, amount)
sendPacket(2,"action|drop\n|itemID|"..id)
sleep(200)
sendPacket(2,"action|dialog_return\ndialog_name|drop_item\nitemID|"..id.."|\
ncount|"..amount)
end
function dropItem()
if growtopia.checkInventoryCount(242) > 0 then
findPath(wlPos.x-1,wlPos.y)
sleep(200)
faceSide(2)
sleep(200)
drop(242,growtopia.checkInventoryCount(242))
sleep(200)
end
if growtopia.checkInventoryCount(7764) > 0 then
findPath(eggPos.x-1,eggPos.y)
sleep(200)
faceSide(2)
sleep(200)
drop(7764,growtopia.checkInventoryCount(7764))
sleep(200)
end
if growtopia.checkInventoryCount(7588) > 0 then
findPath(blastPos.x-1,blastPos.y)
sleep(200)
faceSide(2)
sleep(200)
drop(7588,growtopia.checkInventoryCount(7588))
sleep(200)
end
if growtopia.checkInventoryCount(7624) > 0 then
findPath(runePos.x-1,runePos.y)
sleep(200)
faceSide(2)
sleep(200)
drop(7624,growtopia.checkInventoryCount(7624))
sleep(200)
end
if growtopia.checkInventoryCount(7592) > 0 then
findPath(mapPos.x-1,mapPos.y)
sleep(200)
faceSide(2)
sleep(200)
drop(7592,growtopia.checkInventoryCount(7592))
sleep(200)
end
end
function takeItem()
if growtopia.checkInventoryCount(242) == 0 then
findPath(wlPos.x,wlPos.y)
sleep(500)
findPath(wlPos.x-1,wlPos.y)
sleep(250)
faceSide(2)
sleep(250)
drop(242,growtopia.checkInventoryCount(242)-1)
sleep(200)
end
if growtopia.checkInventoryCount(7588) == 0 then
findPath(blastPos.x,blastPos.y)
sleep(500)
findPath(blastPos.x-1,blastPos.y)
sleep(250)
faceSide(2)
sleep(250)
drop(7588,growtopia.checkInventoryCount(7588)-1)
sleep(200)
end
end
function scan(id)
for _,obj in pairs(getObjectList()) do
if obj.itemid == id then return obj.amount end
end
return 0
end
function joinWorld(world,id)
while getCurrentWorldName():upper() ~= world:upper() do
sendPacket(3,"action|join_request\nname|"..world.."\ninvitedWorld|0")
sleep(5000)
end
if id ~= "" then
while getTile(math.floor(getLocal().posX/32),math.floor(getLocal().posY/
32)).fg == 6 do
sendPacket(3,"action|join_request\nname|"..world.."|"..id.."\
ninvitedWorld|0")
sleep(5000)
end
end
end
function randWorld()
letters =
{"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U
","V","W","X","Y","Z","1",'2','3','4','5','6','7','8','9','0'}
length = 10
math.randomseed(os.time())
local text = ""
for i = 1, length do
local randomValue = math.random()
local randomIndex = math.floor(randomValue * #letters) + 1
local adjustedIndex = (randomIndex - 1) % #letters + 1
local randomChar = letters[adjustedIndex]
text = text .. randomChar
end
return text
end
a,b = worldSave:match("(.*)|(.*)")
joinWorld(a,b)
sleep(1000)
local x = 0
for _,tile in pairs(getTiles()) do
if tile.fg == 20 then
x = x + 1
findPath(tile.x,tile.y)
sleep(500)
local pkt = {}
pkt.type = 3
pkt.value = 32
pkt.px = math.floor(GetLocal().posX/32)
pkt.py = math.floor(GetLocal().posY/32)
pkt.x = GetLocal().posX
pkt.y = GetLocal().posY
SendPacketRaw(false,pkt)
sleep(750)
end
if x >= 5 then break end
end
dropItem()
sleep(1000)
LogToConsole(scan(7588))
while scan(7588) > 0 do
takeItem()
sleep(500)
local pkt = {}
pkt.type = 3
pkt.value = 7588
pkt.px = math.floor(GetLocal().posX/32)
pkt.py = math.floor(GetLocal().posY/32)
pkt.x = GetLocal().posX
pkt.y = GetLocal().posY
SendPacketRaw(false,pkt)
sleep(200)
LogToConsole(randWorld())
sendPacket(2,"action|dialog_return\ndialog_name|terraformer_reply\nitemID|
7588|\nworldname|"..randWorld())
sleep(4000)
while getTile(math.floor(GetLocal().posX/32),math.floor(GetLocal().posY/32)-
1).fg ~= 242 do
local pkt = {}
pkt.type = 3
pkt.value = 242
pkt.px = math.floor(GetLocal().posX/32)
pkt.py = math.floor(GetLocal().posY/32)-1
pkt.x = GetLocal().posX
pkt.y = GetLocal().posY
SendPacketRaw(false,pkt)
sleep(200)
end
sleep(500)
for _,tile in pairs(getTiles()) do
if tile.fg == 7628 then
cariTreasure(tile.x,tile.y)
sleep(200)
end
end
sleep(500)
joinWorld(a,b)
sleep(500)
dropItem()
end