What does this mean?
the context is "you have 261 gold"
trigger "you have (*.) gold"
send SetVariable "count-gold", CInt (GetVariable ("count-gold)) + %1
try adding the second " after the "count-gold"))
erm, so,
SetVariable "count-gold", CInt (GetVariable ("count-gold")) + %1
At least, thats what I think youre asking. Honestly, with that many words, Ive no idea.
Oh, and your regexp should be .* not *.
Im assuming that is just a typo, which is why its usually more reliable (so we know if the typo is in your trigger, or just in the translating to forum) to just copy/paste the trigger.
Now if the variable "count-myrrh" does not exist VBscript complains that you are trying to do a CInt on a "null" variable. Just make sure the variable exists first (eg. set to 0) or have a test like:
if not isnull (GetVariable ("count_myrrh")) then
SetVariable "count_myrrh", CInt (GetVariable ("count_myrrh")) + %1
end if
Note also that the variable "count-myrrh" will *never* exist, because MUSHclient variables cannot have hyphens in them. You want something like "count_myrrh" which I used in the code above when I was testing it.
Actually, a better regexp would be (\d+) myrhh
no ^ since it would prohibit matching on lines with prompts.
This way having
<[prompt]> 33 myrhh
will still match, unless you dont want it. And if you want it anchored to the end of the line $ afterwards.
(actually, I agree, it would be smart to anchor it, since otherwise it will match on people talking about on it. So, while this will match on more things, it will match on too many, Im only posting, to bring up the anchors, you can edit if needed, to suit your needs)