Advertisement
intersys

News Bot

Feb 16th, 2018
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.58 KB | None | 0 0
  1. alias NewsD dialog -m NewsD NewsD
  2. dialog NewsD {
  3.   title "News"
  4.   size -1 -1 178 135
  5.   option dbu
  6.   list 1, 6 15 165 91, size
  7.   text "News Script", 2, 70 6 38 8, center
  8.   button "Add News", 3, 7 110 37 12
  9.   button "Delete News", 4, 49 110 37 12
  10.   button "Clear News", 5, 133 110 37 12
  11.   button "Timer", 6, 91 110 37 12
  12.   text "Currect timer in mins:", 7, 8 125 55 8
  13.   edit "", 8, 64 124 16 9, disable read
  14.   button "Send News", 9, 133 123 37 10
  15.   button "Turn On", 10, 91 123 37 10
  16. }
  17.  
  18. on *:dialog:NewsD:*:*: {
  19.   if ($devent == sclick) {
  20.     if ($did == 3) {
  21.       var %nmsg = $input(Type the message,e,Type Message)
  22.       if (%nmsg) {
  23.         write News.txt $chr(7) %nmsg
  24.       }
  25.       .timer 1 1 dnes
  26.     }
  27.     elseif ($did == 4) { .write -dl $+ $did($dname,1).sel News.txt | dnes }
  28.     elseif ($did == 5) { .write -c News.txt | dnes }
  29.     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) } }
  30.     elseif ($did == 9) { .snews }
  31.     elseif ($did == 10) {
  32.       if (%newst) { .timernews off | .timernews 0 %newst snews }
  33.     }
  34.   }
  35.   if ($devent == init) { dnes }
  36. }
  37. alias dnes {
  38.   did -r newsd 1
  39.   var %x = 1
  40.   while ($lines(News.txt) >= %x) {
  41.     did -a newsd 1 %x $+ $chr(41) $read(news.txt, %x)
  42.     inc %x
  43.   }
  44.   did -ra newsd 8 $calc(%newst / 60)
  45. }
  46. alias SNews {
  47.   amsg 01---- 10News from Play-iL01 ----
  48.   play #play-il,#play-il.adv News.txt
  49. }
  50. on *:playend: amsg 01---- 10End of the news01 ----
  51. on *:connect: {
  52.   if (%newst) { timer 0 %newst snews }
  53. }
  54. Menu * {
  55.   News: NewsD
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement