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 ➜ VBscript ➜ Setting wildcards and their values?

Setting wildcards and their values?

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


Posted by Xyborg   Canada  (47 posts)  Bio
Date Thu 30 Sep 2004 01:50 PM (UTC)

Amended on Thu 30 Sep 2004 02:15 PM (UTC) by Xyborg

Message
Ok. I'll show the text that I see, and then explain what I mean.

-----------
| |1|2|3|4|5|
|A|7|U|Q|U|9|
|B|7|U|H|M|M|
|C|S|k|o|6|S|
|D|U|N|5|h|X|
|E|X|W|s|5|3|
-----------
Botig says, 'Please say the characters located at A-1, B-4, C-1, D-2 and E-4 back to me.'

Now. I want to store all the values there. Such as:

A-1 = 7
A-2 = U

and so on. But I'm not sure how I'd go about doing that. Then I want to use what Botig says to pick certain variables and then 'say #####' which would be the 5 required variables.

I believe the trigger for each line would look like so

<trigger
enabled="y"
match="^\|A\|(.*?)\|(.*?)\|(.*?)\|(.*?)\|(.*?)\|$"
regexp="y"
send_to="12"
sequence="100"
other_text_colour="black"
other_back_colour="black"
>
<send>SetVariable &quot;A-1&quot;, &quot;%1&quot;
SetVariable &quot;A-2&quot;, &quot;%2&quot;
SetVariable &quot;A-3&quot;, &quot;%3&quot;
SetVariable &quot;A-4&quot;, &quot;%4&quot;
SetVariable &quot;A-5&quot;, &quot;%5&quot;</send>
</trigger>

But how do I take those wildcards and store them?

So yeah... I think I explained it pretty good.

[EDIT] Had the trigger line wrong. Changed it so it's right.
[EDIT] Added the full trigger as how I'd do it.

We offer power to those willing to take it. Sadly, few are unburdened enough by their prejudices to accept.
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #1 on Thu 30 Sep 2004 05:51 PM (UTC)
Message
lol Gar.

Is that finished? :P

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #2 on Thu 30 Sep 2004 06:42 PM (UTC)
Message
You should be able to use this one trigger to match on all five lines. But the one you have should work just as well.

Also, you might think about using an array to story the values. Not that its really important, but it will keep your variables from going crazy.


<triggers>
  <trigger
   enabled="y"
   ignore_case="y"
   match="^|(a|b|c|d|e)\|(\w)\|(\w)\|(\w)\|(\w)\|(\w)\|$"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>setvariable &quot;%1-1&quot;, &quot;%2&quot;
setvariable &quot;%1-2&quot;, &quot;%3&quot;
setvariable &quot;%1-3&quot;, &quot;%4&quot;
setvariable &quot;%1-4&quot;, &quot;%5&quot;
setvariable &quot;%1-5&quot;, &quot;%6&quot;</send>
  </trigger>
</triggers>


Then you'd match this:

^Botig says\, \'Please say the characters located at ([A-E]\-\w)\, ([A-E]\-\w)\, ([A-E]\-\w)\, ([A-E]\-\w) and ([A-E]\-\w) back to me\.\'$


(Are there always five? and is there no comma between 4 and 5?)
Heck... If its always A B C D E then you can simplify it a lot too.
(you could even store each line of five as one variable, and then just split the string, theres a bunch of ways to go about this whole thing)

and then you'd use getvariable "%1" to get the values. Assemble them all into a temporary string, and then send it.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Xyborg   Canada  (47 posts)  Bio
Date Reply #3 on Thu 30 Sep 2004 08:38 PM (UTC)
Message
Yeah. Always 5x5 table. But I'll mess with it later lol.

We offer power to those willing to take it. Sadly, few are unburdened enough by their prejudices to accept.
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.


14,933 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.