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

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sat Dec 17, 2005 1:00 pm Post subject: |
|
|
is it just me or are really Sir_Fz's scripts becoming to look like awyeah's?
those multiline if's are hard to read, and prone to errors _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
helpme Voice
Joined: 08 May 2005 Posts: 17
|
Posted: Sat Dec 17, 2005 1:33 pm Post subject: |
|
|
Dont know if it work, dont see a w32 troyan, so is this right or not??
| Code: | ###################################################################
# #
# Coded by: Opposing (Fz@nexushells.net) - #nexushells @ DALnet #
# Version: 1.0 #
## #
# Description: Bankicks nicks who are suspicious of being #
# infected with w32.aplore@mm Trojan/Virus/Worm. #
# Translated from the Oz mirc addon. #
# #
# Report bugs/suggestions to Fz at nexushells.net #
###################################################################
#
##############################
# Configurations start here: #
# __________________________ #
## Set the channels you want this script to work on.
## example: set aplore(chans) "#chan1 #chan2" (in lowercase)
set aplore(chans) [channels]
## Set the kick message.
set aplore(kmsg) "w32.aplore@mm Trojan/Virus/Worm Infected."
## Set, in minutes, ban time for this offence.
set aplore(btime) "30"
# Configurations end here. #
############################
#
######################################################################
# Code starts here, please do not edit anything unless you know TCL: #
# __________________________________________________________________ #
bind join - * aplore:kick
proc aplore:kick {nick uhost hand chan} {
global aplore
set aplorenick 0
if {([string is alpha $nick]) || ([string match *\[-^`_\]* $nick]) || ([lsearch -exact $aplore(chans) [string tolower $chan]] == -1)} { return 0 }
scan $uhost %\[^@\]@%s ident host
if {([string match -nocase "*[set sident [string trimleft $ident ~]]*" $nick]) && ([string is alpha [string range $nick 0 3]]) && ([string is integer [string range $nick end-1 end]]) && ([string is integer [string index $sident end]]) && ([string index $ident 0] == "~")} {
putquick "KICK $chan $nick :$aplore(kmsg)"
putquick "MODE $chan +b *!*@$host"
putlog "\002$nick\002!\002$ident\002 is infected with w32.aplore@mm."
}
}
putlog "w32.aplore@mm bankick v1.0 by Opposing Loaded..." |
|
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Dec 17, 2005 2:14 pm Post subject: |
|
|
| demond wrote: | is it just me or are really Sir_Fz's scripts becoming to look like awyeah's?
those multiline if's are hard to read, and prone to errors |
I didn't want to stack everything into 1 if, and there are no erros and please make it easier if you care (I don't)  _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Sat Dec 17, 2005 6:46 pm Post subject: |
|
|
| helpme wrote: | | Dont know if it work, dont see a w32 troyan, so is this right or not?? |
Wait patiently until an "infected" client enters a channel.
| Code: | Baller14!~baller14 is infected with w32.aplore@mm.
--> Baller14 (~Baller14@66.195.171.35) has joined #eggdrops
* Alchera sets ban on *!*@66.195.171.35
<-- Alchera has kicked Baller14 from #eggdrops (w32.aplore@mm Trojan/Virus/Worm Infected.) |
I run the script in XChat and the above is what you are expecting from your bot.
If the script does not work simply '.set errorInfo' in the command console and post results in this forum.
Btw demond, 'ifs' or no, Sir_Fz's script works as expected.  _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sat Dec 17, 2005 9:29 pm Post subject: |
|
|
I have no doubt it works
my point was that we should cultivate good programming (in our case, that translates to scripting) practices; and having multiline if's with nested condition levels is hardly good practice _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Sun Dec 18, 2005 1:23 am Post subject: |
|
|
Never suggested otherwise. LOL
Now demond, take up Sir_Fz's "challenge"?  _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sun Dec 18, 2005 2:17 am Post subject: |
|
|
that if can be substituted with a single regexp, bet let leave this to the avid readers  _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Dec 18, 2005 9:17 am Post subject: |
|
|
demond, I don't see how it could be replaced with just 1 regexp, so my request is to do it (I couldn't)  _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Dec 18, 2005 9:45 am Post subject: |
|
|
This is my short version:
| Code: | ###################################################################
# #
# Coded by: Opposing (Fz@nexushells.net) - #nexushells @ DALnet #
# Version: 2.0 #
## #
# Description: Bankicks nicks who are suspicious of being #
# infected with w32.aplore@mm Trojan/Virus/Worm. #
# Translated from the Oz mirc addon. #
# #
# Report bugs/suggestions to Fz at nexushells.net #
###################################################################
#
##############################
# Configurations start here: #
# __________________________ #
## Set the channels you want this script to work on.
## example: set aplore(chans) "#chan1 #chan2" (in lowercase)
set aplore(chans) [channels]
## Set the kick message.
set aplore(kmsg) "w32.aplore@mm Trojan/Virus/Worm Infected."
## Set, in minutes, ban time for this offence.
set aplore(btime) "30"
# Configurations end here. #
############################
#
######################################################################
# Code starts here, please do not edit anything unless you know TCL: #
# __________________________________________________________________ #
bind join - * aplore:kick
proc aplore:kick {nick uhost hand chan} {
global aplore
if {[string is alpha $nick] || [string match {*[-^`_]*} $nick] || [lsearch -exact $aplore(chans) [string tolower $chan]] == -1} { return 0 }
scan $uhost %\[^@\]@%s ident host
if {[string match -nocase "*[string trimleft $ident ~]*" $nick] && [regexp {^[A-z]{3,}[0-9]{2}$} $nick] && [regexp {^~[A-z]{3,}[0-9]$} $ident]} {
putquick "KICK $chan $nick :$aplore(kmsg)"
putquick "MODE $chan +b *!*@$host"
putlog "\002$nick\002!\002$ident\002 is infected with w32.aplore@mm."
}
}
putlog "w32.aplore@mm bankick v2.0 by Opposing Loaded..." |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
helpme Voice
Joined: 08 May 2005 Posts: 17
|
Posted: Sun Dec 18, 2005 10:21 am Post subject: |
|
|
| so is this script auto active on all channels?? "set aplore(chans) [channels]" |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Dec 18, 2005 11:25 am Post subject: |
|
|
| helpme wrote: | | so is this script auto active on all channels?? "set aplore(chans) [channels]" |
If you ask this again, I'll forbid you from using this script! yes, I told you so didn't I? and if it's not kicking that's because as Alchera said, no infected user joined yet. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
|