rendered paste bodyon *:LOAD:{
/set %NumberChansKnC 0
/set %NumberChansmTLK 0
}
alias addtoarray {
/searcharray
if (%ChanCheckKnC == true) {
/notice $me This channel is already being mirrored to
}
else {
/inc %NumberChansKnC 1
/set %country [ $+ %NumberChansKnC ] $chan
/notice $me Mirroring to channel $chan is turned on
}
}
alias -l searcharray {
/var %counter 1
/set %ChanCheckKnC false
while (%counter <= %NumberChansKnC) {
if (%country [ $+ [ %counter ] ] == $chan) {
/set %indexKnC %counter
/set %ChanCheckKnC true
}
/inc %counter 1
}
}
alias delfromarray {
/searcharray
if (%ChanCheckKnC == false) {
/notice $me This channel issn't on the list so can't be deleted
}
else {
while (%indexKnC < %NumberChansKnC) {
%country [ $+ [ %indexKnC ] ] = %country [ $+ [ %indexKnC + 1 ] ]
/inc %indexKnC 1
}
/unset %country [ $+ [ %NumberChansKnC ] ]
/dec %NumberChansKnC 1
/notice $me Mirroring to channel $chan is turned off
}
}