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

Gammon Forum

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

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Random outputs
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Random outputs

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Absolute Zero   (3 posts)  [Biography] bio
Date Sat 05 Feb 2011 06:42 AM (UTC)

Amended on Sat 05 Feb 2011 12:15 PM (UTC) by Absolute Zero

Message
Ok so I don't know how simple or complex this is but I would like to make a simple trigger and alias to do two different things

My trigger is to match '* attacks you!'

What I'd like it to do is output one of four different things at random:

1) yell OH HELP

2) page fcpd %1 is killing me!

3) say Dead or alive you're coming with me

and the alias is 'grief *'

I want it to attack %1 and also output one of three different things at random

1) yell DEAD OR ALIVE YOU'RE COMING WITH ME

2) -%1 You are being greifed please hold still

3) -%1 hey check out my new camera

I'd also like space to add extra ones as I think of them with an equal chance of any among them being used...

I don't know how to do this myself so thanks for any help you can give.
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Sat 05 Feb 2011 08:27 PM (UTC)
Message
The trigger would look like this:


<triggers>
  <trigger
   enabled="y"
   match="* attacks you!"
   send_to="12"
   sequence="100"
  >
  <send>

local responses = {
  "yell OH HELP",
  "page fcpd %1 is killing me!",
  "say Dead or alive you're coming with me",

-- more here

}

Send (responses  [math.random (1, #responses)])

</send>
  </trigger>
</triggers>


The alias will be similar.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Absolute Zero   (3 posts)  [Biography] bio
Date Reply #2 on Sun 06 Feb 2011 08:23 AM (UTC)
Message
Ok and how do I implement this? I've been adding triggers through the in game trigger menu.
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Sun 06 Feb 2011 08:26 AM (UTC)
Message
Template:pasting For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Absolute Zero   (3 posts)  [Biography] bio
Date Reply #4 on Tue 28 Feb 2012 11:45 AM (UTC)
Message
Hate to ressurect this thread, But I can't figure out how to transfer this script into a similar scenario but for a timer.


I'd like to make a timer that every time it fires, sends a random input from a list, but this time each repetition of the timer should be able to do two inputs, for instance

option one:
ping
@me doing is=option one

option two:
ping
@me doing is=this is option two

option three:
ping
@me doing is=and this is option three

It should be similar to the previous in that those two inputs could be anything, and that more should be readily addable to the list... I look forward to your reply and would like to thank you for your previous help and hope you can help me again.
[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.


3,408 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

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

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]