mIRC Homepage
Posted By: Gremel if script that looks at version info - 13/03/06 11:17 PM
What I was hoping for was makin a script that would only work on one channel, #Santharia, that would version check any user that enters. If they use Trillian, send them one message, if they use some other program, say PJIRC or mIRC itself, it would say somthing else dependin on program.

Is this possible?
Posted By: Pap Re: if script that looks at version info - 13/03/06 11:24 PM
when a person joins your channel, you would do

/ctcp $nick VERSION

See:
/help on join

then you need to grab that VERSION reply and do something with it.

See:
/help on ctcpreply
Posted By: DaveC Re: if script that looks at version info - 14/03/06 08:22 AM
Code:
on *:join:#Santharia:{
  if (!$($+(%,onjoin.#Santharia.,$nick),2)) {
    ctcp $nick version
    set -u30 $+(%,onjoin.#Santharia.,$nick) $true
    $+(.timer.onjoin.#Santharia.,$nick) 1 35 set -u1 $+(%,onjoin.#Santharia.,$nick) $true $(|,) onctcpreply.version $nick
  }
}
on *:ctcpreply:VERSION*:{ onctcpreply.version $nick $1- }
alias -l onctcpreply.version {
  if ($($+(%,onjoin.#Santharia.,$1),2)) {
    unset $+(%,onjoin.#Santharia.,$1)
    $+(.timer.onjoin.#Santharia.,$1) off
    if ($0 == 1)            { .msg $1 what no version at all?!?!??! }
    elseif ($2 == Trillian) { .msg $1 blah blah blah }
    elseif ($2 == Pjirc)    { .msg $1 blob blob blob }
    elseif ($2 == Mirc)     { .msg $1 glab glab glab }
    else                    { .msg $1 I dont know this client! }
  }
}

*code untested*

Try that, if it doesnt work, get back to me.
PS you dont see the messages going out from the bot, only the clients joining well see them, so test using a cleint as well.
© mIRC Discussion Forums