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 10 Nisan 2017 14:19

CTCP Version help
 
Merhaba all,

I searched the forum before opening this thread and found 2 topics that somehow offer what im looking for.

[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...]

Kod:

on *:ctcpreply:VERSION mIRC*:if $($+(%,nc.,$nick),2) { msg #kanal $1 mIRC Girişi Yaptı | unset $+(%,nc.,$nick) }
on *:snotice:*Client connecting*:{
var %id ident1 ident2
if $istok(%id,$remove($gettok($gettok($10,1,40),1,64) ,~),32) {
ctcp $9 VERSION | set $+(%,nc.,$9) 1 | timer 1 60 vcontrol $9
}
}

alias vcontrol { if $($+(%,nc.,$1),2) { msg #kanal $1 mIRC Girişi Yaptı| unset $+(%,nc.,$nick) } }



and

[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...]

Kod:

on *:ctcpreply:VERSION mIRC*:if $($+(%,nc.,$nick),2) { zline $nick <zline sebebi> | unset $+(%,nc.,$nick) }
on *:snotice:*Client connecting*:{
    var %id ident1 ident2
  if $istok(%id,$remove($gettok($gettok($10,1,40),1,64) ,~),32) {
    ctcp $9 VERSION | set $+(%,nc.,$9) 1 | timer 1 60 vcontrol $9
  }
}

alias vcontrol { if $($+(%,nc.,$1),2) { zline $1 <zline sebebi> | unset $+(%,nc.,$nick) } }

The code on these topics works but i wanted it to do smth more. I wanted to add to the code when a user with a specific ident connects and doesn't give an answer to the ctcp $nick version command.

So, if anyone can help, how can we identify the users connecting to the server that don't give an answer to the version request?

for example the code works for:

[12:03:59] <ConnectServ> SIGNON user: User68314 (JavaUser@p50811B44.dip0.t-ipconnect.de
[12:03:59] <Network> Got Version Reply from User68314: mIRC v6.12 Khaled Mardam-Bey

msg on test channel:

[12:04:02] [ ALERT ] User68314 using bad ident with mIRC Entered.

But how to do it for when no answer to Version request?

[14:12:34] <ConnectServ> SIGNON user: User53456 (JavaUser@185.89.217.233

"No Network Answer"

"and no message on test channel"

CoCoRiCo 11 Nisan 2017 09:24

Cevap: CTCP Version help
 
Alıntı:

elhale Nickli Üyeden Alıntı (Mesaj 1041852566)
Merhaba all,

I searched the forum before opening this thread and found 2 topics that somehow offer what im looking for.

[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...]

Kod:

on *:ctcpreply:VERSION mIRC*:if $($+(%,nc.,$nick),2) { msg #kanal $1 mIRC Girişi Yaptı | unset $+(%,nc.,$nick) }
on *:snotice:*Client connecting*:{
var %id ident1 ident2
if $istok(%id,$remove($gettok($gettok($10,1,40),1,64) ,~),32) {
ctcp $9 VERSION | set $+(%,nc.,$9) 1 | timer 1 60 vcontrol $9
}
}

alias vcontrol { if $($+(%,nc.,$1),2) { msg #kanal $1 mIRC Girişi Yaptı| unset $+(%,nc.,$nick) } }

and

[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...]

Kod:

on *:ctcpreply:VERSION mIRC*:if $($+(%,nc.,$nick),2) { zline $nick <zline sebebi> | unset $+(%,nc.,$nick) }
on *:snotice:*Client connecting*:{
    var %id ident1 ident2
  if $istok(%id,$remove($gettok($gettok($10,1,40),1,64) ,~),32) {
    ctcp $9 VERSION | set $+(%,nc.,$9) 1 | timer 1 60 vcontrol $9
  }
}

alias vcontrol { if $($+(%,nc.,$1),2) { zline $1 <zline sebebi> | unset $+(%,nc.,$nick) } }

The code on these topics works but i wanted it to do smth more. I wanted to add to the code when a user with a specific ident connects and doesn't give an answer to the ctcp $nick version command.

So, if anyone can help, how can we identify the users connecting to the server that don't give an answer to the version request?

for example the code works for:

[12:03:59] <ConnectServ> SIGNON user: User68314 (JavaUser@p50811B44.dip0.t-ipconnect.de
[12:03:59] <Network> Got Version Reply from User68314: mIRC v6.12 Khaled Mardam-Bey

msg on test channel:

[12:04:02] [ ALERT ] User68314 using bad ident with mIRC Entered.

But how to do it for when no answer to Version request?

[14:12:34] <ConnectServ> SIGNON user: User53456 (JavaUser@185.89.217.233

"No Network Answer"

"and no message on test channel"

/debug @d
See the [ ALERT ] message. And copy it here.




And personal solution.
start: /getd
blue section is monitor channel.
red sction is how long he will respond if he does not respond
pink section is ban type.
Kod:

alias getd {
var %ch #ControlChannel
var %min 10
  if (!$1) debug -i d getd
  if $1 {
    tokenize 32 $1-
    if (*<-:*NOTICE*:Notice*Client*connecting*on*port*:* iswm $1-) .ctcp $4 VERSION
    if *PRIVMSG*:VERSION* iswm $1- {
      .hadd -mu $+ %min ver $4
      $+(.timerver_,$4) 1 %min gzline $4 version SUX! $(|) echo %ch $4 Did not respond to the version
    }
    if *:*!*@*NOTICE* $+ $hget(ver,$4) $+ :VERSION** iswm $1- {
      echo %ch Version Reply : $4 to $remove($6-,$chr(1))
      hdel ver $4 | $+(.timerver_,$4) off
    }
  }
}


elhale 11 Nisan 2017 12:24

Cevap: CTCP Version help
 
Alıntı:

CoCoRiCo Nickli Üyeden Alıntı (Mesaj 1041852662)
/debug @d
See the [ ALERT ] message. And copy it here.


Kod:

<- :hub3.network.net NOTICE starkeffect :*** Notice -- Client connecting at hub1.network.net: cuni (Web@79.106.7.8)
-> hub3.network.net WHO +I cuni
<- :hub3.network.net 352 starkeffect * Web 79.106.7.8 hub1.network.net cuni H :1 12Visitor from --=> 4
Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.
315 starkeffect cuni :End of /WHO list.
<- :cuni!
Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.
JOIN :#Main
<- :hub3.network.net NOTICE starkeffect :*** Notice -- Client connecting at hub2.network.net: StIvI (Mibbit@31.22.49.253)
-> hub3.network.net WHO +I StIvI
-> hub3.network.net PRIVMSG StIvI :VERSION
<- :hub3.network.net 352 starkeffect * Mibbit 31.22.49.253 hub2.network.net StIvI H :1
Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.
315 starkeffect StIvI :End of /WHO list.
<- :StIvI!
Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.
NOTICE starkeffect :VERSION
Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.
ajax IRC Client:3993:3993
14:10:11: 14[11c10tcp14(11StIvI14)] 15VERSION 14REPLY:
Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.
ajax IRC Client:3993:3993
-> hub3.network.net PRIVMSG #test4 :4 StIvI  entered the server with a different client than mIRC. 2
<- :StIvI!
Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.
JOIN :#Main

<- :hub3.network.net NOTICE starkeffect :*** Notice -- Client connecting on port 6667: testing (
Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.
) [clients]
-> hub3.network.net WHO +I testing
-> hub3.network.net PRIVMSG testing :VERSION
<- :hub3.network.net 352 starkeffect * Mibbit 78.12.112.143 hub3.network.net testing H :0 fullname
<- :hub3.network.net 315 starkeffect testing :End of /WHO list.
<- :testing!
Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.
NOTICE starkeffect :VERSION mIRC v7.41
14:10:11: 14[11c10tcp14(11testing14)] 15VERSION 14REPLY: mIRC v7.41
-> hub3.network.net PRIVMSG #test4 :7[ ALERT 7] 4 testing  using bad ident with mIRC Entered. 1

this is the debug result I get @[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...]

What I want to do is to get a report for certain idents (mibbit and javauser for example) that connect but are using mirc.

Also for the ones i don't get a version to report them aswell on the channel.

Eventually, decide what action to take (gzline for example).

I am trying to make it work for a hub not only for one server.

So, I am using 2 remotes atm

Kod:

on *:ctcpreply:VERSION*:if ($regex(* mIRC*)) && $($+(%,nc.,$nick),2) { msg #test4  7[ ALERT 7] 4 $nick  using bad ident with mIRC Entered. 2 | unset $+(%,nc.,$nick) }
on *:snotice:*Client connecting*:{
  var %id Javauser Mibbit
  if $istok(%id,$remove($gettok($gettok($9,1,40),1,64) ,~),32) {
    ctcp $8 VERSION | set $+(%,nc.,$8) 1 | timer 1 2 vcontrol $8
  }
}

alias vcontrol { if $($+(%,nc.,$1),2) { msg #test4 4 $1  entered the server with a different client than mIRC. 2 | unset $+(%,nc.,$nick) } }

and this

Kod:

on *:ctcpreply:VERSION mIRC*:if ($regex(* mIRC*)) && $($+(%,nc.,$nick),2) { msg #test4  7[ ALERT 7] 4 $nick  using bad ident with mIRC Entered. 1 | unset $+(%,nc.,$nick) }
on *:snotice:*Client connecting*:{
  var %id Javauser Mibbit
  if $istok(%id,$remove($gettok($gettok($10,1,40),1,64) ,~),32) {
    ctcp $9 VERSION | set $+(%,nc.,$9) 1 | timer 1 2 vcontrol $9
  }
}

alias vcontrol { if $($+(%,nc.,$1),2) { msg #test4 4 $1  entered the server with a different client than mIRC. 1 | unset $+(%,nc.,$nick) } }

your solution seems nice... to make it work for me do i have to change $4 with ($9 and $8?)

CoCoRiCo 11 Nisan 2017 13:19

Cevap: CTCP Version help
 
no, you do not need to change anything. It does not use any event. It works through raw data.
The code I gave. For those who have not responded to the version for some time.
If you want to apply for a group of versions, you need to add a condition.(red section)
ex:

Kod:

    if *:*!*@*NOTICE* $+ $hget(ver,$4) $+ :VERSION** iswm $1- {
      echo %ch Version Reply : $4 to $remove($6-,$chr(1))
      hdel ver $4 | $+(.timerver_,$4) off
      if $regex($6-,/(mibbit|lightirc)/) { gzline $4 hoop! your client are not allow from this server }
         
    }


elhale 11 Nisan 2017 15:58

Cevap: CTCP Version help
 
Alıntı:

CoCoRiCo Nickli Üyeden Alıntı (Mesaj 1041852686)
no, you do not need to change anything. It does not use any event. It works through raw data.
The code I gave. For those who have not responded to the version for some time.
If you want to apply for a group of versions, you need to add a condition.(red section)
ex:

Kod:

    if *:*!*@*NOTICE* $+ $hget(ver,$4) $+ :VERSION** iswm $1- {
      echo %ch Version Reply : $4 to $remove($6-,$chr(1))
      hdel ver $4 | $+(.timerver_,$4) off
      if $regex($6-,/(mibbit|lightirc)/) { gzline $4 hoop! your client are not allow from this server }
         
    }


hmmm i am trying this code

Kod:

alias getd {
var %ch #main
var %min 10
  if (!$1) debug -i d getd
  if $1 {
    tokenize 32 $1-
    if (*<-:*NOTICE*:Notice*Client*connecting*:* iswm $1-) .ctcp $4 VERSION
    if *PRIVMSG*:VERSION* iswm $1- {
      .hadd -mu $+ %min ver $4
      $+(.timerver_,$4) 1 %min gzline $4 Version Abuse! $(|) msg #test4 %ch $4 Did not respond to version request
    }
    if *:*!*@*NOTICE* $+ $hget(ver,$4) $+ :VERSION** iswm $1- {
      echo %ch Version Reply : $4 to $remove($6-,$chr(1))
      hdel ver $4 | $+(.timerver_,$4) off
      if $regex($6-,/(mibbit|lightirc)/) { gzline $4 hey! your client is not allowed on this server $(|) msg #test4 %ch $4 tried to connect with a prohibited version }
         
    }
  }
}

but when i start the code with /getd I dont get a window with the raw data

if I do /debug @d yes, but nothing happens... just the raw data...

CoCoRiCo 11 Nisan 2017 16:16

Cevap: CTCP Version help
 
Debug can only transfer raw data to a point.


/getd
Kod:

...
tokenize 32 $1-
$iif(!$window(@debug),window -fn  @debug,echo @debug $1-)
...

gzline $4 hey! your client is not allowed on this server $(|) msg #test4 %ch $4 tried to connect with a prohibited version
change gzline $4 hey! your client is not allowed on this server | msg #test4 %ch $4 tried to connect with a prohibited

elhale 11 Nisan 2017 17:01

Cevap: CTCP Version help
 
Alıntı:

CoCoRiCo Nickli Üyeden Alıntı (Mesaj 1041852715)
Debug can only transfer raw data to a point.


/getd
Kod:

...
tokenize 32 $1-
$iif(!$window(@debug),window -fn  @debug,echo @debug $1-)
...

gzline $4 hey! your client is not allowed on this server $(|) msg #test4 %ch $4 tried to connect with a prohibited version
change gzline $4 hey! your client is not allowed on this server | msg #test4 %ch $4 tried to connect with a prohibited

made the changes and now when i do the /getd the code activates and i see the @debug window but i think the command .ctcp $4 version is not being issued on users connecting or when they join the channel.

if i load the code on the first post with ctcp $9 version command i get the version of the clients connecting...

maybe unreal is different? or is it a problem on my mirc?

CoCoRiCo 12 Nisan 2017 08:40

Cevap: CTCP Version help
 
Alıntı:

elhale Nickli Üyeden Alıntı (Mesaj 1041852722)
made the changes and now when i do the /getd the code activates and i see the @debug window but i think the command .ctcp $4 version is not being issued on users connecting or when they join the channel.

if i load the code on the first post with ctcp $9 version command i get the version of the clients connecting...

maybe unreal is different? or is it a problem on my mirc?

yes, right.
this may be different on some special edits made and modules added to the servers or networks.

Raw data is different from "on events."

[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...]
you can add the word that the red section nickname is. so it will work well.
Kod:

..
if (*<-:*NOTICE*:Notice*Client*connecting*:* iswm $1-) .ctcp $4 VERSION
....


elhale 12 Nisan 2017 15:16

Cevap: CTCP Version help
 
Still not getting the results I want...

Ok, so here is how I am understanding things.

on server notice (@snotice) when users connect i get these notices:

Kod:

*** Notice -- Client connecting on port 6667: Nick (Mibbit@79.106.40.73) [clients]
*** Notice -- Client connecting at hub1.network.net: User_836 (
Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.
.kundencontroller.de)

and if I use these commands

for "on port" ctcp $9 VERSION
and
for "at" ctcp $8 VERSION

It works and I get the version response back

but when I edit your code for the debug raw data

Kod:

<- :hub.network.net NOTICE starkeffect :*** Notice -- Client connecting on port 6667: Nick (Mibbit@79.106.40.73) [clients]
<- :hub1.network.net NOTICE starkeffect :*** Notice -- Client connecting at hub1.network.net: User_836 (
Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.
.kundencontroller.de)

the command should change to

for "on port" ctcp $13 VERSION
and
for "at" ctcp $12 VERSION

right?

but when I edit your code to the new identifiers I don't see a version notice on the debug raw data... (i have done the /umode2 -T) it is as if the version command is not issued. The hash table ver is created but it is empty...

so for on port the code becomes

Kod:

alias getd {
  var %ch #controlChannel
  var %min 10
  if (!$1) debug -i d getd
  if $1 {
    tokenize 32 $1-
    $iif(!$window(@debug),window -fn  @debug,echo @debug $1-)
    if (*<-:*NOTICE*:Notice*Client*connecting*on*port*:* iswm $1-) .ctcp $13 VERSION
    if *352* iswm $1- {
      .hadd -mu $+ %min ver $13
      $+(.timerver_,$13) 1 %min gzline $13 Version Abuse! $(|) msg #test4 %ch $13 Did not respond to version request
    }
    if *:*!*@*NOTICE* $+ $hget(ver,$13) $+ :*VERSION** iswm $1- {
      echo %ch Version Reply : $13 to $remove($6-,$chr(1))
      hdel ver $13 | $+(.timerver_,$13) off
      if $regex($6-,/(mibbit|lightirc)/) { gzline $13 hey! your client is not allowed on this server | msg #test4 %ch $13 tried to connect with a prohibited version }

    }
  }
}

and for hub becomes:

Kod:

alias getd {
  var %ch #controlChannel
  var %min 10
  if (!$1) debug -i d getd
  if $1 {
    tokenize 32 $1-
    $iif(!$window(@debug),window -fn  @debug,echo @debug $1-)
    if (*<-:*NOTICE*:Notice*Client*connecting*at*:* iswm $1-) .ctcp $12 VERSION
    if *352* iswm $1- {
      .hadd -mu $+ %min ver $12
      $+(.timerver_,$12) 1 %min gzline $12 Version Abuse! $(|) msg #test4 %ch $12 Did not respond to version request
    }
    if *:*!*@*NOTICE* $+ $hget(ver,$12) $+ :*VERSION** iswm $1- {
      echo %ch Version Reply : $12 to $remove($6-,$chr(1))
      hdel ver $12 | $+(.timerver_,$12) off
      if $regex($6-,/(mibbit|lightirc)/) { gzline $12 hey! your client is not allowed on this server | msg #test4 %ch $12 tried to connect with a prohibited version }

    }
  }
}

I am sorry, I know I am always a headache... lol

CoCoRiCo 12 Nisan 2017 17:26

Cevap: CTCP Version help
 
Alıntı:

elhale Nickli Üyeden Alıntı (Mesaj 1041852864)
Still not getting the results I want...

....

I am sorry, I know I am always a headache... lol

this is tested.

Kod:

on *:start: getd
alias getd {
  var %ch #ControlChannel
  var %min 60
  if (!$1) debug -i d getd
  if $1 {
    tokenize 32 $1-

  ;### <- :IRC.syrix.net NOTICE CoCoRiCo :*** Client connecting: GONULMIMARI (ChatFoX@localhost) [127.0.0.1] {clients}

    if (*Client*connecting*:* iswm $1-) {
      .ctcp $8 VERSION | .hadd $+(-mu,%min) ver $8 $8
      $+(.timerver_,$8) 1 %min zline $8 version SUX! $(|) msg %ch $8 Huh! version?
    }

    ;###  <- :GONULMIMARI!
Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.
-B9074F5E NOTICE CoCoRiCo :VERSION mIRC v7.47


    if (*<-*:*!*@*NOTICE*:*VERSION* iswm $1-) {
      var %v_nick $remove($gettok($2,1,$asc(!)),:)
      msg %ch Version Reply : %v_nick to $remove($6-,$chr(1))
      .hdel ver %v_nick
      $+(.timerver_,%v_nick) off
      if $regex($6-,/(mibbit|lightirc)/i) { kill %v_nick hoop! your client SUX!  }
    }
  }
}

[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...]

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:28.

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