📄 placer.lua
字号:
-- Example Placer script
-- called when the mouse moves and a button pressed that is set to Placer.lua
function main ()
local x = mappy.getValue (mappy.MOUSEBLOCKX)
local y = mappy.getValue (mappy.MOUSEBLOCKY)
local blk = mappy.getValue (mappy.CURANIM)
if (blk == -1) then
blk = mappy.getValue (mappy.CURBLOCK)
else
-- setBlock need anims in the format below (ie: anim 1 should be a value of -2)
blk = -(blk+1)
end
-- Place a '+' of blocks at current position
if x > 0 then
mappy.setBlock (x-1, y, blk)
end
if y > 0 then
mappy.setBlock (x, y-1, blk)
end
mappy.setBlock (x, y, blk)
if x < (mappy.getValue (mappy.MAPWIDTH)-1) then
mappy.setBlock (x+1, y, blk)
end
if y < (mappy.getValue (mappy.MAPHEIGHT)-1) then
mappy.setBlock (x, y+1, blk)
end
end
test, errormsg = pcall( main )
if not test then
mappy.msgBox("Error ...", errormsg, mappy.MMB_OK, mappy.MMB_ICONEXCLAMATION)
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -