This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Sparkpowder's profile picture

About "side"

Started by Sparkpowder, 25 May 2012 - 07:46 PM
Sparkpowder #1
Posted 25 May 2012 - 09:46 PM
What strings are interpreted as a side with the "side" function?
MysticT #2
Posted 25 May 2012 - 09:49 PM
You can get the valid sides with rs.getSides(), it returns a array (table with numeric indices) with all of them. They might change (probably not), but this is the list atm (not in the order returned by rs.getSides()): "left", "right", "top", "bottom", "front", "back".
Sparkpowder #3
Posted 25 May 2012 - 10:02 PM
On a related topic, how do I write something on a monitor?
MysticT #4
Posted 25 May 2012 - 10:13 PM
You can use:

term.redirect(peripheral.wrap("side")) -- change "side" to the side of the monitor
-- print stuff
term.restore() -- restores the output to the console
Sparkpowder #5
Posted 25 May 2012 - 10:26 PM
OK, doesn't work.

I'm using that code and it doesn't work.
MysticT #6
Posted 25 May 2012 - 10:32 PM
It should work, did you change the side and added some prints? cause the code does nothing if you don't chage that.
Example:

term.redirect(peripheral.wrap("right"))
print("Hello World!")
term.restore()
print("Take a look at the monitor please.")
Sparkpowder #7
Posted 25 May 2012 - 10:33 PM
I only used 1 print command.
MysticT #8
Posted 25 May 2012 - 10:34 PM
And did you changed "side" to the side of the monitor?
Sparkpowder #9
Posted 26 May 2012 - 02:15 PM
Yah. The monitor is to the right.
Zalerinian #10
Posted 26 May 2012 - 02:22 PM
From what i know using monitors, this code

term.redirect(peripheral.wrap("right"))
print("Hello World!")
term.restore()
print("Take a look at the monitor please.")

Should actually be this code

term.redirect("right")
print("Hello World!")
sleep(3) -- Leaves text on the monitor for three seconds
term.restore()
print("Take a look at the monitor please.")
Lolgast #11
Posted 26 May 2012 - 02:38 PM
From what i know using monitors, this code

term.redirect(peripheral.wrap("right"))
print("Hello World!")
term.restore()
print("Take a look at the monitor please.")

Should actually be this code

term.redirect("right")
print("Hello World!")
sleep(3) -- Leaves text on the monitor for three seconds
term.restore()
print("Take a look at the monitor please.")
Nope, this is not needed. Did you note the sides are defined when standing in front of it? If you stand behind the computer, left and right is reversed. If that's not the problem, we might see it when you put your code here.