This is a simple !echo command that allow you to say something on channels if your bot is on that chans
If you have any Problem please Post a comment and i'll help you .
if you want it to work only for you use the 1st version and Replace BotOwnerNickHere with your nick.
If you want it to work for the public use the 2nd version.
@UPDATED on 29/03/2014
--1st Version--
on *:text:!say*:#:{
if ($nick == saloun) msg $2 $3-
}
--2nd Version--
on *:text:!say*:#:{
msg $2 $3-
}
$2 shouldnt be up to the end user to determine which channel the bot messages. what if that bot isnt in that channel? i used # (or you can use $chan) because this ensures that the bot isnt going to start messaging channels it isnt in text the end user supplies
the way you are doing it, you might as well change your event to be:
on :text::*:
this way, you do have control as to which channel the bot messages, but it only makes sense for the bot to be in the channel you (the end user is on). error checking my friend.
sorry, i dont mean to argue with you by any means as that is truly not my intention, but i dont understand how you made the outcome "a better result". sorry that i am too technical for you too, but the code was just wrong and if you are going to release a script you best make sure that it is tested and scripted properly, with full error checking instead of taking the easy way out, if anything, i just fixed his script.
yes, because the last asterisk determines which kind of window the event takes place in
from the mirc help file:
The location where this event occurrs can be specified using:
? for any private message
if i were the author, i would stick with on :text::# as this only responds to channels as originally written
and in your case, lose the $2, because if i do !say #test blahblah blah, and the bot isnt on #test, the command wont parse properly. the way i did it ensures that it only messages the channel the bot is in
you could make it work that way (the way you did it)
on :text::#: {
if ($1 = !say) && ($2 ischan) { .msg $2 $3- }
elseif ($1 = !say) && ($2 !ischan) { .join $2 | .msg $2 $3- }
}
this checks that $1 is !say and if the bot is in the channel, message the channel $3-
if the bot isnt in the channel ($2), it will join that channel and message the channel $3-
see what i am getting at here?
yes, now you are adding the error checking, which is correct, which is what i was trying to get at. so now the script wont break and now it works properly.
except i would add an else after the fact
if ($1 == !say) {
if (# isin $2) && ($me !ison $2) { .msg $chan sorry but i am not on $2 }
else { .msg $2 $3- }
}
P.S how are you making code blocks when you post? whats the bbc code to do that?
Thanks For your answer , i will Update it