mIRC Homepage
Posted By: FireDivine Response question. - 18/02/06 02:10 AM
on *:TEXT:sd *:#:{
if ($me == $botname) {
/describe $chan *Slowly kills $nick $+ !*
}
}

The corrent code answers:

*Slowly kills NAME!*

If they type SD TEXT TEXT

How do you code it to respond:

*Slowly kills TEXT TEXT* instead of name?

Thanks!
Posted By: Jigsy Re: Response question. - 18/02/06 02:12 AM
Code:
on *:TEXT:sd *:#:{ 
  if ($me == $botname) {
    describe $chan *Slowly kills $iif($1-,$ifmatch,$nick) $+ !*
  }
}


try that
Posted By: RusselB Re: Response question. - 18/02/06 02:13 AM
Replace $nick with $2 (or $3, $4, etc. depending on which TEXT you actually want displayed)
Posted By: FireDivine Re: Response question. - 18/02/06 02:23 AM
Thanks for the replies. I got it to work, with the help of you all's codes.

on *:TEXT:sd *:#:{

if ($me == $botname) {

describe $chan *Slowly kills $iif($2-,$ifmatch,$10) $+ !*

}

}

Is the final result.
Posted By: FireDivine Re: Response question. - 18/02/06 02:31 AM
The previous code gave an error on entering a room.

So I fixed it with:

on *:TEXT:sd *:#:{
if ($me == $botname) {
describe $chan *Slowly kills $iif($2-,$ifmatch,$3) $+ !*
}
}
Posted By: FireDivine Re: Response question. - 18/02/06 02:42 AM
Is there a way to welcome somebody when they enter the room?

I am pretty sure there is but:

on *:TEXT:* joined *:#:{
if ($me == $botname) {
/msg $chan WB $nick $+ !
}
}

Is not working.

Never mind.

I found a good link for a welcome message:

https://forums.mirc.com/s...true#Post148733
Posted By: FireDivine Re: Response question. - 18/02/06 02:58 AM
I got it to work with:

on *:JOIN:#:{
if ($me == $botname) {
/msg $chan WB $nick
}
}
Posted By: DaveC Re: Response question. - 18/02/06 06:49 AM
The code you had was logicialy flawed, becuase you always had to have a $2 anyway sd * means there must be a $2

Code:
on *:TEXT:sd*:#:{
  if ($me == $botname) {
    if ($1 == sd) { describe $chan *Slowly kills $iif($len($2-),$2-,$nick) $+ !* }
  }
}


* match to sd* so SD on its own works or SD <something> works
* make sure the first word was SD becuase it catches SDBLAHhetc as well.
* in the $iif check the lenth of $2- rather than what it is since a few values well produce false conditions
* reinserted $nick where u put $3 for some reason
© mIRC Discussion Forums