0% found this document useful (0 votes)
105 views2 pages

Auto Grind - Lua

This document contains Lua code for an item grinding script in a game. It defines variables to store the player's x and y position. It also defines salt and pepper item IDs. The code adds a hook to detect when certain dialogs are opened. When a food grinder is detected, it runs the Grind function, which sends packets to interact with the grinder and drop excess items. The main loop runs the Grind function repeatedly.

Uploaded by

Saddam Nadhri
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)
105 views2 pages

Auto Grind - Lua

This document contains Lua code for an item grinding script in a game. It defines variables to store the player's x and y position. It also defines salt and pepper item IDs. The code adds a hook to detect when certain dialogs are opened. When a food grinder is detected, it runs the Grind function, which sends packets to interact with the grinder and drop excess items. The main loop runs the Grind function repeatedly.

Uploaded by

Saddam Nadhri
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/ 2

-- Credit to Faraday#1010

x = math.floor(GetLocal().posX//32)
y = math.floor(GetLocal().posY//32)

salt = 4566
pepper = 4584

----------------------------------------
-- Variant
----------------------------------------

AddHook(function(var)
if var.v1 == "OnDialogRequest" and var.v2:match("Item Finder") then
return true
end

if var.v1 == "OnTalkBubble" and var.v3:find("I don't have enough") then


return true
end

if var.v1 == "OnDialogRequest" then


if var.v2:find("Food Grinder") then
x = var.v2:match("|x|(%d+)")
y = var.v2:match("|y|(%d+)")
var = {}
var.v0 = "OnTextOverlay"
var.v1 = "`wFood Grinder `9Detected`w, Running the `4Script"
SendVariant(var)
return true
end
end

return false
end,"OnVariant")

----------------------------------------
-- End Variant
----------------------------------------

----------------------------------------
-- Function
----------------------------------------

function Grind()
SendPacket(2, "action|dialog_return\ndialog_name|item_search\n"..salt.."|1\
n"..pepper.."|1")
Sleep(2000)
SendPacket(2,"action|dialog_return\ndialog_name|grinder\nx|"..x.."|\ny|"..y.."|\
nitemID|"..salt.."|\namount|2")
Sleep(200)
SendPacket(2,"action|dialog_return\ndialog_name|grinder\nx|"..x.."|\ny|"..y.."|\
nitemID|"..pepper.."|\namount|2")
Sleep(200)
for _, v in pairs(GetInventory()) do
if v.id == 4568 and v.amount > 200 then
SendPacket(2, "action|dialog_return\ndialog_name|drop\nitem_drop|4568|\
nitem_count|"..v.amount);
Sleep(200);
elseif v.id == 4570 and v.amount > 200 then
SendPacket(2, "action|dialog_return\ndialog_name|drop\nitem_drop|4570|\
nitem_count|"..v.amount);
Sleep(200);
end
end
end

----------------------------------------
-- End Function
----------------------------------------

while true do
Grind()
end

You might also like