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.

Help Me With This Code

Old posts that have not been replied to for several years.
Z
ZaKiR
Voice
Posts: 35
Joined: Wed Jun 16, 2004 10:05 pm

Post by ZaKiR »

Code: Select all

set killnicks { 
"dick"
"bitch" 
} 

set killreason "\00304Réason: \00301\037B\037\00314ad \00301\037N\037\00314ick \00301\037D\037\00314étéctéd\003" 

bind raw - NOTICE client:connect 

proc client:connect {from keyword args} { 
global killnicks killreason 
if {[string match "*Client connecting*" $args]} { 
set usernick [lindex [split $args] 9] 
foreach nick $killnicks { 
if {[string match -nocase *$nick* $usernick]} { 
putserv "KILL $nick :$killreason" 
break 
} 
} 
} 
}
Someone please check out all the lines & say where is the error... This code is not working for bot nick 'bitch' and 'aabitchaa' ... thanks
D
DarkJFMan
Halfop
Posts: 85
Joined: Mon Dec 15, 2003 3:19 pm

Post by DarkJFMan »

user wrote:
DarkJFMan wrote:and also make sure you put that script in a new file, because if you have too many scripts on same file, they'll interact causing others to crash.
Putting the code in a new file makes no difference what so ever unless you source the resulting file into another interpreter/namespace.
I know it shouldn't but sometimes, if you have too many scripts, and you got a mistake in one, that's not showing any problems, on bots' start up, having a new file, might help out, because it happened to me once, i had 2 wrong scripts, whenever i restart bot/rehash i don't get any errors. but they cause a script not to work, when i put that script in a new file, it was working fine. then again you can't be too cautious.
Z
ZaKiR
Voice
Posts: 35
Joined: Wed Jun 16, 2004 10:05 pm

Post by ZaKiR »

yes i made another file for this this script called Kill-On-BadNick.tcl & i put that on scripts folder & in eggdrop.conf file i did....
source scripts/alltools.tcl
source scripts/action.fix.tcl
source scripts/identifY.tcl
source scripts/OPER.tcl
source scripts/ChaN-LiMiT.tcl
source scripts/PinG.tcl
source scripts/SeeN.tcl
source scripts/ChanGE-BaD-NicK.tcl
source scripts/ReMovE-BaN.tcl
source scripts/AdvertisE.tcl
source scripts/Excess-Flood.tcl
source scripts/ResPonder.tcl
source scripts/KiLL-On-BadWord.tcl
source scripts/Kill-On-BadNick.tcl
this file is at last... but then what's my error ??
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

If you have too many scripts loaded.
Comment them temporarily and only use necessary
ones such as botnick identification and oper identification or so.

Then check if the script works.
Usually this happens with me as well, they some times
clash with other loaded scripts some where, if you have
too many loaded.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

awyeah wrote:If you have too many scripts loaded.
Comment them temporarily and only use necessary
ones such as botnick identification and oper identification or so.

Then check if the script works.
Usually this happens with me as well, they some times
clash with other loaded scripts some where, if you have
too many loaded.
They don't if you don't have same proc's :mrgreen:
Z
ZaKiR
Voice
Posts: 35
Joined: Wed Jun 16, 2004 10:05 pm

Post by ZaKiR »

Code: Select all


set killnicks { 
"dick" 
"bitch" 
} 

set killreason "\00304Réason: \00301\037B\037\00314ad \00301\037N\037\00314ick \00301\037D\037\00314étéctéd\003" 

bind raw - NOTICE client:connect 

proc client:connect {from keyword args} { 
global killnicks killreason 
if {[string match "*Client connecting*" $args]} { 
set usernick [lindex [split $args] 9] 
foreach nick $killnicks { 
if {[string match -nocase *$nick* $usernick]} { 
putserv "KILL $nick :$killreason" 
break 
} 
} 
} 
} 
]

So how can i make this code working? i don`t have same proc
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Maybe yeah, same procedure names or something... like I have 300, 400kb exceeding tcls in most of my eggies, heh.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Hmmm, lets see now.

Is this set to the correct list index number, even?
Or you might be splitting it wrong.

Code: Select all

set usernick [lindex [split $args] 9]
add these lines in the script

Code: Select all

putlog "/[1/] Bad user nick: [lindex [split $args] 9]"
putlog "/[2/] Bad user nick: [lindex $args 9]"
This should show you in dcc partyline with the bot when
the script runs the results, which of these is correct, by
giving results, or if it isn't correct.

This is to check if it is okay and should tell you if you have
set it on the correct list index.

---
Still hopeless if this doesn't do it then, you can try this.

remove this line from the script

Code: Select all

set usernick [lindex [split $args] 9]
and then replace this line

Code: Select all

if {[string match -nocase *$nick* $usernick]} {

by this line

Code: Select all

if {[string match -nocase *$nick* $args]} {
Or try running this code, its the same after replacing if
you don't get what I have just said.

Infact try running this code

Code: Select all

set killnicks { 
"dick" 
"bitch" 
} 

set killreason "\00304Réason: \00301\037B\037\00314ad \00301\037N\037\00314ick \00301\037D\037\00314étéctéd\003" 

bind raw - NOTICE client:connect 

proc client:connect {from keyword arg} { 
 global killnicks killreason 
  if {[string match -nocase "*client connecting*" $arg]} {
   foreach nick $killnicks { 
    if {[string match -nocase *$nick* $arg]} { 
     putserv "KILL $nick :$killreason" 
     return 0
     }
   }
 }
}
If still this doesn't do it, its a hopeless case :-?
I rest my case :roll:
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Is someone missing something that is staring them right in the face?
For a start, do not use this:

Code: Select all

set killnicks { 
"dick" 
"bitch" 
}
Use this:

Code: Select all

set killnicks { 
*dick*
*bitch*
}
Notice no quotes?

That should fix at least one problem. :P
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
d
dollar
Op
Posts: 178
Joined: Tue Oct 28, 2003 3:47 pm
Location: Netherlands

Post by dollar »

Awyeah, try reading what respectable people like strikelight tell you. $args is a special variable in Tcl, it's always a list. Split is used for magically transforming strings into lists, so why are you splitting $args? :S
dollar (or something similar) at:
#eggdrop / #tcl - undernet
#egghelp / #tcl / #eggtcl - efnet
#eggdrop.support / #tcl - quakenet
#eggdrop - ircnet
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

You can change the variable name to arg or args or idontcare or iforgotwhileediting or igavenexample to whatever you like.

I was just trying to get the script working, whether args, which he posted the script originally in, or arg which I made it in my last post while editing.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
d
dollar
Op
Posts: 178
Joined: Tue Oct 28, 2003 3:47 pm
Location: Netherlands

Post by dollar »

awyeah wrote:You can change the variable name to arg or args or idontcare or iforgotwhileediting or igavenexample to whatever you like.
You can change it, yes, but you should understand the difference between poopoo and args, else you'll keep 'changing it' everywhere, until a bug pops up.
dollar (or something similar) at:
#eggdrop / #tcl - undernet
#egghelp / #tcl / #eggtcl - efnet
#eggdrop.support / #tcl - quakenet
#eggdrop - ircnet
Locked