17 posts
Posted 28 October 2012 - 01:19 AM
You know how you can append to a file using fs? I was wondering if you can do the same with variables containing strings.
Example:
var = "a"
I want to add-on to it so I can make a word like "add"
Could i do something like var = var"dd"?
278 posts
Posted 28 October 2012 - 01:21 AM
Yes, you can, by using the concentation operator, or ".." (2 dots/periods)
myVar = "a"
myVar = myVar.."dd"
print(myVar)
This code should print "add".
1111 posts
Location
Portland OR
Posted 28 October 2012 - 01:21 AM
concatenate the string so
var = "a"
var = var.."dd"
17 posts
Posted 28 October 2012 - 01:24 AM
Thanks! While you're here, the rs.setBundledOutput doesn't seem to be working.
Example:
rs.getBundledInput("right") returns 65
I want to set it to 0 (or any number) so I do rs.setBundledOutput("right",0) just like the wiki entry says, but it doesn't do anything. I do rs.getBundledInput("right") after doing that command, and it's still set to 65…
1111 posts
Location
Portland OR
Posted 28 October 2012 - 01:29 AM
Is there something else holding the redstone signals on? By doing rs.setBundledOutput("right",0) everything that the computer is sending is turned off.
Since you're using getBundledInput() you're testing what is coming into the computer, Verify that the computer is not sending the signal by testing the output. rs.getBundledOutput("right")
17 posts
Posted 28 October 2012 - 01:31 AM
Thanks so much, guys!