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

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri Jul 25, 2003 6:45 pm Post subject: |
|
|
well, that would be a bot slow. isn't there a faster way ?
like if regexp [split... $uhost ....] or somethin like that ? _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Papillon Owner

Joined: 15 Feb 2002 Posts: 724 Location: *.no
|
Posted: Sat Jul 26, 2003 4:02 am Post subject: |
|
|
lol
please hit me someone!
.... and gimme a cup of coffee!
| Code: | | set ident [lindex [split $uhost @] 0] |
then do the if-test again on the $ident _________________ Elen sila lúmenn' omentielvo |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
|
| Back to top |
|
 |
TsT Voice
Joined: 04 Mar 2003 Posts: 16 Location: Strasbourg, France
|
Posted: Sat Jul 26, 2003 6:59 am Post subject: |
|
|
| Papillon wrote: | | Code: | | set ident [lindex [split $uhost @] 0] |
|
Or with regexp:
| Code: | | regexp {^([^@]+)} $uhost _ ident |
TsT, the regexp lover. |
|
| Back to top |
|
 |
Papillon Owner

Joined: 15 Feb 2002 Posts: 724 Location: *.no
|
Posted: Sat Jul 26, 2003 7:43 am Post subject: |
|
|
hehe
TsT, the regexp lover
I'm sorry to dissapoint you but regexp is slow, if you care about every millisecond then you should avoid regexp whenever possible _________________ Elen sila lúmenn' omentielvo |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Jul 26, 2003 8:13 am Post subject: |
|
|
Oh, I see then there must be a faster way right ?? lol _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
EEggy Op
Joined: 26 Sep 2002 Posts: 122
|
Posted: Sat Jul 26, 2003 1:25 pm Post subject: |
|
|
Hi, so can you please paste the complete working script??
thank you _________________ EEggy |
|
| Back to top |
|
 |
TsT Voice
Joined: 04 Mar 2003 Posts: 16 Location: Strasbourg, France
|
Posted: Sun Jul 27, 2003 10:06 am Post subject: |
|
|
| Papillon wrote: | hehe
TsT, the regexp lover
I'm sorry to dissapoint you but regexp is slow, if you care about every millisecond then you should avoid regexp whenever possible |
I just saw this for the fun.
Regexp is sometime more usefull to split lot of part of one string in one line, like:
set nickuserhost "foo!bar@one.two.isp.com"
set nick ... (foo)
set user ... (bar)
set subdom ... (one.two)
set dom ... (isp)
set tld ... (com)
if {[regexp {^([^!]+)!([^@]+)@(.*)[.]{0,1}([^.]+).([^.]+)$} $nickuserhost _ nick user subdom dom tld]} {
#not matching...
}
And i'm agree regexp is slower than split/lindex ... but have you some check or statistique to see more the difference ?
I use very often regexp and i never see the difference  |
|
| Back to top |
|
 |
Papillon Owner

Joined: 15 Feb 2002 Posts: 724 Location: *.no
|
Posted: Sun Jul 27, 2003 3:23 pm Post subject: |
|
|
well, I'm not talkin about seconds... although with enough regexp's it will be
You can test the difference with the time command
| Code: | bind dcc - test testproc
proc testproc {hand idx arg} {
putlog [time proc1]
putlog [time proc2]
}
proc proc1 {} {
set host "papillon!papillon@is.a.rabid.chickenkiller.com"
set data [regexp {^([^!]+)!([^@]+)@(.*)[.]{0,1}([^.]+).([^.]+)$} $host _ nick user subdom dom tld]
}
proc proc2 {} {
set host "papillon!papillon@is.a.rabid.chickenkiller.com"
set nick [lindex [split $host !] 0]
set user [lindex [split [lindex [split $host @] 0] !] 1]
set subdom [join [lrange [split [lindex [split $host @] 1] .] 0 end-1] .]
set dom [lindex [split $host .] end]
} |
or load this to your bot
if you have tcl installed on your machine you can use tclsh/wish to test the difference  _________________ Elen sila lúmenn' omentielvo |
|
| Back to top |
|
 |
TsT Voice
Joined: 04 Mar 2003 Posts: 16 Location: Strasbourg, France
|
Posted: Mon Jul 28, 2003 5:43 am Post subject: |
|
|
It's true, I got proc1 is 3x more slower than proc2:
| Quote: | % time proc1
306 microseconds per iteration
% time proc2
103 microseconds per iteration
|
BUT there are not really equivalent because proc1 provide a matching result...
proc2 need string match to check if data is valid  |
|
| Back to top |
|
 |
Papillon Owner

Joined: 15 Feb 2002 Posts: 724 Location: *.no
|
Posted: Mon Jul 28, 2003 5:56 am Post subject: |
|
|
hehe, add a string match then and try again  _________________ Elen sila lúmenn' omentielvo |
|
| Back to top |
|
 |
Fisherman Guest
|
Posted: Sat Aug 30, 2003 10:28 am Post subject: |
|
|
spamming bots has been a problem lately.. i have been looking for a tcl to ban the spam bots who sits in the channels.. and put out some webpage address when u say hi..
so far i havent found any..
the thing now i am doing is just use MIRC script to msg the bots and find out if they are one of those and remotely send a message to the bot to ban that user.. a tcl of this kind may help i think ... can someone tell a tcl of that if exists? |
|
| Back to top |
|
 |
EEggy Op
Joined: 26 Sep 2002 Posts: 122
|
Posted: Sat Feb 14, 2004 10:24 pm Post subject: |
|
|
Hi Sir_Fz,
is it possible if you can paste the working codes please, because i have no luck.
advance thanks _________________ EEggy |
|
| Back to top |
|
 |
TALES Halfop

Joined: 09 Nov 2003 Posts: 59 Location: Netherlands
|
Posted: Tue Feb 17, 2004 3:34 pm Post subject: |
|
|
i have made 1 script for weird nicks could do some modification for your needs ?? i think that your talking about the virii FYLE i have found the source of FYLE that has some intresting thinks:
1 realname (always some domein name like .net .com etc..)
2 nick register with email *@hotmail.com (got this from BarkerJr)
3 nick is random (everybody knows this )
the scan i have made scans on the realname an the random nicks have to build in the if nick is register with email *@hotmail.com
the script i have so fare are on http://www.cb3rob.net/~tales in the tcl section bad2pack.zip
the realname scanner has not been made by me but made a little modification for the FYLE bots (original code by Papillon modified and adjusted by caesar) |
|
| Back to top |
|
 |
|