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.

check my little tcl script

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
User avatar
K3rN3L_P4nIC
Voice
Posts: 6
Joined: Fri Nov 17, 2006 11:08 pm

check my little tcl script

Post by K3rN3L_P4nIC »

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: Select all

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"
}
}
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Begin with properly indenting the code.

And your foreach's don't appear to be right at all.
User avatar
K3rN3L_P4nIC
Voice
Posts: 6
Joined: Fri Nov 17, 2006 11:08 pm

Post by K3rN3L_P4nIC »

Hi again, this a new code:

Code: Select all

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"
   }
  }
 }
}
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

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: Select all

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

Code: Select all

proc bot:checkop {nick host hand chan mode target}
You could improve the procedure.

Code: Select all

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
Post Reply