mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-05-04 21:09:21 +02:00
27 lines
882 B
Lua
27 lines
882 B
Lua
setDefaultTab("Tools")
|
|
local toggle = macro(1000, "mwall step", "F12",function() end)
|
|
|
|
onPlayerPositionChange(function(newPos, oldPos)
|
|
if oldPos.z ~= posz() then return end
|
|
if oldPos then
|
|
local tile = g_map.getTile(oldPos)
|
|
if toggle.isOn() and tile:isWalkable() then
|
|
useWith(3180, tile:getTopUseThing())
|
|
toggle.setOff()
|
|
end
|
|
end
|
|
end)
|
|
|
|
local toggle2 = macro(1000, "mwall on target", "F11",function() end)
|
|
|
|
onCreaturePositionChange(function(creature, newPos, oldPos)
|
|
if creature == target() or creature == g_game.getFollowingCreature() then
|
|
if oldPos and oldPos.z == posz() then
|
|
local tile2 = g_map.getTile(oldPos)
|
|
if toggle2.isOn() and tile2:isWalkable() then
|
|
useWith(3180, tile2:getTopUseThing())
|
|
toggle2.setOff()
|
|
end
|
|
end
|
|
end
|
|
end) |