[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Plugins
. . -> [Subject]  Trigger help

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Trigger help

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Talahari   (1 post)  [Biography] 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?
[Go to top] top

Posted by Shaun Biggs   USA  (644 posts)  [Biography] 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.
[Go to top] top

Posted by Nick Gammon   Australia  (18,800 posts)  [Biography] 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
[Go to top] 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]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]