Setting wildcards and their values?

Posted by Xyborg on Thu 30 Sep 2004 01:50 PM — 4 posts, 15,707 views.

Canada #0
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.
Amended on Thu 30 Sep 2004 02:15 PM by Xyborg
USA #1
lol Gar.

Is that finished? :P
USA #2
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.
Canada #3
Yeah. Always 5x5 table. But I'll mess with it later lol.