128 posts
Location
Holland
Posted 15 June 2013 - 10:14 AM
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! code:http://pastebin.com/9sWKnPS0pastebin get 9sWKnPS0 CommandRedstone
Note:this program requires openPeripheral:
http://www.computerc...711#entry120711suggestions: if you have any suggestions please post them below.
updater:
pastebin get r3WdEVUm CR updater
code:http://pastebin.com/r3WdEVUmcredit:
Mikeemoo for openPeripheral
theoriginalbit for fixing some bugs
authors:
Xiretza
Jappards
620 posts
Location
Holland
Posted 15 June 2013 - 10:21 AM
Nice and simple. Well done!
7508 posts
Location
Australia
Posted 15 June 2013 - 10:30 AM
nice and simple.
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
not true = false
not false = true
128 posts
Location
Holland
Posted 15 June 2013 - 11:00 AM
thanks!Spoiler
nice and simple.
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
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
7508 posts
Location
Australia
Posted 15 June 2013 - 11:03 AM
thanks for noticing it me, the thread code is already updated, i will now be updating the pastebin.
No problems. You could use a similar method for the pulse command too
if command == "pulse" then
rs.setOutput("top", not redstoneState)
sleep(4)
rs.setOutput("top", redstoneState)
end
128 posts
Location
Holland
Posted 15 June 2013 - 11:16 AM
i already updated it on this thread and pastebin
24 posts
Location
Somewhere behind the moon
Posted 15 June 2013 - 12:39 PM
Ok, made a little better (I hope :P/>) version, changed some things…
http://pastebin.com/GkTuNmwSChanges:
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 :P/>
128 posts
Location
Holland
Posted 15 June 2013 - 01:03 PM
thanks, i will update it, it does miss the clear command thought, but i can just add that to your version
24 posts
Location
Somewhere behind the moon
Posted 15 June 2013 - 01:14 PM
it does miss the clear command thought
Why should it clear? The redstone signal is either on or off, you don't have to clear anything… And on startup it clears automatically.
128 posts
Location
Holland
Posted 15 June 2013 - 01:21 PM
well, in case bugs mess the screen up
24 posts
Location
Somewhere behind the moon
Posted 15 June 2013 - 01:47 PM
well, in case bugs mess the screen up
Bugs?! In my programs are no bugs :D/>
24 posts
Location
Somewhere behind the moon
Posted 15 June 2013 - 09:23 PM
Sorry, but I had to do that. New termglassRS:
http://pastebin.com/UGTKZhLP New updater:
http://pastebin.com/JyYgs2YsMade 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.
128 posts
Location
Holland
Posted 16 June 2013 - 03:35 AM
no problem, but i have a problem connecting to pastebin.