| View previous topic :: View next topic |
| Author |
Message |
Skipper Voice
Joined: 21 Aug 2005 Posts: 29
|
Posted: Sat Aug 27, 2005 12:48 am Post subject: Public commands |
|
|
| Code: |
# Command trigger
variable trigger {.}
bind pub o|o ${trigger}op
bind pub o|o ${trigger}deop
bind pub o|o ${trigger}voice
bind pub o|o ${trigger}devoice
bind pub o|o ${trigger}kick
bind pub o|o ${trigger}kb
bind pub o|o ${trigger}nb
proc op {nick uhost hand chan text} {
global botnick
if {[botisop $nick $chan]} && {[isop $nick $chan]} {
set target [lindex $text 0]
set target1 [lindex $text 1]
set target2 [lindex $text 2]
if {$target == ""} {
putserv "MODE $chan +o $nick
}
}
}
proc deop {nick host hand chan text} {
global botnick
if {[isop $nick $chan]} {
set target [lindex $text 0]
set target1 [lindex $text 1]
set target2 [lindex $text 2]
if {$target == ""} {
putserv "MODE $chan -o $nick"
} else {
putserv "MODE $chan -ooo $target $target1 $target2"
}
}
}
proc voice {nick host hand chan text} {
global botnick
if {[isop $nick $chan]} {
set target [lindex $text 0]
set target1 [lindex $text 1]
set target2 [lindex $text 2]
if {$target == ""} {
putserv "MODE $chan +v $nick"
} else {
putserv "MODE $chan +vvv $target $target1 $target2"
}
}
}
proc devoice {nick host hand chan text} {
global botnick
if {[isop $nick $chan]} {
set target [lindex $text 0]
set target1 [lindex $text 1]
set target2 [lindex $text 2]
if {$target == ""} {
putserv "MODE $chan -v $nick"
} else {
putserv "MODE $chan -vvv $target $target1 $target2"
}
}
}
proc kb {nick host hand chan text} {
global botnick
if {[isop $nick $chan]} {
set target [lindex $text 0]
set reason [lrange $text 0 end]
set bhost [getchanhost $target $chan]
set banmask "*!*[string trimleft [string range $bhost [string first "!" $bhost] end] ?^~-_+?]"
if {$target == ""} {
putserv "MODE $chan +b $banmask"
putserv "kick $chan $target :$reason"
}
}
}
proc kick {nick host hand chan text} {
global botnick
if {[isop $nick $chan]} {
set target [lindex $text 0]
set reason [lrange $text 0 end]
if {$target == ""} {
putserv "kick $chan $target :$reason"
}
}
}
proc nb {nick host hand chan text} {
global botnick
if {[isop $nick $chan]} {
set target [lindex $text 0]
set reason [lrange $text 0 end]
if {$target == ""} {
putserv "MODE $chan +b $nick"
putserv "kick $chan $target :$reason"
}
}
}
|
Well, A public command tcl which works for the ppl who are op in that channel.. without adding the users to the bots userlist..
But i wonder whats wrong.. bot is not responding.
Rgds
Skipper |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Sat Aug 27, 2005 1:14 am Post subject: |
|
|
| Code: | bind <type> <flags> <keyword/mask> [proc-name]
Description: You can use the 'bind' command to attach Tcl procedures
to certain events. flags are the flags the user must have to trigger
the event (if applicable). proc-name is the name of the Tcl procedure
to call for this command (see below for the format of the procedure
call). If the proc-name is omitted, no binding is added. Instead, the
current binding is returned (if it's stackable, a list of the current
bindings is returned).
Returns: name of the command that was added, or (if proc-name was
omitted), a list of the current bindings for this command
Module: core |
Person triggering the script has to have the 'o' flag i.e. a bot user. _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
Skipper Voice
Joined: 21 Aug 2005 Posts: 29
|
Posted: Sat Aug 27, 2005 2:01 am Post subject: |
|
|
Hello Alchera,
Without adding the person to bots user list.. it cant be done in any other way? i want the bot to respond to the command.. if the user is an op. any alterations can be done?
Rgds
Skipper |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sat Aug 27, 2005 2:33 am Post subject: |
|
|
| sure, change the bind flags and add [isop] check in each trigger proc; however, that would render the whole thing completely pointless (like most, if not all of your other needs - no offense) because if you are an op, you don't need the bot to perform chores that you can do yourself |
|
| Back to top |
|
 |
Skipper Voice
Joined: 21 Aug 2005 Posts: 29
|
Posted: Sun Aug 28, 2005 8:54 am Post subject: |
|
|
Hello,
Thanks demond.. But let me know.. where i should change? and what i should change? Pls give the changes in my code.
Rgds
Skipper |
|
| Back to top |
|
 |
dMTOn Voice
Joined: 30 Aug 2005 Posts: 6
|
Posted: Tue Aug 30, 2005 4:04 am Post subject: |
|
|
I need script like it too
If i put isop
| Code: |
bind pub isop ${trigger}op
bind pub isop ${trigger}deop
bind pub isop ${trigger}voice
bind pub isop ${trigger}devoice
bind pub isop ${trigger}kick
bind pub isop ${trigger}kb
bind pub isop ${trigger}nb
|
Everyone can use commands (ops, voiced, not voiced)
I'm looking for script that you need only to be a operator of channel(don't have to identify to bot, be master, etc) |
|
| Back to top |
|
 |
Dizzle Op
Joined: 28 Apr 2005 Posts: 109
|
Posted: Tue Aug 30, 2005 6:36 am Post subject: |
|
|
well a the procs have the code
| Code: | | if {[isop $nick $chan]} { |
this makes sure only opped ppl in the chan may use the command, without identify too the bot etc, so its already there _________________ What's this real life ppl keep talking about ??? And where can I download it ??? |
|
| Back to top |
|
 |
CrazyEgg Halfop
Joined: 28 Jul 2005 Posts: 47
|
Posted: Tue Aug 30, 2005 7:36 am Post subject: |
|
|
| Quote: |
set PUBCHAR "."
bind pub o|o ${PUBCHAR}kick kick
......................
|
as Alchera say the
| Quote: | | bind <type> <flags> <keyword/mask> [proc-name] |
(Alchera corect me if i am wrong pls)
as demond say the o|o meaning that the user with flags global op or channel op can use the command.The bot didnt add any user with this.If you want to use everyone just give *|* or simple * and with the "if isop.." what you have give permission only to op on channel. (demond correct me pls if i am wrong)
as Dizzle say
| Code: |
if {[isop $nick $chan]} {
|
you have the code :
| Code: |
if {[botisop $chan] && [isop $nick $chan]} {
(i think like that is correct) just add it to each proc.
|
dMTOn
isop i thing that is not acceptable.
as i say bind pub *|* ${trigger}op op
or
bind pub * ${trigger}op op
and if you want to used everyone just dont give [isop $nick $chan]
as i saw the script have no protections against kick bot/kick owner/ban type *!*@*/ban bot address/ban op/ban owner etc.
I thing that the public commands has the conception the op or user to give commands without to be op.If is op what the point to type .op nick
and not click to mirc/pirch/xchat menu to op him.
Anyway:)) |
|
| Back to top |
|
 |
Dizzle Op
Joined: 28 Apr 2005 Posts: 109
|
Posted: Tue Aug 30, 2005 12:16 pm Post subject: |
|
|
i dont see the point off not opping the person yourself, i think when the wrong person is opped they can blame the bot of doing that  _________________ What's this real life ppl keep talking about ??? And where can I download it ??? |
|
| Back to top |
|
 |
Skipper Voice
Joined: 21 Aug 2005 Posts: 29
|
Posted: Wed Aug 31, 2005 2:59 am Post subject: |
|
|
Hello Dizzle,
I changed the bindings to
bind PUB -|-
But still its not working.. whats wrong yet in the tcl?
Rgds
Skipper |
|
| Back to top |
|
 |
CrazyEgg Halfop
Joined: 28 Jul 2005 Posts: 47
|
Posted: Wed Aug 31, 2005 3:28 am Post subject: |
|
|
| can you give as a part of modificate code? like bind pub for kick and proc for kick. |
|
| Back to top |
|
 |
|