mIRC Home    About    Download    Register    News    Help

Print Thread
If guest is in nick #232219 24/05/11 01:10 PM
Joined: Oct 2005
Posts: 98
S
starpossen Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Oct 2005
Posts: 98
Hi.

How would you go about changing nick from Guest to normal nick automaticly?

Re: If guest is in nick [Re: starpossen] #232220 24/05/11 01:46 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
(untested)
Code:
; check your nickname on connect and as it changes
on me:*:nick: { noguestnick $newnick }
on *:connect: { noguestnick $me }

alias -l noguestnick {
; nickname starts with "Guest", no auto-nickchange-marker set for this connection
  if ((Guest* iswm $1) && (!$hget(noguestnick,$cid))) {

  ; change nick to main nickname (if not matching Guest*), else to alternative nickname (if not matching Guest*), else to FALLBACKNICKNAME
    nick $iif((Guest* !iswm $mnick),$v2,$iif((Guest* !iswm $anick),$v2, FALLBACKNICKNAME ))

    ; set auto-nickchange-marker for this connection for 90s - to prevent a "nickspam loop" (circular quarrelling with services or the like)
    if ($event != connect) { hadd -mu90 noguestnick $cid x }
  }
}


Last edited by Horstl; 24/05/11 02:00 PM.
Re: If guest is in nick [Re: Horstl] #232223 24/05/11 02:59 PM
Joined: Oct 2005
Posts: 98
S
starpossen Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Oct 2005
Posts: 98
Thanks for the quick reply, so FALLBACKNICKNAME would be the part I change to my normal nick in the script?

Re: If guest is in nick [Re: starpossen] #232224 24/05/11 03:27 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
The script tries to use your normal nicknames in the first place, that is your "main nickname" and "alternate nickname", as set in the mIRC options dialogue or with mIRC commands.
I added FALLBACKNICKNAME just for the (unlikely) case both normal nicknames match "Guest*" (for whatever reason), so you can put a hardcoded nickname there. smile

Re: If guest is in nick [Re: Horstl] #232225 24/05/11 04:33 PM
Joined: Oct 2005
Posts: 98
S
starpossen Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Oct 2005
Posts: 98
I see, thanks for explaining, I will test it later, thanks again.