- Code: Select all
dialog aamsgs {
title "Auto AMSG Script"
size -1 -1 205 45
option dbu
box "Auto AMSG Setup", 1, 2 0 202 33
text "Text:", 2, 5 9 14 8
button "Close", 3, 88 34 30 10, ok
edit "", 4, 19 8 182 10, autohs
button "START", 7, 149 19 25 11, disable
button "STOP", 8, 176 19 25 11, disable
radio "5 min.", 5, 20 20 25 10
radio "15 min.", 6, 47 20 26 10
radio "30 min.", 9, 75 20 26 10
radio "1 Hour", 10, 104 20 26 10
}
on *:dialog:aamsgs:sclick:*: {
if ($did == 7) { startautoamsg | did -b aamsgs 7 | did -e aamsgs 8 }
if ($did == 8) { stopautoamsg | did -b aamsgs 8 | did -e aamsgs 7 }
if ($did == 5) { .set %autoamsgtime 300 }
if ($did == 6) { .set %autoamsgtime 900 }
if ($did == 9) { .set %autoamsgtime 1800 }
if ($did == 10) { .set %autoamsgtime 3600 }
}
on *:dialog:aamsgs:edit:*: {
.set %autoamsgtext $did(aamsgs,4)
}
on *:dialog:aamsgs:init:*: {
did -ra aamsgs 4 %autoamsgtext
if (%autoamsg == 1) { did -e aamsgs 8 }
if (!%autoamsg) { did -e aamsgs 7 }
if (%autoamsgtime == 300) { did -c aamsgs 5 }
if (%autoamsgtime == 900) { did -c aamsgs 6 }
if (%autoamsgtime == 1800) { did -c aamsgs 9 }
if (%autoamsgtime == 3600) { did -c aamsgs 10 }
}
alias startautoamsg {
.set %autoamsg 1
.inc %autoamsgnr
amsg %autoamsgtext ¬ Auto AMSG NR.: %autoamsgnr ¬
.timeraamsgs 0 %autoamsgtime autoamsgtextlol
}
alias autoamsgtextlol {
.inc %autoamsgnr
amsg %autoamsgtext ¬ Auto AMSG NR.: %autoamsgnr ¬
}
alias stopautoamsg {
.unset %autoamsg
.timeraamsgs off
}
alias aamsgs {
if ($dialog(aamsgs) == $null) {
dialog -m aamsgs aamsgs
}
else {
dialog -vd aamsgs
}
}
GL&HF