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 

check my little tcl script

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
K3rN3L_P4nIC
Voice


Joined: 17 Nov 2006
Posts: 6

PostPosted: Sat Nov 18, 2006 4:56 pm    Post subject: check my little tcl script Reply with quote

This scrip intention is a kickban and msg to any nick obtains op from my channel, the nick obtain @ is different to nick access op, for example:
Nick access op official is Jagger, but the boy entry on chan using other nick then bot baned this nick. This is the code:

Code:
set chanservices "ChanServ@services.dal.net"
set commandwhy "WHY"
set nickchans "Chanserv"
set nickaops {
"nick1"
"nick2"
"nick3"
"nicknn"
}

bind mode - "#iquitos +o" bot:checkop
bind notc - "*" bot:checkwhy

proc bot:checkop {nick host hand chan mode target} {
global chanservices commandwhy nickchans
 if {[string compare -nocase $::botnick $target] == 0} {return}
 if {[string compare -nocase $nickchans $nick] != 0} {return}
 putserv "PRIVMSG $chanservices :$commandwhy $chan $target"
}

proc bot:checkwhy {nick host hand text dest} {
global nickaops
 foreach nickaop $nickaops { if {([string match -nocase *$nickaop* $nick])} {return}
 if {[string compare -nocase "ChanServ" $nick] !=0} {return}
 foreach nickaop $nickaops { if {([string match -nocase *$nickaop* $nick])} {return}
 puthelp "PRIVMSG $nick :You are using a nick no equal to nick access on the chan"
 putquick "MODE $chan +b $nick"
 putquick "KICK $chan $nick :Change your nick and rejoin"
}
}
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Sun Nov 19, 2006 1:58 pm    Post subject: Reply with quote

Begin with properly indenting the code.

And your foreach's don't appear to be right at all.
Back to top
View user's profile Send private message
K3rN3L_P4nIC
Voice


Joined: 17 Nov 2006
Posts: 6

PostPosted: Tue Nov 21, 2006 5:20 pm    Post subject: Reply with quote

Hi again, this a new code:
Code:
set chans_bop "*"
set chanservices "ChanServ@services.dal.net"
set commandwhy "WHY"
set nickchans "Chanserv"
set nickaops {
"nick1"
"nick2"
"nick3"
"nicknn"
}

bind mode - "*+*o*" bot:checkop
bind notc - "*" bot:checkwhy

proc bot:checkop:checkop {nick host hand chan mode target} {
 if {[string compare -nocase $::botnick $target] == 0} {return}
 if {[string compare -nocase "ChanServ" $nick] != 0} {return}
 putserv "CHANSERV WHY $chan $target"
}

proc bot:checkwhy {nick host hand text dest} {
global botnick nickaops nickchans
if {(([lsearch -exact [string tolower $chans_bop] [string tolower $chan]] != -1) || ($chans_bop == "*"))} {
 foreach nickaop $nickaops { if {([string match -nocase *$nickaop* $botnick])} {return}
   foreach nickaop $nickaops { if {([string match -nocase *$nickaop* $nickchans])} {return}
    foreach nickaop $nickaops { if {([string match -nocase *$nickaop* $nick])} {return}
 puthelp "PRIVMSG $nick :Ud, no esta usando su nick de AOP/SOP no esta permitido, se le dio el acceso a un nick determinado, por favor cambiese de nick"
 putquick "MODE $chan +b $nick"
 putquick "KICK $chan $nick :Pongase su nick de OP"
   }
  }
 }
}
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Tue Nov 21, 2006 6:00 pm    Post subject: Reply with quote

Quote:
Nick has AOp access to #Channel. Reason: Identification to the nickname Nick.

The above is the DALnet ChanServ response to a "why" trigger. You do not appear to be checking this, instead a procedure is triggered on any response from ChanServ.
Code:
proc bot:checkop:checkop {nick host hand chan mode target}

The above is incorrect. Try:
Code:
proc bot:checkop {nick host hand chan mode target}

You could improve the procedure.
Code:
set chanserv "chanserv@Services.dal.net"
setudef flag chk.access

proc bot:checkop {nick host hand chan mode target} {
  if {$target == $::botnick} {
   if {[channel get $chan chk.access]} {
     putserv "PRIVMSG $::chanserv :why $chan $nick" -next
    }
  }
}

_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests 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