Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Network packet protection
- by BigSHinyToys
- ]]--
- local function findDevice(sType)
- for _,sSide in pairs(rs.getSides()) do
- if peripheral.isPresent(sSide) and peripheral.getType(sSide) == sType then
- return sSide,peripheral.wrap(sSide)
- end
- end
- end
- local function dec2hex(nInput)
- return string.format("%X",tonumber(nInput))
- end
- local function hex2dec(sInput)
- return tonumber(sInput,10)
- end
- local sOut = {}
- for a = 0,15 do
- term.setCursorPos(1,a + 1)
- term.write(dec2hex(a).." ")
- for b = 0,15 do
- local char = string.char((a*16) + b)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.lime)
- term.write(char)
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.lightBlue)
- term.write(dec2hex(a)..dec2hex(b))
- table.insert(sOut,char)
- end
- -- table.insert(sOut,"/n")
- end
- --[[
- local file = fs.open("data","w")
- file.write(table.concat(sOut))
- file.close()
- ]]--
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- local sSide,modem = findDevice("modem")
- modem.open(255)
- modem.transmit(255,255,table.concat(sOut))
- os.pullEvent()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement