Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- REDNET API --
- -- For personal use in ComputerCraft --
- -- You are welcome to download it and add to it --
- -- Plazter --
- -- there are commented out some of the auto, a comment that is, you can outcomment it again if u want the info--
- --2013--
- -- Clear setting --
- term.clear()
- term.setCursorPos(1,1)
- -- Settings ended --
- -- simple shortcuts --
- open = rednet.open
- close = rednet.close
- cast = rednet.broadcast
- send = rednet.send
- output = rs.setOutput
- input = rs.getInput
- -- end of shortcuts --
- -- functions --
- function center(text)
- local x,y = mon.getSize()
- local x2,y2 = mon.getCursorPos()
- mon.setCursorPos(math.ceil((x/2) - (text:len() / 2)),y2)
- mon.write(text)
- end
- function autoMon()
- for a,b in pairs(rs.getSides()) do
- if peripheral.getType(b) == 'monitor' then
- mon = peripheral.wrap(b)
- print("Wrapped Monitor on: ".. b)
- break
- end
- end
- end
- function autoModem()
- for a,b in pairs(rs.getSides()) do
- if peripheral.getType(b) == 'modem' then
- rednet.open(b)
- --print("Wrapped Modem on: ".. b)
- break
- end
- end
- end
- function rec()
- local id, msg, dist = rednet.receive()
- end
- function drive()
- for a,b in pairs(rs.getSides()) do
- if peripheral.wrap(b) == 'drive' then
- drive = peripheral.wrap(b)
- -- print("Wrapped Drive on: ".. b)
- break
- end
- end
- end
- function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- -- end of functions --
- print("ComputerID is: ".. os.getComputerID())
- print("Api loaded succesfull!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement