Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- integer cooldown = 60;
- integer tries = 3;
- /////Riddles//////
- list clues = [
- "You sit on it, but you can't take it with you...",
- "What has a single eye but cannot see?",
- "When I'm born, I stay in the sun A little time, and I make crazy When I'm old, I'm worth a fortune, What am I?",
- "The more it dries, the wetter it becomes.",
- "I cannot hear or even see, but sense light and sounds there may be. Sometimes I end up on the hook, or even deep into a book. What Am I?",
- "When you do not know what I am, then I am something. But when you know what I am, then I am nothing. What am I?"];
- /////Answers//////
- list answers = [
- "chair",
- "needle",
- "wine",
- "towel",
- "worm",
- "riddle"];
- ///////////
- integer index;
- integer len;
- integer reply;
- string answer;
- integer i;
- integer j;
- default
- {
- state_entry()
- {
- llSetText("Hack Me!",<1,1,1>,1);
- len = llGetListLength(clues);
- }
- touch_start(integer total_number)
- {
- index = llFloor(llFrand(len));
- llSay(0, llList2String(clues, index));
- answer = llList2String(answers, index);
- state input;
- }
- }
- state input {
- state_entry(){
- reply = llListen(0,"","","");
- llSetTimerEvent(60);
- }
- listen(integer channel, string name, key id, string msg)
- {
- integer index = llSubStringIndex(msg,answer);
- if(index == -1){
- llSay(0,"Incorrect. "+(string)(tries - i)+" tries left.");
- if (i < (tries-1)){
- i++;
- }else{
- state locked;
- }
- }else{
- llSay(0,"Correct!");
- state default;
- }
- }
- state_exit(){
- llListenRemove(reply);
- i = 0;
- }
- }
- state locked {
- state_entry(){
- llSetTimerEvent(1.0);
- }
- timer(){
- llSetText("Locked for:" + (string)(cooldown-j) + " Seconds.",<1,0,0>,1);
- if (cooldown > j){
- j++;
- }else{
- state default;
- }
- }
- state_exit(){
- j = 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement