mIRC Home    About    Download    Register    News    Help

Print Thread
#143447 24/02/06 02:30 PM
Joined: Feb 2005
Posts: 185
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Feb 2005
Posts: 185
Hi Guys.

I was wondering if its possible to have a notice for when an IRCop joins a channel?

Example:

Joins : the-man [D.P.G@sg-196.129.18426] [Last Nick: ThE-MaN] [Clones: Theman] [IRCop:Yes!]


As for the last nick and clone bit, I already have that, but I would like to add the IRCop on the end...

How would I go about that?

Any help you be great.


sub-zero.homeip.net:6667

#143448 24/02/06 02:52 PM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
IRCop status can be determined by doing a /userhost on the user. The * in the line means they are an IRCop.

Code:
on *:JOIN:*:{ {
  .enable #joinscan
  .userhost $1
  .timer 1 5 .disable #joinscan 
}

#joinscan off
raw 302:*:{
  ; REGEX: (nick)(*=+)(ident)@(host)
  if ($regex(scan,$2-,/([^*=+]+)([*=+])+([^*=+]+)@([^*=+]+)/)) {
    echo -a $regml(scan,1) ( $+ $regml(scan,3) $+ $regml(scan,4) $+ ) $iif(* isin $regml(scan,4),is,is not) an IRCop
  }
    .disable #joinscan
  halt
}
#joinscan end



(untested code)

-genius_at_work

#143449 24/02/06 03:35 PM
Joined: Feb 2005
Posts: 185
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Feb 2005
Posts: 185
Unfortunaltly that doesnt work... I located my code for the Clones and last nick.. maybe the above code code could be inmplemented into it?

Code:
 alias join.helper {
  var %clones = $clscanint($1, $2)
  var %last = $addr.lastnick($address($1, 2))
  if (%last == <unknown> && $numtok(%clones, 32) == 0) { return $iif($iif($isalias(join.cust), $join.cust($1-)), ( $+ $ifmatch $+ )) }
  if (%clones == $null && %last == $null) { return $null }
  if (%clones != $null && %last == $null) { return (Clones: %clones $+ $iif($iif($isalias(join.cust), $join.cust($1-)), $chr(44) $ifmatch) $+ ) }
  if (%clones == $null && %last != $null && $VTECget(silast) != off) { return (Last nick: %last $+ $iif($iif($isalias(join.cust), $join.cust($1-)), $chr(44) $ifmatch) $+ ) }
  if (%clones != $null && %last != $null && $VTECget(silast) != off) {
    if (%clones = %last) {
      return (Clone/Last nick: %clones $+ $iif($iif($isalias(join.cust), $join.cust($1-)), $chr(44) $ifmatch) $+ )
    }
    else {
      return (Clone $+ $iif($numtok(%clones, 32) > 1,s) $+ : %clones $+ , Last nick: %last $+ $iif($iif($isalias(join.cust), $join.cust($1-)), $chr(44) $ifmatch) $+ )
    }
  }
} 

on *^:join:#:{
  var %i = 1,%a,%b = $gettok($hget(lastnicks,$site),1,32)
  while $ialchan($1,$2,%i).nick { %a = %a $v1 | inc %i }
  while $ialchan($wildsite,#,%i).nick { %a = %a $v1 | inc %i }
  ; %a is set all nicks from $site
  if %b && $v1 != $nick { %b = 4[Last Nick: $v1 $+ ] } | else var %b
  ; if <lastnick> is the current nick it will not be shown
  if $remtok(%a,$nick,32) { %a = 3[Clones: $v1 $+ ] } | else var %a
  ; check if there are any clones to display
  echo -tic join # 11 ·09 · 4Joins :  $nick $+([,$address,]) %a %b
  hadd -m lastnicks $site $nick $ctime
  ; update hash table
  .timerlastnick 1 3 hsave lastnicks lastnicks.hsh
  ; save hash table, timer so it isn't saved multiple times if multiple joins
  haltdef
}



sub-zero.homeip.net:6667

#143450 25/02/06 03:08 AM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Sorry, there were a couple bugs in my code. Try this version:

Code:
on *:JOIN:*:{
  .enable #joinscan
  .userhost $nick
  .timer 1 5 .disable #joinscan 
}

#joinscan off
raw 302:*:{
  echo -a $1-
  ; REGEX: (nick)(*=+)(ident)@(host)
  if ($regex(scan,$2-,/([^*=+]+)([*=+]+)([^*=+]+)@([^*=+]+)/)) {
    ; ########## Add your code here ########
    ; $regml(scan,1) = nick
    ; $regml(scan,2) = status - * means ircop
    ; $regml(scan,3) = ident
    ; $regml(scan,4) = host

    echo -a $regml(scan,1) ( $+ $regml(scan,3) $+ @ $+ $regml(scan,4) $+ ) $iif(* isin $regml(scan,2),is,is not) an IRCop $regml(scan,2)
  }
  .disable #joinscan
  halt
}
#joinscan end


-genius_at_work

#143451 25/02/06 10:37 AM
Joined: Feb 2005
Posts: 185
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Feb 2005
Posts: 185
Thank you, works nicely, now how would i change the echo to be of this format?...

Code:
[ 10:02:38 ]  · · Joins :  Skeletor [Skeletor@admin.atrum.org] [IRCop: Yes]
 


and then take out the...

Code:
 Skeletor Sub-Zero=+subz@sg-20267.unknown.com
Sub-Zero (subz@sg-20267.unknown.com) is not an IRCop =+ 


So it will only echo if they are an ircop.


sub-zero.homeip.net:6667

#143452 25/02/06 03:08 PM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Edit this line:

echo -a $regml(scan,1) ( $+ $regml(scan,3) $+ $regml(scan,4) $+ ) $iif(* isin $regml(scan,4),is,is not) an IRCop

To be this:

if (* isin $regml(scan,2)) echo -a · · Joins : $regml(scan,1) $([,0) $regml(scan,3) $+ @ $+ $regml(scan,4) $+ $(],0) [IRCop: Yes]


Note that the code i have provided may need to be altered to work well on multiple channels.

-genius_at_work

#143453 25/02/06 07:51 PM
Joined: Feb 2005
Posts: 185
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Feb 2005
Posts: 185
Nice one !!! cool


sub-zero.homeip.net:6667


Link Copied to Clipboard