| View previous topic :: View next topic |
| Author |
Message |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat Jul 05, 2008 12:13 pm Post subject: |
|
|
That's an error-message, saying there's a syntactical error in the script. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
asdd1 Voice
Joined: 05 Jul 2008 Posts: 23
|
Posted: Sat Jul 05, 2008 12:22 pm Post subject: |
|
|
Fixed this error and now:
| Code: | | [19:22] Tcl error [pv_kick2]: invalid command name "# join channel klik www pussy http" |
|
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sat Jul 05, 2008 12:23 pm Post subject: |
|
|
| Code: | #Antispam With cycle command
# -> bantime
set bantime 30
# -> banned words
set bannedwords "# join channel klik www pussy http"
# -> minutes bot should cycle channels
set timecycle 1
# SCRIPT BEGINS
bind msgm - "*" pv_kick2
# kick
proc pv_kick2 {nick uhost hand text} {
foreach bword [split $bannedwords]
foreach word [split $text] {
if {[string match -nocase [string tolower $bword] [string tolower $word]]} {
set banthisguy 1 ; break ; break
}
}
}
if {[info exists banthisguy]} {
foreach pvchan2 [channels] {
if {![isop $nick $pvchan2] && ![isvoice $nick $pvchan2] && [onchan $nick $pvchan2]} {
set pvmask2 "*!*$uhost"
if {![ischanban $pvmask2 $pvchan2]} {
set pvkickmsg2 "\002Msg Spam 30min. Ban!"
newchanban $pvchan2 $pvmask "Anti-Spam" $::pvkickmsg2 "%0d0h30m"
}
}
}
}
}
# cycle
timer $timecycle part_chan
proc part_chan {} {
global timecycle
foreach chancycle [channels] {
putserv "PART $chancycle :\037Spam Check!\037"
}
timer $timecycle part_chan
}
# SCRIPT ENDS |
That was me trying to write code without having to involve the bot. LMFAO
The script above was tested, loaded into my bot, and immediately banned my clone which spammed it, so seems to work. Traded out that lsearch, which wouldve been nice and eliminated a foreach, but it wasn't working as expected.. keke _________________ speechles' eggdrop tcl archive
Last edited by speechles on Sat Jul 05, 2008 12:25 pm; edited 2 times in total |
|
| Back to top |
|
 |
asdd1 Voice
Joined: 05 Jul 2008 Posts: 23
|
Posted: Sat Jul 05, 2008 12:24 pm Post subject: |
|
|
asd
Last edited by asdd1 on Sat Jul 05, 2008 1:41 pm; edited 1 time in total |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat Jul 05, 2008 12:32 pm Post subject: |
|
|
@Speechles: A hint, add a "break" to the bword foreach-loop when the test evaluates to true, and you don't have to test all the other patterns as you already have a match..
Or just do it like this:
| Code: | proc pv_kick2 {nick uhost hand text} {
foreach bword [split $::bannedwords] {
if {[string match -nocase "*$bword*" $text]} {
foreach pvchan2 [channels] {
if {[onchan $nick $pvchan2] && ![isop $nick $pvchan2] && ![isvoice $nick $pvchan2]} {
set pvmask2 "*!*$uhost"
if {![ischanban $pvmask2 $pvchan2]} {
newchanban $pvchan2 $pvmask "Anti-Spam" "\002Msg Spam 30min. Ban!" "%0d0h30m"
}
}
}
break
}
}
} |
_________________ NML_375, idling at #eggdrop@IrcNET
Last edited by nml375 on Sat Jul 05, 2008 12:46 pm; edited 1 time in total |
|
| Back to top |
|
 |
asdd1 Voice
Joined: 05 Jul 2008 Posts: 23
|
Posted: Sat Jul 05, 2008 12:33 pm Post subject: |
|
|
asd
Last edited by asdd1 on Sat Jul 05, 2008 1:42 pm; edited 1 time in total |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat Jul 05, 2008 12:39 pm Post subject: |
|
|
| asdd1 wrote: | | Code: | [19:23] Tcl error in file 'eggdrop.conf':
[19:23] invalid command name "}"
while executing
"}"
(file "scripts/Advertise.TCL" line 37)
invoked from within
"source scripts/Advertise.TCL"
(file "eggdrop.conf" line 117)
[19:23] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
|
 |
This is due to this line:
| Code: | | foreach bword [split $bannedwords] |
Change it to this, and you'll fix this error and another one...
| Code: | | foreach bword [split $::bannedwords] { |
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
asdd1 Voice
Joined: 05 Jul 2008 Posts: 23
|
Posted: Sat Jul 05, 2008 12:42 pm Post subject: |
|
|
| Ok, fixed, but my spam isn't detected ;( |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat Jul 05, 2008 12:46 pm Post subject: |
|
|
asdd1: If you're using the piece of code posted by me, it's meant to replace the pv_kick2 in the script posted by speechles.
Regardless which you use, you'll need to set the variable bannedwords to a list of "badwords". _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
asdd1 Voice
Joined: 05 Jul 2008 Posts: 23
|
Posted: Sat Jul 05, 2008 12:47 pm Post subject: |
|
|
| nml375 wrote: | asdd1: If you're using the piece of code posted by me, it's meant to replace the pv_kick2 in the script posted by speechles.
Regardless which you use, you'll need to set the variable bannedwords to a list of "badwords". |
I'm using the speechles variant and it doesnt detect .
| Quote: | | Regardless which you use, you'll need to set the variable bannedwords to a list of "badwords". |
What you mean ?
Last edited by asdd1 on Sat Jul 05, 2008 12:50 pm; edited 1 time in total |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat Jul 05, 2008 12:50 pm Post subject: |
|
|
| asdd1 wrote: | | Ok, fixed, but my spam isn't detected ;( |
The change to using newchanban requires that you configured your bot to enforce bans on the channel(s) (.chanset #thechannel +enforcebans), and it will not kick or ban people identified as friends (or op if set +dontkickops) or masters/owners. Could you doublecheck these conditionals with your test bench? _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
asdd1 Voice
Joined: 05 Jul 2008 Posts: 23
|
Posted: Sat Jul 05, 2008 12:51 pm Post subject: |
|
|
asd
Last edited by asdd1 on Sat Jul 05, 2008 1:42 pm; edited 1 time in total |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat Jul 05, 2008 12:53 pm Post subject: |
|
|
| asdd1 wrote: | | nml375 wrote: | asdd1: If you're using the piece of code posted by me, it's meant to replace the pv_kick2 in the script posted by speechles.
Regardless which you use, you'll need to set the variable bannedwords to a list of "badwords". |
I'm using the speechles variant and it doesnt detect .
| Quote: | | Regardless which you use, you'll need to set the variable bannedwords to a list of "badwords". |
What you mean ? |
Hadn't seen your post 'bout "fixed but not detecting" when I replied. But basically, in the top of the script, there is a line saying set bannedwords "# join channel klik www pussy http". This line sets that variable to hold a set of words used to detect spam (badwords). _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat Jul 05, 2008 12:57 pm Post subject: |
|
|
| asdd1 wrote: | | nml375 wrote: | | asdd1 wrote: | | Ok, fixed, but my spam isn't detected ;( |
The change to using newchanban requires that you configured your bot to enforce bans on the channel(s) (.chanset #thechannel +enforcebans), and it will not kick or ban people identified as friends (or op if set +dontkickops) or masters/owners. Could you doublecheck these conditionals with your test bench? |
<05.07 19:50:47> <gather-lv> [19:50] #janis# chanset #Botnet +enforcebans
<05.07 19:51:01> <gather-lv> [19:51] gather-lv joined #botnet.
<05.07 19:51:01> <gather-lv> [19:51] #botnet: mode change '+o gather-lv' by ChanServ!service@services.irc.lv
No result. I have different IPs. |
Oki, could you see if your test client shows up when you do .bans ? _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
asdd1 Voice
Joined: 05 Jul 2008 Posts: 23
|
Posted: Sat Jul 05, 2008 12:59 pm Post subject: |
|
|
asd
Last edited by asdd1 on Sat Jul 05, 2008 1:42 pm; edited 1 time in total |
|
| Back to top |
|
 |
|