Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --example "setblock"
- local component = require("component")
- local event = require("event")
- local term = require("term")
- local gpu = component.gpu
- blockid = "stone"
- if not component.isAvailable("command_block") then
- local d = component.debug
- detect = true
- function cmd(comm) -- Это если у нас дебаг карта
- d.runCommand(comm)
- end
- end
- if component.isAvailable("command_block") and detect == false then
- local cmdblock = component.command_block
- function cmd(comm) -- Если есть командный блок
- cmdblock.setCommand(comm)
- cmdblock.executeCommand()
- end
- end
- while true do
- local id, _, x, y = event.pullMultiple("touch", "drag")
- if id == "touch" or id == "drag" then
- if y>1 then
- gpu.set(x, y, "■")
- cmd("/setblock ~"..(x-1).." ~"..(yMonitorSize+3-y).." ~0 minecraft:"..blockid)
- redraw()
- checkblock()
- function Exitfromprogram()
- gpu.setBackground(0x696969)
- gpu.fill(1,1,80,1, " ")
- for x=1,xMonitorSize do
- for y=1,yMonitorSize - 1 do
- cmd("/setblock ~"..x.." ~"..y.." ~0 minecraft:air")
- removedblocks = removedblocks + 1
- gpu.set(1,1, "Exiting please wait... Removing blocks: "..removedblocks.."/"..exitblockstotal)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement