Channel Linker

Platform:  mIRC
Published  Apr 22, 2010
Updated  Apr 24, 2010
Got bored and couldn't think of anything productive so made this. :D Hope you all like it. on 1:LOAD:{
guser owner $$?"Enter your nick."
echo -a Thanks for loading the Channel Linker by Cados. Commands are:
.timer 1 1 echo -a !link <channel>
.timer 1 2 echo -a !cut
.timer 1 3 echo -a All commands are done in a channel and the channel it was said on is linked with the other channel specified.
}
on owner:TEXT:*:#:{
if ($1 == !link) {
if (!$2) { .msg $chan Please specify a channel to link to. }
elseif ($me !ison $2) { .msg $chan I am not in $2 $+ . }
else {
.msg $chan Establishing connection with $2 $+ ...
.msg $chan Establishing connection with $chan $+ ...
set %chan1 $chan
set %chan2 $2
.msg $chan Connection established!
.msg $2 Connection established!
set %connection on
}
}
if ($1 == !cut) {
if (!%conenction) { .msg $chan There is no connection set up. }
else {
.msg %chan1 Disconnecting....
.msg %chan2 Disconnecting....
unset %chan1
unset %chan2
unset %connection
}
}
}
on *:text:*:%chan1 || %chan2:if (%connection == on) msg $iif(# = %chan1,%chan2,%chan1) [ $+ $nick $+ ]: $1
}
on *:ACTION:*:#:{
if (%connection == on) {
if ($chan == %chan1) { .msg %chan2 * $nick $1- }
elseif ($chan == %chan2) { .msg %chan1 * $nick $1- }
}
}
on *:JOIN:#:{
if (%connection == on) {
if ($chan == %chan1) { .msg %chan2 $nick has joined %chan1 $+ . }
elseif ($chan == %chan2) { .msg %chan1 $nick has joined %chan2 $+
}
}
on *:PART:#:{
if (%connection == on) {
if ($chan == %chan1) { .msg %chan2 $nick has parted %chan1 $+ . }
elseif ($chan == %chan2) { .msg %chan1 $nick has parted %chan2 $+
}
}

Comments

Sign in to comment.
WorldDMT   -  Apr 25, 2010
about %chan1,%chan2 edited
but about

Quote

And shouldn't this line:

Quote

$iif(# = %chan1,%chan2,%chan1)


Be this:

Code

 


the event is only for %chan1 and %chan2 so
if # = %chan1 else # = %chan2

about

Quote

$iif((%connection = on) && (# = %chan1,%chan2,%chan1),msg [ $+ $nick $+ ]: $1-))


the syntax is $iif(C,T,F)
C = condition
T = true
F = false
so look at that condition (# = %chan1,%chan2,%chan1) that will never work

so about my last post

Code

 
 Respond  
Jethro   -  Apr 24, 2010
WorldDMT, shouldn't this line:

Quote

on *:text:*:%chan1 || %chan2: {

be this:

Code

 


And shouldn't this line:

Quote

$iif(# = %chan1,%chan2,%chan1)

Be this:

Code

 


Also, I think we could get rid of the if statement by combining them in the $iif like this:

Code

 
Unless what you've done is another way of coding that I'm not sure of?
 Respond  
WorldDMT   -  Apr 24, 2010
add a condition if ($2 != #)
use $iif e.g:

Code

 


on action event u have to use describe instead of msg
 Respond  
Cados   -  Apr 23, 2010
Ok, fixed. Thanks.
 Respond  
PuNkTuReD   -  Apr 23, 2010
no need for the

else { halt }

having it, could possibly cause other scripts to stop functioning.
 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.