Skip to content

Commit 812a408

Browse files
authored
Update All In One.lua
1 parent 64f1967 commit 812a408

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

All In One.lua

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,13 @@ end
6161
function break_item(t)
6262
local x = t[1] or t.x or exit_message{message="x coordinate is not defined"}
6363
local y = t[2] or t.y or exit_message{message="y coordinate is not defined"}
64-
64+
65+
local nx, ny = GetLocal().posX, GetLocal().posY
6566
pkt = {}
6667
pkt.px = x;
6768
pkt.py = y;
68-
pkt.x = x * 32;
69-
pkt.y = (y - 1) * 32;
69+
pkt.x = nx;
70+
pkt.y = ny;
7071
pkt.type = 3;
7172
pkt.value = 18;
7273
SendPacketRaw(false, pkt);
@@ -78,12 +79,13 @@ function place_item(t)
7879
local x = t[1] or t.x or exit_message{message="x coordinate is not defined"}
7980
local y = t[2] or t.y or exit_message{message="y coordinate is not defined"}
8081
local item_id = t[3] or t.item_id or exit_message{message="item id is not defined"}
81-
82+
83+
local nx, ny = GetLocal().posX, GetLocal().posY
8284
pkt = {}
8385
pkt.px = x;
8486
pkt.py = y;
85-
pkt.x = x * 32;
86-
pkt.y = (y - 1) * 32;
87+
pkt.x = nx;
88+
pkt.y = ny;
8789
pkt.type = 3;
8890
pkt.value = item_id;
8991
SendPacketRaw(false, pkt);
@@ -116,15 +118,15 @@ function clear_island()
116118
local tile = GetTile(x, y)
117119
if (tile.fg == 12988) or (tile.fg == 12986) or (tile.bg == 14 and tile.fg ~= 8) or (tile.fg == 1104) or (tile.bg == 1102) then
118120
if (FindPath(tile.x, tile.y - 1) == false) then
119-
break_item{ x= tile.x, y = tile.y}
121+
break_island{ x= tile.x, y = tile.y}
120122
break
121123
end
122124
end
123125
else
124126
local tile = GetTile(199 - x, y)
125127
if (tile.fg == 12988) or (tile.fg == 12986) or (tile.bg == 14 and tile.fg ~= 8) or (tile.fg == 1104) or (tile.bg == 1102) then
126128
if (FindPath(tile.x, tile.y - 1) == false) then
127-
break_item{x= tile.x, y = tile.y}
129+
break_island{x= tile.x, y = tile.y}
128130
break
129131
end
130132
end

0 commit comments

Comments
 (0)