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: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

It's fairly easy to implement it... I'll see if it'll be added in the next release.
d
dq
Voice
Posts: 32
Joined: Mon Apr 03, 2006 12:28 am

Post by dq »

Hey Fz,

Is there any possible way to implement a way for (either myself or you to include in the next release) a function that allows you to dynamically add bad words and/or advertising rules to the "aplists" (or even anything that's in the aplists file for that matter) file either by PUB/MSG/DCC.

Thus far I've tried adding them directly into the actual script it's self then rehashing, and adding it into "aplists" then rehashing/reloading/resetting the channel, the only way it works is if I add it into aplists then -chan it then +chan it again which is a major inconvenience for the type of situation the bo is in.

Any ideas/suggestions and even snippets would be greatly appreciated.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Adding to lists through the ap:add DCC command works just fine, no need for -/+chan at all. Note that the global lists are only used if there are no channel-specific lists. For example if channel #chan has no #chan bwords list then the bot will use the global bwords list. As for adding them via msg/public commands, I already said that I'll take it into consideration.
d
dq
Voice
Posts: 32
Joined: Mon Apr 03, 2006 12:28 am

Post by dq »

I see I see, thanks for the update.

However there was one issue I came across when adding via the command, the bot seems to malfunction when I add the word "[wordhere]" in some cases where the bot is idling people will use the brackets to evade the filtered words, so I thought I'd add them to the filter list as well. The situation is when I add "[wordhere]" the bot starts to ban anyone that types anything, like I just added * or something, I've made sure this was the issue as I isolated it to make sure.

Any ideas?

Edit: I forgot to mention I tried escaping the brackets with \[ and \] but still no go.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Actually escaping the brackets does work. [] have special meaning in string match, for example if you add "*[ab]*" then you'll be matching any string containing a OR b but if you add "*\[ab\]*" then you'll be matching any string containing [ab].
d
dq
Voice
Posts: 32
Joined: Mon Apr 03, 2006 12:28 am

Post by dq »

Ahh, I understand.. but what's the difference between using "*/[ab/]*" and just */[ab/]* as that's what I was using and it was breaking the bot?

And while I have you, can you help me with a another proc I'm having issues with, basically with this next proc I want to test for all the invalid characters, such as ` ~ ! @ # etc etc;

Code: Select all

proc pub:join {nick host hand chan arg} {
	set chan [lindex $arg 0]
	#set match [string map {\\ \\\\ [ \\\[ ] \\\] \{ \\\{ \} \\\}} $match]
	#proc icodes str { regexp {r:\d{1,3}\sb:\d{1,3}\su:\d{1,3}\sc:\d{1,3}} $str }
	if {[matchattr $hand A] == 0} {noaccess2 $nick ; return}
	if {$chan == $match} {notice $nick "You must provide a valid channel name." ; return}
	if {![llength [split $arg]] || [validchan [set channel [lindex [split $arg] 0]]]} {
		putquick "NOTICE $nick :\002join\002\: requires more parameters."
	} else {
		cmdlog $chan $nick $hand "join $chan"
		channel add $chan
		putquick "NOTICE $nick :I have joined \002$chan\002"
		putlog "\[[ctime [unixtime]]\] ($chan|$host) \[$nick:$hand\]: join $chan"
	}
}
I am still a novice so that's probably a bit wrong, basically I want the bot to check for invalid characters when you type (trigger)join #channel, or to make things easier I was thinking if there was a way that you could only type #channel and if you typed anything other than #with_a_word_here it will mark it as invalid, not sure if that's possible.

Thanks again for all your help.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

This should be able to do your job:

Code: Select all

proc pub:join {nick host hand chan arg} { 
   set chan [string map {\\ \\\\ [ \\\[ ] \\\] \{ \\\{ \} \\\} $ \\\$ \" \\\"} [string tolower [lindex $arg 0]]]
   if {[string equal "0" [matchattr $hand A]]} {noaccess2 $nick; return 0} 
   if {[string equal -nocase $match $chan]} {putserv "NOTICE $nick :You must provide a valid channel name." ; return 0}
   if {![llength [split $arg]] || [validchan $chan]} { 
      putquick "NOTICE $nick :\002join\002\: requires more parameters." 
   } else { 
      cmdlog $chan $nick $hand "join $chan"
      channel add $chan
      putquick "NOTICE $nick :I have joined \002$chan\002" 
      putlog "\[[ctime [unixtime]]\] ($chan|$host) \[$nick:$hand\]: join $chan"
   } 
}
For all the invalid characters you mentioned, you can use something like:

Code: Select all

if {[string match {*[`~@]*} [string index $chan 0]] || [string equal "##" [string range $chan 0 2]]} { return 0 }
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
d
dq
Voice
Posts: 32
Joined: Mon Apr 03, 2006 12:28 am

Post by dq »

I don't think it's working, at least not for me.. in a nutshell I basically want the bot to check for the invalid characters then return "You must provide a valid etc", with that being said I've done some research and to list all the characters that people could be using is an insanely redundant job, so I thought maybe if the person doesn't provide a word proceeding the hash (#) then the bot will reject it regardless, I'll list some examples below;
(trigger)join #
Which will return invalid channel.
(trigger)join #any sort of character
Which will return invalid channel.
(trigger)join #word
Bot joins the channel.

Hopefully that makes sense =x
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Give this a go, hopefully it should fullfil all your requirements.

Code: Select all

proc pub:join {nick host hand chan text} {
 if {[lindex $text 0] == ""} { 
  putserv "PRIVMSG $chan :Please provide a channel name"; return 0 
 }
 set chan [string map {\\ \\\\ [ \\\[ ] \\\] \{ \\\{ \} \\\} $ \\\$ \" \\\"} [string tolower [lindex $text 0]]]
 if {[string match {*[`~@$"]*} $chan] || [string match "* *" $chan] || ([regexp -all {\#} $chan] > 1)} { 
  putserv "PRIVMSG $chan :Please provide a valid channel name"; return 0
 }  
 if {[string equal "#" [string index $chan 0]] && [string match "#*" $chan] && [regexp -nocase {[0-9a-z]} [string range $chan 1 end]] && ([string length $chan] >= 2)} {
  channel add $chan 
  putserv "PRIVMSG $chan :I have joined \002$chan\002."
  }
}
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

dq wrote:Ahh, I understand.. but what's the difference between using "*/[ab/]*" and just */[ab/]* as that's what I was using and it was breaking the bot?
It's *\[ab\]* and not */[ab/]*. With or without quotes makes no difference.

Please keep irrelevant posts out of this thread. This thread is for AllProtection *ONLY*.
B
Balu
Voice
Posts: 4
Joined: Thu May 31, 2007 7:14 am

Post by Balu »

Got a prob with the following. could anybody pls help me?

[13:09] Tcl error in file 'baghira.conf':
[13:09] unmatched open quote in list
while executing
"lrange $apl 2 end"
(procedure "rd" line 5)
invoked from within
"rd"
(procedure "load" line 50)
invoked from within
"load"
(in namespace eval "::AllProtection" script line 2567)
invoked from within
"namespace eval AllProtection {

# Basic declarations: (don't touch)
variable declr
foreach declr {textl textc notcl notcc capsp repeatf codesf adexemp..."
(file "scripts/allprotection4.6b7.tcl" line 140)
invoked from within
"source scripts/allprotection4.6b7.tcl"
(file "baghira.conf" line 1350)
[13:09] * KONFIGURATIONSDATEI NICHT GELADEN (NICHT GEFUNDEN ODER FEHLER)
thx
B
Balu
Voice
Posts: 4
Joined: Thu May 31, 2007 7:14 am

Post by Balu »

fixed the prob. when i deleted the applist it worked. but on every rehash of the bot the prob is back again. so i think there is a bug in that applist.

may u can fix that . ty
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Show me the content of your aplists file.
B
Balu
Voice
Posts: 4
Joined: Thu May 31, 2007 7:14 am

Post by Balu »

the content of aplist
bchans global #example1 #example2 #example3
bnicks global *porno* *horny* *horney* *[censored]* *asshole* *dick* *bitch* *fagget* *shithead* *shitter* *penis* *pussy* *fukker* *camsex* *hure* *nutte* *fick* *[censored]*
bidents global *porno* *horny* *horney* *[censored]* *asshole* *dick* *bitch* *fagget* *shithead* *shitter* *penis* *pussy* *fukker*
bwords global *[censored]* "*bastard *" *cock* "* [censored] *" *ommak* *fag* "* fick*" *fick* *asshole* *bitch* *pussy* "* whore *" "* slut *" *dickhead* *horny* "* shithead *" *fagget* "* dick? *" "* fag? *" "* fuker *" *penis* "* fuk *" *hure* *fotze* *nutte*
adexempts global %chan www.egghelp.org
droneexempts global "*example1*!*@*" "*!*example2*@*" "*!*@example3.net"
bctcrs global "*exploitation script*"
adwords global "*join *" "*plz visit*" "*http://*
ptextl punish 12:6
ptextc punish 750:6
pnotil punish 6:3
pnotic punish 600:4
pctcpf punish 4:20
ty
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

adwords global "*join *" "*plz visit*" "*http://*
There's a missing quote after "*http://* you forgot to close the quote. I must ask you, are you adding the elements manually into the file instead of using the .ap:add DCC command?
Post Reply