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 

Ircop eggdrop bot with SACommands

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


Joined: 04 Sep 2022
Posts: 14
Location: London

PostPosted: Sun Sep 04, 2022 1:04 am    Post subject: Ircop eggdrop bot with SACommands Reply with quote

Hello guys. I need a little bit help about this script. Something is wrong. Is it possiable someone help me with it?
Code:

bind msg n op msg:op

proc msg:op {nick uhost handle txt}  {
  if {$txt == ""} {
    putserv "samode $chan +o $nick"
    return 0
  }

  if {![onchan $txt $chan]} {
    putserv "notice $nick :$txt is not on $chan"
    return 0
  }
  putserv "samode $chan +o $txt"
  putserv "PRIVMAG #admins :$txt get OP in $chan"
}
Back to top
View user's profile Send private message Visit poster's website
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1108
Location: France

PostPosted: Sun Sep 04, 2022 3:58 am    Post subject: Reply with quote

Give the error message, use .set errorInfo to have more datas about the error.
But...
- $chan is never setted
- PRIVMAG ?
_________________
https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
Valentin
Voice


Joined: 04 Sep 2022
Posts: 14
Location: London

PostPosted: Sun Sep 04, 2022 4:44 am    Post subject: Reply with quote

CrazyCat wrote:
Give the error message, use .set errorInfo to have more datas about the error.
But...
- $chan is never setted
- PRIVMAG ?



Hey, CrazyCat. This is the error:
[08:42:39] Tcl error [msg:op]: can't read "chan": no such variable
_________________
if there's a will, there's a way.
Back to top
View user's profile Send private message Visit poster's website
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1191

PostPosted: Sun Sep 04, 2022 9:49 am    Post subject: Reply with quote

Quote:

...
This is the error:
[08:42:39] Tcl error [msg:op]: can't read "chan": no such variable


CrazyCat pointed that out,with:
Quote:

- $chan is never setted


See here:
Code:

proc msg:op {nick uhost handle txt}  {
  if {$txt == ""} {
    putserv "samode $chan +o $nick"
...


When your script gets to that point, it is trying to use a variable named $chan, that does not exist. It's never been set in that procedure.

Is this script intended to be used in just one channel? If so, a simple solution would be to simply :
Code:

set chan "#ChannelName"

at the top of the proc.

Also, don't forget that CrazyCat said:
Quote:

- PRIVMAG ?


because once you get the $chan variable thing fixed, then that line with that typo in it, is going to error. Wink

I hope this helps.
_________________
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
Back to top
View user's profile Send private message
Valentin
Voice


Joined: 04 Sep 2022
Posts: 14
Location: London

PostPosted: Sun Sep 04, 2022 1:53 pm    Post subject: Reply with quote

willyw wrote:
Quote:

...
This is the error:
[08:42:39] Tcl error [msg:op]: can't read "chan": no such variable


CrazyCat pointed that out,with:
Quote:

- $chan is never setted


See here:
Code:

proc msg:op {nick uhost handle txt}  {
  if {$txt == ""} {
    putserv "samode $chan +o $nick"
...


When your script gets to that point, it is trying to use a variable named $chan, that does not exist. It's never been set in that procedure.

Is this script intended to be used in just one channel? If so, a simple solution would be to simply :
Code:

set chan "#ChannelName"

at the top of the proc.

Also, don't forget that CrazyCat said:
Quote:

- PRIVMAG ?


because once you get the $chan variable thing fixed, then that line with that typo in it, is going to error. Wink

I hope this helps.



So, the point is to give me op at any channel where I want. The bot is IRCop. And must make notice at #admins for any get op. The bot will not be in the channel where I want to give me OP. Must be something like OperServ but eggdrop.
_________________
if there's a will, there's a way.
Back to top
View user's profile Send private message Visit poster's website
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 826
Location: Tennessee, USA

PostPosted: Sun Sep 04, 2022 3:33 pm    Post subject: Reply with quote

Try this code.
The command syntax is: op #somechannel
The bot will attempt to OP the +n flagged command user in #somechannel.
Important: This is Not a very secure method of getting op, as it is just protected by the flags on the bind!!!!
Be sure your bot owners only have very secure host masks!

Code:

bind msg n op msg:op

proc msg:op {nick uhost handle txt}  {
  set chan [lindex [split [string trim $txt]] 0]

  if {![string match "#?*" $chan]} {
    putserv "PRIVMSG $nick :Command syntax: \002op #somechannel\002"
    return 0
  }

  putserv "samode $chan +o $nick"
  putserv "PRIVMSG #admins :$nick get OP in $chan"
}


_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
Back to top
View user's profile Send private message Visit poster's website
Valentin
Voice


Joined: 04 Sep 2022
Posts: 14
Location: London

PostPosted: Sun Sep 04, 2022 3:57 pm    Post subject: Reply with quote

SpiKe^^ wrote:
Try this code.
The command syntax is: op #somechannel
The bot will attempt to OP the +n flagged command user in #somechannel.
Important: This is Not a very secure method of getting op, as it is just protected by the flags on the bind!!!!
Be sure your bot owners only have very secure host masks!

Code:

bind msg n op msg:op

proc msg:op {nick uhost handle txt}  {
  set chan [lindex [split [string trim $txt]] 0]

  if {![string match "#?*" $chan]} {
    putserv "PRIVMSG $nick :Command syntax: \002op #somechannel\002"
    return 0
  }

  putserv "samode $chan +o $nick"
  putserv "PRIVMSG #admins :$nick get OP in $chan"
}



Yeah, this work Spike^^ but is give OP only to the user use the command. I can`t give OP to another user. I can get of only to myself.
_________________
if there's a will, there's a way.
Back to top
View user's profile Send private message Visit poster's website
Valentin
Voice


Joined: 04 Sep 2022
Posts: 14
Location: London

PostPosted: Sun Sep 04, 2022 4:29 pm    Post subject: Reply with quote

The bot now is give OP only to the user who use the command.
The false is my. I ment the bot must give OP to everyone named in the command.
The script must be work like this way: "op #somechannel somenick"
_________________
if there's a will, there's a way.
Back to top
View user's profile Send private message Visit poster's website
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1108
Location: France

PostPosted: Sun Sep 04, 2022 6:57 pm    Post subject: Reply with quote

Code:
bind msg n op msg:op

proc msg:op {nick uhost handle txt}  {
  lassign [split [string trim $txt]] chan vict
  if {![string match "#?*" $chan]} {
    putserv "PRIVMSG $nick :Command syntax: \002op #somechannel \[user\]\002"
    return 0
  }
  if {$vict eq ""} { set vict $nick }
  putserv "samode $chan +o $vict"
  putserv "PRIVMSG #admins :$vict get OP in $chan"
}

This will allow !op #channel and !op #channel user
_________________
https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
Valentin
Voice


Joined: 04 Sep 2022
Posts: 14
Location: London

PostPosted: Sun Sep 04, 2022 8:25 pm    Post subject: Reply with quote

Thank you CrazyCat is working perfect!
_________________
if there's a will, there's a way.
Back to top
View user's profile Send private message Visit poster's website
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 826
Location: Tennessee, USA

PostPosted: Sun Sep 04, 2022 10:18 pm    Post subject: samop.tcl version 0.1 Reply with quote

Here's a more complete version of the script, with all the features you hinted about in your posts above...

This will allow !op #channel and !op #channel user
and !op #channel nick nick2 nick3

Code:

# set one admin channel here for an added security check.
# both the bot and the command user will need to be in this channel.
# maybe set this channel password protected or invite only...
# ex. set samop(adminchan) "#admins"
# or set empty to not require command users to be in an admin channel.
# ex: set samop(adminchan) ""
set samop(adminchan) "#admins"

# set one report channel here for the bot to report mode changes to.
# ex. set samop(reportchan) "#admins"
# or set empty to not report modes.  ex: set samop(reportchan) ""
set samop(reportchan) "#admins"


bind msg n op msg:op

proc msg:op {nick uhost handle txt}  {   global samop
  set targets [lassign [split [string trim $txt]] chan]
  if {![string match "#?*" $chan]} {
    putserv "PRIVMSG $nick :Command syntax: \002op #somechannel \[nick(s)\]\002"
    return 0
  }

  if {[string match "#?*" $samop(adminchan)]} {
    if {![botonchan $samop(adminchan)] || ![onchan $nick $samop(adminchan)]} {
      putserv "PRIVMSG $nick :Both you & the bot must be on $samop(adminchan)"
      return 0
    }
  }

  if {![llength $targets]} {  lappend targets $nick  }
  set mode [string repeat "o" [llength $targets]]
  putserv "samode $chan +$mode [join $targets]"
  if {[string match "#?*" $samop(reportchan)]} {
    putserv "PRIVMSG $samop(reportchan) :[join $targets] get OP in $chan"
  }
  return 0
}

putlog "samop.tcl version 0.1 loaded."


_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
Back to top
View user's profile Send private message Visit poster's website
Valentin
Voice


Joined: 04 Sep 2022
Posts: 14
Location: London

PostPosted: Sun Sep 04, 2022 11:23 pm    Post subject: Re: samop.tcl version 0.1 Reply with quote

Code:

# set one admin channel here for an added security check.
# both the bot and the command user will need to be in this channel.
# maybe set this channel password protected or invite only...
# ex. set samop(adminchan) "#admins"
# or set empty to not require command users to be in an admin channel.
# ex: set samop(adminchan) ""
set samop(adminchan) "#admins"

# set one report channel here for the bot to report mode changes to.
# ex. set samop(reportchan) "#admins"
# or set empty to not report modes.  ex: set samop(reportchan) ""
set samop(reportchan) "#admins"


#################################
############# OWNER #############
#################################

bind msg n owner msg:qop

proc msg:qop {nick uhost handle txt}  {   global samop
  set targets [lassign [split [string trim $txt]] chan]
  if {![string match "#?*" $chan]} {
    putserv "NOTICE $nick :Command syntax: \002OWNER #somechannel \[nick(s)\]\002"
    return 0
  }

  if {[string match "#?*" $samop(adminchan)]} {
    if {![botonchan $samop(adminchan)] || ![onchan $nick $samop(adminchan)]} {
      putserv "NOTICE $nick :Both you & the bot must be on $samop(adminchan)"
      return 0
    }
  }

  if {![llength $targets]} {  lappend targets $nick  }
  set mode [string repeat "q" [llength $targets]]
  putserv "samode $chan +$mode [join $targets]"
  if {[string match "#?*" $samop(reportchan)]} {
    putserv "PRIVMSG $samop(reportchan) :$nick used OWNER to make [join $targets] OWNER in $chan"
  }
  return 0
}


##################################
############ PROTECT #############
##################################

bind msg n protect msg:sop

proc msg:sop {nick uhost handle txt}  {   global samop
  set targets [lassign [split [string trim $txt]] chan]
  if {![string match "#?*" $chan]} {
    putserv "NOTICE $nick :Command syntax: \002PROTECT #somechannel \[nick(s)\]\002"
    return 0
  }

  if {[string match "#?*" $samop(adminchan)]} {
    if {![botonchan $samop(adminchan)] || ![onchan $nick $samop(adminchan)]} {
      putserv "NOTICE $nick :Both you & the bot must be on $samop(adminchan)"
      return 0
    }
  }

  if {![llength $targets]} {  lappend targets $nick  }
  set mode [string repeat "a" [llength $targets]]
  putserv "samode $chan +$mode [join $targets]"
  if {[string match "#?*" $samop(reportchan)]} {
    putserv "PRIVMSG $samop(reportchan) :$nick used PROTECT to make [join $targets] PROTECT in $chan"
  }
  return 0
}


#################################
############## OP ###############
#################################

bind msg n op msg:op

proc msg:op {nick uhost handle txt}  {   global samop
  set targets [lassign [split [string trim $txt]] chan]
  if {![string match "#?*" $chan]} {
    putserv "NOTICE $nick :Command syntax: \002OP #somechannel \[nick(s)\]\002"
    return 0
  }

  if {[string match "#?*" $samop(adminchan)]} {
    if {![botonchan $samop(adminchan)] || ![onchan $nick $samop(adminchan)]} {
      putserv "NOTICE $nick :Both you & the bot must be on $samop(adminchan)"
      return 0
    }
  }

  if {![llength $targets]} {  lappend targets $nick  }
  set mode [string repeat "o" [llength $targets]]
  putserv "samode $chan +$mode [join $targets]"
  if {[string match "#?*" $samop(reportchan)]} {
    putserv "PRIVMSG $samop(reportchan) :$nick used OP to make [join $targets] OP in $chan"
  }
  return 0
}


#################################
############# HALFOP ############
#################################

bind msg n halfop msg:hop

proc msg:hop {nick uhost handle txt}  {   global samop
  set targets [lassign [split [string trim $txt]] chan]
  if {![string match "#?*" $chan]} {
    putserv "NOTICE $nick :Command syntax: \002HALFOP #somechannel \[nick(s)\]\002"
    return 0
  }

  if {[string match "#?*" $samop(adminchan)]} {
    if {![botonchan $samop(adminchan)] || ![onchan $nick $samop(adminchan)]} {
      putserv "NOTICE $nick :Both you & the bot must be on $samop(adminchan)"
      return 0
    }
  }

  if {![llength $targets]} {  lappend targets $nick  }
  set mode [string repeat "h" [llength $targets]]
  putserv "samode $chan +$mode [join $targets]"
  if {[string match "#?*" $samop(reportchan)]} {
    putserv "PRIVMSG $samop(reportchan) :$nick used HALFOP to make [join $targets] HALFOP in $chan"
  }
  return 0
}


#################################
############# VOICE #############
#################################

bind msg n voice msg:vop

proc msg:vop {nick uhost handle txt}  {   global samop
  set targets [lassign [split [string trim $txt]] chan]
  if {![string match "#?*" $chan]} {
    putserv "NOTICE $nick :Command syntax: \002VOICE #somechannel \[nick(s)\]\002"
    return 0
  }

  if {[string match "#?*" $samop(adminchan)]} {
    if {![botonchan $samop(adminchan)] || ![onchan $nick $samop(adminchan)]} {
      putserv "NOTICE $nick :Both you & the bot must be on $samop(adminchan)"
      return 0
    }
  }

  if {![llength $targets]} {  lappend targets $nick  }
  set mode [string repeat "v" [llength $targets]]
  putserv "samode $chan +$mode [join $targets]"
  if {[string match "#?*" $samop(reportchan)]} {
    putserv "PRIVMSG $samop(reportchan) :$nick used VOICE to make [join $targets] VOICE in $chan"
  }
  return 0
}


#################################
############# OWNER #############
#################################

bind msg n deowner msg:deqop

proc msg:deqop {nick uhost handle txt}  {   global samop
  set targets [lassign [split [string trim $txt]] chan]
  if {![string match "#?*" $chan]} {
    putserv "NOTICE $nick :Command syntax: \002DEOWNER #somechannel \[nick(s)\]\002"
    return 0
  }

  if {[string match "#?*" $samop(adminchan)]} {
    if {![botonchan $samop(adminchan)] || ![onchan $nick $samop(adminchan)]} {
      putserv "NOTICE $nick :Both you & the bot must be on $samop(adminchan)"
      return 0
    }
  }

  if {![llength $targets]} {  lappend targets $nick  }
  set mode [string repeat "q" [llength $targets]]
  putserv "samode $chan -$mode [join $targets]"
  if {[string match "#?*" $samop(reportchan)]} {
    putserv "PRIVMSG $samop(reportchan) :$nick used DEOWNER to make [join $targets] DEOWNER in $chan"
  }
  return 0
}


##################################
############ PROTECT #############
##################################

bind msg n deprotect msg:desop

proc msg:desop {nick uhost handle txt}  {   global samop
  set targets [lassign [split [string trim $txt]] chan]
  if {![string match "#?*" $chan]} {
    putserv "NOTICE $nick :Command syntax: \002DEPROTECT #somechannel \[nick(s)\]\002"
    return 0
  }

  if {[string match "#?*" $samop(adminchan)]} {
    if {![botonchan $samop(adminchan)] || ![onchan $nick $samop(adminchan)]} {
      putserv "NOTICE $nick :Both you & the bot must be on $samop(adminchan)"
      return 0
    }
  }

  if {![llength $targets]} {  lappend targets $nick  }
  set mode [string repeat "a" [llength $targets]]
  putserv "samode $chan -$mode [join $targets]"
  if {[string match "#?*" $samop(reportchan)]} {
    putserv "PRIVMSG $samop(reportchan) :$nick used DEPROTECT to make [join $targets] DEPROTECT in $chan"
  }
  return 0
}


#################################
############## OP ###############
#################################

bind msg n deop msg:deop

proc msg:deop {nick uhost handle txt}  {   global samop
  set targets [lassign [split [string trim $txt]] chan]
  if {![string match "#?*" $chan]} {
    putserv "NOTICE $nick :Command syntax: \002DEOP #somechannel \[nick(s)\]\002"
    return 0
  }

  if {[string match "#?*" $samop(adminchan)]} {
    if {![botonchan $samop(adminchan)] || ![onchan $nick $samop(adminchan)]} {
      putserv "NOTICE $nick :Both you & the bot must be on $samop(adminchan)"
      return 0
    }
  }

  if {![llength $targets]} {  lappend targets $nick  }
  set mode [string repeat "o" [llength $targets]]
  putserv "samode $chan -$mode [join $targets]"
  if {[string match "#?*" $samop(reportchan)]} {
    putserv "PRIVMSG $samop(reportchan) :$nick used DEOP to make [join $targets] DEOP in $chan"
  }
  return 0
}


#################################
############# HALFOP ############
#################################

bind msg n dehalfop msg:dehop

proc msg:dehop {nick uhost handle txt}  {   global samop
  set targets [lassign [split [string trim $txt]] chan]
  if {![string match "#?*" $chan]} {
    putserv "NOTICE $nick :Command syntax: \002DEHALFOP #somechannel \[nick(s)\]\002"
    return 0
  }

  if {[string match "#?*" $samop(adminchan)]} {
    if {![botonchan $samop(adminchan)] || ![onchan $nick $samop(adminchan)]} {
      putserv "NOTICE $nick :Both you & the bot must be on $samop(adminchan)"
      return 0
    }
  }

  if {![llength $targets]} {  lappend targets $nick  }
  set mode [string repeat "h" [llength $targets]]
  putserv "samode $chan -$mode [join $targets]"
  if {[string match "#?*" $samop(reportchan)]} {
    putserv "PRIVMSG $samop(reportchan) :$nick used DEHALFOP to make [join $targets] DEHALFOP in $chan"
  }
  return 0
}


#################################
############ DEVOICE ############
#################################

bind msg n devoice msg:devop

proc msg:devop {nick uhost handle txt}  {   global samop
  set targets [lassign [split [string trim $txt]] chan]
  if {![string match "#?*" $chan]} {
    putserv "NOTICE $nick :Command syntax: \002DEVOICE #somechannel \[nick(s)\]\002"
    return 0
  }

  if {[string match "#?*" $samop(adminchan)]} {
    if {![botonchan $samop(adminchan)] || ![onchan $nick $samop(adminchan)]} {
      putserv "NOTICE $nick :Both you & the bot must be on $samop(adminchan)"
      return 0
    }
  }

  if {![llength $targets]} {  lappend targets $nick  }
  set mode [string repeat "v" [llength $targets]]
  putserv "samode $chan -$mode [join $targets]"
  if {[string match "#?*" $samop(reportchan)]} {
    putserv "PRIVMSG $samop(reportchan) :$nick used DEVOICE to make [join $targets] DEVOICE in $chan"
  }
  return 0
}


#################################
############# HELP ##############
#################################

bind msg n help msg:help
proc msg:help {nick uhost hand txt} {
  if {[llength $txt]<13} {
putserv "NOTICE $nick :=============== HELP ================"
putserv "NOTICE $nick :/msg AdminServ OWNER #channel nick"
putserv "NOTICE $nick :/msg AdminServ DEOWNER #channel nick"
putserv "NOTICE $nick :/msg AdminServ PROTECT #channel nick"
putserv "NOTICE $nick :/msg AdminServ DEPROTECT #channel nick"
putserv "NOTICE $nick :/msg AdminServ OP #channel nick"
putserv "NOTICE $nick :/msg AdminServ DEOP #channel nick"
putserv "NOTICE $nick :/msg AdminServ HALFOP #channel nick"
putserv "NOTICE $nick :/msg AdminServ DEHALFOP #channel nick"
putserv "NOTICE $nick :/msg AdminServ VOICE #channel nick"
putserv "NOTICE $nick :/msg AdminServ DEVOICE #channel nick"
putserv "NOTICE $nick :/msg AdminServ HELP"
putserv "NOTICE $nick :================ END ================"
  }
}


putlog "samop.tcl version 0.1 loaded."



So, this is the scripts. Working perfect. I`m just added commands for +q +a +h +v -q -a -o -h -v and help.
Thank you, Spike^^ and CrazyCat
_________________
if there's a will, there's a way.
Back to top
View user's profile Send private message Visit poster's website
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1108
Location: France

PostPosted: Mon Sep 05, 2022 10:20 am    Post subject: Reply with quote

Could do a shorter version using a routing proc:
Code:
# set one admin channel here for an added security check.
# both the bot and the command user will need to be in this channel.
# maybe set this channel password protected or invite only...
# ex. set samop(adminchan) "#admins"
# or set empty to not require command users to be in an admin channel.
# ex: set samop(adminchan) ""
set samop(adminchan) "#admins"

# set one report channel here for the bot to report mode changes to.
# ex. set samop(reportchan) "#admins"
# or set empty to not report modes.  ex: set samop(reportchan) ""
set samop(reportchan) "#admins"


#################################
############# OWNER #############
#################################

bind msg n owner msg:qop
bind msg n protect msg:sop
bind msg n op msg:op
bind msg n halfop msg:hop
bind msg n voice msg:vop
bind msg n deowner msg:deqop
bind msg n deprotect msg:desop
bind msg n deop msg:deop
bind msg n dehalfop msg:dehop
bind msg n devoice msg:devop

proc msg:qop {nick uhost handle text}  { samode $nick + q OWNER $text }
proc msg:sop {nick uhost handle text}  { samode $nick + p PROTECT $text }
proc msg:op {nick uhost handle text}  { samode $nick + o OP $text }
proc msg:hop {nick uhost handle text}  { samode $nick + h HALFOP $text }
proc msg:vop {nick uhost handle text}  { samode $nick + v VOICE $text }
proc msg:deqop {nick uhost handle text}  { samode $nick - q DEOWNER $text }
proc msg:desop {nick uhost handle text}  { samode $nick - p DEPROTECT $text }
proc msg:deop {nick uhost handle text}  { samode $nick - o DEOP $text }
proc msg:dehop {nick uhost handle text}  { samode $nick - h DEHALFOP $text }
proc msg:devop {nick uhost handle text}  { samode $nick - v DEVOICE $text }

proc samode {nick to mode label text} {
   set targets [lassign [split [string trim $txt]] chan]
   if {![string match "#?*" $chan]} {
      putserv "NOTICE $nick :Command syntax: \002$label #somechannel \[nick(s)\]\002"
      return 0
   }
   if {[string match "#?*" $::samop(adminchan)]} {
      if {![botonchan $::samop(adminchan)] || ![onchan $nick $::samop(adminchan)]} {
         putserv "NOTICE $nick :Both you & the bot must be on $::samop(adminchan)"
         return 0
      }
   }
   if {![llength $targets]} {  lappend targets $nick  }
   set mode [string repeat $mode [llength $targets]]
   putserv "samode $chan $to$mode [join $targets]"
   if {[string match "#?*" $::samop(reportchan)]} {
      putserv "PRIVMSG $::samop(reportchan) :$nick used $label to make [join $targets] $label in $chan"
   }
   return 0
}

#################################
############# HELP ##############
#################################

bind msg n help msg:help
proc msg:help {nick uhost hand txt} {
  if {[llength $txt]<13} {
putserv "NOTICE $nick :=============== HELP ================"
putserv "NOTICE $nick :/msg AdminServ OWNER #channel nick"
putserv "NOTICE $nick :/msg AdminServ DEOWNER #channel nick"
putserv "NOTICE $nick :/msg AdminServ PROTECT #channel nick"
putserv "NOTICE $nick :/msg AdminServ DEPROTECT #channel nick"
putserv "NOTICE $nick :/msg AdminServ OP #channel nick"
putserv "NOTICE $nick :/msg AdminServ DEOP #channel nick"
putserv "NOTICE $nick :/msg AdminServ HALFOP #channel nick"
putserv "NOTICE $nick :/msg AdminServ DEHALFOP #channel nick"
putserv "NOTICE $nick :/msg AdminServ VOICE #channel nick"
putserv "NOTICE $nick :/msg AdminServ DEVOICE #channel nick"
putserv "NOTICE $nick :/msg AdminServ HELP"
putserv "NOTICE $nick :================ END ================"
  }
}


putlog "samop.tcl version 0.1 loaded."


Could also be optimised with a variable containing modes and labels which can allow to generate help depending on its content
_________________
https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 826
Location: Tennessee, USA

PostPosted: Mon Sep 05, 2022 10:48 am    Post subject: Reply with quote

That looks nice CrazyCat:)
_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
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 -> 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