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.

AllProtection.tcl (Stable: v4.8 / Beta: v4.9b4)

Support & discussion of released scripts, and announcements of new releases.
Post Reply
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Basically, what .ap:disable does is that it disables all the .ap:settings. However, there's no .ap:enable command which restores the channel's original settings. One option is to use the .ap:reset command to set AllProtection's default settings (set in the script) or .ap:import to import similar settings from another channel.
e
evildude
Voice
Posts: 24
Joined: Tue Feb 03, 2004 9:13 pm

Post by evildude »

Hi,
Ever since I changed over to the newest version people are being punished for typing channel names and the ban indicates it's an advertising word and the mask is *#c* and *#f* etc.

Now I can't find those entries anywhere. I looked at the tcl itself and also did an '.ap:list adwords global' and '.ap:list adwords #channel' and those entries are not listed. I also tried bwords and still can't find anything where they are listed. This only started with the use of the latest version. Any help would be appreciated.

Thanks
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Yes, the # is built-in in the new version of AllProtection for advertising protection (along with http://, ftp://, //(.)write and www.). However, You can use the adexempts list to exempt certain words from triggering the offense. For example if you add # to the adexempts list, it will no longer be detected as advertisement.
e
evildude
Voice
Posts: 24
Joined: Tue Feb 03, 2004 9:13 pm

Post by evildude »

Thanks for responding so quckly. I am thinking about doing an adexempt because of a situation I ran into. In the channel I run a stats bot and people type !place it tells them what rank they are in chatting. While discussing someones !place they happened to mention that they were "in place #3" and it banned him. :lol: :lol:
w
willyw
Revered One
Posts: 1200
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

Hello,

Have v4.5, and am now looking at v4.6b9, on Sir_Fz advice.

I knew that 4.5 would not ban ops. However there are times when it would be nice to be able to do so.

This line appears in the header of v4.6b9:
* AllProtection exempts channel ops, friends (+f) and masters (+mo) from protection by default.
and looks very familiar ( I don't have v4.5 in front of me at the moment)

But reading on down a bit, in v4.6b9, I see:
# Set here any additional exempts, you can exempt the following:
# ops: Channel ops
# halfops: Channel halfops
# voices: Channel voices
# +flags|+flags: Users with global or channel specific flags (e.g. +fm friends and masters...)
# -flags&-flags: Users which do not have the specified flags (e.g. -k&-k)
variable exmptype {ops voices +fmo|+fmo}
Additional?
In addition to what?

But the main question is,
If the line were change to : variable exmptype { }
Would AllProtection then no longer exempt ops?

It looks like, if left alone, the "default" behavior mentioned earlier would prevail, and since "ops" are mentioned specifically in the variable exmptype, then perhaps if it is removed then the behavior of AP now, as compared to v4.5 will be different.... and AP can now kick and ban ops?
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

I should probably change the word "Additional" as there are no built-in exempts any more. You can set the default exemptions in this setting as mentioned in its documentation. If you do not want to exempt channel operators then you can simply remove "ops" from the setting (same with other exempts). So yes, if you set it to {}, the bot won't exempt anyone.
w
willyw
Revered One
Posts: 1200
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

Sir_Fz wrote:I should probably change the word "Additional" as there are no built-in exempts any more. You can set the default exemptions in this setting as mentioned in its documentation. If you do not want to exempt channel operators then you can simply remove "ops" from the setting (same with other exempts). So yes, if you set it to {}, the bot won't exempt anyone.
Excellent!

Thanks for the reply
w
willyw
Revered One
Posts: 1200
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

I see:
* AllProtection does not use the internal banlist of the bot so you will not have to worry
# about other ops not being able to remove the bans, they can! (feature or bug, I dont care :P)
is in the header still.

Is there any way around this now? or too much to modify?

Such that AP can set a ban, so that if it is removed without using the bot, that the bot would put it back on? (dynamic or sticky.. either would be ok)

If not capable now, could it be made a configurable option then?

Thanks.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

The script can be altered a little bit to place internal bans instead of just channel bans. I'm at work right now so I don't have time to do it; try to fiddle around with the script and modify it (the banning lines are not more than two or three in the script...). It is a good idea to make it a configurable feature though, so I'll keep it in consideration.
w
willyw
Revered One
Posts: 1200
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

Sir_Fz wrote:The script can be altered a little bit to place internal bans instead of just channel bans. I'm at work right now so I don't have time to do it; try to fiddle around with the script and modify it (the banning lines are not more than two or three in the script...). It is a good idea to make it a configurable feature though, so I'll keep it in consideration.

Thanks for the reply.
This is encouraging! :)


So you know, I am not a tcl programmer. Or any kind of programmer.
By your response above, I'm afraid that you believe I know something of tcl.
Just wanted to clarify that.

But I did have a look at tcl-commands.doc, and also:
http://www.egghelp.org/files/tcl.doc
along with allprotection4.6b9.tcl

I don't know what other reference material to use, or where to start (if anybody wants to comment with direction, that would be much appreciated - some of the links here http://www.egghelp.org/faq.htm#040 are dead )

I got to here in your script:

Code: Select all

proc queue {c b} {
 variable apqueue
 if {$apqueue(time) < 1} {putquick "MODE $c +b $b"} {
  lappend apqueue([string tolower $c]) $b
 }
}
and am not at all sure I'm in the right place. Laugh if you want to now.

And as best as I can tell, nothing happens if apqueue time is set above 1.
Yet... it must. Doesn't it?
That was a big stumbling spot.
And I don't know how the lappend part interacts.

Then, in tcl-commands.doc, I found newchanban , and I suspect that is what I'd want to try to use.
newchanban <channel> <ban> <creator> <comment> [lifetime] [options]
But I don't know how to pass to it all the parameters that it wants, from the variables in your script.


I'm way over my head, and lost.
Sorry. I wish I could participate more, but I've spent enough time on it to realize that I need help.

Whenever you get time, if you could direct me some, I would like very much to experiment with adding the internal ban.
I suppose it doesn't matter if the present ban by "mode" command stays active too. Can't we just add this on top of it, for simplicity's sake?

Thanks again.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

apqueue(time) is the time in seconds used for the queue timer. If it's set to 1 for example, the script will launch a timer which will queue bans and dump them every 1 second. So, suppose your bot issues 3 bans in 0.8 seconds before the proc is triggered, when the dump:queues procedure is triggered, the script will simultaneously set the three bans together (depending on your network that is). Now, in your situation, since you're going to use Eggdrop [newchanban] then you don't need AP's queue. I recommend the following changes to integrate Eggdrop's [newchanban]:

1. Set apqueue(time) to 0

2. Replace occurrences of:

Code: Select all

queue $c $bm
with

Code: Select all

queue $c $bm $bti [clonemap [mapall $km $c $bti] [incr cc]]
3. Add kr and bt to procedure queue like this:

Code: Select all

proc queue {c b bt kr} {
4. Replace the following line from procedure queue:

Code: Select all

if {$apqueue(time) < 1} {putquick "MODE $c +b $b"} {
with

Code: Select all

if {$apqueue(time) < 1} {newchanban $c $b AllProtection $kr $bt} {
Edit: You might want to remove the unban timer after setting the ban, so comment or remove the lines following the [queue] line:

Code: Select all

if {$bti > 0 && [istimer "pushmode $c -b $bm"] == ""} {
 timer $bti [list pushmode $c -b $bm]
}
and you can also remove the kick-line since [newchanban] does that already: (under "kb" in punish proc)

Code: Select all

if {[onchan $jn $c] && ![punishing k:$jn:$c]} {
 putquick "KICK $c $jn :[clonemap [mapall $km $c $bti] [incr cc]]"
}
Last edited by Sir_Fz on Sat Feb 21, 2009 4:13 am, edited 1 time in total.
w
willyw
Revered One
Posts: 1200
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

Sir_Fz wrote:apqueue(time) is the time in seconds used for the queue timer. If it's set to 1 for example, the script will launch a timer which will queue bans and dump them every 1 second. So, suppose your bot issues 3 bans in 0.8 seconds before the proc is triggered, when the dump:queues procedure is triggered, the script will simultaneously set the three bans together (depending on your network that is). Now, in your situation, since you're going to use Eggdrop [newchanban] then you don't need AP's queue.
Just curious... but why was it needed at all?
I recommend the following changes to integrate Eggdrop's [newchanban]:
...
Thank you very much for taking time to do this for me, and anybody else that might be following along. :)

Have made the changes (more on this below), and done some quick testing... and it seems to work!

This is very nice.

I hope that whenever you do a new release, that you include some option, such that we can choose which way we want to implement bans.
If not, I'm probably going to stick with this. This was one of the only (along with being able to choose to exempt Ops or not) reasons that we used xchannel for some certain protections. With these two new capabilities, AP is looking very, very nice.
3. Add kr and bt to procedure queue like this:

Code: Select all

proc queue {c b kr bt} {
Here is a big question.

Using the above, it didn't seem to behave properly. With very limited understanding, I tried to follow the process.

I think the above might be a typo, in that the position of "kr" and "bt"
are inverted.

Using:

Code: Select all

proc queue {c b bt kr} {
here now, and it seems to do what it is supposed to now.

When you have time, could you look at it again, and let us know if this is the correct order for "bt" and "kr"?
...
Edit: You might want to remove the unban timer after setting the ban, so comment or remove the lines following the [queue] line:

Code: Select all

if {$bti > 0 && [istimer "pushmode $c -b $bm"] == ""} {
 timer $bti [list pushmode $c -b $bm]
}
:) Did you come back and add these lines? or did I just overlook them?
See... I spent a lot of time, scratching my head, and trying to pin down where a problem was, to present it to you with as much info as I could.
What was happening was: Bot would remove the ban at the right time, but would not "expire" the ban within itself! Ban could not be found with
.bans , but could be found with .bans all as a global ban!
If user re-entered, he would be banned again, and now it would become a channel ban again, and would not expire.
If user did not enter, then 1 minute after the ban was removed, it would also "expire".

It was a confusing mess.

However, when I came back to report to you, I found the above. Made those edits.
Now... it "expires" the ban FIRST, then immediately removes it.
In other words... it works much better, and seems to be usable now.
and you can also remove the kick-line since [newchanban] does that already: (under "kb" in punish proc)

Code: Select all

if {[onchan $jn $c] && ![punishing k:$jn:$c]} {
 putquick "KICK $c $jn :[clonemap [mapall $km $c $bti] [incr cc]]"
}

Again, many thanks to you. I really appreciate this. Will try to report again, after more time in testing.
I hope somebody else reading along finds this useful too.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

willyw wrote:
Sir_Fz wrote:apqueue(time) is the time in seconds used for the queue timer. If it's set to 1 for example, the script will launch a timer which will queue bans and dump them every 1 second. So, suppose your bot issues 3 bans in 0.8 seconds before the proc is triggered, when the dump:queues procedure is triggered, the script will simultaneously set the three bans together (depending on your network that is). Now, in your situation, since you're going to use Eggdrop [newchanban] then you don't need AP's queue.
Just curious... but why was it needed at all?
This has been implemented to allow the eggdrop to queue as much bans as possible before dumping them to the server. It very much reduces the bot's possibility of flooding out in case of massive floods (where it would send to the server 10s of ban commands in seconds instead of stacking them in single commands).
willyw wrote:
3. Add kr and bt to procedure queue like this:

Code: Select all

proc queue {c b kr bt} {
Here is a big question.

Using the above, it didn't seem to behave properly. With very limited understanding, I tried to follow the process.

I think the above might be a typo, in that the position of "kr" and "bt"
are inverted.

Using:

Code: Select all

proc queue {c b bt kr} {
here now, and it seems to do what it is supposed to now.

When you have time, could you look at it again, and let us know if this is the correct order for "bt" and "kr"?
Yes, you are right, I accidentally flipped the order :) I edited my post now and corrected this "typo."
F
FireWarrior
Voice
Posts: 19
Joined: Tue Oct 28, 2008 1:12 am

AllProtection v4.6b9 by Opposing - AntiSpamBot basic setting

Post by FireWarrior »

Hello all.
First off, congratulations Opposing/Sir_Fz for a great script and many thanks for the tremendous hard work that you’ve put in it. I’m both glad and grateful.
Everything works like a dream but for some reason I’m not able to get the anti spam bot running. The script loads fine, and I get no error messages, but the cycler is nowhere to be seen…
I’ve set the following variables in the script:
# AntiSpamBot basic settings
# You can edit all these settings as you wish
# example: set antispam(nick) AntiSpamBot
set antispam(nick) PandaBear
set antispam(altnick) PandaBear`
# Antispam ident & real name
set antispam(user) vitality
set antispam(realname) "Warm n sunggly."
# example: set antispam(ip) 127.0.0.1
set antispam(ip) 64.18.132.28
# example: set antispam(host) my.lame.vhost.net
set antispam(host) snuggly.pand.as
Then I set the values for the antispam bot using dcc. I’ve disabled the idle-time and it was successful as the quote shows:
.chanset #MyChannel ap:antispam "- 10"
<Datum> Successfully set modes { ap:antispam { "- 10" } } on #MyChannel.
Datum is my eggdrop v1.6.19
Please note:
1. vitality is the ident/user name of my eggdrop. I’ve provided the ip and host for the antispam bot from the list of available vhosts from my shell.
2. I’ve kept the values in 1. different from those of my eggdrop, i.e. the vhosts of the antispam bot are not the same as my bot.
I would like to repeat that I get no error messages and the script loads fine with this message:
<Datum> [00:01] AllProtection v4.6b9 by Opposing Loaded...
Could somebody please help? I need it desperately, but I’ll wait patiently… :)
Thanking you all for the time and effort in advance,
Regards.
Last edited by FireWarrior on Thu Feb 26, 2009 4:16 am, edited 2 times in total.
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Is antispam enabled on any of your bot's channels? In order to enable the antispam bot on a channel use: .chanset #channel ap:antispam + <greet> <cycle-time> <idle-time> (it is disabled by default).
Post Reply