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 

Need help - Script will not work

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
hazzlah
Voice


Joined: 13 May 2011
Posts: 4

PostPosted: Fri Sep 02, 2011 9:20 pm    Post subject: Need help - Script will not work Reply with quote

Hi @all

have a prob with the Script.
First Line works fine $killnick has passed the authorized Connection.

But when a nick connect with Nick who not stand in the reqexp Line he do nothing.

I dont find the error hope somebody can help me.

Thx


Code:
bind pubm -|- "*SIGNON*user:*" connect:chk


#killproc
proc connect:chk {nick uhost handle chan arg} {

set killnick [lindex $arg 2]

 if { [regexp -nocase {SomeNick} $killnick] || [regexp -nocase {otherNiCk} $killnick] || [regexp -nocase {TheGuy} $killnick] || [regexp -nocase {On3Nick} $killnick] } {
 putnow "PRIVMSG #chan : $killnick has passed the authorized Connection"

 } else {

  putserv "KILL $killnick : You are not authorized to connect to this server"

   }
}
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sat Sep 03, 2011 10:31 am    Post subject: Reply with quote

I assume you've arranged for your eggdrop to have Irc Op Privileges on the server, and that your eggdrop indeed attains these privileges (using hte OPER command)?

For starters, do you see any errors on your partyline console or logfiles?

Next, don't use list commands (such as lindex) on strings. In this case, use the split command to break the string into a proper list.
Code:
set killnick [lindex [split $arg] 2]


Also, I probably wouldn't use multiple regular expressions in this case, as you aren't really using any patterns or such. A list of approved nicks and an lsearch would be faster, and alot easier to maintain... (although I have to use string tolower to make the matching case-insensitive). This is not related to your problem though.
Code:
set approved [list \
  "somenick" \
  "othersick" \
  "theguy" \
  "on3nick" \
]

proc connect:chk {nick host handle channel text} {
  set killnick [lindex [split $text] 2]
  if {[lsearch -exact $::approved [string tolower $killnick]] >= 0} {
    puthelp "PRIVMSG #chan :$killnick has passed the authorized Connection"
  } else {
    putserv "KILL $killnick :You are not authorized to connect to this server"
  }
}

_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
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