@program RPChans.muf 1 10000 d i ( Setup of a camera @set camera=_alisten/1:RPChans.muf ) $def }tell }cat me @ swap ansi_notify $def }otell }cat me @ #-1 rot ansi_notify_except $def A.CAMERAS { 4232 1 4399 2 4403 3 4571 4 4134 5 4133 6 4132 7 4131 8 }dict $def A.CHANNELS { A.CAMERAS foreach swap repeat }dict $def network "SCTV" $include $lib/alynna lvar param lvar cameras lvar channels : channel.help { "TV Channels 1.0 -- by Alynna" " " "Syntax:" " +channel # Tune a channel on or off" " +channel 0 Turn off all channels" " +channel/list Show all channels and what they are showing" " +channel/prog Set a channel's programming" " +channel/hide Toggle yourself visible or hidden from cameras" " +channel/who See who is watching what channels" " +channel/verbose See whenever someone starts/stops watching a local camera" }array atellme ; : channel.set param @ "#h*" smatch if channel.help exit then param @ atoi var! channel channel @ not if me @ "_channels/" remove_prop { "You have turned all your channels off." }cat network pretty tellme exit then channels @ channel @ [] not if { "That channel doesnt exist!" }cat network pretty tellme exit then me @ { "_channels/" channel @ }cat over over getprop if 0 else 1 then setprop { "You have turned channel ^YELLOW^" channel @ "^NORMAL^ " me @ { "_channels/" channel @ }cat getprop if "^GREEN^on^NORMAL^" channels @ channel @ [] dbref location contents_array foreach var! target pop target @ "_channels/verbose" getprop if target @ { "^RED^" me @ " has started watching the camera here.^NORMAL^" }cat network pretty ansi_notify then repeat else "^RED^off^NORMAL^" channels @ channel @ [] dbref location contents_array foreach var! target pop target @ "_channels/verbose" getprop if target @ { "^GREEN^" me @ " has stopped watching the camera here.^NORMAL^" }cat network pretty ansi_notify then repeat then "!" }cat network pretty tellme ; : channel.list { network " channels" }cat header tellme { "|C#|On?|Programming |" }tell channels @ foreach var! camera var! channel { "|" channel @ tostr 2 rj "|" me @ { "_channels/" channel @ }cat getprop if "^GREEN^ * ^NORMAL^" else " " then "|" prog { "_channels/" channel @ }cat getprop dup not if pop "" then 69 lj "|" }tell repeat { network " v1.0" }cat footer tellme ; : channel.who { network " channels" }cat header tellme { "|C#|On?|Listeners " }tell channels @ foreach var! camera var! channel { "|" channel @ tostr 2 rj "|" me @ { "_channels/" channel @ }cat getprop if "^GREEN^ * ^NORMAL^" else " " then "|" { online_array foreach var! target pop target @ "_channels/" channel @ intostr strcat getprop if target @ name then repeat }array " " array_join }tell repeat { network " v1.0" }cat footer tellme ; : channel.prog param @ "=" split var! text atoi var! channel channels @ channel @ [] not if { "That channel doesnt exist!" }cat network pretty tellme exit then param @ not if prog { "_channels/" channel @ }cat 0 setprop { "Programming for channel " channel @ " has been cleared." }cat network pretty tellme else prog { "_channels/" channel @ }cat text @ setprop { "Programming for channel " channel @ " has been set." }cat network pretty tellme then ; : channel.hide me @ "_channels/hide" getprop not if me @ { "_channels/hide" }cat 1 setprop { "You are now hidden from the cameras." }cat network pretty tellme else me @ { "_channels/hide" }cat 0 setprop { "You are now visible to the cameras." }cat network pretty tellme then ; : channel.verbose me @ "_channels/verbose" getprop not if me @ { "_channels/verbose" }cat 1 setprop { "You will now see when people join and leave channels." }cat network pretty tellme else me @ { "_channels/verbose" }cat 0 setprop { "You will no longer see when people join and leave channels." }cat network pretty tellme then ; : main param ! a.cameras cameras ! a.channels channels ! command @ case "+channel" smatch when channel.set exit end "+channel/list" smatch when channel.list exit end "+channel/who" smatch when channel.who exit end "+channel/prog" smatch when channel.prog exit end "+channel/hide" smatch when channel.hide exit end "+channel/verbose" smatch when channel.verbose exit end endcase cameras @ trig int [] var! channel trig "DARK" flag? if exit then trig "HIDDEN" flag? if exit then trig "LIGHT" flag? not if exit then me @ "_channels/hide" getprop if exit then online_array foreach var! target pop target @ "_channels/" channel @ intostr strcat getprop if target @ { "^YELLOW^[^GREEN^" channel @ "^YELLOW^]^NORMAL^ " param @ }cat ansi_notify then repeat ; . c q