Your browser lacks required capabilities. Please upgrade it or switch to another to continue.
Loading…
<<silently>>
<<set $startTime to "">>
<<set $stDisplay to "">>
<<set $endTime to "">>
<<set $endDisplay to "">>
<<set $notepad to "">>
<<set $a1 to "correct">>
<<set $a2 to "correct">>
<<set $a3 to "correct">>
<<set $a to "correct">>
<<set $w to 0>>
<<set $wrong = ["Ooooh, sorry, wrong answer. Try again!", "Not quite. Have another go.", "Looks like you'll be stuck here for a while longer.", "Oof. Nope.", "Wrong is not a way out of here.", "Keep trying, eh?", "You must like it here."]>>
<<set $tTime to "">>
<</silently>>
Your team name is $teamname. If you need to correct this, you can [[go back|teams]].
If you're happy with your teamname, click the button below to enter the escape room.
<<button "start">>
<<set $startTime to Date.now()>>
<<set $stDisplay to new Date()>>
<<set $scounter to 0>>
<<set $mcounter to 0>>
<<goto [[Q1]]>>
<</button>>
Question 1:
Image
<<textbox "$q1" "" autofocus>> <<button "SUBMIT">>
<<set $q1 to $q1.trim().toLowerCase().replace(/\s\s+/g, "")>>
/* trim() removes leading and trailing whitespace, toLowerCase() convert to lower case, replace turns multiple spaces between words into single spaces. you may want to omit some or all of these methods. */
<<if $q1 == "">>
<<replace "#textbox-reply">>\
You ain't getting out of here without making some attempt!\
<<timed 3s>><<replace "#textbox-reply">><</replace>><</timed>>\
<</replace>>\
<<elseif $q1 is not $a1 && $w < 2>>\
<<set $w += 1>>\
<<replace "#textbox-reply">>\
<<print either($wrong)>>\
<</replace>>\
<<timed 3s>><<replace "#textbox-reply">><</replace>><</timed>>\
<<elseif $w == 2 && $q1 is not $a1>>\
<<replace "#textbox-reply">>\
<<print either($wrong)>> Would you like a <<link "hint">>
<<script>>
Dialog.setup("Hint", "hint");
Dialog.wiki(Story.get("Hint1").processText());
Dialog.open();
<</script>>
<</link>>?<</replace>>\
<<elseif $q1 == $a1>>
<<set $w to 0>>
<<goto [[Q2]]>>
<</if>>
<</button>>
<span id="textbox-reply"></span>
Full instructions for use of this template are at https://www.evernote.com/shard/s12/sh/f7997cda-436b-d7ec-f40a-5df03b8b7aca/44bb8ce18159e2d23b4dbb4e01e6d1ccQuestion 2:
Image
<<textbox "$q2" "" autofocus>> <<button "SUBMIT">>
<<set $q2 to $q2.trim().toLowerCase().replace(/\s\s+/g, "")>>
/* trim() removes leading and trailing whitespace, toLowerCase() convert to lower case, replace turns multiple spaces between words into single spaces. you may want to omit some or all of these methods. */
<<if $q2 == "">>
<<replace "#textbox-reply">>\
You ain't getting out of here without making some attempt!\
<<timed 3s>><<replace "#textbox-reply">><</replace>><</timed>>\
<</replace>>\
<<elseif $q2 is not $a2 && $w < 2>>\
<<set $w += 1>>\
<<replace "#textbox-reply">>\
<<print either($wrong)>>\
<</replace>>\
<<timed 3s>><<replace "#textbox-reply">><</replace>><</timed>>\
<<elseif $w == 2 && $q2 is not $a2>>\
<<replace "#textbox-reply">>\
<<print either($wrong)>> Would you like a <<link "hint">>
<<script>>
Dialog.setup("Hint", "hint");
Dialog.wiki(Story.get("Hint2").processText());
Dialog.open();
<</script>>
<</link>>?<</replace>>\
<<elseif $q2 == $a2>>
<<set $w to 0>>
<<goto [[Last Q]]>>
<</if>>
<</button>>
<span id="textbox-reply"></span>
Question:
Image
<<textbox "$q" "" autofocus>> <<button "SUBMIT">>
<<set $q to $q.trim().toLowerCase().replace(/\s\s+/g, "")>>
/* trim() removes leading and trailing whitespace, toLowerCase() convert to lower case, replace turns multiple spaces between words into single spaces. you may want to omit some or all of these methods. */
<<if $q == "">>
<<replace "#textbox-reply">>\
You ain't getting out of here without making some attempt!\
<<timed 3s>><<replace "#textbox-reply">><</replace>><</timed>>\
<</replace>>\
<<elseif $q is not $a && $w < 2>>\
<<set $w += 1>>\
<<replace "#textbox-reply">>\
<<print either($wrong)>>\
<</replace>>\
<<timed 3s>><<replace "#textbox-reply">><</replace>><</timed>>\
<<elseif $w == 2 && $q is not $a>>\
<<replace "#textbox-reply">>\
<<print either($wrong)>> Would you like a <<link "hint">>
<<script>>
Dialog.setup("Hint", "hint");
Dialog.wiki(Story.get("HintX").processText());
Dialog.open();
<</script>>
<</link>>?<</replace>>\
<<elseif $q == $a>>
<<set $endTime to Date.now()>>
<<set $enDisplay to new Date()>>
<<set $seconds = 1000>>
<<set $minutes = 1000 * 60>>
<<set $timeMs = $endTime - $startTime>>
<<set $timeMin = $timeMs / $minutes>>
<<set $min = Math.trunc($timeMin)>>
<<set $s = $timeMin - $min>>
<<set $sec = $s * 60>>
<<set $tTime = (($endTime-$startTime)/1000)/86400>>
<<goto [[results]]>>
<</if>>
<</button>>
<span id="textbox-reply"></span>
<<silently>>
/* Put this code in a Twine passage designed for the purpose of sending data
This will call the jQuery $.ajax() function to send the data to the Google Sheet. If no errors have occurred, the new value will appear in the sheet within seconds of the call.
The Passage: should be near the end, or at least a passage that appears after all variables have been set. It needs to be one that “completes” the playthrough - putting the code on Ending1 if they get to Ending3 won’t record the data.
*/
<<script>>
var sendData = JSON.stringify({
"Team": state.active.variables.teamname,
"Minutes": state.active.variables.min,
"Seconds": state.active.variables.sec,
"Start Time": state.active.variables.startTime,
"End Time": state.active.variables.endTime,
"Start Display": state.active.variables.stDisplay,
"End Display": state.active.variables.enDisplay,
"Total Time": state.active.variables.tTime
});
$.ajax({
url:"https://script.google.com/macros/s/AKfycbzmqjIHR3ZvanukxaMw57smKZidM-0rnDVYLnLcXQ/exec",
method:"POST",
dataType: "json",
data: sendData
}).done(function() {});
<</script>>
<</silently>>\
<<if $mcounter < 45>>
You made it out in $min minutes and $sec second<<if $sec != 1>>s<</if>>!
Your start time: $stDisplay
Your end time: $enDisplay
<<else>>
Aw, bummer, you didn't make it out. I suppose you'll just have to live in the holiday grotto forever, or at least until next year. Been nice knowing you!
<</if>>
[[leader]] <<if not tags().includes("nofooter")>>\
<div class="ctr"><div class="center">Use the area below for notes:
<<textarea "$notepad" "">></div></div>\
<</if>>
<<if not tags().includes("noheader")>>\
<div class="flex-container"><div class="name">Team: $teamname</div><div class="clock"><span id="minutes">00</span>:<span id="seconds">00</span></div></div><hr>
<<silently>>
<<repeat 1s>>
<<if $mcounter < 45>>
<<set $scounter += 1>>
<<if $scounter >= 0 && $scounter <= 9>>
<<replace "#seconds">>0$scounter<</replace>>
<<elseif $scounter >=10 && $scounter <= 59>>
<<replace "#seconds">>$scounter<</replace>>
<<elseif $scounter == 60>>
<<set $scounter to 0>>
<<set $mcounter += 1>>
<<replace "#seconds">>00<</replace>>
<<if $mcounter >= 0 && $mcounter <= 9>>
<<replace "#minutes">>0$mcounter<</replace>>
<<elseif $mcounter >=10 && $mcounter <= 45>>
<<replace "#minutes">>$mcounter<</replace>>
<<elseif $mcounter == 45>>
<<set $tTime = 2700>>
<<goto [[results]]>>
<</if>>
<</if>>
<<else>>
<<stop>>
<</if>>
<</repeat>>
<</silently>>
<</if>><h1>Title</h1>
Written by
Designed by Lyle Skains
<div class="board">Leaderboard</div>
<span id="print">Updating leaderboard...</span>
<<repeat .5s>>
<<set $leader = $board>>
<<script>>$().sheetrock({
url: 'https://docs.google.com/spreadsheets/d/1rDIg3oK_CNDh3gWHPLXsz7JtTf3gE3nbANY2LRdi9GQ/edit#gid=1208363435',
callback: function (error, options, response) {
State.variables.leader = response.html;
},
query: "select A,B,C"
})
<</script>>
<<if $leader != null>>
<<stop>>
<</if>>
<</repeat>>
<<repeat .5s>>
<<if $leader.includes($teamname)>>
<<replace "#print">><table id="leader" class="ctr"><tr><th>Rank</th><th>Team</th><th>Time</th></tr>$leader</table>
<</replace>>
<<stop>>
<</if>>
<</repeat>><<silently>><<set $teamname to "">><</silently>>\
If you already registered your team, select your team name from this list.
Team name
<<listbox "$regname">>
<<optionsfrom $txt>>
<</listbox>> <<button "Submit">>
<<if $lead.includes($regname)>>
<<replace "#text">>\
Haven't you already come through the room? If you're going to cheat, at least make up a new team name!\
<</replace>>
<<else>>
<<set $teamname to $regname>><<goto [[ready]]>><</if>><</button>>
<span id="text"></span>
If you did not pre-register, enter your team name here.
<<textbox "$teamname" "" autofocus>> <<button "Submit">>
<<if $teamname == "">>
<<replace "#textbox-reply">>\
Please enter a teamname.\
<</replace>>
<<elseif $register.includes($teamname)>>
<<replace "#textbox-reply">>\
That name is taken. Please try again. If you already signed your team up with that name, select from the drop-down above.\
<</replace>>
<<else>>
<<goto [[ready]]>>
<</if>>
<</button>>
<span id="textbox-reply"></span>Hinty mchintsalotoodles of hintshint hint hint<<silently>>
<<set $today to Date.now()>>
<<set $ms to new Date(2020, 11, 2, 12, 0, 0)>>
<<set $gamest to $ms.getTime()>>
<<set $tname to "">>
<</silently>>\
<h1>Title</h1>
Written by
Designed by Lyle Skains
<<if $today < $gamest>>
Sign up as a <<link "team">><<replace "#signup">>\
<table>\
<tr><td>Enter Team Name:</td><td><<textbox "$tname" "" autofocus>></td></tr>
<tr><td>Team Leader:</td><td><<textbox "$tleader" "">></td></tr>
<tr><td>Team Member 2:</td><td><<textbox "$tm2" "">></td></tr>
<tr><td>Team Member 3:</td><td><<textbox "$tm3" "">></td></tr>
<tr><td>Team Member 4:</td><td><<textbox "$tm4" "">></td></tr>
</table>
<<button "Team Sign Up">>
<<if $tname is "">>
<<replace "#notempty">>You kinda have to at least enter a name.\ <</replace>>
<<elseif $register.includes($tname)>>
<<replace "#notempty">>That name is already taken. Check the list below to see if you're already registered, or choose a new name.\
<</replace>>
<<else>>
<<script>>
var sendData = JSON.stringify({
"Name": state.active.variables.tname,
"Team Leader": state.active.variables.tleader,
"Team Member 2": state.active.variables.tm2,
"Team Member 3": state.active.variables.tm3,
"Team Member 4": state.active.variables.tm4
});
$.ajax({
url:"https://script.google.com/macros/s/AKfycbzmqjIHR3ZvanukxaMw57smKZidM-0rnDVYLnLcXQ/exec",
method:"POST",
dataType: "json",
data: sendData
}).done(function() {});
<</script>>
<<replace "#notempty">>Woohoo! $tname is entered in the FMC holiday escape room. Come back here on 2 December to play. Refresh the page to see the updated register.<</replace>>
<<set $tname to "">>
<</if>>
<</button>>
<span id="notempty"></span>\
<</replace>><</link>> or an <<link "individual">><<replace "#signup">>\
Your name: <<textbox "$indname" "" autofocus>> <<button "Sign Up">>
<<if $indname is "">>
<<replace "#notempty">>You kinda have to at least enter a name.\ <</replace>>
<<else>>
<<script>>
var sendData = JSON.stringify({
"Individual": state.active.variables.indname
});
$.ajax({
url:"https://script.google.com/macros/s/AKfycbzmqjIHR3ZvanukxaMw57smKZidM-0rnDVYLnLcXQ/exec",
method:"POST",
dataType: "json",
data: sendData
}).done(function() {});
<</script>>
<<replace "#notempty">>Woohoo! You are entered in the FMC holiday escape room. Come back here on 2 December to play. Refresh the page to see the updated register.<</replace>>
<<set $indname to "">>
<</if>>
<</button>>
<span id="notempty"></span>\
<</replace>><</link>> (we'll group individuals into teams).
<span id="signup"></span>
<div class="board">Registered Teams</div>
<span id="teamboard">Updating list...</span>
<<silently>>
<<repeat .5s>>
<<if $register != undefined>>
<<replace "#teamboard">><table id="leader" class="ctr"><tr><th>Team</th><th>Team Leader</th><th>Team Member 2</th><th>Team Member 3</th><th>Team Member 4</th></tr>$register</table>
<</replace>>
<<set $reg to $register>>
<<stop>>
<</if>>
<</repeat>>
<</silently>>
<div class="board">Registered Individuals</div>
<span id="indboard">Updating list...</span>
<<silently>>
<<repeat .5s>>
<<if $inds != undefined>>
<<replace "#indboard">><table id="inds" class="ctr">$inds</table>
<</replace>>
<<set $ind to $inds>>
<<stop>>
<</if>>
<</repeat>>
<</silently>>
<<else>>
[[Enter Escape Room|teams]]
<div class="board">Leaderboard</div>
<span id="leaderboard">Updating Leaderboard...</span>
<<silently>>
<<repeat .5s>>
<<if $board != undefined>>
<<replace "#leaderboard">><table id="leader" class="ctr"><tr><th>Rank</th><th>Team</th><th>Time</th></tr>$board</table>
<</replace>>
<<set $lead to $board>>
<<stop>>
<</if>>
<</repeat>>
<</silently>>
<</if>>