egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

echoX Remover v1.32.b by awyeah

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Fri Aug 10, 2007 8:16 am    Post subject: echoX Remover v1.32.b by awyeah Reply with quote

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.

Quote:

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.

Here's an example:
Quote:

* jorrie (~dickinson@203.106.196.249) has joined #awyeah
* Eric32_kl (~eric36_kl@110.249.95.219.klj01-home.tm.net.my) has left #awyeah
* adapter sets mode: +b *!*@203.106.196.249
* jorrie was kicked by adapter ( echoX Inviter Kick - You are no doubt smart in spamming and adversiting echoX Inviter, but we are more smarter. Copyright © 2007 awyeah Inc. All rights reserved.)

*** After kicking and banning the user if you check the following..

on /whois:
jorrie No such nick/channel
jorrie End of /WHOIS list.

on /whowas:
jorrie was ~dickinson@203.106.196.249 * Francesc Kassower
jorrie using redemption.ix.us.dal.net Fri Aug 10 08:47:27 2007
End of WHOWAS


Download this script from the link below:
echoX Remover v1.32.b
_________________
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================


Last edited by awyeah on Tue Aug 21, 2007 9:52 pm; edited 6 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Aug 12, 2007 6:42 pm    Post subject: Reply with quote

You're applying [split] on a list again.
Code:
set idlist [split [lrange [split $idfile "\n"] 1 end-1]]

idfile is already a list in your script so this should be enough:
Code:
set idlist [lrange $idfile 1 end-1]

although I don't know why you're doing this (not considering the first and last elements). Same with fnfile (it's also already a list).
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Mon Aug 13, 2007 2:50 am    Post subject: Reply with quote

Sir_Fz wrote:
You're applying [split] on a list again.
Code:
set idlist [split [lrange [split $idfile "\n"] 1 end-1]]

idfile is already a list in your script so this should be enough:
Code:
set idlist [lrange $idfile 1 end-1]

although I don't know why you're doing this (not considering the first and last elements). Same with fnfile (it's also already a list).


Yeah my bad shouldn't apply split again on a list, it won't affect anything however, but it would be redundant, as I said its still a testrelease.

The reason for using lrange with index 1 to end-1 is because:

Code:

<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:

Code:

set idlist [lrange [split $idfile "\n"] 1 end-1]


*** Edited, fixed and uploaded script
_________________
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Aug 13, 2007 10:00 am    Post subject: Reply with quote

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:
Code:
set idfile {adams
allen
...
wright
young}

Or possibly
Code:
set idfile [split {adams
allen
...
wright
young} "\n"]


If you'd like to use list instead, try this:
Code:
set idfile [list adams \
allen \
...
wright \
young]


Could be achieved in a few other ways aswell.
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Mon Aug 13, 2007 12:16 pm    Post subject: Reply with quote

Thanks for the detailed info. I already knew most of it. If I use:

Code:

set idfile {adams
allen
...
wright
young}


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
_________________
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================


Last edited by awyeah on Mon Aug 13, 2007 9:58 pm; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Mon Aug 13, 2007 7:40 pm    Post subject: Reply with quote

There's no difference between
Code:
set list {
element1
elmenet2
}

and
Code:
set list {element1
element2}

as far as I know. It is a list and IMO there's no need for [split] at all.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Aug 13, 2007 7:56 pm    Post subject: Reply with quote

@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.
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Mon Aug 13, 2007 8:36 pm    Post subject: Reply with quote

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.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Mon Aug 13, 2007 9:40 pm    Post subject: Reply with quote

echoX Remover v1.32.b has been updated with the following:

Quote:

(*) Added additional regexp checks for the realname database
(*) Added user configurable script options
(*) Added timer to who channel users


Please download the latest revised version from the link in the first post of this thread.
_________________
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Mon Aug 13, 2007 10:34 pm    Post subject: Reply with quote

Quote:
but we are more smarter

It's bugging me. Very Happy

Quote:
but we are smarter

_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Mon Aug 13, 2007 10:39 pm    Post subject: Reply with quote

Alchera wrote:
Quote:
but we are more smarter

It's bugging me. Very Happy

Quote:
but we are smarter


Haha, ok edited. Razz

Note: You can change the script's default kick message to whatever you like; that wouldn't interest me a bit.
_________________
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Aut0Cr0ss
Voice


Joined: 15 Jun 2007
Posts: 19

PostPosted: Wed Aug 15, 2007 10:42 pm    Post subject: Reply with quote

i got that error in DCC.
Tcl error [echox:who:chan]: missing close-bracket
Back to top
View user's profile Send private message
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Wed Aug 15, 2007 10:56 pm    Post subject: Reply with quote

Aut0Cr0ss wrote:
i got that error in DCC.
Tcl error [echox:who:chan]: missing close-bracket


Missed a square bracket in one of the checking conditions for the echox:who:chan procedure.

*** Error fixed and script uploaded

You can download the script again from the same link! and thanks for reporting the error.
_________________
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Mon Aug 20, 2007 12:46 am    Post subject: Reply with quote

Tested the script for various echox matching criterias. Found out that all those regexp checks were just basically redundant and slowed the script more.

Quote:

- 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.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
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


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber