0% found this document useful (0 votes)
32 views22 pages

PNB

The document contains a script with various settings and configurations for an automated system in a gaming environment, including options for auto-buying items, managing player interactions, and handling inventory. It includes functions for item collection, trash management, and player status checks, along with hooks for processing game events. Additionally, it outlines specific variables and settings that control the behavior of the automation features.

Uploaded by

septramdhn
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)
32 views22 pages

PNB

The document contains a script with various settings and configurations for an automated system in a gaming environment, including options for auto-buying items, managing player interactions, and handling inventory. It includes functions for item collection, trash management, and player status checks, along with hooks for processing game events. Additionally, it outlines specific variables and settings that control the behavior of the automation features.

Uploaded by

septramdhn
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/ 22

-- General Settings --

local autoBuy = false -- Auto Buy Pack


local autoBan = false -- Auto Ban for Non Whitelist
local autoStop = false -- Auto Stop (If there is someone)
local autoGhost = true -- Auto Ghost
local autoArroz = true -- Auto Consume Arroz
local autoClover = true -- Auto Consume Clover
local autoInvasion = false -- Auto Buy World Lock (Avoid Tax)
local autoTelephone = false -- Auto Buy Diamond Lock in Telephone
local removeAnimation = true -- Remove Effects
local findPathRemote = true -- FindPath Magplant Remote [false for Moderator
Account | true for Non Moderator Account]

-- Variable Settings --
local collectGem = 1 -- Auto Collect Gems
local HidePeople = 1 -- Hide People (Be Alone)
local ignoreDrop = 1 -- Ignore New Drops
local magplantX, magplantY = 3, 193 -- Magplant X and Magplant Y
local whiteList = {""} -- Whitelist Name [Anti Ban]
local trashList = { -- Trash List [Supports Custom Item ID + Don't forget to follow
the format]
{trashItemID = 0, customItemID = 0}
}

-- Auto Restart Pnb --


local autoRestart = false -- Auto Restart Pnb
local restartAfter = {hour = 0, minute = 0, second = 0} -- Hour(s) and Minute(s)
Restart and Second(s)

-- Pack Settings --
local packName = "" -- Item Debug
local packPrice = 0 -- Pack Price
local storeTiles = { -- Add if your going to multiple item.id [Don't forget to
follow the format]
{item = 0, x = 0, y = 0}
}

-- Storage Settings --
local depositMode = 0 -- Deposit Mode [1] = Dropping Packs, Deposit Mode [2] =
Restocking Method
local depositWorld = "" -- Deposit World

-- Don't Touch --
local startingTime = os.time()
local lastMessageId
local username = GetLocal().name
local userMod = false
local doneSetup = false
local nextTile = false
local changeMagplant = false
local getPlayerArroz = false
local getPlayerClover = false
local getPlayerGhost = false
local telepX = 0
local telepY = 0
local magplantCount = 1
local magplantX = magplantX - 1
local oldMagplantX = magplantX
local oldMagplantY = magplantY
local worldName = GetWorld().name
local previousGems = GetPlayerInfo().gems
local positionX = math.floor(GetLocal().pos.x / 32)
local positionY = math.floor(GetLocal().pos.y / 32)
local vendTotal = 0
local packList = {}
ChangeValue("[C] Modfly", true)

if autoBan and not autoStop then


autoStop = true
end

if autoTelephone and not autoBuy then


autoBuy = true
end

if autoInvasion and not autoBuy then


autoBuy = true
end

if packName ~= "" and packName ~= nil then


autoBuy = true
end

for _, tileChange in ipairs(storeTiles) do


tileChange.x = tileChange.x - 1
tileChange.y = tileChange.y - 1
end

AddHook("onvariant", "pussy", function(var)


if var[0] == "OnSDBroadcast" then
return true
end

if var[0] == "OnTextOverlay" and var[1]:find("You can't drop that here, face


somewhere with open space.") then
nextTile = true
return true
end

if var[0] == "OnTextOverlay" and var[1]:find("You don't have enough of those")


then
return true
end

if var[0] == "OnDialogRequest" and var[1]:find("add_player_info") then


if var[1]:match("|4604|") then
getPlayerArroz = true
else
getPlayerArroz = false
return true
end

if var[1]:match("|528|") then
getPlayerClover = true
else
getPlayerClover = false
return true
end
if var[1]:match("|290|") then
getPlayerGhost = true
else
getPlayerGhost = false
return true
end

return true
end

if var[0] == "OnDialogRequest" and var[1]:find("MAGPLANT 5000") then


if var[1]:match("`6The machine is currently empty!``") then
changeMagplant = true
end

if var[1]:match("Building mode: `6DISABLED``") then


changeMagplant = true
end

if var[1]:match("Stock: `4EMPTY!``") then


changeMagplant = true
end

return true
end

if var[0] == "OnDialogRequest" and var[1]:find("Security Camera") then


return true
end

if var[0] == "OnDialogRequest" and var[1]:find("Telephone") then


return true
end

if var[0] == "OnDialogRequest" and var[1]:find("Blue Gem Lock") then


return true
end

if var[0] == "OnDialogRequest" and var[1]:find("The BGL Bank") then


return true
end

if var[0] == "OnDialogRequest" and var[1]:find("Diamond Lock") then


return true
end

if var[0] == "OnDialogRequest" and var[1]:find("Recycle") then


return true
end

if var[0] == "OnDialogRequest" and var[1]:find("Drop") then


return true
end

if var[0] == "OnDialogRequest" and var[1]:find("DigiVend Machine") then


if var[1]:match("This machine contains a total of (%d+)") then
vendTotal = var[1]:match("This machine contains a total of (%d+)") or 0
return true
end

return true
end

if var[0] == "OnStoreRequest" then


return true
end

if var[0] == "OnConsoleMessage" and var[1]:find("Your atoms are suddenly


aware of quantum tunneling.") then
return true
end

if var[0] == "OnConsoleMessage" and var[1]:find("Applying cheats...") then


return true
end

if var[0] == "OnConsoleMessage" and var[1]:find("Whoa, calm down toggling


cheats on/off... Try again in a second!") then
return true
end

if var[0] == "OnConsoleMessage" and var[1]:find("Cheat Active") then


return true
end

if var[0] == "OnConsoleMessage" and var[1]:find("/ghost") then


return true
end

if var[0] == "OnConsoleMessage" and var[1]:find("You're entering worlds way too


fast, slow down!") then
return true
end

if var[0] == "OnConsoleMessage" and var[1]:match("`1O`2h`3, `4l`5o`6o`7k


`8w`9h`ba`!t `$y`3o`2u`4'`ev`pe `#f`6o`8u`1n`7d`w!") then
return true
end

if var[0] == "OnConsoleMessage" and var[1]:match("`6>>`4Spam detected!`` Please


wait a bit before typing anything else. Please note, any form of bot/macro/auto-
paste will get all of your accounts banned, so don't do it!``") then
return true
end

if var[0] == "OnTalkBubble" and var[2]:find("(gems).") then


return true
end

if var[0] == "OnTalkBubble" and var[2]:find("You got `$Diamond Lock``!") then


return true
end

if var[0] == "OnTalkBubble" and var[2]:match("Can't use `$/find`` here, there


are over 6K items dropped here - pick them up or use /find in a different world
with empty space!") then
return true
end

if var[0] == "OnTalkBubble" and var[2]:find("Disable Ignore Others Drop Cheat


or Ghost in the shell to collect items!") then
return true
end

if var[0] == "OnTalkBubble" and var[2]:match("You can't punch/place anything


else while you have the `$Autofarm Cheat`` active!") then
return true
end

if var[0] == "OnTalkBubble" and var[2]:match("`1O`2h`3, `4l`5o`6o`7k


`8w`9h`ba`!t `$y`3o`2u`4'`ev`pe `#f`6o`8u`1n`7d`w!") then
return true
end

if var[0] == "OnTalkBubble" and var[2]:match("You received a MAGPLANT 5000


Remote.") then
return true
end

if var[0] == "OnTalkBubble" and var[2]:find("The MAGPLANT 5000 is empty.")


then
changeMagplant = true
return true
end

return false
end)

AddHook("onprocesstankupdatepacket", "pussy", function(packet)


if packet.type == 8 or packet.type == 17 then
if removeAnimation then
return true
end
end
end)

for _, tile in pairs(GetTiles()) do


if tile.fg == 3898 then
telepX = tile.x
telepY = tile.y
break
end

if telepX ~= 0 and telepY ~= 0 then


break
end
end

for _, itemInsert in ipairs(storeTiles) do


table.insert(packList, itemInsert.item)
end

local function removeColorAndSymbols(str)


cleanedStr = string.gsub(str, "`(%S)", '')
cleanedStr = string.gsub(cleanedStr, "`{2}|(~{2})", '')
return cleanedStr
end

table.insert(whiteList, removeColorAndSymbols(GetLocal().name:lower()))

local function getPlayerCount()


local playerCount = 0
while GetWorld() == nil do
return
end

for _, player in pairs(GetPlayerList()) do


if GetLocal().netid ~= tonumber(player.netid) then
playerCount = playerCount + 1
end
end

return playerCount
end

local function formatNumber(num)


num = math.floor(num + 0.5)

local formatted = tostring(num)


local k = 3
while k < #formatted do
formatted = formatted:sub(1, #formatted - k) .. "," ..
formatted:sub(#formatted - k + 1)
k = k + 4
end

return formatted
end

local function findItem(itemID)


local count = 0
local oldCount = 0
if GetWorld() == nil then
return oldCount
else
for _, inv in pairs(GetInventory()) do
if inv.id == itemID then
count = count + inv.amount
oldCount = count
end
end
end

return count
end

local function scanItem(itemID)


local count = 0
local oldCount = 0
if GetWorld() == nil then
return oldCount
else
for _, tile in pairs(GetTiles()) do
if tile.fg == itemID or tile.bg == itemID then
count = count + 1
oldCount = count
end
end
end

return count
end

local function scanObject(id)


local count = 0
local oldCount = 0
if GetWorld() == nil then
return oldCount
else
for _, object in pairs(GetObjectList()) do
if object.id == id then
count = count + object.amount
oldCount = count
end
end
end

return count
end

if username:find("@") then
userMod = true
end

local function getPing()


local cmd = io.popen('powershell -command "Test-Connection -ComputerName
213.179.209.200 -Count 1 | Select-Object -ExpandProperty ResponseTime"')
local ping = cmd:read()
cmd:close()
return ping
end

if GetWorld() == nil then


player = removeColorAndSymbols(player)
else
player = removeColorAndSymbols(GetLocal().name)
end

local function warp(world)


SendPacket(3 ,"action|join_request\nname|".. world .. "|\ninvitedWorld|0")
Sleep(2500)
end

local function getLocalInfo()


::loopInfo::
while GetWorld() == nil or GetWorld().name ~= worldName:upper() do
for i = 1, 1 do
end
warp(worldName:lower())
Sleep(4500)
if GetWorld() ~= nil then
if GetWorld().name == worldName:upper() then
Sleep(1000)
goto loopInfo
end
end
end

SendPacket(2, "action|wrench\n|netid|".. GetLocal().netid)


Sleep(100)
end

local function dropItem(itemID, count)


SendPacket(2,"action|dialog_return\ndialog_name|drop\nitem_drop|"..
itemID .."|\nitem_count|".. count)
Sleep(100)
end

local function itemTrash(trashList)


for _, trash in ipairs(trashList) do
while findItem(trash) >= 1 do
SendPacket(2, "action|dialog_return\ndialog_name|trash\nitem_trash|"..
trash .."|\nitem_count|".. findItem(trash))
Sleep(100)

if findItem(trash) == 0 then
break
end
end
end
end

local function trashItem()


for _, trash in ipairs(trashList) do
local trashItemID = trash.trashItemID
local customItemID = trash.customItemID

if customItemID == 0 or customItemID == nil then


customItemID = trashItemID
end

while findItem(trashItemID) >= 1 do


SendPacket(2, "action|dialog_return\ndialog_name|trash\nitem_trash|"..
trashItemID .."|\nitem_count|".. findItem(trashItemID))
Sleep(100)

if findItem(trashItemID) == 0 then
break
end
end
end

local findTrash = {14356, 14358, 14360}


local trashChests = {- 172, - 174, - 176}
for _, trashs in ipairs(trashChests) do
for _, realTrash in ipairs(findTrash) do
if findItem(realTrash) >= 1 then
SendPacket(2, "action|dialog_return\ndialog_name|trash\
nitem_trash|".. trashs .."|\nitem_count|".. findItem(realTrash))
Sleep(100)

if findItem(trashs) == 0 and findItem(realTrash) == 0 then


break
end
end
end
end
end

local function warnText(text)


packet = {}
packet[0] = "OnAddNotification"
packet[1] = "interface/atomic_button.rttex"
packet[2] = text
packet[3] = "audio/hub_open.wav"
packet[4] = 0
SendVariantList(packet)
return true
end

local function place(id, x, y, bool)


while GetWorld() == nil or GetWorld().name ~= worldName:upper() do
return
end

if bool then
local pkt = {}
pkt = {}
pkt.type = 3
pkt.value = id
pkt.x = type(x) == "number" and x * 32 or GetLocal().pos.x
pkt.y = type(y) == "number" and y * 32 or GetLocal().pos.y
pkt.px = math.floor(pkt.x / 32)
pkt.py = math.floor(pkt.y / 32)
SendPacketRaw(false, pkt)
else
local pkt = {}
pkt = {}
pkt.type = 3
pkt.value = id
pkt.px = math.floor(GetLocal().pos.x / 32 + x)
pkt.py = math.floor(GetLocal().pos.y / 32 + y)
pkt.x = GetLocal().pos.x
pkt.y = GetLocal().pos.y
SendPacketRaw(false, pkt)
end
end

local function punch(x, y)


while GetWorld() == nil or GetWorld().name ~= worldName:upper() do
return
end

local pkt = {}
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

local function wrench(x, y, bool)


while GetWorld() == nil or GetWorld().name ~= worldName:upper() do
return
end

if bool then
local pkt = {}
pkt = {}
pkt.type = 3
pkt.value = 32
pkt.x = type(x) == "number" and x * 32 or GetLocal().pos.x
pkt.y = type(y) == "number" and y * 32 or GetLocal().pos.y
pkt.px = math.floor(pkt.x / 32)
pkt.py = math.floor(pkt.y / 32)
SendPacketRaw(false, pkt)

elseif not bool then


local pkt = {}
pkt = {}
pkt.type = 3
pkt.value = 32
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
end

local function convertItem(id)


local pkt = {}
pkt = {}
pkt.value = id
pkt.type = 10
SendPacketRaw(false, pkt)
end

function table.find(t, value)


for k, v in pairs(t) do
if v == value then
return k
end
end
return nil
end

local function loweredTable(table)


local result = {}
for i, v in ipairs(table) do
result[i] = string.lower(v)
end
return result
end

local function findPath(x, y, state, bool)


while GetWorld() == nil or GetWorld().name ~= worldName:upper() do
return
end

if bool then
local pkt = {}
pkt.type = 0
pkt.state = state
pkt.x = type(x) == "number" and x * 32 or GetLocal().pos.x
pkt.y = type(y) == "number" and y * 32 or GetLocal().pos.y
pkt.px = math.floor(pkt.x / 32)
pkt.py = math.floor(pkt.y / 32)
SendPacketRaw(false, pkt)
Sleep(60)

elseif not bool then


FindPath(x, y, state)
end
end

local function playerPosition()


::returnPosition::
while GetWorld() == nil or GetWorld().name ~= worldName:upper() do
for i = 1, 1 do
end
warp(worldName:lower())
Sleep(4500)
if GetWorld() ~= nil then
if GetWorld().name == worldName:upper() then
Sleep(1000)
goto returnPosition
end
end
end

findPath(positionX, positionY, 100, false)


Sleep(1000)
if GetTile(math.floor(GetLocal().pos.x / 32), math.floor(GetLocal().pos.y /
32)).fg == 6 then
goto returnPosition
end
end

local function autoPause()


if autoStop then
::loopPause::
for _, player in pairs(GetPlayerList()) do
if not table.find(loweredTable(whiteList),
removeColorAndSymbols(player.name:lower())) then
for i = 1, 1 do
SendPacket(2, "action|dialog_return\ndialog_name|cheats\
ncheck_autofarm|0\ncheck_bfg|0\ncheck_lonely|".. HidePeople .."\ncheck_ignoreo|"..
ignoreDrop .."\ncheck_gems|".. collectGem)
Sleep(100)
end

if autoBan then
if userMod then
for i = 1, 1 do
Sleep(2500)
SendPacket(2, "action|input\n|text|/boot "..
removeColorAndSymbols(player.name))
Sleep(1000)
end
else
for i = 1, 1 do
Sleep(2500)
SendPacket(2, "action|input\n|text|/ban "..
removeColorAndSymbols(player.name))
Sleep(1000)
end
end
end
Sleep(100)
goto loopPause
else
end
end
end
end

local function getItem()


local countTry = 0
::loopReceive::

while GetWorld() == nil or GetWorld().name ~= worldName:upper() do


for i = 1, 1 do
end
warp(worldName:lower())
Sleep(4500)
if GetWorld() ~= nil then
if GetWorld().name == worldName:upper() then
Sleep(1000)
goto loopReceive
end
end
end

if findItem(5640) == 0 or changeMagplant then


if changeMagplant then
while GetWorld() == nil or GetWorld().name ~= worldName:upper() do
for i = 1, 1 do
end
warp(worldName:lower())
Sleep(4500)
if GetWorld() ~= nil then
if GetWorld().name == worldName:upper() then
Sleep(1000)
goto loopReceive
end
end
end

for i = 1, 1 do
if magplantX and magplantY and GetTile(magplantX + 1, magplantY).fg
== 5638 then
magplantX = magplantX + 1
magplantCount = magplantCount + 1
warnText("`wMagplant `2#".. magplantCount - 1 .." `wis empty.
Switching to Magplant `2#".. magplantCount)
Sleep(1000)
else
warnText("`wMagplant `2#".. magplantCount .." `wis empty.
Switching to Magplant `2#1")
magplantCount = 1
magplantX = oldMagplantX
Sleep(1000)
end
end

while GetWorld() == nil or GetWorld().name ~= worldName:upper() do


for i = 1, 1 do
end
warp(worldName:lower())
Sleep(4500)
if GetWorld() ~= nil then
if GetWorld().name == worldName:upper() then
Sleep(1000)
goto loopReceive
end
end
end

changeMagplant = false
end

while GetWorld() == nil or GetWorld().name ~= worldName:upper() do


for i = 1, 1 do
end
warp(worldName:lower())
Sleep(4500)
if GetWorld() ~= nil then
if GetWorld().name == worldName:upper() then
Sleep(1000)
goto loopReceive
end
end
end

if findPathRemote then
findPath(magplantX, magplantY - 1, 32, true)
Sleep(100)
wrench(magplantX, magplantY, true)
Sleep(100)
SendPacket(2, "action|dialog_return\ndialog_name|magplant_edit\nx|"..
magplantX .."|\ny|".. magplantY .."|\nbuttonClicked|getRemote")
else
Sleep(100)
wrench(magplantX, magplantY, true)
Sleep(100)
SendPacket(2, "action|dialog_return\ndialog_name|magplant_edit\nx|"..
magplantX .."|\ny|".. magplantY .."|\nbuttonClicked|getRemote")
end

if findItem(5640) >= 1 then


else
countTry = countTry + 1
goto loopReceive
end

if countTry == 5 then
countTry = 0
end

while GetWorld() == nil or GetWorld().name ~= worldName:upper() do


for i = 1, 1 do
end
warp(worldName:lower())
Sleep(4500)
if GetWorld() ~= nil then
if GetWorld().name == worldName:upper() then
Sleep(1000)
goto loopReceive
end
end
end
end

playerPosition()
Sleep(1000)
end

local function depositItem()


::loopDeposit::
for i = 1, 1 do
SendPacket(2, "action|dialog_return\ndialog_name|cheats\ncheck_autofarm|0\
ncheck_bfg|0\ncheck_lonely".. HidePeople .."\ncheck_ignoreo|".. ignoreDrop .."\
ncheck_gems|".. collectGem)
Sleep(100)
trashItem()
end

if depositMode == 1 then
if GetWorld().name ~= depositWorld:upper() then
warp(depositWorld:lower())
Sleep(4500)
end

::loopDrop::
for _, storeItem in ipairs(storeTiles) do
for _, tile in pairs(GetTiles()) do
if tile.x == storeItem.x and tile.y == storeItem.y then
findPath(tile.x + 1, tile.y, 48, true)
if findItem(storeItem.item) >= 1 then
dropItem(storeItem.item, findItem(storeItem.item))
Sleep(1000)
end

if nextTile then
nextTile = false
storeItem.x = storeItem.x + 1
goto loopDrop
end

while GetWorld() == nil or GetWorld().name ~=


depositWorld:upper() do
for i = 1, 1 do
end
warp(depositWorld:lower())
Sleep(4500)
if GetWorld() ~= nil then
if GetWorld().name == depositWorld:upper() then
Sleep(1000)
goto loopDeposit
end
end
end
end
end
end
else
if GetWorld().name ~= depositWorld:upper() then
warp(depositWorld:lower())
Sleep(4500)
end

local countVend = #packList


for _, tileInfo in ipairs(storeTiles) do
local packID = tileInfo.item

if scanItem(9268) < countVend then


end

for _, tile in pairs(GetTiles()) do


if tile.fg == 9268 and tile.x == tileInfo.x and tile.y ==
tileInfo.y then
findPath(tile.x, tile.y, 32, true)
if findItem(packID) >= 1 then
Sleep(100)
SendPacket(2, "action|dialog_return\ndialog_name|vend_edit\
nx|".. tileInfo.x .."|\ny|".. tileInfo.y .."|\nbuttonClicked|addstock\nsetprice|0\
nchk_peritem|0\nchk_perlock|1")
wrench(tileInfo.x , tileInfo.y , true)
Sleep(1000)
end

while GetWorld() == nil or GetWorld().name ~=


depositWorld:upper() do
for i = 1, 1 do
end
warp(depositWorld:lower())
Sleep(4500)
if GetWorld() ~= nil then
if GetWorld().name == depositWorld:upper() then
Sleep(1000)
goto loopDeposit
end
end
end

if findItem(packID) == 0 then
break
end
end
end
end
end

if GetWorld().name ~= worldName:upper() then


warp(worldName:lower())
Sleep(4500)
playerPosition()
end

playerPosition()
end

local function buyItem()


local count = 0
::loopItem::
trashItem()
while GetWorld() == nil or GetWorld().name ~= worldName:upper() do
for i = 1, 1 do
end
warp(worldName:lower())
Sleep(4500)
if GetWorld() ~= nil then
if GetWorld().name == worldName:upper() then
Sleep(1000)
goto loopItem
end
end
end

::loopTelephone::
if autoTelephone then
while GetPlayerInfo().gems >= 120000 do
SendPacket(2,"action|dialog_return\ndialog_name|telephone\nnum|53785|\
nx|".. telepX .."|\ny|".. telepY .."|\nbuttonClicked|dlconvert")
Sleep(100)

while GetWorld() == nil or GetWorld().name ~= worldName:upper() do


for i = 1, 1 do
end
warp(worldName:lower())
Sleep(4500)
if GetWorld() ~= nil then
if GetWorld().name == worldName:upper() then
Sleep(1000)
goto loopTelephone
end
end
end

if findItem(1796) >= 100 then


SendPacket(2,"action|dialog_return\ndialog_name|telephone\nnum|
53785|\nx|".. telepX .."|\ny|".. telepY .."|\nbuttonClicked|bglconvert")
Sleep(100)
end

if findItem(7188) >= 1 then


SendPacket(2, "action|dialog_return\ndialog_name|bank_deposit\
nbgl_count|".. findItem(7188))
Sleep(100)
end
if GetPlayerInfo().gems < 120000 then
Sleep(100)
break
end
end
::endTelephone::

if GetPlayerInfo().gems < 120000 then


Sleep(100)
end
end

::loopInvasion::
if autoInvasion then
while GetPlayerInfo().gems >= 10000 do
SendPacket(2, "action|buy\nitem|buy_worldlockpack")
Sleep(100)

while GetWorld() == nil or GetWorld().name ~= worldName:upper() do


for i = 1, 1 do
end
warp(worldName:lower())
Sleep(4500)
if GetWorld() ~= nil then
if GetWorld().name == worldName:upper() then
Sleep(1000)
goto loopInvasion
end
end
end

if findItem(242) >= 100 then


convertItem(242)
Sleep(100)
end

if findItem(1796) >= 100 then


Sleep(100)
SendPacket(2,"action|dialog_return\ndialog_name|telephone\nnum|
53785|\nx|".. telepX .."|\ny|".. telepY .."|\nbuttonClicked|bglconvert")
end

if findItem(7188) >= 1 then


SendPacket(2, "action|dialog_return\ndialog_name|bank_deposit\
nbgl_count|".. findItem(7188))
Sleep(100)
end

if GetPlayerInfo().gems < 10000 then


break
end
end

if GetPlayerInfo().gems < 10000 then


Sleep(100)
end
end
::loopPack::
if packName ~= "" then
for i = 1, 1 do
SendPacket(2, "action|dialog_return\ndialog_name|cheats\
ncheck_autofarm|0\ncheck_bfg|0\ncheck_lonely".. HidePeople .."\ncheck_ignoreo|"..
ignoreDrop .."\ncheck_gems|".. collectGem)
Sleep(100)
end

for _, item in pairs(packList) do


while GetPlayerInfo().gems >= packPrice do
SendPacket(2,"action|buy\nitem|".. packName:lower())
Sleep(100)
count = count + 1

while GetWorld() == nil or GetWorld().name ~= worldName:upper() do


for i = 1, 1 do
end
warp(worldName:lower())
Sleep(4500)
if GetWorld() ~= nil then
if GetWorld().name == worldName:upper() then
Sleep(1000)
goto loopPack
end
end
end

if findItem(item) >= 250 then


break
end

if count == 250 then


break
end
end
end
end

count = 0
Sleep(1000)
if packName ~= "" and packName ~= nil then
Sleep(100)
depositItem()
end
end

local function playerRestart()


local targetTime = os.time() + restartAfter.hour * 3600 + restartAfter.minute *
60 + restartAfter.second

while os.time() < targetTime do


local remainingSeconds = targetTime - os.time()
local remainingHours = math.floor(remainingSeconds / 3600)
local remainingMinutes = math.floor((remainingSeconds % 3600) / 60)
local remainingSecondsDisplay = remainingSeconds % 60
coroutine.yield()
end
if os.time() >= targetTime then
Sleep(1000)
warp("EXIT")
end

continueRestart = coroutine.create(playerRestart)
end

continueRestart = coroutine.create(playerRestart)
local function resumeCoroutine()
local status, err = coroutine.resume(continueRestart)
if not status then
print("Error in coroutine:", err)
end
end

local autoFarm = false


local function pnbBreak()
::loopPnb::
if autoFarm then
Sleep(1000)
trashItem()

if findItem(5640) == 0 then
Sleep(1000)
getItem()
end

for i = 1, 1 do
while GetWorld() == nil or GetWorld().name ~= worldName:upper() do
for i = 1, 1 do
end
warp(worldName:lower())
Sleep(4500)
if GetWorld() ~= nil then
if GetWorld().name == worldName:upper() then
Sleep(1000)
goto loopPnb
end
end
end

Sleep(100)
SendPacket(2, "action|dialog_return\ndialog_name|cheats\
ncheck_autofarm|1\ncheck_bfg|1\ncheck_lonely".. HidePeople .."\ncheck_ignoreo|"..
ignoreDrop .."\ncheck_gems|".. collectGem)
end

if changeMagplant then
Sleep(100)
getItem()
end

if autoBuy then
if GetPlayerInfo().gems >= packPrice * 250 then
Sleep(1000)
buyItem()
end
end
if findItem(5640) == 0 then
goto loopPnb
Sleep(1000)
end

if findItem(1796) >= 100 then


SendPacket(2,"action|dialog_return\ndialog_name|telephone\nnum|53785|\
nx|".. telepX .."|\ny|".. telepY .."|\nbuttonClicked|bglconvert")
Sleep(100)
end

if findItem(7188) >= 1 then


SendPacket(2, "action|dialog_return\ndialog_name|bank_deposit\
nbgl_count|".. findItem(7188))
Sleep(100)
end

if getPlayerCount() > 0 then


if autoStop then
while autoPause() do
Sleep(1000)
autoPause()
break
end
end
end

for _, item in pairs(packList) do


if findItem(item) >= 250 then
Sleep(1000)
depositItem()
end
end

getLocalInfo()
if not getPlayerArroz then
Sleep(100)
for i = 1, 1 do
if autoArroz then
place(4604, 0, 0)
Sleep(100)
end
end
end

getLocalInfo()
if not getPlayerClover then
Sleep(100)
for i = 1, 1 do
if autoClover then
place(528, 0, 0)
Sleep(100)
end
end
end

getLocalInfo()
if not getPlayerGhost then
Sleep(100)
for i = 1, 1 do
if autoGhost then
SendPacket(2, "action|input\ntext|/ghost")
Sleep(100)
end
end
end

while GetWorld() == nil or GetWorld().name ~= worldName:upper() do


for i = 1, 1 do
end
warp(worldName:lower())
Sleep(4500)
if GetWorld() ~= nil then
if GetWorld().name == worldName:upper() then
Sleep(1000)
goto loopPnb
end
end
end

if autoRestart then
Sleep(1000)
resumeCoroutine()
end
end
end

while true do
Sleep(1000)

if changeMagplant then
Sleep(1000)
getItem()
end

if findItem(5640) == 0 then
autoFarm = true
Sleep(1000)
getItem()
Sleep(1000)
pnbBreak()
end

if findItem(5640) >= 1 then


autoFarm = true
Sleep(1000)
pnbBreak()
end

while GetWorld() == nil or GetWorld().name ~= worldName:upper() do


for i = 1, 1 do
end
warp(worldName:lower())
Sleep(4500)
if GetWorld() ~= nil then
if GetWorld().name == worldName:upper() then
Sleep(1000)
if findItem(5640) == 0 then
autoFarm = true
Sleep(1000)
getItem()
Sleep(1000)
pnbBreak()
end
end
end
end

while GetWorld() == nil or GetWorld().name ~= worldName:upper() do


warp(worldName:lower())
Sleep(4500)
if GetWorld() ~= nil then
if GetWorld().name == worldName:upper() then
Sleep(1000)
if findItem(5640) >= 1 then
autoFarm = true
Sleep(1000)
pnbBreak()
end
end
end
end
end

You might also like