Page 1 of 1

Password door problems [split from old topic]

Posted: Wed Oct 18, 2017 10:57 am
by Jb_007
i am creating a password door but only one input 1 character at a time
create a room, create 3 switches and execute code with 1 switch eg switch 1 script 1 etc
#include "zcommon.acs"
str alpha[26]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
str store;
str getinput;
str chk="c";
int count=-1;
function void showalpha(void)
{
count++;
getinput=alpha[count];
print(s:getinput);
}
function void stor(void)
{
store=getinput;
print(s:store);
}
function void ck(void)
{
if (chk==store) {
print(s:"Welcome!!");
}else{
print(s:"invalid password!!");
}
}
script 1 (void) {
showalpha();
}
script 2 (void)
{
stor();
}
script 3 (void)
{
ck();
}