mIRC Home    About    Download    Register    News    Help

Print Thread
#58501 30/10/03 10:02 PM
Joined: Sep 2003
Posts: 122
Gar Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Sep 2003
Posts: 122
I am trying to figure out how to do something that would get a random result back.

This is what I want:

Code:
on *:ACTION:*:#:{
  if ($! == wonders) && ($2 == what) && ($4 == saying) {
    pull random sayings from a list found here
  }
}


* Bahran wonders what Gararion's saying is today?

I don't know how to do the random part. Any help?

Last edited by Gar; 30/10/03 10:33 PM.
#58502 30/10/03 10:25 PM
Joined: Oct 2003
Posts: 30
Ameglian cow
Offline
Ameglian cow
Joined: Oct 2003
Posts: 30
on *:ACTION:*:#:{
if ($! == wonders) && ($2 == what) && ($4 == saying) {
msg $chan $read(list.txt,n)
}
}


------
Cheers m8!
#58503 30/10/03 10:46 PM
Joined: Sep 2003
Posts: 122
Gar Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Sep 2003
Posts: 122
Code:
on *:ACTION:*:#:{
  if ($! == wonders) && ($2 == what) && ($4 == saying) {
   saying 1
   saying 2
   saying 3
   saying 4
   saying 5
  }
}


I have this random script for a slap script I use, but I can't see how I would edit it to work with the above script:

Code:
alias slap {
  if ($1) {
    if ((!$2) || ($2 !isnum 1-6)) tokenize 32 $1 $rand(1,6)
    if ($2 == 1) %s = upside the head with a large trout.
    if ($2 == 2) %s = with a Volvo... that was clamped anyway so the driver doesn't mind.
    if ($2 == 3) %s = with the back of his hand.
    if ($2 == 4) %s = with a wiffle bat.
    if ($2 == 5) %s = with a Cat'O'Nine tails.
    if ($2 == 6) %s = with a nuclear warhead...
    describe $active slaps $1 %s
  }
  else echo 4 -a * SLAP syntax: /slap nick [number 1 - 6]
}

Last edited by Gar; 30/10/03 10:47 PM.
#58504 30/10/03 11:31 PM
Joined: Apr 2003
Posts: 426
Fjord artisan
Offline
Fjord artisan
Joined: Apr 2003
Posts: 426
alias rslap {
if ($1 ison $chan) {
me slaps $1 $read(rslap.txt)
}
}



/rslap <nick>

All you then need to do is make a text file called rslap.txt and place it in the root mIRC directory (eg, c:\program files\mirc\) and make sure each entry is like this:

around a bit with a large salmon
with a large cricket bat
over the head with a piece of cod

etc.

As the script has the /me slaps in it already, and you're supplying who wants to be slapped.


--------
mIRC - fun for all the family (except grandma and grandpa)
#58505 30/10/03 11:39 PM
Joined: Sep 2003
Posts: 122
Gar Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Sep 2003
Posts: 122
I don't want a slap one, the slap works. I want something that when a person does this:

* Bahran wonders what Gararion's saying of the week is...

it gives themm a random saying.

#58506 31/10/03 12:57 PM
Joined: Oct 2003
Posts: 273
E
EVH Offline
Fjord artisan
Offline
Fjord artisan
E
Joined: Oct 2003
Posts: 273
Code:
on *:ACTION:*:#: {
  if (($1-2 == wonders what) &amp;&amp; ($4 == saying)) {
    var %rand = $rand(1,5)
    if (%rand == 1) describe # saying 1
    if (%rand == 2) describe # saying 2
    if (%rand == 3) describe # saying 3
    if (%rand == 4) describe # saying 4
    if (%rand == 5) describe # saying 5
  }
}

#58507 01/11/03 12:53 AM
Joined: Sep 2003
Posts: 58
S
Babel fish
Offline
Babel fish
S
Joined: Sep 2003
Posts: 58
Put a view "sayings" in a plain text file.

example :

file name : sayings.txt
Code:
saying 1
saying 2
saying 3


Then put this in your script....

Code:
on *:action:*:#: {
    if (($1 == wonders) &amp;&amp; ($2 == what) &amp;&amp; ($4 == saying)) {
      describe # $read(sayings.txt,t)
    }
  }
}


Now it will say a random line from the text file "sayings.txt"

if you have new sayings or you want to replace or delete an old one then just put it in the text file or erase them...


I hope this is what you mean...

Grtzzz Stimpy

Last edited by stimpy; 01/11/03 12:55 AM.

***************************
To chat, or not to chat.
That's the question

Link Copied to Clipboard