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.

Public commands

Old posts that have not been replied to for several years.
Locked
S
Skipper
Voice
Posts: 29
Joined: Sun Aug 21, 2005 10:00 am

Public commands

Post by Skipper »

Code: Select all

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

Post by Alchera »

Code: Select all

  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
S
Skipper
Voice
Posts: 29
Joined: Sun Aug 21, 2005 10:00 am

Post by Skipper »

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
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

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
S
Skipper
Voice
Posts: 29
Joined: Sun Aug 21, 2005 10:00 am

Post by Skipper »

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
d
dMTOn
Voice
Posts: 6
Joined: Tue Aug 30, 2005 3:59 am

Post by dMTOn »

I need script like it too
If i put isop

Code: Select all

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)
D
Dizzle
Op
Posts: 109
Joined: Thu Apr 28, 2005 11:21 am
Contact:

Post by Dizzle »

well a the procs have the code

Code: Select all

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 ???
C
CrazyEgg
Halfop
Posts: 47
Joined: Thu Jul 28, 2005 4:02 pm

Post by CrazyEgg »

set PUBCHAR "."

bind pub o|o ${PUBCHAR}kick kick
......................
as Alchera say the
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: Select all

if {[isop $nick $chan]} {
you have the code :

Code: Select all

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:))
D
Dizzle
Op
Posts: 109
Joined: Thu Apr 28, 2005 11:21 am
Contact:

Post by Dizzle »

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 :lol: :lol:
What's this real life ppl keep talking about ??? And where can I download it ???
S
Skipper
Voice
Posts: 29
Joined: Sun Aug 21, 2005 10:00 am

Post by Skipper »

Hello Dizzle,

I changed the bindings to

bind PUB -|-

But still its not working.. :) whats wrong yet in the tcl?

Rgds

Skipper
C
CrazyEgg
Halfop
Posts: 47
Joined: Thu Jul 28, 2005 4:02 pm

Post by CrazyEgg »

can you give as a part of modificate code? like bind pub for kick and proc for kick.
Locked