This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

ctcp no version reply help

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
m
michalis
Voice
Posts: 1
Joined: Sun Jul 01, 2007 10:46 am

ctcp no version reply help

Post by michalis »

Hello, i found this code for my needs, i just want your help making this code to ban/kick users that dont reply on bots ctcp version not to voice them

Code: Select all

bind ctcr - VERSION version:reply 
bind join - * check:version 

proc check:version {nick uhost hand chan} { 
 global cversion 
 set cversion([string tolower $nick]) $chan 
 putserv "privmsg $nick :\001VERSION\001" 
} 

proc version:reply {nick uhost hand dest kw arg} { 
 global cversion 
 if {[isbotnick $dest] && [info exists cversion([set nick [string tolower $nick]])]} { 
  if {[string match -nocase "*mirc*" $arg]} { 
   pushmode $cversion($nick) +v $$nick 
  } 
  unset cversion($nick) 
 } 
}
Thanks, Michalis
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

This should do the job for you. It will VERSION the user on join and if there is no version reply from the user within 15secs, then it will go ahead and kick/ban that user from the channel.

Code: Select all

bind ctcr - VERSION version:reply 
bind join - * check:version 

proc check:version {nick uhost hand chan} { 
 global cversion 
 set cversion([string tolower $nick]) 1
 putserv "PRIVMSG $nick :\001VERSION\001"
 utimer 15 [list no:version:reply $nick $uhost $chan]
} 

proc version:reply {nick uhost hand dest kw arg} { 
 global cversion 
 if {[info exists cversion([string tolower $nick])]} {
  unset cversion([string tolower $nick])
 }
}

proc no:version:reply {nick uhost chan} {
 global cversion
 if {[info exists cversion([string tolower $nick])] && [onchan $nick $chan]} { 
  putserv "MODE $chan +b *!*@[lindex [split $uhost @] 1]"
  putserv "KICK $chan $nick :No CTCP version reply"
  unset cversion([string tolower $nick])
  }
}
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
P
PeLL
Voice
Posts: 28
Joined: Fri Mar 04, 2011 10:59 am
Location: spain
Contact:

Post by PeLL »

It works very well
Can you add to ignore idents?
Large channel much lag.
Thank you .
User avatar
Dominatez
Halfop
Posts: 50
Joined: Mon Jan 14, 2019 5:08 pm
Location: United Kingdom

Post by Dominatez »

I am getting the following error.

Tcl error [ctcpvers]: can't read "::verschan": no such variable
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

You two realize this is an old topic? Open a new topic and link to this if you really have to and let this one rest in the Archives. :roll:

@PeLL If you add 'ignore idents' on a large channel you will have a huge ignore list in no time. What do you want to achieve? What's the issue?

@Dominatez : The error you get has nothing to do with this since there's no ctcpvers function nor verschan is used in here. Look in your other scripts.
Once the game is over, the king and the pawn go back in the same box.
P
PeLLq
Voice
Posts: 3
Joined: Wed Apr 24, 2019 1:24 pm

Post by PeLLq »

Hello greetings.
I am looking for a TCL that can make ctcp version on connect.
And if you can ignore webchat or webchat user modes.
s
simo
Revered One
Posts: 1108
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

so ur bot is opered ?
P
PeLLq
Voice
Posts: 3
Joined: Wed Apr 24, 2019 1:24 pm

Post by PeLLq »

if right.
Thank you very much for answering
User avatar
Dominatez
Halfop
Posts: 50
Joined: Mon Jan 14, 2019 5:08 pm
Location: United Kingdom

Post by Dominatez »

I would set the utimer to maybe 30 or even 45 seconds as some people connecting to a network may experience lag between themselves and the bot, and if no version was received or late received, it would kick and ban the user for that.

Might be a better idea for the bot to message a channel op on kick letting them know that this user was kicked and when for ctcp.
P
PeLL
Voice
Posts: 28
Joined: Fri Mar 04, 2011 10:59 am
Location: spain
Contact:

Post by PeLL »

I want to continue this post to see if what I want to do is possible...
Following the post with the ctcp on join chan (it works perfectly) I need it to work on connect to the server.

Currently it works to inspire the ctcp but it doesn't work for it to be positive or negative.


Code: Select all

bind raw - notice ctcp
bind ctcr - VERSION version:reply

proc ctcp {from key text} {
global cversion
if {[string match *!*@* $from]} { return 0 }
        if {![regexp -nocase { CONNECT: Client connecting on port (\d+) \(class (\S+)\): ([^!]+)!([^@]+)@(\S+) \(([0-9a-f.:]+)\) \[(.*)\]} $text -> port class nick ident host ip realname]} { return 0 }
      if {[lsearch -regexp $nick] ne -1} { return }  
  set text [split $text]

	set cversion([string tolower $nick]) 10
	
    putserv "PRIVMSG $nick :\001ping\001"

  }
  return 0
}

proc version:reply {nick uhost hand dest kw arg} {
 global cversion
 if {[info exists cversion([string tolower $nick])]} {
  unset cversion([string tolower $nick])
 }
}

proc no:version:reply {nick} {
 global cversion
 if {[info exists cversion([string tolower $nick])]} {
  #putserv "MODE $chan +b *!*@[lindex [split $uhost @] 1]"
  #putserv "KICK $chan $nick :No CTCP version reply"
  putserv "Gline $nick :no ctcp"
  unset cversion([string tolower $nick])
  }
}
Ctcp on connect if it works, but it doesn't know anything else...
Thank you very much for the help .
User avatar
CrazyCat
Revered One
Posts: 1304
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

Your no:version:reply is never called.

Add a timer to run it after a reasonable delay:

Code: Select all

proc ctcp {from key text} {
   global cversion
   if {[string match *!*@* $from]} { return 0 }
   if {![regexp -nocase { CONNECT: Client connecting on port (\d+) \(class (\S+)\): ([^!]+)!([^@]+)@(\S+) \(([0-9a-f.:]+)\) \[(.*)\]} $text -> port class nick ident host ip realname]} { return 0 }
   if {[lsearch -regexp $nick] ne -1} { return } 
   set text [split $text]
   set cversion([string tolower $nick]) 10
   putserv "PRIVMSG $nick :\001ping\001"
   # Timer to add
   utimer 15 [list no:version:reply nick host]
  }
  return 0
}

proc no:version:reply {nick uhost} {
   global cversion
   if {[info exists cversion([string tolower $nick])]} {
      #putserv "MODE $chan +b *!*@[lindex [split $uhost @] 1]"
      #putserv "KICK $chan $nick :No CTCP version reply"
      putserv "Gline $nick :no ctcp"
      unset cversion([string tolower $nick])
   }
}
P
PeLL
Voice
Posts: 28
Joined: Fri Mar 04, 2011 10:59 am
Location: spain
Contact:

Post by PeLL »

I confess that this was what I did the first time but the timer didn't work...
Tcl error in script for 'timer83':
invalid command name "no:version:reply"

like this for all connections, utimer error...

Thank you very much CrazyCat.
s
simo
Revered One
Posts: 1108
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

Also u seem to use ping to check version
User avatar
CrazyCat
Revered One
Posts: 1304
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

Simo is right, you have to do:

Code: Select all

putserv "PRIVMSG $nick :\001VERSION\001"
And concerning your error: can you show us your complete script ? If you only have the small piece of code which is in this thread, this error is weird. Or you have a typo somewhere.
P
PeLL
Voice
Posts: 28
Joined: Fri Mar 04, 2011 10:59 am
Location: spain
Contact:

Post by PeLL »

oh that's right, I made a mistake about ctcp...
23:26:15 pell [23:21:38] -NOTICE- *** CONNECT: Client connecting on port 6667 (class main): Guest-98765!Guest@XX.XX.XX.XX (XX.XX.XX.XX) [...]
23:26:15 pell [23:21:39] Tcl error [version:reply]: invalid command name "version:reply"
23:26:15 pell [23:21:39] CTCP reply VERSION: mIRC v7.36 Khaled Mardam-Bey from Guest-98765 (Guest@egg-9hl.fe7.r1tsib.IP) to pell
23:26:29 pell [23:21:53] Tcl error in script for 'timer95':
23:26:29 pell [23:21:53] invalid command name "no:version:reply"
Post Reply