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.

clearbans it's not working

Help for those learning Tcl or writing their own scripts.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

This discussion is/was about removing all channel bans upon user request. You should make your own topic in Script Requests as things tend to go in a different dirrection.

As for automatically remove all bans older than 1 hour or whatever you want I updated the code:

Code: Select all

Code cemoved cos will read after some proper testing. Enough making a fool of myself for today.  xD
Keep in mind that I haven't tested anything so it's up to you to do this task and report back if get any errors.

Also, notice that there's a new channel flag called clearbans that you need to activate with .chanset #channel +clearbans on the channels where you want the 1 hour (or whatever) bans to be removed automatically.

Oh, and if the nick isn't specified in the channel bans list and not bot's internal bans list, then the "simple user . ! ub nick not other bans" is kind of impossible to achieve. What I mean by this? If you have mIRC do /debug @x then a /mode #channel b where #channel is an actual channel you are on and see the output in the @x window that just showed up.

Let's take as example my output:

Code: Select all

<- :amsterdam.nl.eu.undernet.org 367 me #EggDrop *!~eggy@modemcable*.mc.videotron.ca * 1548937832
where me is my name obviously, #EggDrop is the channel, *!~eggy@modemcable*.mc.videotron.ca is the ban mask, * is the nick and 1548937832 is the timestamp in unix time format (how many seconds have passed since 00:00:00 on 1 January 1970). So, since the nick is * you can't actually match a nick against that as will match all bans.

If you wanted !clearbans, .cb, !cb to do the same thing then duplicate the line with !clearbans and change the command to .cb or whatever you want.

Edit: Fixed typo.
Last edited by caesar on Tue Feb 05, 2019 10:50 am, edited 2 times in total.
Once the game is over, the king and the pawn go back in the same box.
S
Stefano1990
Voice
Posts: 25
Joined: Mon Jun 04, 2018 10:07 am
Contact:

Hello

Post by Stefano1990 »

ceasar when i type !clearbans on PL is show me this echo repeated 28 times same link

Code: Select all

[10:14:16] <TEST> [09:14:16] Tcl error [::clearbans::raws]: can't read "raw": no such variable
[10:14:16] <TEST> [09:14:16] Tcl error [::clearbans::raws]: can't read "raw": no such variable
[10:14:16] <TEST> [09:14:16] Tcl error [::clearbans::raws]: can't read "raw": no such variable
[10:14:16] <TEST> [09:14:16] Tcl error [::clearbans::raws]: can't read "raw": no such variable
Use your common sense and try not to make me look too much like I know what I'm doing.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Ah, my bad again. :roll:

I was testing stuff in tclsh environment and had a variable called raw and in the code it's actually called text, so locate:

Code: Select all

lassign [split $raw] bot chan ban nick time
and replace it with:

Code: Select all

lassign [split $text] bot chan ban nick time
and should fix things.
Once the game is over, the king and the pawn go back in the same box.
S
Stefano1990
Voice
Posts: 25
Joined: Mon Jun 04, 2018 10:07 am
Contact:

Hello

Post by Stefano1990 »

now is show this echo on PL during !clearbans

Code: Select all

Tcl error [::clearbans::raws]: can't use non-numeric string as operand of "-"
Use your common sense and try not to make me look too much like I know what I'm doing.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I've noticed a few more typos and decided to pull down the code so I can properly test it and post when done.
Once the game is over, the king and the pawn go back in the same box.
S
Stefano1990
Voice
Posts: 25
Joined: Mon Jun 04, 2018 10:07 am
Contact:

Hello

Post by Stefano1990 »

ceasar its ok my friend when u have time thx again in advance with ur excellent work scripts
Use your common sense and try not to make me look too much like I know what I'm doing.
s
simo
Revered One
Posts: 1108
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

i had some other similar script wich gave me the error its fixed now
tnx again caesar for the efforts i was curious about 1 thing tho i tried using the

set clearbans(max) 6

i changed it to 15 since inspircd servers allow 15 mode settings per line
yet is seems to remove bans in sets of 5 no matter what i do any way to
fix this ?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Most likely you have a clearbans(max) variable in another script that overwrites the 15 you write, hence why i told you to unload other scripts. To make sure the server really allows you to issue 15 modes per line when you connect to the server should notice a line like this for instance from Undernet:

Code: Select all

WHOX WALLCHOPS WALLVOICES USERIP CPRIVMSG CNOTICE SILENCE=25 MODES=6 MAXCHANNELS=50 MAXBANS=100 NICKLEN=12 are supported by this server
where MODES=6 is the max you are permitted.

I like to wrap code into namespaces cos then I don't have to worry about variables being overwritten from another file or have duplicated function names.
Once the game is over, the king and the pawn go back in the same box.
s
simo
Revered One
Posts: 1108
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

indeed thats what it was thx again caesar
I like to wrap code into namespaces cos then I don't have to worry about variables being overwritten from another file or have duplicated function names.
sounds very usefull as i found out myselve it can be a thing if u forget u have some same variable somewhere
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

Yes but he also wanted it to clear Channel Bans of the channel
which is what we now have :)

ps this will do great for my new Security Script 8)
ComputerTech
Post Reply