<triggers>
<trigger
match="this is a line"
enabled="y"
regexp="n"
send_to="12"
sequence="100"
>
<send>
Send("say this is a test")
</send>
</trigger>
</triggers>
That's your fairly basic TRIGGER trigger. If you wanted to match a line within a script, you could always do something like string.find(), string.match(), string.sub(), etc.
One such script that I just wrote is as follows:
location = "rep12089176"
items = {
id = "12098735",
name = "Item Name"
}
if string.match(location,"rep",1) ~= nil then
Note("Received container contents!!")
Note("Container number: " .. string.sub(location,4))
for k, v in pairs(items) do
Note(v)
end -- for
end -- if
The string.match(location,"rep",1) returns a numerical position of the first occurrence of the search string "rep" if it exists anywhere in the "location" variable.
The string.sub(location,4) returns the substring in the "location" variable from position 4 onward -> "12089176".
So you COULD do something like string.sub(location,string.match(location,"rep",1))
So in plain English, location is a string variable. Items is a table with two string variables.
If location has the word "rep" anywhere within it, then print the string from the position where "rep" ends onward to the end. Then for every variable in the items table, print the value of it. But only do this if "rep" exists in the location string.