Hey Vegeta. I came up with this...
alias ff {
if (!%ff. [ $+ [ $1- ] ]) || (!$exists(%ff. [ $+ [ $1- ] ])) set %ff. [ $+ [ $1- ] ] $shortfn($findfile($mircdir,$1-,1))
return %ff. [ $+ [ $1- ] ]
}
alias checked {
var %dname $1
set %checked 2
echo 4 -a $did(%dname,172).sel : $gettok($did(%dname,172,%checked).text,5,32)
:next
if ($gettok($did(%dname,172,%checked),5,32) == 2) {
if (!$read(checked.txt,w,* $+ $gettok($did(%dname,172,%checked).text,6-,32))) write checked.txt $did(%dname,172,%checked).text
elseif ($gettok($did(%dname,172,%checked).text,5,32) == 1) write -dl $+ $calc(%checked - 1) checked.txt
}
inc %checked
if (%checked <= $did(%dname,172).lines) goto next
}
alias fav {
splay on.wav
if (!$dialog(faves)) { dialog -m faves faves }
}
dialog faves {
title "Favourites"
size -1 -1 98 94
option dbu
list 172, 4 4 90 50, size
button "Add", 2, 4 57 30 10
button "Delete", 3, 34 57 30 10
button "Join", 4, 64 57 30 10
box "", 5, -5 69 106 5
button "Close", 6, 64 80 30 10, ok cancel
}
On *:Dialog:faves:init:*: {
dll $ff(mdx.dll) SetMircVersion $version
dll $ff(mdx.dll) MarkDialog $dname
dll $ff(mdx.dll) MarkDialog $dname
dll $ff(mdx.dll) SetControlMDX $dname 172 listview rowselect showsel single grid labeltip report nosortheader checkboxes flatsb > $ff(views.mdx)
dll $ff(mdx.dll) SetBorderStyle 172 staticedge
did -i $dname 172 1 headerdims 170
did -i $dname 172 1 headertext Channel
listrooms
if ($exists(checked.txt)) loadbuf -ro $dname 172 checked.txt
}
alias faveslist {
var %y = 1
while (%y <= $did(faves,172).lines) {
if (sclick* !iswm $did(faves,172,%y).text) {
if (!$read(checked.txt,w,* $+ $gettok($did(faves,172,%y).text,6-,32))) write checked.txt $did(faves,172,%y).text
else {
if ($read(checked.txt,w,* $+ $gettok($did(faves,172,%y).text,6-,32))) && (* $+ $gettok($did(faves,172,%y).text,5,32) $+ * !iswm $read(checked.txt,$readn)) write -l $+ $readn checked.txt $did(faves,172,%y).text
}
}
inc %y
}
}
On *:Dialog:faves:sclick:172:{
did -i $dname $did 1 page event
tokenize 32 $did($dname,$did,1)
set %sendl $did(faves,172,$3)
.timer -m 1 320 faveslist %sendl
}
alias listrooms {
var %l 1
did -r faves 172
if (!$read(Text/favourites.txt,%l)) { did -a faves 172 Directory Empty }
while (%l <= $lines(Text/favourites.txt)) {
did -a faves 172 $read(Text/favourites.txt,%l)
inc %l
}
}
Now it adds whatever is in the favourites.txt. they will also be added to checked.txt, and whatever was checked will show a checkmark beside it when you reopn it until you uncheck it. 