dartmud improves

Posted by Humiliation on Fri 28 Apr 2006 11:54 PM — 7 posts, 28,737 views.

#0
does anyone know how to make a script that triggers on


* You think your (wildcard) skill has improved. *

and counts every time it happens for each particular skill that comes up?
#1
<triggers>
<trigger
enabled="y"
match="\* You think your (.*) skill has improved\. \*"
regexp="y"
send_to="12"
sequence="100"
>
<send>SetVariable("%1" .. "_skill", (GetVariable("%1" .. "_skill") or 0) + 1)</send>
</trigger>
</triggers>

This should work as long as you set your language to Lua. You'll be able to get the current number from <skill>_skill.

e.g.

* You think your posting skill has improved. *

will set the variable posting_skill to posting_skill + 1, or 1 if it didn't exist already.
#2
when i load the scrip an error comes up saying

[string "Script file"]:1: unexpected symbol near `<'
#3
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=4777

Read this.
#4
now when i improve is says

Send-to-script cannot execute because scripting is not enabled.
#5
You need to open up the scripting window (Shift+Ctrl+6) and enable scripting, and set the language to Lua.

To be honest, you could probably do this without scripting, but I guess I'm a sucker for Lua.
#6
all good. thanks for your help