| View previous topic :: View next topic |
| Author |
Message |
DarkStar723 Voice
Joined: 09 Sep 2005 Posts: 11
|
Posted: Fri Apr 21, 2006 4:01 pm Post subject: Global text-string ignore (for stats.mod/megahal/alice) |
|
|
Ive been trying to work up a full function text-string ignore in tcl for awhile, mainly to ignore wbs/winamp display/whatever else i can think of for stats.mod, alice, and megahal. I run several bots using these, but havent managed to get a consistent ignore going for them. Binding a text-string i want to ignore to a function that does nothing seems to work about 15% of the time, its only 15% because getting it to call that bind before anything else is kinda tricky (seems to be just luck).
Now, im kinda lost as to how to get this working, im wondering if im just wasting my time on it, it seems like im gonna have to script something individually for each module/script that causes problems, which i doubt im smart enough to pull off, and it seems kind of inefficient.
So, can anyone think of a good way to go about creating a (hopefully global) text-string ignore? Or, could help me out with scripting something for each module/script individually. |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Fri Apr 21, 2006 4:06 pm Post subject: |
|
|
problem is that ignoring totally will involve also ignoring for flood control. I suggest removing all binds for the modules you dont want these lines, write a prog binding to pubm and call the functions within the proc only if the text is fine.
example:
| Code: | set pubmlist {pubm:stat}
set actionlist {ctcp:stat}
foreach functionname $pubmlist {
unbind pubm -|- * $functionname
}
foreach functionname $actionlist {
unbind ctcp -|- ACTION $functionname
}
unset functionname
bind pubm -|- * filteredpubm
bind ctcp -|- ACTION filteredaction
proc filteredpubm {n u h c t} {
if {![string match -nocase {*is playing*} $t]} {
foreach f $::pubmlist {
eval [list $f $n $u $h $c $t]
}
}
return 0
}
proc filteredaction {n u h d k t} {
if {[validchan $d] && ![string match -nocase {*is playing*} $t]} {
foreach f $::actionlist {
eval [list $f $n $u $h $d $k $t]
}
}
return 0
} |
modify/expand the string matchs as neccessary. I'd recommned to not use a regex on such binds. _________________ De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens... |
|
| Back to top |
|
 |
DarkStar723 Voice
Joined: 09 Sep 2005 Posts: 11
|
Posted: Fri Apr 21, 2006 8:31 pm Post subject: |
|
|
| oh wow thanks, didnt expect to get a response that quickly. Well, to be honest, i never even use the flood control anymore, i mean, i have some people who actually type (not pasting, actual typing) so fast that they hit the networks excess flood limit fairly regularly. But, thanks for this example, ill try it instead, just in case i want to mess with flood control again, hopefully im smart enough to modify it for each individual module/script, haha. |
|
| Back to top |
|
 |
|
|
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
|
|