action applying to one topic

(Tubbadù) #1

Hi everyone! I have wrote this:

playing is an action applying to one topic.
	understand "play [text]" as playing.
	report playing:
		say "You are not very good at this game...";

I need to make him say a different thing only if [text] is “briscola”… how can I do?
thank you in advance! bye!

0 Likes

#2

The easiest way is probably to make “playing briscola” a separate action, triggered by the command “play briscola”. This won’t cause any problems with the compiler.

If you wanted several customized responses, you could use a table like this, adapted from chapter 5.4 of the recipe book:

Playing is an action applying to one topic. Understand "play [text]" as playing.
Report playing: say "You are not very good at this game."

Instead of playing a topic listed in the Table of Playing Responses: say "[response entry][paragraph break]".

Table of Playing Responses
Topic		Response
"Briscola"		"Good job!"
"Pinochle"		"LOL, nope."
"Uno"		"What a numpty!"
0 Likes

(Daniel Stelzer) #3

You could also just use an Instead rule.

Instead of playing "briscola":
0 Likes

(Tubbadù) #4

Yes! Now it works! Thank you both very very much!

0 Likes