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.
Help for those learning Tcl or writing their own scripts.
FmX
Voice
Posts: 39 Joined: Wed Dec 06, 2006 12:42 pm
Post
by FmX » Sat Oct 14, 2023 12:57 pm
Hello, can someone told me how to make this script to work on channels that i want:
Code: Select all
bind ctcr - VERSION version:reply
bind join - * check:version
proc check:version {nick uhost hand chan} { if {$nick eq $::botnick} {return}
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])
}
}
Thanks
Online
CrazyCat
Revered One
Posts: 1301 Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:
Post
by CrazyCat » Sat Oct 14, 2023 6:21 pm
If you want to use it on only one channel, just modify the bind join:
Code: Select all
bind join - "#yourchan *" check:version
If you want to use it on several channels, the better way is to add a channel setting and check if it's enabled or not for the joined channel:
Code: Select all
setudef flag vcheck
bind join - * check:version
proc check:version {nick uhost hand chan} {
global cversion
if {$nick eq $::botnick} {return}
if {![channel get $chan vcheck]} { return }
set cversion([string tolower $nick]) 1
putserv "PRIVMSG $nick :\001VERSION\001"
utimer 15 [list no:version:reply $nick $uhost $chan]
}
FmX
Voice
Posts: 39 Joined: Wed Dec 06, 2006 12:42 pm
Post
by FmX » Sun Oct 15, 2023 1:47 am
Ok, cool thanks. But if i want to run on specific channels, here to add?
bind join - "#yourchan #test2 *" check:version
simo
Revered One
Posts: 1108 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Sun Oct 15, 2023 6:24 am
or/and you could use it with public command to enable/disable in channel
Syntax: !version on/off
Code: Select all
bind PUB n !version Pub:Version:Checker
setudef flag vcheck
proc Pub:Version:Checker {nick uhost hand chan arg} {
switch -nocase -- [lindex [split $arg] 0] {
on {
if {[channel get $chan vcheck]} {
putserv "NOTICE $nick :Version-Checker is already enabled on $chan."
} else {
channel set $chan +vcheck
putserv "NOTICE $nick :Version-Checker is now enabled on $chan."
}
}
off {
if {![channel get $chan vcheck]} {
putserv "NOTICE $nick :Version-Checker is already disabled on $chan."
} else {
channel set $chan -vcheck
putserv "NOTICE $nick :Version-Checker is now disabled on $chan."
}
}
}
}
bind join - * check:version
bind ctcr - VERSION version:reply
proc check:version {nick uhost hand chan} {
global cversion
if {$nick eq $::botnick} {return}
if {![channel get $chan vcheck]} { return }
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])
}
}
aslpls
Halfop
Posts: 47 Joined: Mon May 02, 2016 9:41 am
Post
by aslpls » Sun Oct 15, 2023 8:24 am
so this is the function of this script
Code: Select all
* Trivia (ux@Tri.via) has joined #aslpls
* aslbot sets mode: +b *!*@Tri.via
* Trivia was kicked by aslbot (No CTCP version reply)
I think it will kick all the users joining the channel
simo
Revered One
Posts: 1108 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Sun Oct 15, 2023 9:57 am
aslpls wrote: so this is the function of this script
Code: Select all
* Trivia (ux@Tri.via) has joined #aslpls
* aslbot sets mode: +b *!*@Tri.via
* Trivia was kicked by aslbot (No CTCP version reply)
I think it will kick all the users joining the channel
meaning u tested it and thats what happened or you just think that happens without even testing it ?
aslpls
Halfop
Posts: 47 Joined: Mon May 02, 2016 9:41 am
Post
by aslpls » Sun Oct 15, 2023 2:25 pm
hey man simo, in this forum i am not posting a comment without testing it.
yes i've tried it. and it works.
just wondering, if a user (No CTCP version reply) .. it will kick/ban the user.
again, just wondering..
if you can explain it to me what's the point on this script to be used in this channel so that i ca n understand. i am not like you can create this kind of script and understand the flow.
FmX
Voice
Posts: 39 Joined: Wed Dec 06, 2006 12:42 pm
Post
by FmX » Sun Oct 15, 2023 2:37 pm
Its against spam bots who join spam and leave.
They doesnt respond to version
aslpls
Halfop
Posts: 47 Joined: Mon May 02, 2016 9:41 am
Post
by aslpls » Sun Oct 15, 2023 3:01 pm
yes, i understand it is for spambot..
but my bot which is Trivia bot it is not a spam bot. and still
kick/ban my bot.
how the bot should decide if this bot is a spam bot or not?
FmX
Voice
Posts: 39 Joined: Wed Dec 06, 2006 12:42 pm
Post
by FmX » Mon Oct 16, 2023 8:33 am
It cant, kick ban everyone who doesnt reply to version