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.

enforce bans / kicks on all common channels

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
User avatar
Get_A_Fix
Master
Posts: 206
Joined: Sat May 07, 2005 6:11 pm
Location: New Zealand

Post by Get_A_Fix »

simo wrote:looks to be working good caesar
is it possible to have it also remove ban on all channels if a ban is removed
You'd have to

Code: Select all

bind mode - "% -b" [namespace current]::banRemoval
and track either only the bans the bot placed, or all of the bans on each channel. It would require building another proc (named banRemoval) to do the opposite of what the enforce procedure does.
We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals.
s
simo
Revered One
Posts: 1072
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

i dont know how too i tried few things but didnt work
s
simo
Revered One
Posts: 1072
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

i tested your script again ceasar when setting bans on weird chars of nicks and that gave me an error:

&ChanServ Sets Mode on #shqiperia to: +b *[*!*@*
18:44:37 (1 User) is Banned [hjsdd]

wich should have kicked [hjsdd]

but instead returned error: Tcl error [::enforceBans::enforce]: wrong # args: should be "incr varName ?increment?"
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Ah, there's a space between - and $enforce(max), just remove it in:

Code: Select all

incr len - $enforce(max)
like:

Code: Select all

incr len -$enforce(max)
As for this:
simo wrote:looks to be working good caesar
is it possible to have it also remove ban on all channels if a ban is removed
Add this in the namespace of the other code:

Code: Select all

bind mode - "% -b" [namespace current]::banRemoval

proc banRemoval {nick uhost hand chan mc ban} {
	foreach ch [channels] {
		if {![botisop $ch]} continue
		if {[ischanban $ban $ch]} {
			pushmode $ch -b $ban
		}
	}
}
Haven't tested so let me know if works (or doesn't) as intended.
Once the game is over, the king and the pawn go back in the same box.
s
simo
Revered One
Posts: 1072
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

thanks for the reply caesar i changed what u suggested but now when trying to
ban like:

15:56:09 &ChanServ Sets Mode on #shqiperia to: +b *[*!*@*
15:56:09 (1 User) is Banned [dsqw]ccno

wich should have kicked out [dsqw]ccno
but it didnt trigger and no errors
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Right, let's give matchaddr a try then by replacing:

Code: Select all

if {![string match -nocase $ban $n![getchanhost $n $c]]} continue
with:

Code: Select all

if {![matchaddr $ban $n![getchanhost $n $c]]} continue
See if this works and reply back.
Once the game is over, the king and the pawn go back in the same box.
s
simo
Revered One
Posts: 1072
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

excellent that seems to work in all conditions thanks caesar

i also tested the one for removal and that seems to work as well

much apreciated caesar
Post Reply