<!--Saved by Quest 5.6.5621.18142-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Journal">
<gameid>31c8b0d3-5c93-4b12-ae5c-b6a599c6e852</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
<object name="journal">
<inherit name="editor_object" />
<inherit name="openable" />
<alias>journal</alias>
<look>This is a 3" x 5" notebook with metal covers. The pages are a strange pliable substance which cannot be torn. You could 'note' things in it.</look>
<note type="script">
// this is a comment
get input {
msg ("This is the result: " + result)
}
</note>
<alt type="stringlist">
<value>notebook</value>
</alt>
<take />
<pages type="stringlist" />
<currentpage type="int">-1</currentpage>
<feature_container />
<read type="script"><![CDATA[
if (journal.isopen) {
journal.currentpage = journal.currentpage + 1
if (journal.currentpage > ListCount(journal.pages) - 1) {
journal.currentpage = 0
}
if (journal.currentpage <= ListCount(journal.pages) - 1) {
msg (StringListItem(journal.pages, journal.currentpage))
}
else {
msg ("There are no notes in the journal.")
}
}
else {
msg ("The journal is closed.")
}
]]></read>
<openscript type="script">
journal.currentpage = -1
HelperOpenObject (journal)
msg ("You open it.")
</openscript>
</object>
<object name="pencil">
<inherit name="editor_object" />
<alias>pencil</alias>
<take />
</object>
</object>
<command name="note">
<pattern>note</pattern>
<script>
if (Got(journal)) {
if (Got(pencil)) {
if (journal.isopen) {
msg ("Enter your note")
get input {
list add (journal.pages, result)
}
}
else {
msg ("The journal is closed.")
}
}
else {
msg ("You need something to write with.")
}
}
else {
msg ("I don't understand your command.")
}
</script>
</command>
</asl>
<!--Saved by Quest 5.6.5621.18142-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Journal">
<gameid>31c8b0d3-5c93-4b12-ae5c-b6a599c6e852</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>
<start type="script">
firsttime {
for (i, 1, 32, 1) {
dictionary add (journal.pages2, "Page " + i, "")
}
}
</start>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
<object name="journal">
<inherit name="editor_object" />
<inherit name="openable" />
<alias>journal</alias>
<look>This is a 3" x 5" notebook with metal covers. The 32 pages are a strange pliable substance which cannot be torn. It looks like you could turn the journal to page #, and you could 'note' things in it.</look>
<alt type="stringlist">
<value>notebook</value>
</alt>
<take />
<currentpage type="int">1</currentpage>
<feature_container />
<read type="script">
if (journal.isopen) {
msg ("Page " + journal.currentpage)
msg (StringDictionaryItem(journal.pages2, "Page " + journal.currentpage))
}
else {
msg ("The journal is closed.")
}
</read>
<openscript type="script">
journal.currentpage = 1
HelperOpenObject (journal)
msg ("You open it.")
</openscript>
<pages2 type="stringdictionary" />
<erase type="script"><![CDATA[
blah = 1
if (Got(pencil)) {
blah = blah + 2
}
if (journal.isopen) {
blah = blah + 4
}
switch (blah) {
case (1, 5) {
msg ("You need something to erase with.")
}
case (3) {
msg ("The journal is closed.")
}
case (7) {
newtextlist = Split(StringDictionaryItem(journal.pages2, "Page " + journal.currentpage), "<br>")
list remove (newtextlist, StringListItem (newtextlist, ListCount(newtextlist) - 1))
if (ListCount(newtextlist) > 0) {
newtext = Join (newtextlist, "<br>")
}
else {
newtext = ""
}
dictionary remove (journal.pages2, "Page " + journal.currentpage)
dictionary add (journal.pages2, "Page " + journal.currentpage, newtext)
msg ("OK")
}
}
]]></erase>
</object>
<object name="pencil">
<inherit name="editor_object" />
<alias>pencil</alias>
<take />
<look>This is a sharp #2 pencil with an eraser.</look>
</object>
</object>
<command name="note">
<pattern>note</pattern>
<script><![CDATA[
blah = 0
if (Got(journal)) {
blah = 1
}
if (Got(pencil)) {
blah = blah + 2
}
if (journal.isopen) {
blah = blah + 4
}
switch (blah) {
case (0, 4) {
msg ("I don't understand your command.")
}
case (1, 5) {
msg ("You need something to write with.")
}
case (2, 6) {
msg ("You need something to write on.")
}
case (3) {
msg ("The journal is closed.")
}
case (7) {
msg ("Enter your note.")
get input {
newtext = StringDictionaryItem(journal.pages2, "Page " + journal.currentpage) + "<br>" + result
dictionary remove (journal.pages2, "Page " + journal.currentpage)
dictionary add (journal.pages2, "Page " + journal.currentpage, newtext)
msg ("OK")
}
}
}
]]></script>
</command>
<command name="turnjournalpage">
<pattern>turn journal to page #textpage#</pattern>
<script><![CDATA[
if (Got(journal)) {
blah = toint(textpage)
if (blah > 0 and blah < 33) {
HelperOpenObject (journal)
journal.currentpage = toint(textpage)
msg ("You turn to page " + (blah))
}
else {
msg ("There is no page " + blah)
}
}
else {
msg ("I don't understand your command.")
}
]]></script>
</command>
<verb>
<property>erase</property>
<pattern>erase</pattern>
<defaultexpression>"You can't erase " + object.article + "."</defaultexpression>
</verb>
</asl>
msg ("Enter your note.")
get input {
journal.text = journal.text + "<br>" + result
}
msg ("OK")
msg (journal.text)
<!--Saved by Quest 5.6.5621.18142-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Journal">
<gameid>31c8b0d3-5c93-4b12-ae5c-b6a599c6e852</gameid>
<version>1.1</version>
<firstpublished>2015</firstpublished>
<start type="script">
firsttime {
for (i, 1, 32, 1) {
dictionary add (journal.pages, "Page " + i, "")
}
}
</start>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
<object name="journal">
<inherit name="editor_object" />
<inherit name="openable" />
<alias>journal</alias>
<look>This is a 3" x 5" notebook with metal covers. The 32 pages are a strange pliable substance which cannot be torn. It looks like you could turn the journal to page #, and you could 'note' things in it.</look>
<alt type="stringlist">
<value>notebook</value>
</alt>
<take />
<currentpage type="int">1</currentpage>
<feature_container />
<pages type="stringdictionary" />
<read type="script">
if (journal.isopen) {
msg ("Page " + journal.currentpage)
msg (StringDictionaryItem(journal.pages, "Page " + journal.currentpage))
}
else {
msg ("The journal is closed.")
}
</read>
<openscript type="script">
journal.currentpage = 1
HelperOpenObject (journal)
msg ("You open it.")
</openscript>
<erase type="script"><![CDATA[
blah = 1
if (Got(pencil)) {
blah = blah + 2
}
if (journal.isopen) {
blah = blah + 4
}
switch (blah) {
case (1, 5) {
msg ("You need something to erase with.")
}
case (3) {
msg ("The journal is closed.")
}
case (7) {
newtextlist = Split(StringDictionaryItem(journal.pages, "Page " + journal.currentpage), "<br>")
list remove (newtextlist, StringListItem (newtextlist, ListCount(newtextlist) - 1))
if (ListCount(newtextlist) > 0) {
newtext = Join (newtextlist, "<br>")
}
else {
newtext = ""
}
dictionary remove (journal.pages, "Page " + journal.currentpage)
dictionary add (journal.pages, "Page " + journal.currentpage, newtext)
msg ("OK")
}
}
]]></erase>
</object>
<object name="pencil">
<inherit name="editor_object" />
<alias>pencil</alias>
<take />
<look>This is a sharp #2 pencil with an eraser.</look>
</object>
</object>
<command name="note">
<pattern>note</pattern>
<script><![CDATA[
blah = 0
if (Got(journal)) {
blah = 1
}
if (Got(pencil)) {
blah = blah + 2
}
if (journal.isopen) {
blah = blah + 4
}
switch (blah) {
case (0, 4) {
msg ("I don't understand your command.")
}
case (1, 5) {
msg ("You need something to write with.")
}
case (2, 6) {
msg ("You need something to write on.")
}
case (3) {
msg ("The journal is closed.")
}
case (7) {
msg ("Enter your note.")
get input {
newtext = StringDictionaryItem(journal.pages, "Page " + journal.currentpage) + "<br>" + result
dictionary remove (journal.pages, "Page " + journal.currentpage)
dictionary add (journal.pages, "Page " + journal.currentpage, newtext)
msg ("OK")
}
}
}
]]></script>
</command>
<command name="turnjournalpage">
<pattern type="string"><![CDATA[^turn (the journal |journal )?to page (?<text>\d+)$|^turn (the |a )?(?<text>page)$|^turn (the page |a page |page )?(?<text>back)$]]></pattern>
<script><![CDATA[
switch (true) {
case (IsInt (text)) {
blah = toint(text)
if (blah > 0 and blah < 33) {
HelperOpenObject (journal)
journal.currentpage = blah
msg ("You turn to page " + blah)
}
else {
msg ("There is no page " + blah)
}
}
case (text = "page") {
if (journal.isopen) {
journal.currentpage = journal.currentpage + 1
if (journal.currentpage = 33) {
journal.currentpage = 1
}
msg ("You turn to page " + journal.currentpage)
}
else {
msg ("The journal is closed.")
}
}
case (text = "back") {
if (journal.isopen) {
journal.currentpage = journal.currentpage - 1
if (journal.currentpage = 0) {
journal.currentpage = 32
}
msg ("You turn to page " + journal.currentpage)
}
else {
msg ("The journal is closed.")
}
}
default {
msg ("I don't understand your command.")
}
}
]]></script>
</command>
<verb>
<property>erase</property>
<pattern>erase</pattern>
<defaultexpression>"You can't erase " + object.article + "."</defaultexpression>
</verb>
</asl>