Reply to this subject
Start a new subject
 
Refresh page
| Posted by |
Talahari
(1 post) bio
|
| Date |
Wed 11 Apr 2007 12:29 AM (UTC) [ quote
] |
| Message |
Alright, Im still learning this whole scriptoing trigger thing...could one of you really smart guys tell me how I need to do this simple task. I am writing a trigger simaler to
You say, test *
then I wish it to print %1 + 1 so when i say "test 1" itll print "test 2".
any ideas? | top |
|
| Posted by |
Shaun Biggs
USA (644 posts) bio
|
| Date |
Reply #1 on Wed 11 Apr 2007 01:04 AM (UTC) [ quote
] Amended on Wed 11 Apr 2007 01:05 AM (UTC) by Shaun Biggs
|
| Message |
If you are using Lua, then it would be this:
<triggers>
<trigger
enabled="y"
match="You say, test *"
send_to="12"
sequence="350"
>
<send>print( "test "..tonumber(%1)+1 )
</send>
</trigger>
</triggers>
I also note that there are no quotes around test 1 in your example. You might have to put them in so the match would be something more similar to:
match="You say, 'test *'" |
It is much easier to fight for one's ideals than to live up to them. | top |
|
| Posted by |
Nick Gammon
Australia (18,800 posts) bio
Forum Administrator |
| Date |
Reply #2 on Wed 11 Apr 2007 03:09 AM (UTC) [ quote
] |
| Message |
In "send to script" the substitution is done literally, so this would also work:
<triggers>
<trigger
enabled="y"
match="You say, test *"
send_to="12"
sequence="350"
>
<send>print( "test ", %1 + 1 )
</send>
</trigger>
</triggers>
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | 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,580 views.
Reply to this subject
Start a new subject
 
Refresh page
top
Comments to:
Gammon Software support
Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )