Jump to content




question about inputs


  • You cannot reply to this topic
3 replies to this topic

#1 tox662

  • New Members
  • 2 posts

Posted 12 November 2012 - 04:12 PM

I am a beginner and am trying to make a rock paper scissors program to learn and better understand lua and computercraft. I immediately ran into a problem. I want to do it using 4 buttons, a rock, paper, scissors, and start button. I want it to say "press start to begin" and start the game when they press start obviously. But I cant find a way to make my program wait for an input. I tried os.pullEvent(redstone.getInput('input side') == true) but it didn't seem to work. Any help is appreciated, thanks in advance.

#2 Shnupbups

  • Members
  • 596 posts
  • LocationThat place over there. Y'know. The one where I am.

Posted 12 November 2012 - 08:47 PM

In this case, you would type:
if redstone.getInput("side") then
--What you want to do when you get the input
Glad to help,

Shnup :P/>



#3 InputUsername

  • Members
  • 231 posts
  • LocationThe Netherlands

Posted 13 November 2012 - 04:57 AM

I understand that using redstone outside of the computer is easier, so I would also go with Shnup's solution.

But another way is to use the recently added Advanced Computers. They have mouse click support and can also show color.

I don't think that helped but if it did, you're welcome.

#4 tox662

  • New Members
  • 2 posts

Posted 13 November 2012 - 11:37 AM

Thanks, that was a pretty simple solution, hope to increase my lua knowledge from here! :P/>





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users