hmm just wondering

Posted by Metsuro on Tue 18 May 2004 09:55 PM — 7 posts, 23,904 views.

USA #0
is it possible to get two triggers one to store a variable and one to check a variable in the trigger match like

so and so says targert 190 (190 gets saved as a variable)

and then

ship 190 (9, 9, 9, 9) (190 is the thing i want to get and the numbers in the () i want to get set as another variable with or without the "," but with the spaces
Greece #1
Yes, make the second trigger match on "ship @number (*, *, *, *)"
USA #2
Ok this might sound stupid but how would i set the trigger to set the variables heh, this is only one variable i might add
Greece #3
make it match on "* says ship *" and select Send to: Scripting and write in the send to field:
SetVariable "number", "%2"
Australia Forum Administrator #4
Or, just have:

Match: * says ship *
Send: %2
Send to: variable
Variable: number
USA #5
i get an error

ship @Ship (s) at (*)
------------------^

nothing to repeat
Australia Forum Administrator #6
That means you have "regular expression" checked, however that is not a valid regular expression.

Either don't use regular expressions, eg.

ship @Ship (*, *, *, *)

or, use regular expressions properly, say:

^ship \@Ship \((\d+), (\d+), (\d+), (\d+)\)$

The \d says "digit" followed by "+" means "one or more of the previous thing" (ie. the digit). This would match on:

ship 190 (1, 2, 3, 4)

... assuming that @ship had "190" in it.