This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

another little help :$

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
Fiby
Voice
Posts: 7
Joined: Sat Feb 23, 2008 11:29 am
Location: Spain
Contact:

another little help :$

Post by Fiby »

Hi :oops:
i want with this script, when the nick spammer join in my channel, put permban in the banlist in my eggdrop, and too put ban in X for 1 hour.
but i want this type of ban in X and banlist.

*!*@host.domain

so, i compile this code, but don't run :oops:

Code: Select all

set spreason "(Drone) mIRC Infectado. Entre a #dmsetup y Solicite Ayuda & Luego entre a #unban y pida unban"
bind join - * NickBanSpambots

proc NickBanSpambots {nick uhost hand chan text} {
	global spambot reason
	if {[regexp {^(?!.*[@.]undernet\.org$)(?:A(?:ldora|lysia|morita|nemona|nita|pril|ra|retina)|
     B(?:arbra|ella|ettina|lenda|riana|ianca|ridget)|
     C(?:amille|ara|arla|armen|helsea|larissa)|
     D(?:amita|anielle|aria|iana|onna|ora|oris)|
     E(?:bony|den|liza|mily|rin|ve|velyn)|Faith|
     G(?:ale|ilda|loria)|H(?:aley|elga|olly)|
     I(?:da|dona|ris|sabel|vana|vory)|
     J(?:anet|ewel|oanna|ulie|uliet)|
     K(?:acey|ali|ara|assia|atie|atrina|yle)|
     L(?:ara|aura|inda|ola|olita|ynn)|
     M(?:aia|aria|ary|eggie|ilenia|imi|yra)|
     N(?:adia|aomi|atalie|icole|ina|ova)|
     O(?:ana|lga|livia)|Peggy|Queen|
     R(?:ae|aquel|ita|osa)|S(?:haron|ilver)|Tara|
     U(?:la|ma)|V(?:alda|alora|anessa|icky|iolet)|
     X(?:enia|ylia)|Z(?:enia|ilya|oe))[1-4]\d!} "$nick!$uhost"]} {
        set bsnick [lindex $text 0]
        if {[string length [lindex $text 1]] == 0} { set reason $spreason } else { set reason [lrange $text 1 end] }
		set bspamnick *!*@[lindex [split [getchanhost $tnick $chan] @] 1]
		newchanban $chan *!*@[lindex [split [getchanhost $tnick $chan] @] 1] $nick $reason 0
		putserv "KICK $chan $bsnick :Ban: $reason"
		putserv "PRIVMSG X :ban $chan $bspamnick 1 100 $reason"
	}
}


can get me a hand ? :oops:

Thanks :oops:

:oops:

Edit: Wrapped code. (Sir_Fz)
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Any error messages or such would be helpful.

However, one thing that stands out instantly, is that you define spreason in globalspace, but try to access it as a local variable within NickBanSpambots. You also define reason as a globally accessed variable within the same proc, yet it does not appear to be used outside the proc.

You should either add spreason to the global-definition within NickBanSpambots, or access it as ::spreason (or $::spreason)
NML_375
User avatar
Fiby
Voice
Posts: 7
Joined: Sat Feb 23, 2008 11:29 am
Location: Spain
Contact:

Post by Fiby »

i can't undernstand, don't speaker engish, you can paste the code?
how should be? :cry:

I have put it

Code: Select all

set spreason "(Drone) mIRC Infectado. Entre a #dmsetup y Solicite Ayuda & Luego entre a #unban y pida unban"
bind join - * NickBanSpambots

proc NickBanSpambots {nick uhost hand chan text} {
	global spreason
	if {[regexp {^(?!.*[@.]undernet\.org$)(?:A(?:ldora|lysia|morita|nemona|nita|pril|ra|retina)|
     B(?:arbra|ella|ettina|lenda|riana|ianca|ridget)|
     C(?:amille|ara|arla|armen|helsea|larissa)|
     D(?:amita|anielle|aria|iana|onna|ora|oris)|
     E(?:bony|den|liza|mily|rin|ve|velyn)|Faith|
     G(?:ale|ilda|loria)|H(?:aley|elga|olly)|
     I(?:da|dona|ris|sabel|vana|vory)|
     J(?:anet|ewel|oanna|ulie|uliet)|
     K(?:acey|ali|ara|assia|atie|atrina|yle)|
     L(?:ara|aura|inda|ola|olita|ynn)|
     M(?:aia|aria|ary|eggie|ilenia|imi|yra)|
     N(?:adia|aomi|atalie|icole|ina|ova)|
     O(?:ana|lga|livia)|Peggy|Queen|
     R(?:ae|aquel|ita|osa)|S(?:haron|ilver)|Tara|
     U(?:la|ma)|V(?:alda|alora|anessa|icky|iolet)|
     X(?:enia|ylia)|Z(?:enia|ilya|oe))[1-4]\d!} "$nick!$uhost"]} {
        set bsnick [lindex $text 0]
        if {[string length [lindex $text 1]] == 0} { set reason $::spreason } else { set reason [lrange $text 1 end] }
		set bspamnick *!*@[lindex [split [getchanhost $tnick $chan] @] 1]
		newchanban $chan *!*@[lindex [split [getchanhost $tnick $chan] @] 1] Spambot $reason 0
		putserv "KICK $chan $bsnick :Ban: $reason"
		putserv "PRIVMSG X :ban $chan $bspamnick 1 100 $reason"
	}
}
and the code error in the partyline get me this

Code: Select all

<)EggFiby> [23:36] Tcl error [NickBanSpambots]: wrong # args: should be "NickBanSpambots nick uhost hand chan text"
<Mayreta> .set errorInfo
<)EggFiby> Currently: wrong # args: should be "NickBanSpambots nick uhost hand chan text"
<)EggFiby> Currently:     while executing
<)EggFiby> Currently: "NickBanSpambots $_jp1 $_jp2 $_jp3 $_jp4"
and in my chan put this type of ban in X ( *!*Myraxipy@211.186.234.* ) but don't put chan ban.

Code: Select all

*** Naomi29 ( Myraxipy@211.186.234.39 ) Entra al Canal #mychan
* X pone modo: +b *!*Myraxipy@211.186.234.*
* Naomi29 ha sido KICKEADO por X ((EggFiby) (Drone) mIRC Infectado. Entre a #dmsetup y Solicite Ayuda & Luego entre a #unban y pida unban)


:cry: snif

Edit: Wrapped code. (Sir_Fz)
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

The arguments for NickBanSpambots does not match the binding (join):
(8) JOIN (stackable)
bind join <flags> <mask> <proc>
procname <nick> <user@host> <handle> <channel>

Description: triggered by someone joining the channel. The mask in
the bind is matched against "#channel nick!user@host" and can
contain wildcards.
Module: irc
In this case, there is no text-parameter, which makes sense since you cannot send a message with your join...
Even so, NickBanSpambots uses $text to retrieve various information.
To be honest, I'm having a hard time trying to figure out what this piece of code is supposed to accomplish.
NML_375
User avatar
Fiby
Voice
Posts: 7
Joined: Sat Feb 23, 2008 11:29 am
Location: Spain
Contact:

Post by Fiby »

mmm ok :oops:

so this is the first code:

Code: Select all

set reason "(Drone) mIRC Infectado. Entre a #dmsetup y Solicite Ayuda & Luego entre a #unban y pida unban"
bind join - * NickBanSpambots

proc NickBanSpambots {nick uhost hand chan} {
	global reason
	if {[regexp {^(?!.*[@.]undernet\.org$)(?:A(?:ldora|lysia|morita|nemona|nita|pril|ra|retina)|
     B(?:arbra|ella|ettina|lenda|riana|ianca|ridget)|
     C(?:amille|ara|arla|armen|helsea|larissa)|
     D(?:amita|anielle|aria|iana|onna|ora|oris)|
     E(?:bony|den|liza|mily|rin|ve|velyn)|Faith|
     G(?:ale|ilda|loria)|H(?:aley|elga|olly)|
     I(?:da|dona|ris|sabel|vana|vory)|
     J(?:anet|ewel|oanna|ulie|uliet)|
     K(?:acey|ali|ara|assia|atie|atrina|yle)|
     L(?:ara|aura|inda|ola|olita|ynn)|
     M(?:aia|aria|ary|eggie|ilenia|imi|yra)|
     N(?:adia|aomi|atalie|icole|ina|ova)|
     O(?:ana|lga|livia)|Peggy|Queen|R(?:ae|aquel|ita|osa)|
     S(?:haron|ilver)|Tara|U(?:la|ma)|
     V(?:alda|alora|anessa|icky|iolet)|X(?:enia|ylia)|
     Z(?:enia|ilya|oe))[1-4]\d!} "$nick!$uhost"]} {
		putserv "PRIVMSG X :ban $chan $nick 1 100 $reason"
	}
}
this code work good. but when join a nick spammer, put this ban (*!*id@*.domain) in X.

so i want that my eggdrop put this type of ban: (*!*@host.domain)
and add this IP to internal permban of my eggdrop.

can make :oops:

please :cry:

:oops:

Edit: Wrapped code. (Sir_Fz)
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Replace

Code: Select all

putserv "PRIVMSG X :ban $chan $nick 1 100 $reason"
with

Code: Select all

putserv "PRIVMSG X :ban $chan *!*@[lindex [split $uhost @] 1] 1 100 $reason"
Post Reply