File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 146
146
147
147
148
148
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\n dialog_name|grinder\n x|" .. grinder_x .. " |\n y|" .. grinder_y .. " |\n itemID|" .. item_id .. " |\n amount|" .. amount .. " \n " )
177
+ end
178
+
179
+
180
+
149
181
function show_notification (t )
150
182
local icon = t [1 ] or t .icon or " interface/large/adventure.rttex"
151
183
local message = t [2 ] or t .message or exit_message {message = " message is not defined" }
You can’t perform that action at this time.
0 commit comments