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

Old posts that have not been replied to for several years.
s
s0ulw4r
Voice
Posts: 17
Joined: Sat Dec 18, 2004 8:16 am
Location: greece
Contact:

!help

Post by s0ulw4r »

I want to make a protect list for nicks that include the words: bot, b0t, serv, sevr. I want every nick that include the above words (bot/b0t/serv/sevr) and it is not registered to the protect nick to be banned. The registration of the nick would be done by the Master either public or with msg (for example !protect LameBot). When I type ! protect +Nick, the specific nick should be able to join the channel Could you help me?

Thanks
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

Code: Select all

set plist {}
set blist {bot b0t serv sevr}
set reason "bot/serv imposter"
bind pub m !protect foo
proc foo {n u h c t} {lappend ::plist [string tolower $t]}
bind join - * bar
proc bar {n u h c} {
  set n [string tolower $n]
  foreach b $::blist {
    if {[string match *${b}* $n] && ([lsearch -exact $::plist $n] == -1)} {
      newchanban $c [maskhost $n!$u] $::botnet-nick $::reason
      putkick $c $n $::reason
    }
  }
}
s
s0ulw4r
Voice
Posts: 17
Joined: Sat Dec 18, 2004 8:16 am
Location: greece
Contact:

not work !help

Post by s0ulw4r »

the protect [bot b0t serv sevr] channel #coba list not working ( *** Now talking in #coba
*** ChanServ sets mode: +o Gh0stMaN
*** cOd3B0t sets mode: +o Gh0stMaN
*** NOR7ON|SEVR sets mode: +o Gh0stMaN
*** UniXSEVR sets mode: +o Gh0stMaN
*** WeiseSEVR sets mode: +o Gh0stMaN
*** ChanB0t sets mode: +o Gh0stMaN
*** BotWeiser sets mode: +o Gh0stMaN
*** CabLESeVR sets mode: +o Gh0stMaN
*** L4m3b0t sets mode: +o Gh0stMaN<NOR7ON|SEVR> [Anti-Idle]
<Gh0stMaN> !protect SilverBOt
<Gh0stMaN> !protect Slow|BOt
not working :( all nicks' b0t b0t serv sevr ' in access #coba list is protects bots.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

what's not working?

from the listing you pasted (next time use

Code: Select all

 tag) I can't understand what your problem is
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

Code: Select all

if {[string match *${b}* $n] && ([lsearch -exact $::plist $n] == -1)} {
you have to add a -nocase in there

Code: Select all

if {[string match -nocase *${b}* $n] && ([lsearch -exact $::plist $n] == -1)} {
Elen sila lúmenn' omentielvo
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

And also for using lsearch matching, put both of the variables to match in similar strings before using -exact; either both in lower strings or upper strings, since it does not have a -nocase switch such as other string manipulation commands. (generally a good idea)
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

awyeah wrote:And also for using lsearch matching, put both of the variables to match in similar strings before using -exact; either both in lower strings or upper strings. (generally a good idea)
how do you lsearch through patterns, matching not a pattern against list elements but an element against patterns?
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Hmm... never tried that, seems odd to match 2 lists of elements and checking if any both of the lists have similar entries. However you would need to use a foreach loop with lsearch for that. The foreach loop would keep changing the element in one list (which will be your search pattern), while you match against the other list.

I just use a foreach loop as you did and use string match as it is faster. But a foreach loop and string match would take the sametime as lsearch then, since string match has a foreach loop with it and it is not alone.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

thats why I used foreach
s
s0ulw4r
Voice
Posts: 17
Joined: Sat Dec 18, 2004 8:16 am
Location: greece
Contact:

Post by s0ulw4r »

[quote="demond"]what's not working?

from the listing you pasted (next time use

Code: Select all

 tag) I can't understand what your problem is[/quote]  want to make a tcl that would give access to channel list (/cs access #channel list) and ban (reason: Is Not Protected. False Bot) those nicks that include the word the words bot/b0t/serv/serv {(bot|b0t|serv|sevr)} $nick]} and are not include in the list of the channelthe tcl might be made in a way that I would add them with publi command! ( !protect EggBot !ptrotect SpEEd|SEVR !protect dArkB0t ................)
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Concept:
First bind on pub, to bind to the trigger which would make the bot do /msg chanserv access #channel list. Then bind to notc, check if [string equal "ChanServ" $nick] and making sure $target is the bot's nick by checking string index 0 != #, if necessary. Then you can find the list index numbers of the text output to check and string match your patterns with a foreach loop or string match the entire text. Though I would prefer using lindex. After match, you can go ahead and do anything you like within the loop itself.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

[quote="s0ulw4r"][quote="demond"]what's not working?

from the listing you pasted (next time use

Code: Select all

 tag) I can't understand what your problem is[/quote]  want to make a tcl that would give access to channel list (/cs access #channel list) and ban (reason: Is Not Protected. False Bot) those nicks that include the word the words bot/b0t/serv/serv {(bot|b0t|serv|sevr)} $nick]} and are not include in the list of the channelthe tcl might be made in a way that I would add them with publi command! ( !protect EggBot !ptrotect SpEEd|SEVR !protect dArkB0t ................)[/quote]

access to channel list? access that grants the right of use of /cs access #channel list? this has nothing to do with your initial request, or you are simply unable to explain what you need (assuming that you know it yourself, which I very much doubt, I think you are totally confused)

what I wrote for you (with Papillon's fix) bans anyone with bot/serv in their nick, if they aren't on the protected list - and you can add nicks to that list with !protect public command - if this doesn't suit you, feel free to help yourself as you wish
s
s0ulw4r
Voice
Posts: 17
Joined: Sat Dec 18, 2004 8:16 am
Location: greece
Contact:

rehelp

Post by s0ulw4r »

this tcl that you gave to me doesn't work,I need a list where I can put the nicks that have the words <<bot, b0t,serv and sevr>> no flags only nicks.Any nick that has the words <<bot, b0t,serv and sevr>> will try to come into the channel and it is not in the protect list will automatically be banned.The one way is to put in the tcl the nicks,the other way is the bot by itself automatically when it comes in the channel to seek the access list of the channel <<greek network:/msg chanserv access list>> and at dalnet is <<:/msg chanserv sop list>>.and the third way is to make it by a command public or /msg.
Thank you for your patience
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Re: rehelp

Post by demond »

s0ulw4r wrote:this tcl that you gave to me doesn't work,I need a list where I can put the nicks that have the words <<bot, b0t,serv and sevr>> no flags only nicks.Any nick that has the words <<bot, b0t,serv and sevr>> will try to come into the channel and it is not in the protect list will automatically be banned.The one way is to put in the tcl the nicks,the other way is the bot by itself automatically when it comes in the channel to seek the access list of the channel <<greek network:/msg chanserv access list>> and at dalnet is <<:/msg chanserv sop list>>.and the third way is to make it by a command public or /msg.
Thank you for your patience
instead of whining "it doesn't work it doesn't work" you could have said that it complains with a Tcl error on $::botnet-nick; change it to ${::botnet-nick} and it's gonna be okay
s
s0ulw4r
Voice
Posts: 17
Joined: Sat Dec 18, 2004 8:16 am
Location: greece
Contact:

working

Post by s0ulw4r »

special thanks
Locked