I am trying to get a handle on how the scripting features of MUSHclient work and need some help.
What I want to do is this: whenever I look around I want to capture the available exits via a trigger. I think want to enumerate through those triggers with a script and print each of them to my screen (but not to the world).
Here is what I have:
Trigger:
<triggers>
<trigger
enabled="y"
group="Exits"
match="(!?exits).*(north|south|east|west)"
match_text_colour="y"
name="test_trigger"
regexp="y"
script="print_exits"
send_to="12"
sequence="100"
text_colour="10"
>
<send>"%0"</send>
</trigger>
</triggers>
Script:
function print_exits(name, line, wildcards)
print("You can go %wildcards[1]")
end
I've tried tweaking this in several ways, and I always receive an error message similar to this:
Compile error
World: Discworld
Immediate execution
[string "Trigger: test_trigger"]:1: unexpected symbol near '"exits: west and north"'
You can move: %wildcards[0]
Can someone please help?
What I want to do is this: whenever I look around I want to capture the available exits via a trigger. I think want to enumerate through those triggers with a script and print each of them to my screen (but not to the world).
Here is what I have:
Trigger:
<triggers>
<trigger
enabled="y"
group="Exits"
match="(!?exits).*(north|south|east|west)"
match_text_colour="y"
name="test_trigger"
regexp="y"
script="print_exits"
send_to="12"
sequence="100"
text_colour="10"
>
<send>"%0"</send>
</trigger>
</triggers>
Script:
function print_exits(name, line, wildcards)
print("You can go %wildcards[1]")
end
I've tried tweaking this in several ways, and I always receive an error message similar to this:
Compile error
World: Discworld
Immediate execution
[string "Trigger: test_trigger"]:1: unexpected symbol near '"exits: west and north"'
You can move: %wildcards[0]
Can someone please help?