mIRC Homepage
Posted By: buyo little problem with on text - 04/02/03 04:18 AM
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
Posted By: Collective Re: little problem with on text - 04/02/03 05:28 AM
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..
Posted By: buyo Re: little problem with on text - 04/02/03 05:48 AM
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?
Posted By: Collective Re: little problem with on text - 04/02/03 05:53 AM
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 # ) {
© mIRC Discussion Forums