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.
Old posts that have not been replied to for several years.
metroid
Owner
Posts: 771 Joined: Wed Jun 16, 2004 2:46 am
Post
by metroid » Mon Aug 30, 2004 1:50 am
Code: Select all
bind mode - "* +b" do_on_ban
proc do_on_ban {nick host hand chan mode vict} {
global botnick protector
if {![validuser $hand]} {
if {[string tolower $nick] == [string tolower $botnick]} { return }
if {![matchattr $hand o]} {
puthelp "NOTICE $nick :$protector(reply)"
pushmode $chan -o $nick
newchanban $chan [maskhost [getchanhost $nick $chan]] $botnick $protector(reason) 1
putserv "MODE $chan +b [maskhost [getchanhost $nick $chan]]"
pushmode $chan -b [lindex $banlist [expr [llength [chanbans $chan]] -1]]
}
}
}
This is the code, now the problem is, the bot doesn't unban people. Its because the person that made it (Papillon) didnt define banlist and i have no clue what to set banlist too then, I've send him an email but i have no clue if he's still active in the tcl stuff
awyeah
Revered One
Posts: 1580 Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:
Post
by awyeah » Mon Aug 30, 2004 3:51 am
What does this script do at first?
It binds on mode +b, so if a ban is set by a non-op (not an +o) then that person is deoped and banned by the bot?
Then why do you use putserv, when you have already used newchanban, strange
Then after that what are you trying to unban? the ban placed?
I presume you can get that out of $vict if I am correct.
And replace this:
Code: Select all
if {[string tolower $nick] == [string tolower $botnick]} { return }
with:
Code: Select all
if {([string equal -nocase $botnick $nick])} { return 0 }
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
metroid
Owner
Posts: 771 Joined: Wed Jun 16, 2004 2:46 am
Post
by metroid » Mon Aug 30, 2004 5:53 am
The script bans the person that sets an ban without permission, afterwards it has to unset the ban set by that person without permission.
Example:
* moo sets mode: +b blah!
blah@moomoobot.com
* chanbot sets mode: -o+b moo moo!
moo@mooshost.com
* moo was kicked by chanbot (Don't break the rules)
* chanbot sets mode: -b blah!
blah@moomoobot.com
Thats what its supposed to do, but so far it only bans the person and then nothing happens cept for the error that it can't find the banlist variable.
awyeah
Revered One
Posts: 1580 Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:
Post
by awyeah » Mon Aug 30, 2004 6:16 am
Code: Select all
pushmode -b [lindex $banlist [expr [llength [chanbans $chan]] -1]]
Basically what this code is trying todo is, that it is finding the last ban placed in the channels banlist and removing it.
It might not be working as there maybe a difference with the IRCd and also because $banlist is not defined.
Try this:
Code: Select all
pushmode -b [lindex [expr [llength [chanbans $chan]] -1] 0]
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
metroid
Owner
Posts: 771 Joined: Wed Jun 16, 2004 2:46 am
Post
by metroid » Mon Aug 30, 2004 8:40 am
nope, nothing happens :\
YooHoo
Owner
Posts: 939 Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast
Post
by YooHoo » Mon Aug 30, 2004 1:43 pm
MeTroiD wrote: Code: Select all
bind mode - "* +b" do_on_ban
...
putserv "MODE $chan +b [maskhost [getchanhost $nick $chan]]"
seems like there shouldn't be a space in your bind to me...
Also seems like you wouldn't use
putserve "MODE $chan +b... , but rather the
pushmode command.
metroid
Owner
Posts: 771 Joined: Wed Jun 16, 2004 2:46 am
Post
by metroid » Mon Aug 30, 2004 2:04 pm
Yoohoo, The banning works just fine. Its the unbanning, read the post next time plz
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Mon Aug 30, 2004 2:41 pm
awyeah wrote: Code: Select all
pushmode -b [lindex [expr [llength [chanbans $chan]] -1] 0]
how about
YooHoo wrote: MeTroiD wrote: Code: Select all
bind mode - "* +b" do_on_ban
...
putserv "MODE $chan +b [maskhost [getchanhost $nick $chan]]"
seems like there shouldn't be a space in your bind to me...
The space in the bind is there for a reason. Your bind would match any mode on a channel with "+b" in its name
Have you ever read "The Manual"?
metroid
Owner
Posts: 771 Joined: Wed Jun 16, 2004 2:46 am
Post
by metroid » Tue Aug 31, 2004 1:24 am
I've tried something else, and this works but i've seen it get errors sometimes
Code: Select all
bind mode -|- "* +b" modes:saveban
proc modes:saveban {nick host hand chan mode vict} {
global lastban
if {($mode == "+b")} {
set lastban($chan) $vict
}
}
bind mode - "* +b" banprot
proc banprot {nick host hand chan mode vict} {
global botnick protector lastban
if {![channel get $chan paranoid]} {
return
}
if {[channel get $chan enforce]} {
return
}
if {![validuser $hand]} {
if {[string tolower $nick] == [string tolower $botnick]} { return }
if {![matchattr $hand o]} {
putquick "MODE $chan -b $lastban($chan)"
unset lastban($chan)
putquick "MODE $chan -o+b $nick [maskhost [getchanhost $nick $chan]]"
putquick "KICK $chan $nick :$protector(reason)"
}
}
}
awyeah
Revered One
Posts: 1580 Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:
Post
by awyeah » Tue Aug 31, 2004 8:09 am
You can always do:
As 'user' said, it will unban the last placed ban when you bind on +b. Hopefully provided the modes are not +bb, +bbb or even more heh. (then there might be some adjustment required)
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Tue Aug 31, 2004 10:00 am
awyeah wrote: Hopefully provided the modes are not +bb, +bbb or even more heh. (then there might be some adjustment required)
tcl-commands.doc wrote: mode changes are broken down into their component parts before being sent here, so the <mode-change> will always be a single mode, such as "+m" or "-o".
Have you ever read "The Manual"?
metroid
Owner
Posts: 771 Joined: Wed Jun 16, 2004 2:46 am
Post
by metroid » Tue Aug 31, 2004 1:59 pm
Tried it but it doesnt work.
awyeah
Revered One
Posts: 1580 Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:
Post
by awyeah » Mon Sep 06, 2004 11:44 pm
Okay, here try this.
I've reduced most lines into one and shortened it.
Code: Select all
bind mode - "+*b*" ban:prot
proc ban:prot {nick uhost hand chan mode target} {
global botnick
if {(![channel get $chan paranoid]) || ([channel get $chan +enforce]) || ([string equal -nocase $botnick $nick]) || ([matchattr $hand o|o $chan])} { return 0 }
if {([string match "*+b*" $mode]) && ($target != "")} {
putquick "MODE $chan -o+b-b $nick [maskhost [getchanhost $nick $chan]] $target" -next
putquick "KICK $chan $nick :Do not ban that address!" -next; return 0
}
}
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
metroid
Owner
Posts: 771 Joined: Wed Jun 16, 2004 2:46 am
Post
by metroid » Tue Sep 07, 2004 1:56 am
Wow, thanks that actually worked exactly like i wanted it to work :]
awyeah
Revered One
Posts: 1580 Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:
Post
by awyeah » Tue Sep 07, 2004 2:00 am
Haha, okay actually I didn't change anything or do anything new if you look closer.
All I did was grouped all your conditions into one which made it easier to read and to implement.
Next time use putlogs to see the outputs and check them.
E.g. putlog "Banmask: $target"
#To see the banmask banned by the user (in your case)
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================