mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2004
Posts: 96
G
Gremel Offline OP
Babel fish
OP Offline
Babel fish
G
Joined: Mar 2004
Posts: 96
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?

Joined: Mar 2003
Posts: 32
P
Pap Offline
Ameglian cow
Offline
Ameglian cow
P
Joined: Mar 2003
Posts: 32
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

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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.


Link Copied to Clipboard