Este código, usando un ON INPUT:
on 1:INPUT:#: {
if ( $1 == !la ) {
var %nc = $chan(0)
if ( %nc == 1 ) { goto c2 }
if ( %nc == 2 ) { goto c1 }
var %c1 = $rand(1,%nc)
describe $chan(%c1) $2-
:c1
var %c2 = $rand(1,%nc) | if ( %c2 == %c1 ) { goto c1 }
describe $chan(%c2) $2-
:c2
var %c3 = $rand(1,%nc) | if ( %c3 == %c1 ) || ( %c3 == %c2 ) { goto c2 }
describe $chan(%c3) $2-
}
}
Aunque yo, personalmente usaría este otro código, para que no aparezca el INPUT en el canal al poner el comando:
on *:signal:MODOESCRITURA: {
if ( $1 == !la ) {
var %nc = $chan(0)
if ( %nc == 1 ) { goto c2 }
if ( %nc == 2 ) { goto c1 }
var %c1 = $rand(1,%nc)
describe $chan(%c1) $2- | %frase^halt = on
:c1
var %c2 = $rand(1,%nc) | if ( %c2 == %c1 ) { goto c1 }
describe $chan(%c2) $2- | %frase^halt = on
:c2
var %c3 = $rand(1,%nc) | if ( %c3 == %c1 ) || ( %c3 == %c2 ) { goto c2 }
describe $chan(%c3) $2- | %frase^halt = on
}
}