its a simple and short relay bot code
Q. what dose the code do ?
A. when your bot in a channel its send all the msgs in that channel to the channel that you set it in the code
to ( #YOUR-CHANNEL-NAME )
Q. how to turn it off and on
A. use ( !fw on ) to turn it on
A. and ( !fw off ) to turn it off
Q. if i want to send a msg to that channel using the bot what i do
A. use ( !ss < channel name with out ( # ) >
A. for example ( !ss vn Hi There All )
A. the bot will send in that channel a msg like ( [you nickname] : [your msg]
A. for example ( Vyron : Hi There All )
#fw on
on *:TEXT:**:#: {
if ($chan == #VN) { }
else { msg #vn $chan - $nick : $$1 $2- }
}
on *:JOIN:#: {
if ($chan == #VN) { }
else { msg #vn $chan : $nick has joined $chan }
}
on *:PART:#: {
if ($chan == #VN) { }
else { msg #vn $chan : $nick Left $chan }
}
on *:TEXT:!ss *:#:/msg #$2 $nick : $3- | /msg $chan #$2 - $nick : $3-
#fw end
on 10:TEXT:!fw *:#: {
if ($2 == on) { .enable #fw }
elseif ($2 == off) { .disable #fw }
@Sorasyn I noticed your if statements are empty.
its empty becauz if someone join the channel ( your channel )
it will not send $chan : $nick has joined $chan
but in other channels it will send to your channel that that person just join with the name of the channel he join
and like i said
its a simple and short
and also easy so other ppl can learn some things from it :)
Would be better to store the channel name in a variable, accessible only by its local counter-parts.
alias -l ch { return #VN }
Stress test, and debug your code before submitting. One thing I've noticed is small "fatal" errors that won't allow the code to run on another snippet you recently submitted.
Another thing is, I noticed your if statements are empty., yet the else statements have code to execute. Why not flip-flop those, and simply have
if ($chan != #VN) {
This would cut out the middle man, and have a more efficient code setup.