Relay

By alimak96 on Sep 05, 2012

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

Q. how to set my channel
A. simply replace( #VN ) in

($chan == #VN)
{ msg #vn $chan - $nick : $$1 $2- }
{ msg #vn $chan : $nick has joined $chan }
{ msg #vn $chan : $nick Left $chan }

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 }

Comments

Sign in to comment.
alimak96   -  Sep 08, 2012

@blackvenomm666

i use if
so its msg my channel who joined the channels the bot in

if i use what u told me to use it will only send the ppl who joined my channel not in every channel
maybe you didnt understand what i said because of my bad English :P
but yeah try to

 Respond  
blackvenomm666   -  Sep 07, 2012

instead of using an if statement on the events why not put it right in the event itself such as on on :TEXT::#channamehere: { also you don't need a double * you can use just one

 Respond  
alimak96   -  Sep 06, 2012

updated

Q. how to turn it off and on
A. use ( !fw on ) to turn it on
A. and ( !fw off ) to turn it off

 Respond  
alimak96   -  Sep 06, 2012

@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 :)

 Respond  
Sorasyn   -  Sep 05, 2012

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.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.