This snippet lets you add/delete randomwords trough a dialog.
It could b usefull for something, dunno for what i was bored when i made it.
Its a pretty basic dialog.
"/randword" to launch dialog. The rest is pretty obvious.
dialog RandW {
size -1 -1 220 78
option dbu
title "Random Word Chooser. <-ReQueST->"
box "Manage Words.", 1, 5 3 100 65
text "The words:", 2, 10 17 50 10
edit "", 3, 10 27 83 10
button "[ADD]", 4, 15 40 30 10
button "[DEL]", 5, 55 40 30 10
button "[SAY RANDOM WORD]", 6, 20 55 60 10
list 25, 110 6 100 69, vsbar hsbar
}
alias listupd {
var %a = 1, %b = $numtok(%words,32)
while (%a <= %b) {
did -a RandW 25 $gettok(%words,%a,32)
inc %a
}
}
on *:DIALOG:RandW:SCLICK:4: { did -a RandW 25 $did(3).text | set %words %words $did(3).text $+ $chr(32) }
on *:DIALOG:RandW:SCLICK:5: { set %words $deltok(%words,$findtok(%words,$did(3).text,1,32),32) | did -r RandW 25 | listupd }
on *:DIALOG:RandW:SCLICK:6: { if ($did(25).seltext) { msg $active RandowWord of the moment $chr(35) $+ $findtok(%words,$did(25).seltext,1,32) $+ : $did(25).seltext } }
alias randword { dialog -m RandW RandW | listupd }