| View previous topic :: View next topic |
| Author |
Message |
play4free2 Voice

Joined: 23 Nov 2013 Posts: 33
|
Posted: Fri Jan 17, 2014 8:35 pm Post subject: Botadmin Channel Commands |
|
|
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 |
|
 |
play4free2 Voice

Joined: 23 Nov 2013 Posts: 33
|
Posted: Sat Jan 25, 2014 11:25 pm Post subject: |
|
|
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 |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
|
| Back to top |
|
 |
play4free2 Voice

Joined: 23 Nov 2013 Posts: 33
|
Posted: Fri Jan 31, 2014 11:43 pm Post subject: |
|
|
Thanks SpiKe^^ that was a lot of help, I got mine working now  _________________
420-HIGHTIMES IRC Network |
|
| Back to top |
|
 |
|