[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  VBscript
. . -> [Subject]  Variables...

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Variables...

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Hoss   USA  (48 posts)  [Biography] bio
Date Wed 30 Mar 2005 01:32 AM (UTC)  quote  ]
Message
Alright I'm trying to match on:

Wood 8 gp 0 30 gp

so I created a trigger which is:

Wood * * gp * * gp

Which should then:

world.setvariable "woodprice", "%2"

But the problem is that my variable ends up getting:

8

Which I'm trying to do is match on the 8 but I don't want all the spaces... Any ideas?

Thanks

Hoss
[Go to top] top

Posted by Hoss   USA  (48 posts)  [Biography] bio
Date Reply #1 on Wed 30 Mar 2005 01:35 AM (UTC)  quote  ]
Message
Sorry aperently the spaces didn't show but in the line with:
Wood 8 gp 0 30 gp

There is 5+ spaces bewteen every part except the gp after the numbers..

Hope that helps

Hoss
[Go to top] top

Posted by Hoss   USA  (48 posts)  [Biography] bio
Date Reply #2 on Wed 30 Mar 2005 01:38 AM (UTC)  quote  ]
Message
Sorry again but the Variable I get has a bunch of spaces before the 8

Thanks Again
Hoss
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #3 on Wed 30 Mar 2005 04:22 AM (UTC)  quote  ]

Amended on Wed 30 Mar 2005 04:23 AM (UTC) by Flannel

Message
You can use code tags [code] and [/code] to retain spacing. (And you can edit posts, instead of having to post a bunch of new ones).

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Hoss   USA  (48 posts)  [Biography] bio
Date Reply #4 on Wed 30 Mar 2005 04:29 AM (UTC)  quote  ]
Message
Hmm I must have missed that then... So how do you edit post?

Alright here's what I'm trying to match on:

Wood                      50 gp            1035          100 gp


so I have been using a trigger which was:

Wood * * gp * * * * gp

I was hoping that it would match the spacing and such... but it hasn't been any ideas on how to match that piece of code?

Hoss
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #5 on Wed 30 Mar 2005 04:38 AM (UTC)  quote  ]
Message
Use Regular expressions.

And to edit a post, log in and click the edit button on the post (next to delete, which is next to the time). You need to be logged in (which also means you don't have to enter your name/password each time you want to post). You log in in the upper right corner.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #6 on Wed 30 Mar 2005 04:40 AM (UTC)  quote  ]
Message
Oh yeah, and the trigger:

^Wood[ ]+(\d+) gp[ ]+(\d+)[ ]+(\d+) gp$
(remember to check the "regular expression" box)
should match (you might need to have a space infront of wood or behind the last gp.

This will make %1 the first number, %2 the second, and %3 the third.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Hoss   USA  (48 posts)  [Biography] bio
Date Reply #7 on Wed 30 Mar 2005 01:56 PM (UTC)  quote  ]
Message
Thank you Flannel! That's exactly what I needed THANK YOU!


Hoss
[Go to top] 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.


1,601 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]