Posted 20 July 2014 - 01:36 PM
Hi everyone
I'm relatively new to Computercraft, but I already understand the basics of this mod and of lua. I'm playing on version 1.57 of Computercraft on the Direwolf20 Pack.
I'm currently working on a password program with a numpad on a monitor. I'm using Direwolf20s button API (pastebin: HRbMF1Eg).
I created a numpad from 0-9 with buttons and want to get a 4-Digit password out of it. I also have a "Reset" and a "Enter" button. Right now I'm doing it very complicated with a lot of code:
I need to do this for every button, so 10 times. Is there an easier way to do this?
This is the pastebin for my not yet finished program: t8jc4KTx
If you want to look at it, you need to use it on a 2x3 advanced monitor on TOP of the computer. Also download the button API and name it button
Thanks a lot :)/>
mist3r_m0nk3y
I'm relatively new to Computercraft, but I already understand the basics of this mod and of lua. I'm playing on version 1.57 of Computercraft on the Direwolf20 Pack.
I'm currently working on a password program with a numpad on a monitor. I'm using Direwolf20s button API (pastebin: HRbMF1Eg).
I created a numpad from 0-9 with buttons and want to get a 4-Digit password out of it. I also have a "Reset" and a "Enter" button. Right now I'm doing it very complicated with a lot of code:
function button1()
if step == 1 then
click1 = 1
elseif step == 2 then
click2 = 1
elseif step == 3 then
click 3 = 1
elseif step == 4 then
click4 = 1
end
step = step + 1
end
I need to do this for every button, so 10 times. Is there an easier way to do this?
This is the pastebin for my not yet finished program: t8jc4KTx
If you want to look at it, you need to use it on a 2x3 advanced monitor on TOP of the computer. Also download the button API and name it button
Thanks a lot :)/>
mist3r_m0nk3y