How is onUserInput supposed to work?
- Code: Select all
function onUserInput(input) {
if(input == "bots"){
print('Bots:\n chopper');
}else if(input == "chopper"){
startChopperBot();
}
}
I tried it like this, but when i type :bots or :chopper, nothing happens.
I also think that the select character function isnt working if your char has ~ or ´ in his name.
@edit
Ok, the input has to be on the cmd prompt. My bad.
@suggestion
Add a "waitCurrent()" or similar, that waits the current action to finish.
@code
Here is a function i made to check whether its a tree.
- Code: Select all
function isTree(tree) {
return tree == "alder" || tree == "appletree" || tree == "ash" || tree == "aspen" || tree == "baywillow" || tree == "beech" || tree == "birch" ||
tree == "birdcherrytree" || tree == "buckthorn" || tree == "cedar" || tree == "cherry" || tree == "chestnuttree" || tree == " conkertree" ||
tree == "corkoak" || tree == "crabappletree" || tree == "cypress" || tree == "elm" || tree == "fir" || tree == "goldenchain" || tree == "hazel" ||
tree == "hornbeam" || tree == "juniper" || tree == "kingsoak" || tree == "larch" || tree == "laurel" || tree == "linden" || tree == "maple" ||
tree == "mulberry" || tree == "oak" || tree == "olivetree" || tree == "peatree" || tree == "pine" || tree == "planetree" || tree == "plumtree" ||
tree == "poplar" || tree == " rowan" || tree == "sallow" || tree == "spruce" || tree == "sweetgum" || tree == "walnuttree" || tree == " whitebeam" ||
tree == "willow" || tree == "yew"; // etc
}
Last edited by lacucaracha on Mon May 02, 2016 8:14 am, edited 1 time in total.