Hi guys,

I would like to know if anyone can help me.

I need the CHGHOST event message.

I've been researching and mIRC, by default, doesn't show a message when a user changes hosts.

I debug the mIRC and found this information:

<- @time=2026-03-27T12:55:56.782Z :Tiago!Tiago@vhost.cferreira.org CHGHOST Tiago suporte.PTirc.org
<- @time=2026-03-27T13:28:35.041Z :Tiago!Tiago@suporte.PTirc.org CHGHOST Tiago vhost.cferreira.org

And I needed that whenever the user switches accounts, it shows both the previous and the new account:

Example:

12:34 · Tiago [Tiago@vhost.cferreira.org] has changed host to Tiago@suporte.PTirc.org

I created this code:
Code
alias pcb { echo $1 $+ $msgstamp $2- }

raw CHGHOST:*:{
  var %c = 1
  while ($comchan($nick,%c)) {
    pcb -i5mt $v1 · $nick has changed host to $+($nick,@,$2)
    inc %c
  }
}

And in the channels where I am and the user is also present, the message appears like this:

12:24 · Tiago has changed host to Tiago@suporte.PTirc.org
12:25 · Tiago has changed host to Tiago@vhost.cferreira.org

However, I can't find a solution to make the previous host appear in the message.

I would appreciate it if someone could help me wink

I found the solution:
Code
alias pcb { echo $1 $+ $msgstamp $2- }

raw CHGHOST:*:{
  var %c = 1, %oldmask = $gettok($fulladdress,2,33), %ident = $gettok(%oldmask,1,64), %newmask = $+(%ident,@,$2)
  while ($comchan($nick,%c)) {
    pcb -i5mt $v1 · $nick ( $+ %oldmask $+ ) has changed host to %newmask
    inc %c
  }
  haltdef
}

Return:

18:51 · Tiago (~Tiago@vhost.cferreira.org) has changed host to ~Tiago@suporte.PTirc.org

Last edited by TECO; 28/03/26 12:44 AM.

TECO
irc.PTirc.org (Co-Admin)