Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias NewsD dialog -m NewsD NewsD
- dialog NewsD {
- title "News"
- size -1 -1 178 135
- option dbu
- list 1, 6 15 165 91, size
- text "News Script", 2, 70 6 38 8, center
- button "Add News", 3, 7 110 37 12
- button "Delete News", 4, 49 110 37 12
- button "Clear News", 5, 133 110 37 12
- button "Timer", 6, 91 110 37 12
- text "Currect timer in mins:", 7, 8 125 55 8
- edit "", 8, 64 124 16 9, disable read
- button "Send News", 9, 133 123 37 10
- button "Turn On", 10, 91 123 37 10
- }
- on *:dialog:NewsD:*:*: {
- if ($devent == sclick) {
- if ($did == 3) {
- var %nmsg = $input(Type the message,e,Type Message)
- if (%nmsg) {
- write News.txt $chr(7) %nmsg
- }
- .timer 1 1 dnes
- }
- elseif ($did == 4) { .write -dl $+ $did($dname,1).sel News.txt | dnes }
- elseif ($did == 5) { .write -c News.txt | dnes }
- elseif ($did == 6) { var %tins = $input(Type the timer of the news in mins,e,Type Timer) | if (%tins) { set %newst $calc(%tins * 60) | did -ra $dname 8 $calc(%newst / 60) } }
- elseif ($did == 9) { .snews }
- elseif ($did == 10) {
- if (%newst) { .timernews off | .timernews 0 %newst snews }
- }
- }
- if ($devent == init) { dnes }
- }
- alias dnes {
- did -r newsd 1
- var %x = 1
- while ($lines(News.txt) >= %x) {
- did -a newsd 1 %x $+ $chr(41) $read(news.txt, %x)
- inc %x
- }
- did -ra newsd 8 $calc(%newst / 60)
- }
- alias SNews {
- amsg 01---- 10News from Play-iL01 ----
- play #play-il,#play-il.adv News.txt
- }
- on *:playend: amsg 01---- 10End of the news01 ----
- on *:connect: {
- if (%newst) { timer 0 %newst snews }
- }
- Menu * {
- News: NewsD
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement