mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2016
Posts: 86
B
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
I'm trying to find a way for whenever someone says "hi" or "hello" etc... but have it have a different response EVERY time and I can have multiple responses instead of 2 or 3. If I could have help, it'd be greatly appreciated

Joined: May 2016
Posts: 11
E
Pikka bird
Offline
Pikka bird
E
Joined: May 2016
Posts: 11
How i do this stuff is:

I just add random number variable. And then add if statements for each random number how many you want.

Code:
on *:TEXT:hello:#: {
    var %rand = $rand(1,how many you want)
    
    if ( %rand == 1  ) {
       //do something
    }

    if( %rand == 2 ) {
      //do something
    }
    
   // and so on
}

Joined: Apr 2016
Posts: 86
B
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
Works great but how do I set it so it only ignores me (Bestpeff) ?

Joined: May 2016
Posts: 11
E
Pikka bird
Offline
Pikka bird
E
Joined: May 2016
Posts: 11
You just add an IF statement for your name

Code:
 if ( $nick != Bestpeff ) { 

    //code 
 } 


or you can do it in another way

Code:
 if ( $nick == Bestpeff ) {

    return 
 } 

Joined: Sep 2016
Posts: 15
T
Pikka bird
Offline
Pikka bird
T
Joined: Sep 2016
Posts: 15
with $rand and if statements it will be long script you can create txt file and fill it with bunch of messages like

randommsg.txt

Code:
hey!
hello!
welcomeback
howdy


then use this code:

Code:
on *:text:hello:#: {
  if ($nick == YOURNICK) { return }
  ; this will pick random line from "randommsg.txt" and use that
  msg # $read(randommsg.txt) 
}


Link Copied to Clipboard