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 

Drone join.
Goto page Previous  1, 2
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Dec 17, 2005 12:59 pm    Post subject: Reply with quote

Try it.
_________________
Follow me on GitHub

- Opposing

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


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sat Dec 17, 2005 1:00 pm    Post subject: Reply with quote

is it just me or are really Sir_Fz's scripts becoming to look like awyeah's? Wink

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
View user's profile Send private message Visit poster's website
helpme
Voice


Joined: 08 May 2005
Posts: 17

PostPosted: Sat Dec 17, 2005 1:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Dec 17, 2005 2:14 pm    Post subject: Reply with quote

demond wrote:
is it just me or are really Sir_Fz's scripts becoming to look like awyeah's? Wink

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) Razz
_________________
Follow me on GitHub

- Opposing

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


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

PostPosted: Sat Dec 17, 2005 6:46 pm    Post subject: Reply with quote

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. Smile

Btw demond, 'ifs' or no, Sir_Fz's script works as expected. Smile
_________________
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
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sat Dec 17, 2005 9:29 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Alchera
Revered One


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

PostPosted: Sun Dec 18, 2005 1:23 am    Post subject: Reply with quote

Never suggested otherwise. LOL

Now demond, take up Sir_Fz's "challenge"? Wink
_________________
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
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sun Dec 18, 2005 2:17 am    Post subject: Reply with quote

that if can be substituted with a single regexp, bet let leave this to the avid readers Wink
_________________
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Dec 18, 2005 9:17 am    Post subject: Reply with quote

demond, I don't see how it could be replaced with just 1 regexp, so my request is to do it (I couldn't) Very Happy
_________________
Follow me on GitHub

- Opposing

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


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Dec 18, 2005 9:45 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
helpme
Voice


Joined: 08 May 2005
Posts: 17

PostPosted: Sun Dec 18, 2005 10:21 am    Post subject: Reply with quote

so is this script auto active on all channels?? "set aplore(chans) [channels]"
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Dec 18, 2005 11:25 am    Post subject: Reply with quote

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! Twisted Evil 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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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