Posted 14 June 2015 - 02:23 PM
Hi. I won't lie, I'm a noob when it comes to coding, but I would really like to learn. Basically, I am trying to write a program for my mobfarm, which includes the user to input certain commands, and the computer to output redstone signals through different RedNet cable colours. I can't nail down the user input part.
Overall, I want the user to be able to specify which mob he wants to spawn, by typing it's name, for example "Skeleton" or "Witch". This is then translated into a different colour of the cable.
I have a basic idea of what the code should look like, but I do not know the functions required.
Here is my idea of the code:
if userInput == "Skeleton"
then rs.setBundledOutput("back",colour.gray)
print (Spawning Skeletons")
elseif userInput == "Blaze"
then rs.setBundledOutput("back".colour.yellow)
print (Spawning Blazes")
This can then be repeated with other mobs etc. The problem occurs, as I said, with the correct capturing, and translation of the user input into the mobs names, into redstone signals.
If anyone would be kind enough to help me sort this out, and possibly give me some tips, I'd be VERY grateful! Thanks!
@edit: Added the indentations.
Overall, I want the user to be able to specify which mob he wants to spawn, by typing it's name, for example "Skeleton" or "Witch". This is then translated into a different colour of the cable.
I have a basic idea of what the code should look like, but I do not know the functions required.
Here is my idea of the code:
if userInput == "Skeleton"
then rs.setBundledOutput("back",colour.gray)
print (Spawning Skeletons")
elseif userInput == "Blaze"
then rs.setBundledOutput("back".colour.yellow)
print (Spawning Blazes")
This can then be repeated with other mobs etc. The problem occurs, as I said, with the correct capturing, and translation of the user input into the mobs names, into redstone signals.
If anyone would be kind enough to help me sort this out, and possibly give me some tips, I'd be VERY grateful! Thanks!
@edit: Added the indentations.
Edited on 14 June 2015 - 05:51 PM