0% found this document useful (0 votes)
12 views4 pages

Magplant Farming Script for UZA

auto pnb Growtopia

Uploaded by

finosusanto329
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)
12 views4 pages

Magplant Farming Script for UZA

auto pnb Growtopia

Uploaded by

finosusanto329
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

MagBG = 568

World = "UZA"
PnbX, PnbY = 1, 186

function rw(t, s, id, x, y)


SendPacketRaw(false, { type = t, state = s, value = id, px = x, py = y, x = x
* 32, y = y * 32 })
end

Magplants = {}
function GetMagplants()
local function GetStocksHook(v)
if v[0] == "OnDialogRequest" and v[1]:find("magplant_edit") then
local x = tonumber(v[1]:match("embed_data|x|(%d+)"))
local y = tonumber(v[1]:match("embed_data|y|(%d+)"))
local stock = tonumber(v[1]:match("Stock: `$(%d+)``"))
if v[1]:find("Stock: `4EMPTY!``") then
stock = 0
end
local has_stock = stock and stock > 0 or false
print(x, y, stock, has_stock)
[Link](Magplants, {
x = x,
y = y,
stock = stock,
has_stock = has_stock,
})
return true
end
end
AddHook("onvariant", "GetStocksHook", GetStocksHook)
for x = 0, [Link](GetWorld().width - 1) do
for y = 0, [Link](GetWorld().height - 1) do
local t = GetTile(x, y)
if [Link] == MagBG and [Link] == 5638 then
rw(nil, nil, nil, x, y)
rw(3, nil, 32, x, y)
Sleep(150)
end
end
end
Sleep(1000)
RemoveHook("GetStocksHook")
end

function StartPNB()
local arroz = false
local songpyeon = false
local cheat = false
local autobfg = false
local MagHabis = false

local function Use(id, x, y)


rw(3, nil, id, x, y)
end
local function CheckPlayer()
SendPacket(2, "action|wrench\n|netid|" .. GetLocal().netid)
end
local function CheckAll()
if not arroz then
Use(4604, PnbX, PnbY)
Sleep(100)
songpyeon = true
elseif not songpyeon then
Use(1056, PnbX, PnbY)
Sleep(100)
songpyeon = true
elseif not cheat then
SendPacket(2, "action|dialog_return\ndialog_name|buycheat")
Sleep(100)
cheat = true
end
end
local function HidePopUp(v)
if v[0] == "OnDialogRequest" and v[1]:find("`bCreative Cheat Menu````")
then
return true
end
if v[0] == "OnDialogRequest" and v[1]:find("magplant_edit") then
return true
end
if v[0] == "OnDialogRequest" and v[1]:find("add_player_info") then
arroz = v[1]:find("|4604|")
songpyeon = v[1]:find("|528|")
cheat = v[1]:find("|16086|")
autobfg = v[1]:find("Cheat Active: Autofarm")
return true
end
if v[0] == "OnTalkBubble" and v[2]:find("The MAGPLANT 5000 is empty") then
if not MagHabis then
MagHabis = true
end
return true
end
end
local function isDisconnected()
if GetClient().ping == 999 and GetWorld() == nil then
return true
end
return false
end
local function GetRemote(x, y)
SendPacket(
2,
"action|dialog_return\ndialog_name|magplant_edit\nx|" .. x .. "|\
ny|" .. y .. "|\nbuttonClicked|getRemote"
)
end
local function CheatMenu()
if autobfg then
SendPacket(2, "action|dialog_return\ndialog_name|cheats\
ncheck_autofarm|0\ncheck_bfg|0\ncheck_gems|1")
else
SendPacket(2, "action|dialog_return\ndialog_name|cheats\
ncheck_autofarm|1\ncheck_bfg|1\ncheck_gems|1")
end
end
Magplants = {}
LogToConsole("`2[INFO] `oScanning magplants...")
GetMagplants()
Sleep(5000)

stockedMagplants = {}
for _, mag in pairs(Magplants) do
if mag.has_stock then
[Link](stockedMagplants, mag)
end
end

if #stockedMagplants == 0 then
LogToConsole("`4[ERROR] `cTidak ada magplant dengan stok yang
ditemukan. Skrip dihentikan.")
return
end

AddHook("onvariant", "HidePopUp", HidePopUp)

local currentIndex = #stockedMagplants


while currentIndex > 0 do
local currentMag = stockedMagplants[currentIndex]

local function ConfigurePNB()


MagHabis = false
FindPath(PnbX, PnbY)
Sleep(1000)
rw(nil, nil, nil, currentMag.x, currentMag.y)
Sleep(200)
rw(3, nil, 32, currentMag.x, currentMag.y)
Sleep(1000)
GetRemote(currentMag.x, currentMag.y)
Sleep(1000)
rw(nil, nil, nil, PnbX, PnbY)
Sleep(1000)
CheckPlayer()
Sleep(550)
CheckAll()
Sleep(550)
CheatMenu()
end

ConfigurePNB()

LogToConsole("`2[INFO] `oMulai farming di magplant saat ini hingga stok


habis...")

while not MagHabis do


if isDisconnected() then
Sleep(30000)
if GetWorld() == nil then
RequestJoinWorld(World)
Sleep(5000)
ConfigurePNB()
Sleep(200)
elseif GetWorld ~= nil then
Sleep(5000)
ConfigurePNB()
Sleep(200)
end
else
CheckPlayer()
Sleep(250)
CheckAll()
Sleep(250)
end
end

CheckPlayer()
CheatMenu()
currentIndex = currentIndex - 1
if currentIndex > 0 then
LogToConsole("`2[INFO] `oPindah ke magplant selanjutnya...")
else
LogToConsole("`2[INFO] `oSemua magplant telah habis. Proses
farming selesai.")
end
Sleep(2000)
end
end

StartPNB()
RemoveHooks()

Common questions

Powered by AI

The 'CheatMenu' function in the script toggles options related to automated features like 'autofarm', 'bfg', and 'gems'. It modifies the execution state based on the 'autobfg' status, switching between these options for farming efficiency. This function has implications on gameplay integrity as it can alter the intended gameplay mechanisms, potentially violating fair play rules by automating and enhancing capabilities unfairly .

The script attempts to conceal user actions by using the 'HidePopUp' function to suppress unwanted dialog requests or notifications, filtering them based on specific strings linked to dialogs or tool states. It also conditions the display of 'TalkBubble' dialogs to prevent visibility of certain cheat-related notifications. This selective bypassing implies efforts to avoid drawing attention and maintain a disguise within the game environment, allowing the operations to proceed without explicit visibility to others .

The script implements a disconnection handling mechanism that checks the client's ping status using the 'isDisconnected' function. If the 'ping' value is 999 and the world data is null, indicating a disconnection, it sleeps for 30 seconds. After this pause, it attempts to rejoin the world using 'RequestJoinWorld' and reconfigures the Magplant setup to resume operations. This ensures continuity of farming operations despite temporary disconnections .

The script utilizes client-side checks by leveraging functions like 'CheckPlayer' and 'isDisconnected', which run checks on the local client state, such as player status and connectivity. These checks trigger commands only if specific conditions are met, such as being connected to the server or having correct player data, ensuring operations do not misfire due to stale or incorrect states. This approach enhances script accuracy and reliability by dynamically aligning automated processes with real-time client conditions .

A bug in the 'RemoveHook' function could prevent the cessation of previously set event handlers, meaning hooks like 'GetStocksHook' and 'HidePopUp' might persist beyond their intended lifespan. This could lead to erroneous operations, duplicated logging, or unwanted interactions with dialog systems due to hooks still actively processing events. Such lingering hooks can degrade script performance by overwhelming system resources with redundant calls or causing unintended behavior due to outdated or conflicting operations, severely impacting overall integrity and reliability .

The script identifies Magplants with stock available by using the GetStocksHook function, which checks dialog requests containing 'magplant_edit' to retrieve the location and stock of Magplants. If stock information is found, it stores the details including the stock count and whether it has stock in the 'Magplants' table. The 'FindPath' function is used to navigate to specific coordinates (PnbX, PnbY), which is necessary for performing operations on the identified Magplants, suggesting its role in executing farming commands in sequence .

The script maintains an ongoing log of its activities by consistently using 'LogToConsole' to print informational and error messages during operations. Logging is essential for troubleshooting as it provides a step-by-step account of actions and decisions taken by the script, allowing users to track progress, pinpoint failures, and understand behavior in case of errors or unexpected outcomes. This systematic feedback aids in diagnosing issues and refining processes .

The script contains conditional checks for variables like arroz, songpyeon, and cheat, which appear to control the execution of specific commands linked to these items. The absence of 'arroz' or 'songpyeon' leads to executing 'Use' function which changes the internal state, indicating a progression in the operation sequence. The 'cheat' check likely guards against illegal or unintended operations by preventing cheat-related functions from executing unless specifically triggered. These conditions signify protective or state-management measures within the script, ensuring only intended operations proceed to prevent errors or violations .

The script manages multiple Magplants through a list-based approach, iterating over 'stockedMagplants' where each Magplant is configured and processed one at a time through the 'ConfigurePNB' function. Strategic elements include the use of a loop to sequentially process Magplants until all stocks are depleted, using 'LogToConsole' to inform the user of the current process status. This approach ensures that each Magplant is individually attended to for farming, providing a structured and status-informed management of resources .

The script uses functions like 'SendPacketRaw' and 'rw' to send instructions to interact with the game environment, such as moving to coordinates and manipulating Magplants. The 'GetStocksHook' and 'GetRemote' functions retrieve and control remote Magplant configurations respectively, while 'CheckAll' and 'ConfigurePNB' manage inventory and tool usage. These methods collectively enable systematic automated farming by systematically probing the game state, altering object conditions, and retrying operations, ensuring a hands-off farming cycle as long as conditions are met, reflecting a sophisticated automation process .

You might also like