mIRC Home    About    Download    Register    News    Help

Print Thread
#9586 04/02/03 04:18 AM
Joined: Feb 2003
Posts: 2
B
buyo Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
B
Joined: Feb 2003
Posts: 2
I'm adding on to another script. It stores nicknames in variables for auto identify, auto ghost, etc. I wanted to use that so that whenever someone says one of my nicknames that is stored in a variable, it will alert me in my status window.

This is the part of the script I am having trouble with. %nick1 etc are obviously the variable that stores my nickname

on *:text: {
if ((%nick1 isin $chan) && (%alert == on)) { .echo -s $timestamp $chr(40) $+ $chan $+ $chr(41) $chr(60) $+ $nick $+ $chr(62) $1- }
if ((%nick2 isin $chan) && (%alert == on)) { .echo -s $timestamp $chr(40) $+ $chan $+ $chr(41) $chr(60) $+ $nick $+ $chr(62) $1- }
if ((%nick3 isin $chan) && (%alert == on)) { .echo -s $timestamp $chr(40) $+ $chan $+ $chr(41) $chr(60) $+ $nick $+ $chr(62) $1- }
if ((%nick4 isin $chan) && (%alert == on)) { .echo -s $timestamp $chr(40) $+ $chan $+ $chr(41) $chr(60) $+ $nick $+ $chr(62) $1- }
if ((%nick5 isin $chan) && (%alert == on)) { .echo -s $timestamp $chr(40) $+ $chan $+ $chr(41) $chr(60) $+ $nick $+ $chr(62) $1- }
if ((%nick6 isin $chan) && (%alert == on)) { .echo -s $timestamp $chr(40) $+ $chan $+ $chr(41) $chr(60) $+ $nick $+ $chr(62) $1- }
if ((%nick7 isin $chan) && (%alert == on)) { .echo -s $timestamp $chr(40) $+ $chan $+ $chr(41) $chr(60) $+ $nick $+ $chr(62) $1- }
if ((%nick8 isin $chan) && (%alert == on)) { .echo -s $timestamp $chr(40) $+ $chan $+ $chr(41) $chr(60) $+ $nick $+ $chr(62) $1- }
if ((%nick9 isin $chan) && (%alert == on)) { .echo -s $timestamp $chr(40) $+ $chan $+ $chr(41) $chr(60) $+ $nick $+ $chr(62) $1- }
if ((%nick10 isin $chan) && (%alert == on)) { .echo -s $timestamp $chr(40) $+ $chan $+ $chr(41) $chr(60) $+ $nick $+ $chr(62) $1- }
haltdef
}

I also tried the following:

on *:text:%nick1:#: {
if (%alert == on) { .echo -s $c4 $timestamp $chr(40) $+ $chan $+ $chr(41) $chr(60) $+ $nick $+ $chr(62) $1- }
haltdef
}

This part works, however, I cannot add %nick2 and so on without making a second "on text", and also it won't let me add * around the outside of my nick *Nickname*

Any help would be greatly appriciated

Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Code:
on *:TEXT:*:#:{
  if ( %alert == on ) {
    var %n = 1
    while ( $eval(% $+ nick $+ %n,2) != $null ) {
      if ( $istok($eval(% $+ nick $+ %n,2),$1-,32) == $true ) && ( $eval(% $+ nick $+ %n,2) ison # ) {
        .echo -st $c4 $chr(40) $+ $chan $+ $chr(41) $chr(60) $+ $nick $+ $chr(62) $1-
      }
      inc %n
    }
  }
}

This code checks if someone said one of the nicknames every time someone says something. It also checks to see if they are in the channel where it was said (I did that because from your first script it looked like you meant ison instead of isin).

Edit: Small bug fix..

Last edited by Collective; 04/02/03 05:36 AM.
Joined: Feb 2003
Posts: 2
B
buyo Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
B
Joined: Feb 2003
Posts: 2
Thanks a bunch smile

I don't suppose there is anyway for it to alert me on something like "Hi Nickname" or "I was talking to Nickname" rather then having it only alert me when soemone says "Nickname" and nothing else?

Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Sorry, I made a [censored] up, it was intended for that to work lol.

replace:
if ( $istok($eval(% $+ nick $+ %n,2),$1-,32) == $true ) && ( $eval(% $+ nick $+ %n,2) ison # ) {

with:
if ( $istok($1-,$eval(% $+ nick $+ %n,2),32) == $true ) && ( $eval(% $+ nick $+ %n,2) ison # ) {


Link Copied to Clipboard