Skip to content

Commit e7135a3

Browse files
authored
Update All In One.lua
1 parent d7a313d commit e7135a3

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

All In One.lua

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,38 @@ end
146146

147147

148148

149+
function grind_food(t)
150+
local position = t[1] or t.position or exit_message{message = "position is not defined"}
151+
local offset = t[2] or t.offset or nil
152+
local item_id = t[3] or t.item_id or exit_message{message = "item id is not defined"}
153+
local amount = t[4] or t.amount or exit_message{message = "amount id is not defined"}
154+
155+
local grinder_x
156+
local grinder_y
157+
158+
if (position == "top") then
159+
grinder_x = (GetLocal().posX // 32)
160+
grinder_y = ((GetLocal().posY // 32) - 1) - ((offset ~= nil) and offset or 0)
161+
162+
elseif (position == "bottom") then
163+
grinder_x = (GetLocal().posX // 32)
164+
grinder_y = ((GetLocal().posY // 32) + 1) + ((offset ~= nil) and offset or 0)
165+
166+
elseif (position == "left") then
167+
grinder_x = ((GetLocal().posX // 32) - 1) - ((offset ~= nil) and offset or 0)
168+
grinder_y = (GetLocal().posY // 32)
169+
170+
elseif (position == "right") then
171+
grinder_x = ((GetLocal().posX // 32) + 1) + ((offset ~= nil) and offset or 0)
172+
grinder_y = (GetLocal().posY // 32)
173+
174+
end
175+
176+
SendPacket(2, "action|dialog_return\ndialog_name|grinder\nx|".. grinder_x .. "|\ny|"..grinder_y.."|\nitemID|"..item_id.."|\namount|"..amount.."\n")
177+
end
178+
179+
180+
149181
function show_notification(t)
150182
local icon = t[1] or t.icon or "interface/large/adventure.rttex"
151183
local message = t[2] or t.message or exit_message{message = "message is not defined"}

0 commit comments

Comments
 (0)