I have test released a script which removes "the famous"echox inviter from channels. This script is currently being tested, so far so it works great as for now.
I haven't gotten time to add any features into it yet.
This script will work on all channels the bot is on. It will WHO every user on join and check the who reply to match with certain criterias to be detected as an echox inviter. This script will kick and ban any echox inviters which join any channel the bot is opped on.
Give it a go! If you feel there are alot of echox inviters on your channel.
<adapter> [02:36] tcl: evaluate (.tcl): split $idfile "\n"
<adapter> Tcl: {} adams allen allison alvarez anderson andrews armstrong arnold avila bailey baker barnes bennett bishop boyd bradley brooks brown bryan burke burton butler campbell carlson carr carter chase chen christensen clark collins comer cook cooper cox crawford cunningham davis day dean dickinson edwards elliott ellis evans fischer fisher fong ford freeman frost garcia gardner gomes gomez gonzales graham green griffin hall hamilton hansen hanson harris harrison hartman harvey hayes henderson henry
<adapter> Tcl: hernandez hill holmes howard hughes hunt jackson jensen johnson jones keller kelley kennedy king lane long lopez marsh martinez mathews matthews mcdonald miller mitchell moore morgan morris nelson newton obrien oconnor olsen palmer parker patterson peck perkins perry peterson phillips powell price randolph reed rice richardson rivera rivers roberts robinson rodrigues rodriguez rogers romero ruis sanders santos shaw short silva simpson smith snyder spafford spencer springer stafford stewart
<adapter> Tcl: stone sullivan taylor thompson turner walker wallace walton ward warner watson weber wells white williams wong wood woods wright young {}
The first and last elements are empty (null), as the same for all lists. Hence to remove those I use:
Actually, wether idfile is a list or not is abit undefined. It does have a list-like structure, yet is handcrafted, so splitting on newlines really is'nt such a bad idea. Since you'll only use it as a list within the script, it might be a good idea to "mark" it as list as you define it, either using split or list, rather than doing conversions with split further on.
As for empty items in the beginning and end, try defining the string such as this:
That would solve the problem and I wouldn't need to use lrange.
The long databases were copied exactly the same from the echoX inviter script (mIRC script). I used them as they were in the mIRC script (copied from a text file); each element in a separate line.
Consider this I didn't use the nicks database, (only user ident and realname databases) because it was a 82kb text file and that IMHO would eat alot of memory for processing and slow the bot down especially.
Well I think I will add the split when I declare the list, rather than incorporating it into the procedure.
*** Script fixed and uploaded
Last edited by awyeah on Mon Aug 13, 2007 9:58 pm, edited 2 times in total.
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee) PS: Guys, I don't accept script helps or requests personally anymore.
==================================
@Sir_Fz: It is something inbetween string and list. It has a structure similar to list, but if you're not careful when adding entries, you'll end up breaking the list-structure. Hence it's not quite a list (yes, in this case, as of now, list commands will work on it, despite it not being a list). Using list or split as illustrated above will make sure it's a proper list, regardless of any special characters within any list-items.
There is a fundamental difference between the two examples you listed, one has a leading and trailing newline, the other does not. This will generate quite different result when converting the string into a list, by splittin on newlines, as the first case will appear to have an empty entry at the beginning and the end.
nml375 wrote:There is a fundamental difference between the two examples you listed, one has a leading and trailing newline, the other does not. This will generate quite different result when converting the string into a list, by splittin on newlines, as the first case will appear to have an empty entry at the beginning and the end.
Yep, thats why I had used lrange as in my first case for the first list-like expression you posted. However, yeilding an empty first and last element in the list wouldn't really make the script buggy since matching with a user ident (which cannot be null) or even a realname (which cannot be null), but it was just for the purpose of clarity I added it, when I tested it.
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee) PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Tested the script for various echox matching criterias. Found out that all those regexp checks were just basically redundant and slowed the script more.
- Removed all additional regexp checks.
- Shortened code for faster processing.
*** Script updated and uploaded
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee) PS: Guys, I don't accept script helps or requests personally anymore.
==================================