Skip to content
MSN

MDX Checkbox

A TG007 community discussion started by Warrior124.

Discussion 22 posts
Page 2 of 2
Open
Topic #6739 · 22 published posts · 2,669 views

Hey Vegeta. I'm working on something else that might work. I'll have it asap. :)

Hey Vegeta. Here is what I've come up with so far. I don't know what you will have for the join code. So, I left that alone for you to fix, lol. Here is the rest...

 

menu * {
-
Favourites: if ($dialog(faves)) dialog -c faves faves | dialog -mod faves faves
-
}

alias ff {
if (!%ff. [ $+ [ $1- ] ]) || (!$exists(%ff. [ $+ [ $1- ] ])) {
if (!$exists($shortfn($findfile($mircdir,$1-,1)))) {
if (*.txt iswm $1-) write $1-
else { echo 12 -a * $1- not found. Please download $1- for script to work properly. | halt }
}
set %ff. [ $+ [ $1- ] ] $shortfn($findfile($mircdir,$1-,1))
}
return %ff. [ $+ [ $1- ] ]
}

alias listrooms {
var %l 1
did -r faves 172
while (%l <= $lines($ff(favourites.txt))) {
did -a faves 172 $read($ff(favourites.txt),%l)
inc %l
}
}

alias fav {
if ($exists(on.wav)) 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 $iif(!$read($ff(favourites.txt),1),$chr(40) $+ Directory Empty $+ $chr(41))
listrooms
if ($exists($ff(favourites.txt))) loadbuf -ro $dname 172 $ff(favourites.txt)
}

alias faveslist {
if (!%y) || (%y >= $lines($ff(favourites.txt))) set %y 1
else set %y $calc(%y + 1)
if (0 + 0 0 2 * iswm $read($ff(favourites.txt),%y)) { 
write -dl $+ %y $ff(favourites.txt)
loadbuf -ro faves 172 $ff(favourites.txt)
if ($file($ff(favourites.txt)).size == 0) { .remove $ff(favourites.txt) | did -i faves 172 1 headertext Channel $chr(40) $+ Directory Empty $+ $chr(41) }
}
.timer -m 1 320 faveslist2 
}

alias faveslist2 if ($read($ff(favourites.txt),w,0 + 0 0 2 *)) .timer -m 1 320 faveslist

On *:Dialog:faves:sclick:2:{
set %channelname $iif($active ischan,$iif($input(Do you want to add current channel to favourites?,y) == $true,$active,$?="Enter Channel Name."),$?="Enter Channel Name.")
if (!$didwm($dname,172,* $+ $right(%channelname,-1))) {
did -i $dname 172 $calc($did(172).lines + 1) 0 + 0 0 1 %channelname
did -i $dname 172 1 headertext Channel
write -l $+ $calc($did(172).lines + 1) $ff(favourites.txt) 0 + 0 0 1 %channelname
}
}

On *:Dialog:faves:sclick:3: faveslist

On *:Dialog:faves:sclick:4: < Join Code Here >

On *:Dialog:faves:sclick:172:{
did -i $dname $did 1 page event
tokenize 32 $did($dname,$did,1)
if (sclick == $1) {
set %tofind $gettok($did(faves,172,$3),6-,32)
if ($gettok($did(faves,172,$3),5,32) == 1) {
if (!$read($ff(favourites.txt),w,* $+ %tofind)) write $ff(favourites.txt) 0 + 0 0 2 %tofind
else write -l $+ $readn $ff(favourites.txt) 0 + 0 0 2 %tofind
}
elseif ($gettok($did(faves,172,$3),5,32) == 2) {
if (!$read($ff(favourites.txt),w,* $+ %tofind)) write $ff(favourites.txt) 0 + 0 0 1 %tofind
else write -l $+ $readn $ff(favourites.txt) 0 + 0 0 1 %tofind
}
}
}

 

I added a bit of coding to where if the ff alias can't find mdx.dll for you then it will let you know that mdx.dll wasn't found in your script, and for you to download one. :)

Edited Jun 26, 2006 5:40 AM by Warrior124