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 

Botadmin Channel Commands

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


Joined: 23 Nov 2013
Posts: 33

PostPosted: Fri Jan 17, 2014 8:35 pm    Post subject: Botadmin Channel Commands Reply with quote

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:
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
_________________

420-HIGHTIMES IRC Network
Back to top
View user's profile Send private message Visit poster's website
play4free2
Voice


Joined: 23 Nov 2013
Posts: 33

PostPosted: Sat Jan 25, 2014 11:25 pm    Post subject: Reply with quote

Update: I got a code to put the action and messages to different channels.
Code:
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
_________________

420-HIGHTIMES IRC Network
Back to top
View user's profile Send private message Visit poster's website
SpiKe^^
Owner


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

PostPosted: Sun Jan 26, 2014 1:40 am    Post subject: Reply with quote

Try looking at this forum post....

http://forum.egghelp.org/viewtopic.php?t=19460&highlight=gline
_________________
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
play4free2
Voice


Joined: 23 Nov 2013
Posts: 33

PostPosted: Fri Jan 31, 2014 11:43 pm    Post subject: Reply with quote

Thanks SpiKe^^ that was a lot of help, I got mine working now Smile
_________________

420-HIGHTIMES IRC Network
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