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.

!say #Channel Text Text text

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
l
lolwutxd
Voice
Posts: 3
Joined: Mon Apr 05, 2010 2:33 am

!say #Channel Text Text text

Post by lolwutxd »

Hello,

I'm after a !Say #Channel $1

tcl script, anybody able to help?
b
bLzR
Voice
Posts: 15
Joined: Sun Feb 28, 2010 4:40 pm

Post by bLzR »

U can achieve this by using the say command in the console to put a message through the bot :)

Code: Select all

say [channel] <text>
Dumps the text to your current console channel (or other specified channel), as if the bot said it.
Examples
	.say #NiceChan Hi everyone! This is Lemmon. I'm talking through the bot!
t
tets
Voice
Posts: 2
Joined: Sun May 02, 2010 12:51 pm

Post by tets »

There is a much easier way

Code: Select all

bind pub m !say say

proc say { n u h c t } {
  set l [split $t]
  set channel [lindex $l 0]
  set msg [join [lrange $l 1 end]]
  puthelp "privmsg $channel :$msg"
}
correct now :)
Last edited by tets on Mon May 03, 2010 8:35 am, edited 1 time in total.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

@EXEQED:
Please remember that the input is a string, not a list; and thus is not suitable for use with neither lindex nor lrange. Further, lrange returns a list, not a string.

Proper way to do it, using lindex and lrange:

Code: Select all

bind pub m !say say

proc say { n u h c t } {
  set l [split t]
  set channel [lindex $l 0]
  set msg [join [lrange $l 1 end]]
  puthelp "privmsg $channel :$msg"
}
NML_375
Post Reply