Growganofth Left Lua
Growganofth Left Lua
-- Fungsi
function log(str)
local x = {}
x[0] = "OnTextOverlay"
x[1] = str
sendVariant(x)
end
function getItemCount(x)
for _, item in pairs(getInventory()) do
if (item.id) == x then
return item.amount
end
end
return 0
end
function hit_(x, y)
sendPacketRaw(false, {x = getLocal().pos.x, y = getLocal().pos.y, tilex = x,
tiley = y, type = 3, value = 18})
end
function enterWorld(w, i)
sendPacket(3, "action|join_request\nname|" .. w .. "|" .. i)
end
function dropReward()
local inventory = getInventory()
if inventory ~= nil then
for _, p in pairs(inventory) do
if p ~= nil then
for _, item in pairs(itemGanothR) do
if (item.id) == item then
sendPacket(2, "action|drop\n|itemID|" .. item)
sendPacket(2, "action|dialog_return\ndialog_name|drop_item\
nitemID|" .. item .. "|\ncount|" .. p.amount)
sleep(200)
end
end
end
end
end
end
function getTicket()
local worldObjects = getWorldObject()
if worldObjects ~= nil then
for _, obj in pairs(worldObjects) do
if obj ~= nil and (obj.id) == 1898 then
local objX = obj.pos.x // 32
local objY = obj.pos.y // 32
findPath(objX, objY)
sleep(2500)
end
end
end
end
-- Loop utama
while true do
sleep(1000)
local localPlayer = getLocal()
if localPlayer ~= nil then
local x = math.floor(localPlayer.pos.x / 32)
local y = math.floor(localPlayer.pos.y / 32)
if getItemCount(1898) == 0 then
toggleCheat(26, false)
enterWorld(storageItem, doorItem)
log("Joined Storage World")
sleep(2000)
dropReward()
log("Dropped Reward Item")
sleep(200)
getTicket()
log("Take Ticket")
sleep(500)
enterWorld("CARNIVAL", "1")
log("Joined CARNIVAL")
sleep(2000)
else
toggleCheat(26, true)
if eventGame == "r" then
findPath(90, 39)
sleep(1000)
end
if x == 90 then
findPath(92, 37)
sleep(200)
enter_(92, 37)
sleep(200)
end
if x == 96 then
findPath(96, 23)
sleep(200)
hit_(96, 23)
sleep(200)
end
end
else
log("Menunggu karakter lokal dimuat...")
sleep(1000)
end
end