… | |
… | |
182 | See C<@ifstate> for an example. |
182 | See C<@ifstate> for an example. |
183 | |
183 | |
184 | =item @ifstate state value |
184 | =item @ifstate state value |
185 | |
185 | |
186 | Requires that the named C<state> has the given C<value>, otherwise this |
186 | Requires that the named C<state> has the given C<value>, otherwise this |
187 | topic is skipped. For more complex comparisons, see C<@cond> with |
187 | topic is skipped. For more complex comparisons, see C<@cond> with |
188 | C<$state>. Example: |
188 | C<$state>. Example: |
189 | |
189 | |
190 | @match quest |
190 | @match quest |
191 | @setstate question quest |
191 | @setstate question quest |
192 | Do you really want to help find the magic amulet of Beeblebrox? |
192 | Do you really want to help find the magic amulet of Beeblebrox? |
… | |
… | |
357 | : $flag->{$name} |
357 | : $flag->{$name} |
358 | or next topic; |
358 | or next topic; |
359 | |
359 | |
360 | } elsif ($cmd eq "ifstate") { |
360 | } elsif ($cmd eq "ifstate") { |
361 | my ($name, $value) = split /\s+/, $args, 2; |
361 | my ($name, $value) = split /\s+/, $args, 2; |
362 | $state->{$name} eq $value |
362 | defined $value ? $state->{$name} eq $value |
|
|
363 | : $state->{$name} |
363 | or next topic; |
364 | or next topic; |
364 | |
365 | |
365 | } elsif ($cmd eq "trigger") { |
366 | } elsif ($cmd eq "trigger") { |
366 | my ($con, $state) = split /\s+/, $args, 2; |
367 | my ($con, $state) = split /\s+/, $args, 2; |
367 | |
368 | |