| View previous topic :: View next topic |
| Author |
Message |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri May 04, 2007 8:49 pm Post subject: |
|
|
It's fairly easy to implement it... I'll see if it'll be added in the next release. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
dq Voice
Joined: 03 Apr 2006 Posts: 32
|
Posted: Sat May 05, 2007 9:26 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat May 05, 2007 9:45 pm Post subject: |
|
|
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. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
dq Voice
Joined: 03 Apr 2006 Posts: 32
|
Posted: Sat May 05, 2007 10:10 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun May 06, 2007 8:15 am Post subject: |
|
|
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]. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
dq Voice
Joined: 03 Apr 2006 Posts: 32
|
Posted: Tue May 15, 2007 12:58 am Post subject: |
|
|
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: | 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. |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Tue May 15, 2007 1:39 am Post subject: |
|
|
This should be able to do your job:
| Code: |
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: |
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.
================================== |
|
| Back to top |
|
 |
dq Voice
Joined: 03 Apr 2006 Posts: 32
|
Posted: Tue May 15, 2007 2:17 am Post subject: |
|
|
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;
Which will return invalid channel.
| Quote: | | (trigger)join #any sort of character | Which will return invalid channel.
| Quote: | | (trigger)join #word | Bot joins the channel.
Hopefully that makes sense =x |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Tue May 15, 2007 3:22 am Post subject: |
|
|
Give this a go, hopefully it should fullfil all your requirements.
| Code: |
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.
================================== |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Tue May 15, 2007 4:59 am Post subject: |
|
|
| 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*. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Balu Voice
Joined: 31 May 2007 Posts: 4
|
Posted: Thu May 31, 2007 7:21 am Post subject: |
|
|
Got a prob with the following. could anybody pls help me?
| Quote: | [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 |
|
| Back to top |
|
 |
Balu Voice
Joined: 31 May 2007 Posts: 4
|
Posted: Thu May 31, 2007 5:17 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
|
| Back to top |
|
 |
Balu Voice
Joined: 31 May 2007 Posts: 4
|
Posted: Fri Jun 01, 2007 3:30 am Post subject: |
|
|
the content of aplist
| Quote: | 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 |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri Jun 01, 2007 6:19 am Post subject: |
|
|
| Quote: | | 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? _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
|