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 

clearbans it's not working
Goto page Previous  1, 2, 3, 4
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
caesar
Mint Rubber


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

PostPosted: Tue Feb 05, 2019 3:41 am    Post subject: Reply with quote

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:

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:

<- :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.
_________________
I tawt I taw a puddy tat!


Last edited by caesar on Tue Feb 05, 2019 10:50 am; edited 2 times in total
Back to top
View user's profile Send private message
Stefano1990
Voice


Joined: 04 Jun 2018
Posts: 20

PostPosted: Tue Feb 05, 2019 4:15 am    Post subject: Hello Reply with quote

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

[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.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
caesar
Mint Rubber


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

PostPosted: Tue Feb 05, 2019 5:14 am    Post subject: Reply with quote

Ah, my bad again. Rolling Eyes

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:

lassign [split $raw] bot chan ban nick time

and replace it with:
Code:

lassign [split $text] bot chan ban nick time

and should fix things.
_________________
I tawt I taw a puddy tat!
Back to top
View user's profile Send private message
Stefano1990
Voice


Joined: 04 Jun 2018
Posts: 20

PostPosted: Tue Feb 05, 2019 5:38 am    Post subject: Hello Reply with quote

now is show this echo on PL during !clearbans
Code:

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.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
caesar
Mint Rubber


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

PostPosted: Tue Feb 05, 2019 11:16 am    Post subject: Reply with quote

I've noticed a few more typos and decided to pull down the code so I can properly test it and post when done.
_________________
I tawt I taw a puddy tat!
Back to top
View user's profile Send private message
Stefano1990
Voice


Joined: 04 Jun 2018
Posts: 20

PostPosted: Tue Feb 05, 2019 12:45 pm    Post subject: Hello Reply with quote

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


Joined: 22 Mar 2015
Posts: 330

PostPosted: Wed Feb 06, 2019 6:58 am    Post subject: Reply with quote

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


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

PostPosted: Wed Feb 06, 2019 9:50 am    Post subject: Reply with quote

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:

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.
_________________
I tawt I taw a puddy tat!
Back to top
View user's profile Send private message
simo
Master


Joined: 22 Mar 2015
Posts: 330

PostPosted: Wed Feb 06, 2019 10:20 am    Post subject: Reply with quote

indeed thats what it was thx again caesar

Quote:
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
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 -> Scripting Help All times are GMT - 4 Hours
Goto page Previous  1, 2, 3, 4
Page 4 of 4

 
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