Posted 25 August 2015 - 09:31 PM
Hello there !
I'd like to know if something is possible in computercraft (CraftOS 1.7) and then how. First, a bit of story !
I prompt the user a command, that can be like this :
But before this, I have a problem with the command itself : how to split the different n parts of the command into n different srings ? Also, I'd like to know the number of substrings…
With those examples, it would do :
Thanks in advance !
I'd like to know if something is possible in computercraft (CraftOS 1.7) and then how. First, a bit of story !
I prompt the user a command, that can be like this :
craft <item [matter]> [number]
get <item,block> <number>
emptyChest
Here are some examples :
"craft pickaxe iron"
"craft sword diamond 2"
"craft piston 5"
"get cobblestone 64"
"get redstone 128"
"emptyChest"
The final goal is via rednet, sending this command to a crafty turtle so it gets everything in the chests, it crafts the thing(s) if needed, and then brings everything in a chest.But before this, I have a problem with the command itself : how to split the different n parts of the command into n different srings ? Also, I'd like to know the number of substrings…
With those examples, it would do :
"craft pickaxe iron" > "craft", "pickaxe", "iron", 3
"craft sword diamond 2" > "craft", "sword", "diamond", "2", 4
"craft piston 5" > "craft", "piston", "5", 3
"get cobblestone 64" > "get", "cobblestone", "64", 3
"get redstone 128" > "get", "redstone", "128", 3
"emptyChest" > "emptyChest", 1
Thanks in advance !