<ask type="scriptdictionary">
<item key="key">
msg ("It's a key.")
</item>
<item key="door">
msg ("It's a door.")
</item>
<item key="window">
msg ("It's a window.")
</item>
</ask><ask type="script">
topics = Split ("key;door;window", ";")
show menu ("Ask orc about...", topics, true) {
switch (result) {
case ("key") {
msg ("It's a key.")
}
case ("door") {
msg ("It's a door.")
}
case ("window") {
msg ("It's a window.")
}
}
}
</ask> <command name="ask">
<pattern type="string"><![CDATA[^ask (?<object1>.*) (about) (?<text>.*)$]]></pattern>
<script>
if (object1 = orc and text = "key") {
msg ("It's a key...")
}
if (object1 = orc and text = "door") {
msg ("It's a door...")
}
if (object1 = orc and text = "window") {
msg ("It's a window...")
}
</script>
</command><ask type="script">
topics = Split ("key;door;window", ";")
show menu ("Ask orc about...", topics, true) {
switch (result) {
case ("key") {
msg ("It's a key.")
}
case ("door") {
msg ("It's a door.")
}
case ("window") {
msg ("It's a window.")
}
}
}
</ask> <command name="ask">
<pattern type="string"><![CDATA[^ask (?<object1>.*) (about) (?<text>.*)$]]></pattern>
<script>
if (object1 = orc and text = "key") {
msg ("It's a key...")
}
if (object1 = orc and text = "door") {
msg ("It's a door...")
}
if (object1 = orc and text = "window") {
msg ("It's a window...")
}
</script>
</command>george wrote:From your code, it seems like you've looked at the conversation pages on the wiki...have you found a library that does all this I wonder? I saw a reference to one on the wiki but I'm not sure if it has what you need.
<object name="orc">
<inherit name="editor_object" />
<ask type="scriptdictionary">
<item key="key">
msg ("It's a key")
</item>
<item key="door">
msg ("It's a door")
</item>
<item key="window">
msg ("It's a window")
</item>
</ask>
<displayverbs type="stringlist">
<value>Look at</value>
<value>Take</value>
<value>Ask</value>
</displayverbs>
</object> <command name="AskGeneric">
<pattern type="string"><![CDATA[^ask (?<object>.*)]]></pattern>
<script>
topics = Split ("key;door;window", ";")
show menu ("Ask " + object + " about...", topics, true) {
DoAskTell (object, result, "ask", "askdefault", "DefaultAsk")
}
</script>
</command>