Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local event = require("event")
- local shell = require("shell")
- local modem = component.modem
- local PORT = 10001
- modem.open(PORT)
- function receive()
- print("Waiting for command on port " .. PORT)
- local _, _, sender, port, distance, msg = event.pull("modem_message")
- local length = tonumber(msg)
- print("Got request to execute length of " .. length .. " from " .. sender)
- shell.execute("fillLine minecraft:dirt 0 " .. length)
- print("Done!")
- end
- while true do
- receive()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement