Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Making os.pullEvent the same as os.pullEventRaw,
- --allowing to prevent the user from using CTRL+T.
- os.pullEvent = os.pullEventRaw
- --Main part of the program that handles EVERYTHING (Apart from attatching the peripheral :P)
- function Main()
- while true do
- --Whatever you are typing goes here
- text = io.read()
- -------------------------------------------------
- --Clear Function
- if (text) == "/clear" then
- sn.send("smartHelmet"," ")
- sn.send("smartHelmet"," ")
- sn.send("smartHelmet"," ")
- sn.send("smartHelmet"," ")
- sn.send("smartHelmet"," ")
- -------------------------------------------------
- elseif (text) == "/help" then
- print("HELP SYSTEM:")
- print("Commands:")
- print("/clear - CURRENTLY clears the OTHER person's text log, being worked on. Soon will clear YOURS, hopefully :3")
- print("/help - Shows this screen")
- print("/changelog - shows the change log of THIS version")
- -------------------------------------------------
- --The /changelog command for 0.0.2
- elseif (text) == "/changelog" then
- print("+Added the /help command")
- print("+Added the /changelog command")
- print("+Added support for the peripheral being on any side without needing to change any code.")
- print("*Fixed the CTRL+T sending 'Terminated' Bug")
- -------------------------------------------------
- --Sending the text to the helmet, unless its a command
- else
- sn.send("smartHelmet",text)
- end
- end
- end
- -------------------------------------------------
- --Detecting the peripheral's side :)
- function getSideOfPeripheral()
- for k,v in pairs(rs.getSides()) do
- -- print(v)
- if (peripheral.getType(v)) == "smNetSender" then
- sn = peripheral.wrap(v)
- Main()
- end
- end
- end
- -------------------------------------------------
- --Calling the attatchPeripheral() function, then, if sucsessful, calls the Main() function.
- function setup()
- getSideOfPeripheral()
- end
- setup()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement