IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası

IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası (https://www.ircforumlari.net/)
-   mIRC Scripting Sorunları (https://www.ircforumlari.net/mirc-scripting-sorunlari/)
-   -   CTCP Version help (https://www.ircforumlari.net/mirc-scripting-sorunlari/771398-ctcp-version-help.html)

elhale 13 Nisan 2017 15:29

Cevap: CTCP Version help
 
Alıntı:

CoCoRiCo Nickli Üyeden Alıntı (Mesaj 1041852882)
this is tested.

Yes! Now it works. I get the results on control channel and gzline-s are issued.

I now have to try and modify it.

As you might have read in the first post I want it to do some other things aswell.

I want it to find out the users connecting with a certain Ident (for example ident Mibbit or Javauser)

14:16:21 *** Notice -- Client connecting at hub2.Albnetwork.net: Beko (Mibbit@185.32.146.6)
::: [ctcp(Beko)] VERSION REPLY: mIRC v7.29 Khaled Mardam-Bey

or

14:16:21 *** Notice -- Client connecting on port 6667: arb (JavaUser@79.126.224.241) [Client exited]
::: [ctcp(arb)] VERSION REPLY: mIRC v6.11 Khaled Mardam-Bey

and to report it on control channel

[ ALERT ] Beko is connecting with a prohibited Ident using mIRC

[ ALERT ] arb is connecting with a prohibited Ident using mIRC

CoCoRiCo 14 Nisan 2017 10:28

Cevap: CTCP Version help
 
You can do whatever you want in this area.
Kod:

if $regex($6-,/(mibbit|lightirc)/i) { kill %v_nick hoop! your client SUX!  }
$read from the list.txt , hash from the hastables.. controls depending on your choise

"$2" represents the full host-address on the raw version, ie the return version.
Kod:

if (*<-*:*!*@*NOTICE*:*VERSION* iswm $1-) {
from here you can set a condition for the mask.

Kod:

if (*Client*connecting*:* iswm $1-) {
if you want a control while connecting to the server, you can do it in the "client connecting on" condition.
that's all

get the nick ip host mask etc. exemple
Kod:

//var %o *** Notice -- Client connecting on port 6667: arb (JavaUser@79.126.224.241) [Client exited]  | echo  $regsubex(%o,/([\(\)\@])/ig,$chr(32))
replace to:

*** Notice -- Client connecting on port 6667: arb JavaUser 79.126.224.241 [Client exited]

elhale 20 Nisan 2017 04:05

Cevap: CTCP Version help
 
Alıntı:

As you might have read in the first post I want it to do some other things aswell.

I want it to find out the users connecting with a certain Ident (for example ident Mibbit or Javauser)

14:16:21 *** Notice -- Client connecting at hub2.Albnetwork.net: Beko (Mibbit@185.32.146.6)
::: [ctcp(Beko)] VERSION REPLY: mIRC v7.29 Khaled Mardam-Bey

or

14:16:21 *** Notice -- Client connecting on port 6667: arb (JavaUser@79.126.224.241) [Client exited]
::: [ctcp(arb)] VERSION REPLY: mIRC v6.11 Khaled Mardam-Bey

and to report it on control channel

[ ALERT ] Beko is connecting with a prohibited Ident using mIRC

[ ALERT ] arb is connecting with a prohibited Ident using mIRC

Ok. I tried smth else and it seems to work for what im looking for...

since we have a services channel where the version of all the users connecting is posted there, then why not grab it from there and not issue a new ctcp on users connecting...

Kod:

on *:start: {
    .hmake nick_to_check
    .hmake nicks_replied
    var -g %HC_MIBBIT_VERSION =
Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.
var -g %HC_JAVA_VERSION = lightIRC.com
}

alias parse_snotice {
    if ($prop == getnick) {
        if ($regex(nick,$1-,/\: (.*) \(/))) {
            var %nick = $regml(nick,1)
            return %nick
        }
    }

    if ($prop == getusername) {
        if ($regex(username,$1-,/\: .* \((.*)\@/))) {
            var %username = $regml(username,1)
            return %username
        }
    }

    if ($prop == getip) {
        if ($regex(ip,$1-,/: .* \(.*\@(.*)\)/)) {
            var %ip = $regml(ip,1)
            return %ip
        }     
    }

    if ($prop == oldnick) {
        if ($regex(onick,$1-,/user\:\ (.*) \(.*\)/)) {
            var %onick = $regml(onick,1)
            return %onick
        }   
    }

    if ($prop == newnick) {

        if ($regex(nnick,$1-,/nick to (.*)/)) {
            var %nnick = $regml(nnick,1)
            return %nnick
        }       
    }

    if ($prop == ipofchangednick) {
        if ($regex(cnip,$1-,/\(.*\@(.*)\)/)) {
            var %cnip = $regml(cnip,1)
            return %cnip
        }       
    }

    if ($prop == csusername) {
        if ($regex(cusername,$1-,/\((.*)\@.*\)/)) {
            var %cusername = $regml(cusername,1)
            return %cusername
        }       
    }

    if ($prop == replyfromnick) {
        if ($regex(rfromnick,$1-,/(.*)\:/)) {
            var %rfromnick = $regml(rfromnick,1)
            return %rfromnick
        }       
    } 

    if ($prop == reply) {
        if ($regex(csreply,$1-,/\: (.*)/)) {
            var %csreply = $regml(csreply,1)
            return %csreply
        }       
    }

    if ($prop == nickfromspam) {
        if ($regex(nicksp,$1-,/\] (.*)\!.*\@/)) {
            var %nicksp = $regml(nicksp,1)
            return %nicksp
        }       
    }

    if ($prop == versionfromspam) {
        if ($regex(versionsp,$1-,/\[NOTICE Network\: '(.*)'\])) {
            var %versionsp = $regml(versionsp,1)
            return %versionsp
        }       
    }

    return 0
}


;Process the commands, issue bans or not
alias issue_command_on_mismatch {
    ; $1 = nickname , $2 = ip with username separated by space . $3 = real version
    if ($prop == mibbit) {
        var %nick = $1
        var %ip = $2
        msg #test4 Mibbit Version mismatch  -> Nickname: %nick  , IP: %ip , Actual Version : $3-
    }

    if ($prop == javauser) {
        var %nick = $1
        var %ip = $2
        msg #test4 JavaUser Version mismatch  -> Nickname: %nick  , IP: %ip  , Actual Version : $3-
    }
}

alias check_if_replied {
    if (!$hget(nicks_replied,$1)) {
        msg #test4 No reply from nick: $1 using ip: $2
    }
}

;Handling of version mismatch
alias check_for_mismatch {
    if ($prop == mibbit) {
        ;%reply_from_nick, %username, %reply

        if ($hget(nick_to_check,$1)) {
            if (!$count($3,%HC_MIBBIT_VERSION)) {
                $issue_command_on_mismatch($1,$hget(nick_to_check,$1),$3).mibbit
            }
        }       
    }

    if ($prop == javauser) {
        if ($hget(nick_to_check,$1)) {

            ;Have to be more lenient with checking java version since it has different build numbers
            ;They all start with lightIRC.com though
            if (!$count($3,%HC_JAVA_VERSION)) {
                $issue_command_on_mismatch($1,$hget(nick_to_check,$1),$3).javauser
            }
        }
    }
}

;Entry point ,
on *:snotice:*Client connecting*: {
    var %nick =    $parse_snotice($1-).getnick
    var %username =    $parse_snotice($1-).getusername
    var %ip = $parse_snotice($1-).getip

    ;Store the nick and ip for 10 seconds
    .hadd -su15 nick_to_check %nick %ip %username

    $+(.timer,%nick) 1 10 check_if_replied %nick %ip   
}

;Connect serv on nick change
on *:text:*changed their nick*:#services {
    var %chan_message = $strip($1-)
    var %old_nick = $parse_snotice(%chan_message).oldnick
    var %new_nick = $parse_snotice(%chan_message).newnick
    var %cnip = $parse_snotice(%chan_message).ipofchangednick
    var %username = $parse_snotice(%chan_message).csusername
    $+(.timer,%old_nick) off
    if ($hget(nick_to_check,%old_nick) && !$hget(nicks_replied,%old_nick)) {
        .hdel nick_to_check %old_nick
        .hadd -su15 nick_to_check %new_nick %cnip %username
        .timer 1 10 check_if_replied %new_nick %cnip
    }
}


;Check spamfilter if reply got lost there
on *:snotice:*NOTICE Network*: {
    var %nickname = $parse_snotice($1-).nickfromspam
    ;var %username = $parse_snotice($1-).userfromspam
    var %version = $parse_snotice($1-).versionfromspam
   
    if ($hget(nick_to_check,%nickname)) {
        var %username = $gettok($hget(nick_to_check,%nickname),2,32)
        var %ip = $gettok($hget(nick_to_check,%nickname),1,32)
        .hadd -su20 nicks_replied %nickname %ip
        if (%username == Mibbit) {
            $check_for_mismatch(%nickname,%username,%version).mibbit
        }

        if (%username == JavaUser) {
            $check_for_mismatch(%nickname,%username,%version).javauser
        }
    }
}

on *:text:*Got Version Reply*:#services {
    var %chan_message = $strip($1-)
    var %nick_from_cmsg = $gettok(%chan_message,5,32)
    var %reply_from_nick = $parse_snotice(%nick_from_cmsg).replyfromnick
    var %reply = $parse_snotice(%chan_message).reply

    if ($hget(nick_to_check,%reply_from_nick)) {
        var %username = $gettok($hget(nick_to_check,%reply_from_nick),2,32)
        var %ip = $gettok($hget(nick_to_check,%reply_from_nick),1,32)
        if (%username == Mibbit) {
            $check_for_mismatch(%reply_from_nick,%username,%reply).mibbit
        }

        if (%username == JavaUser) {
            $check_for_mismatch(%reply_from_nick,%username,%reply).javauser
        }
        .hadd -su20 nicks_replied %reply_from_nick %ip       
    }
}

Now when a users connects with a certain ident (in this case JavaUser) I get a report for it on #test4 like this.

[02:38:18] <starkeffect> JavaUser Version mismatch -> Nickname: User49445 , IP: ip86-134-125-176.cl.ri.cox.net JavaUser , Actual Version : HexChat 2.12.0 / Linux 4.4.0-73-generic [x86_64/800.50MHz/SMP

Ps: thx for your help @[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...] , if you have suggestions on the code above pls advise, although it is working for me as it is...

CoCoRiCo 20 Nisan 2017 08:29

Cevap: CTCP Version help
 
It does not need such a complicated and long code, but it works and if you do what you want it does not matter :)

sad33 24 Mayıs 2017 22:05

Cevap: CTCP Version help
 
bu code 'de biraz oynama yaparak;; Snotice'de sunucuya giren herkese version çekip bunları kayıt altına alsak. ve admin kanalından !version nick dediğimizde kanala yansıtarak bazı komutları uygulasak? mesela version zline mobilden girmişse model zline gibi.tabi bunlardan başka userlerinde etkileneceğini düşünürek muaf nick muaf ip gibi bir code yapılabilirmi?

Brain 25 Mayıs 2017 10:56

Cevap: CTCP Version help
 
Mantıklı kardeşim.

CoCoRiCo 26 Mayıs 2017 08:37

Cevap: CTCP Version help
 
[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...]
[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...]
[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...]

buraları dikkatlice okur ve incelersen sen de yapabilirsin.. senin istediğin kişiselleştirilmiş addon, amacımız öğretmek addon yazıp hizmet etmek degil.

sad33 26 Mayıs 2017 20:06

Cevap: CTCP Version help
 
Hizmet et demedik. yardım talep ettik.ve gösterdiğin siteler seninde gördüğün gibi yabancı dil lisanı oldukça yüksek onları tam anlayabilseydim sen gibi. belki şu anda bunu yazıyor olmazdım. yinede ilgi alakana teşekkür ederim


Tüm Zamanlar GMT +3 Olarak Ayarlanmış. Şuanki Zaman: 03:40.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO
Copyright ©2004 - 2025 IRCForumlari.Net Sparhawk