Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Unterminated string constant?

Unterminated string constant?

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Zendu   (66 posts)  Bio
Date Wed 12 May 2004 08:30 AM (UTC)
Message
What does this mean?
the context is "you have 261 gold"
trigger "you have (*.) gold"
send SetVariable "count-gold", CInt (GetVariable ("count-gold)) + %1

God im helpless
Currently using MushClient 3.46 on Win Xp pro on [url=www.aetolia.com]Aetolia[/url]
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #1 on Wed 12 May 2004 08:33 AM (UTC)

Amended on Wed 12 May 2004 08:37 AM (UTC) by Flannel

Message
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.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Zendu   (66 posts)  Bio
Date Reply #2 on Wed 12 May 2004 08:46 AM (UTC)

Amended on Wed 12 May 2004 08:49 AM (UTC) by Zendu

Message
ya it was the " cant belive i missed that

Now it says either Cint shouldnt be there (when removed, it says: invalid use of setvariable.

hrmm i have something very similar working atm, so i must be missing somehting with wildcard...

God im helpless
Currently using MushClient 3.46 on Win Xp pro on [url=www.aetolia.com]Aetolia[/url]
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #3 on Wed 12 May 2004 10:28 PM (UTC)
Message
Where did you put the quote?

As Flannel says, copy and paste the actual trigger - it is very easy to do (one click) then we know what you actually have.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Zendu   (66 posts)  Bio
Date Reply #4 on Thu 13 May 2004 12:20 AM (UTC)
Message
<triggers>
<trigger
enabled="y"
expand_variables="y"
match="^(.*?) myrrh$"
regexp="y"
send_to="12"
sequence="100"
lowercase_wildcard="y"
>
<send>SetVariable &quot;count-myrrh&quot;, CInt (GetVariable (&quot;count-myrrh&quot;)) + %1</send>
</trigger>
</triggers>



Theres the whole thing

God im helpless
Currently using MushClient 3.46 on Win Xp pro on [url=www.aetolia.com]Aetolia[/url]
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #5 on Thu 13 May 2004 06:28 AM (UTC)
Message
OK, your script part is:

SetVariable "count-myrrh", CInt (GetVariable ("count-myrrh")) + %1

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.




- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #6 on Thu 13 May 2004 06:32 AM (UTC)
Message
Also, if you have a prompt or something before the word "myrrh" you will get an error, eg.


<1000/1000 hp 100/100 m 110/110 mv>14 myrrh


This is because %1 will be in this case "<1000/1000 hp 100/100 m 110/110 mv>14".

A better regular expression might be:

match="^(\d+) myrrh$"

The \d+ says one or more digits, whereas what you had (.*) means zero or more of anything.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #7 on Thu 13 May 2004 07:19 AM (UTC)
Message
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)

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


20,249 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.