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

Help Me With This Code

Post by ZaKiR »

i made a code which will kill someone when connecting with a bad nick... but don`t know why this is not working :(

Code: Select all

set killnicks { 
"*dick*" 
"nick2" 
"nick3" 
} 
 
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 equal -nocase $nick $usernick]} { 
putserv "KILL $nick :$killreason"
break 
} 
} 
} 
} 

I think, may be the following line is not appropriate here

Code: Select all

putserv "KILL $nick :$killreason"
i need some help with that... thanks in advance
User avatar
KrzychuG
Master
Posts: 306
Joined: Sat Aug 16, 2003 2:51 pm
Location: Torun, Poland
Contact:

Post by KrzychuG »

Your bot has opper status on that server?
Que?
Z
ZaKiR
Voice
Posts: 35
Joined: Wed Jun 16, 2004 10:05 pm

Post by ZaKiR »

Of couser my bot has oper access
Z
ZaKiR
Voice
Posts: 35
Joined: Wed Jun 16, 2004 10:05 pm

Post by ZaKiR »

actually this code is working but....

Code: Select all

set killnicks { 
"hell" 
"*hell*" 
}
if someone comes with nick 'hell' it works.. but if someone comes with nick 'sdhellsd' it doesn`t work..
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

First, don't use bold text unless its necessary.

Replace this line:

Code: Select all

if {[string equal -nocase $nick $usernick]} {
with this:

Code: Select all

if {[string match -nocase *$nick* $usernick]} {
and you only need "hell" listed in killnicks
D
DarkJFMan
Halfop
Posts: 85
Joined: Mon Dec 15, 2003 3:19 pm

Post by DarkJFMan »

Not sure if this might work, but also try

Code: Select all

"% *hell*"
Z
ZaKiR
Voice
Posts: 35
Joined: Wed Jun 16, 2004 10:05 pm

Post by ZaKiR »

Code: Select all

set killnicks { 
"hell" 
} 
 
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 
} 
} 
} 
} 
It's working for nick 'hell' but not working for nick 'hell123' :(
but if i change it to

Code: Select all

set killnicks { 
"*hell*" 
} 

then it doesn`t work for 'hell' and 'hell123' both :(
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

I'd say this code should work for anything matching
the words:

dgdsgdhelldgfdgfdg
shell
gotohellloser
lamersinhell

And so on because wildcards are on
both sides of the string match *badword*

Because the words are specificed as *hell*
so there for any match on both left and right
hand sides will give results.

Code: Select all

set killnicks { 
"hell" 
"loser"
"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 -nocase "*client connecting*" $args]} { 
    set usernick [lindex [split $args] 9] 
     foreach badnick $killnicks { 
      if {[string match -nocase *$badnick* $usernick]} { 
       putserv "KILL $badnick :$killreason" 
       return 0
      } 
    } 
  } 
}
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Z
ZaKiR
Voice
Posts: 35
Joined: Wed Jun 16, 2004 10:05 pm

Post by ZaKiR »

Code: Select all

set killnicks { 
"hell" 
"loser" 
"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 -nocase "*client connecting*" $args]} { 
    set usernick [lindex [split $args] 9] 
     foreach badnick $killnicks { 
      if {[string match -nocase *$badnick* $usernick]} { 
       putserv "KILL $badnick :$killreason" 
       return 0 
      } 
    } 
  } 
} 
this code this totally not working... i used nick like 'hell' 'ashellas' ... but this code this not working :(
D
DarkJFMan
Halfop
Posts: 85
Joined: Mon Dec 15, 2003 3:19 pm

Post by DarkJFMan »

I told you give

Code: Select all

"% *hell*"
a try...
Z
ZaKiR
Voice
Posts: 35
Joined: Wed Jun 16, 2004 10:05 pm

Post by ZaKiR »

Code: Select all

set killnicks { 
"% *hell*" 
"% *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 -nocase "*client connecting*" $args]} { 
set usernick [lindex [split $args] 9] 
foreach badnick $killnicks { 
if {[string match -nocase *$badnick* $usernick]} { 
putserv "KILL $badnick :$killreason" 
return 0 
} 
} 
} 
}
this is not working also :(
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

You dont need to set the characters % or * in your wordlist.
Just set your words in between quotation marks after spaces or in new lines.

The string matching procedure has *'s on both sides, so its
useless to use those.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
D
DarkJFMan
Halfop
Posts: 85
Joined: Mon Dec 15, 2003 3:19 pm

Post by DarkJFMan »

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.
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

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.
Have you ever read "The Manual"?
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Code: Select all

set killnicks { 
  *hell*
  *dick* 
  *bitch*
} 
Try this? :)
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Locked