when the openperipheral terminal glasses came out i created a test program, but then i maked it my main program and then i decided to release it for other people.
this program triggers redstone on top of it if one of the following commands are typed
Spoiler
$$toggle--toggles the redstone state
$$pulse--changes the redstone state for 4 seconds and then goes back to before this command
it also displays the state of the redstone
how to use:
Spoiler
1. place the terminal glasses bridge
2.place the computer on top off the terminal glasses bridge
3.place the redstone on top off the computer
4.get terminal glasses(or if you also have MPS installed, get the terminal glasses module on your power helmet)
5.right click the terminal glasses bridge 6.pastebin the program: pastebin get vXryjxUK# CommandRedstone 7.???? 8.PROFIT!
one code improvement though that jumped straight out at me.
this:
if command == "toggle" then
if redstoneState == false then
rs.setOutput("top",true)
redstoneState = true
else
rs.setOutput("top",false)
redstoneState = false
end
end
can become
if command == "toggle" then
redstoneState = not redstoneState --# this line toggles the boolean variable, see quote below for more info
rs.setOutput("top", redstoneState)
end
one code improvement though that jumped straight out at me.
this:
if command == "toggle" then
if redstoneState == false then
rs.setOutput("top",true)
redstoneState = true
else
rs.setOutput("top",false)
redstoneState = false
end
end
can become
if command == "toggle" then
redstoneState = not redstoneState --# this line toggles the boolean variable, see quote below for more info
rs.setOutput("top", redstoneState)
end
this is how the not operator works
Quote
not true = false
not false = true
thanks for noticing it me, the thread code is already updated, i will now be updating the pastebin.
Edit: pastebin updated, if you have any suggestions, please post it below
Ok, made a little better (I hope ) version, changed some things... http://pastebin.com/GkTuNmwS
Changes:
1. You can now tell the program where the RS output and the glassesbridge is
2. LOTS of changes in the background, just have a look at it
Sorry, but I had to do that. New termglassRS: http://pastebin.com/UGTKZhLP New updater: http://pastebin.com/JyYgs2Ys
Made it so you only have to run the updater, it detects what the name of the program was previously and replaces it (And if it fails, it has a save copy called "[filename]_old"). Had to add a bunch off stuff, but I think it's worth it.