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.

Botadmin Channel Commands

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
play4free2
Voice
Posts: 34
Joined: Sat Nov 23, 2013 1:42 am
Contact:

Botadmin Channel Commands

Post by play4free2 »

I know there are a lot of oper.tcl commands.tcl etc. I am working on one that has just the commands I want. The part I can't find in the Archives or written anywhere I have looked. Is one that will have the bot do via channel command .say #channel <message> and .act #channel <action>

I have found this which is what I want but I also want it to message or put an action to a channel I chose too.

Code: Select all

proc actall_func {nick uhost hand chan text} {
  if {[lsearch -exact [channel info $chan] +admin] != -1} {
    if {[string length $text] > 0} {
      set text [string trim $text "{}"]
      foreach n [channels] { putserv "PRIVMSG $n :\001ACTION $text \001" }
    } else { puthelp "NOTICE $nick :.actall <action> - Sends an action to all channels the bot is in." }
  }
}

proc sayall_func {nick uhost hand chan text} {
  if {[lsearch -exact [channel info $chan] +admin] != -1} {
    if {[string length $text] > 0} {
      set text [string trim $text "{}"]
      foreach n [channels] { putserv "PRIVMSG $n :$text" }
    } else { puthelp "NOTICE $nick :.sayall <message> - Sends a message to all channels the bot is in." }
  }
}
I would also like to add the channel commands .gline and .glinedel

Examples:
.gline <user@host mask> [time] <reason>
.glinedel <user@host mask>

If I missed these somewhere please point me in the correct direction.

Thanks for any help
Image
420-HIGHTIMES IRC Network
User avatar
play4free2
Voice
Posts: 34
Joined: Sat Nov 23, 2013 1:42 am
Contact:

Post by play4free2 »

Update: I got a code to put the action and messages to different channels.

Code: Select all

proc act_func {nick uhost hand chan arg} {
  if {[lsearch -exact [channel info $chan] +adminchan] != -1} {
    set cmd [string tolower [lindex $arg 0]]
    if {$cmd == ""} {
      puthelp "NOTICE $nick :.act <#channel> <action> - Sends an action to any channel the bot is in."
      return 0
      } else {
      set chan [lindex [split $arg] 0]
      set arg [join [lrange [split $arg] 1 end]]
      putserv "PRIVMSG $chan :\001ACTION $arg\001"
      return 0
    }
  }
}

proc say_func {nick uhost hand chan arg} {
  if {[lsearch -exact [channel info $chan] +adminchan] != -1} {
    set cmd [string tolower [lindex $arg 0]]
    if {$cmd == ""} {
      puthelp "NOTICE $nick :.say <#channel> <message> - Sends a message to any channel the bot is in."
      return 0
      } else {
      set chan [lindex [split $arg] 0]
      set arg [join [lrange [split $arg] 1 end]]
      putserv "PRIVMSG $chan :$arg"
      return 0
    }
  }
}


But I am still looking to add the channel commands !gline and !delgline

Thanks
Image
420-HIGHTIMES IRC Network
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
User avatar
play4free2
Voice
Posts: 34
Joined: Sat Nov 23, 2013 1:42 am
Contact:

Post by play4free2 »

Thanks SpiKe^^ that was a lot of help, I got mine working now :)
Image
420-HIGHTIMES IRC Network
Post Reply