egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

enforce bans / kicks on all common channels
Goto page Previous  1, 2
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Get_A_Fix
Master


Joined: 07 May 2005
Posts: 206
Location: New Zealand

PostPosted: Fri Jun 17, 2016 10:37 pm    Post subject: Reply with quote

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:
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.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
simo
Owner


Joined: 22 Mar 2015
Posts: 646

PostPosted: Sat Jun 18, 2016 4:45 pm    Post subject: Reply with quote

i dont know how too i tried few things but didnt work
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 646

PostPosted: Tue May 25, 2021 12:47 pm    Post subject: Reply with quote

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?"
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3733
Location: Mint Factory

PostPosted: Wed May 26, 2021 2:18 am    Post subject: Reply with quote

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

incr len - $enforce(max)

like:
Code:

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:

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.
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 646

PostPosted: Wed May 26, 2021 9:58 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3733
Location: Mint Factory

PostPosted: Wed May 26, 2021 10:26 am    Post subject: Reply with quote

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

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

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.
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 646

PostPosted: Wed May 26, 2021 11:41 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber