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.
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
michalis
Voice
Posts: 1 Joined: Sun Jul 01, 2007 10:46 am
Post
by michalis » Sun Jul 01, 2007 10:50 am
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
awyeah
Revered One
Posts: 1580 Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:
Post
by awyeah » Mon Jul 09, 2007 7:57 am
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.
==================================
PeLL
Voice
Posts: 28 Joined: Fri Mar 04, 2011 10:59 am
Location: spain
Contact:
Post
by PeLL » Thu Feb 28, 2019 4:55 pm
It works very well
Can you add to ignore idents?
Large channel much lag.
Thank you .
Dominatez
Halfop
Posts: 50 Joined: Mon Jan 14, 2019 5:08 pm
Location: United Kingdom
Post
by Dominatez » Thu Mar 07, 2019 4:05 pm
I am getting the following error.
Tcl error [ctcpvers]: can't read "::verschan": no such variable
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Fri Mar 08, 2019 2:31 am
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.
@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.
PeLLq
Voice
Posts: 3 Joined: Wed Apr 24, 2019 1:24 pm
Post
by PeLLq » Fri Apr 26, 2019 12:06 pm
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.
simo
Revered One
Posts: 1108 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Sat Apr 27, 2019 4:58 pm
so ur bot is opered ?
PeLLq
Voice
Posts: 3 Joined: Wed Apr 24, 2019 1:24 pm
Post
by PeLLq » Sat Apr 27, 2019 6:04 pm
if right.
Thank you very much for answering
Dominatez
Halfop
Posts: 50 Joined: Mon Jan 14, 2019 5:08 pm
Location: United Kingdom
Post
by Dominatez » Tue Apr 30, 2019 5:20 pm
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.
PeLL
Voice
Posts: 28 Joined: Fri Mar 04, 2011 10:59 am
Location: spain
Contact:
Post
by PeLL » Thu Aug 10, 2023 2:09 pm
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 .
CrazyCat
Revered One
Posts: 1304 Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:
Post
by CrazyCat » Fri Aug 11, 2023 2:07 am
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])
}
}
PeLL
Voice
Posts: 28 Joined: Fri Mar 04, 2011 10:59 am
Location: spain
Contact:
Post
by PeLL » Fri Aug 11, 2023 3:29 pm
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.
simo
Revered One
Posts: 1108 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Fri Aug 11, 2023 4:28 pm
Also u seem to use ping to check version
CrazyCat
Revered One
Posts: 1304 Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:
Post
by CrazyCat » Fri Aug 11, 2023 5:29 pm
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.
PeLL
Voice
Posts: 28 Joined: Fri Mar 04, 2011 10:59 am
Location: spain
Contact:
Post
by PeLL » Fri Aug 11, 2023 5:51 pm
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"