Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.22 KB | None | 0 0
  1.  
  2.  
  3. menu * {
  4. Away System:dialog -m Away_System Away_System
  5. }
  6.  
  7. alias awaysystem {
  8. dialog -m Away_System Away_System
  9. }
  10.  
  11.  
  12. dialog away_system {
  13. title "Away System"
  14. size -1 -1 95 115
  15. option dbu
  16. tab " Nicks", 1, 0 -2 95 139
  17. tab "Reasons", 7
  18. tab "Options", 13
  19. box "Away Nick:", 16, 5 13 85 20, tab 1
  20. box "Reasons:", 18, 5 34 55 60, tab 7
  21. box "Away Nicks:", 15, 5 34 55 60, tab 1
  22. box "Reason:", 17, 5 13 85 20, tab 7
  23. button "Save", 4, 65 50 25 15, tab 1
  24. button "Remove", 5, 65 75 25 15, tab 1
  25. list 11, 7 44 50 48, tab 7 hsbar vsbar size
  26. edit "", 12, 8 20 80 10, tab 7 autohs
  27. list 6, 7 44 50 48, tab 1 hsbar vsbar size
  28. edit "", 2, 8 20 80 10, tab 1 autohs
  29. button "Away", 3, 5 98 25 15
  30. button "Back", 8, 35 98 25 15
  31. button "Done", 20, 65 98 25 15, cancel
  32. button "Save", 10, 65 50 25 15, tab 7
  33. button "Remove", 9, 65 75 25 15, tab 7
  34. box "Page System", 14, 5 15 85 27, tab 13
  35. box "Auto Away", 22, 5 45 85 50, tab 13
  36. radio "60 Minutes Auto Away", 23, 15 63 68 8, tab 13
  37. radio "90 Minutes Auto Away", 24, 15 73 68 8, tab 13
  38. radio "120 Minutes Auto Away", 25, 15 83 68 8, tab 13
  39. radio "Disable Auto Away", 26, 15 53 68 8, tab 13
  40. check "Enable Page System", 19, 18 23 60 8, tab 13
  41. check "Disable Page System", 21, 18 32 60 8, tab 13
  42. }
  43.  
  44.  
  45.  
  46.  
  47.  
  48. on *:dialog:away_system:init:*: {
  49. if (%page == on) { did -c $dname 19 | did -u $dname 21 }
  50. if (%page == off) { did -c $dname 21 | did -u $dname 19 }
  51. if (%autoawayoff == on) { did -c $dname 26 }
  52. if (%autoaway60 == on) { did -c $dname 23 }
  53. if (%autoaway90 == on) { did -c $dname 24 }
  54. if (%autoaway120 == on) { did -c $dname 25 }
  55. var %away.nick = 1
  56. while (%away.nick <= $lines(awaynicks.txt)) {
  57. did -a $dname 6 $read(awaynicks.txt,%away.nick))
  58. inc %away.nick
  59. }
  60. var %away.reason = 1
  61. while (%away.reason <= $lines(awayreasons.txt)) {
  62. did -a $dname 11 $read(awayreasons.txt,%away.reason))
  63. inc %away.reason
  64. }
  65. }
  66.  
  67.  
  68. on *:DIALOG:away_system:sclick:3: {
  69. if ($away) { noop $input(You are already away.,uwo,Error!) | halt }
  70. set %away.cnick $me
  71. set %away.time $ctime
  72. set %away.reason $did(12).text
  73. set %away.nick $did(2).text
  74. if (%away.nick == $null) { noop $input(You must choose an Away Nick.,uwo,Error!) | halt }
  75. if (%away.reason == $null) { noop $input(You must choose an Away Reason.,uwo,Error!) | halt }
  76. if (%page == on) { amsg 15,1I 15,1a0,1m 15,1n0,1ow 15,1a0,1way - 15,1R0,1eason:4,1 %away.reason 15,1T0,1ime:4,1 $time
  77. nick %away.nick
  78. away %away.reason | halt
  79. else {
  80. amsg 15,1I 15,1A0,1m 15,1N0,1ow 15,1A0,1way - 15,1R0,1eason:4,1 %away.reason 15,1T0,1ime:4,1 $time
  81. nick %away.nick
  82. away %away.reason
  83. }
  84. }
  85. }
  86. on *:DIALOG:away_system:sclick:8: {
  87. if (%input.return == on) { noop $input(You are on Auto Away please must type to set yourself back.,uwo,Error!) | halt }
  88. if (!$away) { noop $input(You are not currently away.,uwo,Error!) | halt }
  89. nick %away.cnick
  90. amsg 15,1I 15,1a0,1m 15,1n0,1ow 15,1b0,1ack 15,1f0,1rom:4,1 %away.reason 15,1I 15,1w0,1as 15,1g0,1one 15,1f0,1or:4,1 $duration($calc($ctime - %away.time))
  91. .away
  92. }
  93.  
  94. on *:dialog:away_system:sclick:4: {
  95. if ($did(2).text == $null)) { noop $input(You did not choose a nick to add to the Nick List list.,uwo,Error!) | halt }
  96. if (%away.nick == $null) { halt }
  97. var %away.nick $did(2).text
  98. if (%away.nick == $read(awaynicks.txt,w,%away.nick)) { noop $input(%away.nick is already in the Nick List.,uwo,Error!) | halt }
  99. write awaynicks.txt %away.nick
  100. did -a $dname 6 %away.nick
  101. }
  102.  
  103. on *:dialog:away_system:sclick:10: {
  104. if ($did(12).text == $null)) { noop $input(You did not choose a Reason to add to the Reason List.,uwo,Error!) | halt }
  105. if (%away.reason == $null) { halt }
  106. var %away.reason $did(12).text
  107. if (%away.reason == $read(awayreasons.txt,w,%away.reason)) { noop $input(%away.reason is already in the Reason List.,uwo,Error!) | halt }
  108. write awayreasons.txt %away.reason
  109. did -a $dname 11 %away.reason
  110. }
  111.  
  112. on *:DIALOG:away_system:Sclick:5: {
  113. if (!$did(6).sel) { noop $input(You did not select a nick to remove.,uwo,Error!) | halt }
  114. write -dl $+ $did(6).sel awaynicks.txt
  115. did -d $dname 6 $did(6).sel
  116. }
  117.  
  118. on *:DIALOG:away_system:Sclick:9: {
  119. if (!$did(11).sel) { noop $input(You did not select a reason to remove.,uwo,Error!) | halt }
  120. write -dl $+ $did(11).sel awayreasons.txt
  121. did -d $dname 11 $did(11).sel
  122. }
  123.  
  124. on *:Dialog:away_system:sclick:6: {
  125. did -ra $dname 2 $did(6).seltext
  126. set %away.nick $did(6).seltext
  127. }
  128.  
  129. on *:Dialog:away_system:sclick:11: {
  130. did -ra $dname 12 $did(11).seltext
  131. set %away.nick $did(11).seltext
  132. }
  133.  
  134. on *:Dialog:away_system:sclick:*: {
  135. if ($did == 19) { set %page on | dialog -x away_system away_system | dialog -m away_system away_system | did -fu $dname 13 }
  136. if ($did == 21) { set %page off | dialog -x away_system away_system | dialog -m away_system away_system | did -fu $dname 13 }
  137. if ($did == 26) { set %autoawayoff on | unset %autoaway60 %autoaway90 %autoaway120 | .timerautoaway* off }
  138. if ($did == 23) { set %autoaway60 on | unset %autoawayoff %autoaway90 %autoaway120 | .timerautoaway60 0 1 autoaway60 }
  139. if ($did == 24) { set %autoaway90 on | unset %autoawayoff %autoaway60 %autoaway120 | .timerautoaway90 0 1 autoaway90 }
  140. if ($did == 25) { set %autoaway120 on | unset %autoawayoff %autoaway60 %autoaway90 | .timerautoaway120 0 1 autoaway120 }
  141. }
  142.  
  143. on *:TEXT:*:#: {
  144. if ($($+(%,_Page_Lock,.,$nick),2) >= 2) { halt }
  145. if (%page == on) && ($me isin $strip($1-)) && ($Away) {
  146. .notice $nick 4,1 $nick 14,1I A15,1m 14,1C15,1urrently 14,1A15,1way4,1. 14,1T15,1o 14,1P15,1age 14,1M15,1e 14,1T15,1ype /notice $me @page [message here]
  147. inc -u3600 $+(%,_Page_lock,.,$nick)) 1
  148.  
  149. }
  150. }
  151.  
  152.  
  153. on *:NOTICE:*:?: {
  154. if ($($+(%,_Page_Lock,.,$nick),2) >= 2) { .notice $nick 0,1 $nick 15,1I A0,1m 15,1A0,1way, 15,1P0,1ease 15,1D0,1ont 15,1A0,1buse 15,1M0,1y 15,1P0,1age 15,1S0,1ystem! | halt )
  155. if ($Away) && ($1 == @page) {
  156. beep 10 2
  157. inc %paged
  158. window @Page
  159. echo -t @Page 0,1 $nick 15,1P0,1aged 15,1Y0,1ou 15,1W0,1ith 15,1T0,1he  %paged 15,1M0,1essage: " $strip($2-) 0,1"
  160. write Page.txt 0,1 $nick 15,1P0,1aged 15,1Y0,1ou 15,1W0,1ith 15,1T0,1he  %paged 15,1M0,1essage: " $strip($2-) 0,1"
  161. .notice $nick 15,1T0,1hank 15,1Y0,1ou 0,1 $nick $+ , 15,1Y0,1our 15,1M0,1essage 15,1H0,1as 15,1B0,1een 15,1S0,1aved 15,1A0,1s 15,1N0,1umber %paged $+ .
  162. inc -u86400 $+(%,_Page_lock,.,$nick)) 1
  163. }
  164. }
  165. }
  166.  
  167. alias autoaway60 {
  168. if (!$away && $nick($active,$me).idle >= 3600) {
  169. set %away.time $ctime
  170. amsg 15,1I 15,1A0,1m 15,1N0,1ow 15,1A0,1way - 15,1R0,1eason15,1: 60 15,1M0,1ins 15,1A0,1uto 15,1A0,1way.
  171. .away 15,1A0,1uto 15,1A0,1way.
  172. set %input.return on
  173. }
  174. }
  175.  
  176. alias autoaway90 {
  177. if (!$away && $nick($active,$me).idle >= 5400) {
  178. set %away.time $ctime
  179. amsg 15,1I 15,1A0,1m 15,1N0,1ow 15,1A0,1way - 15,1R0,1eason15,1: 90 15,1M0,1ins 15,1A0,1uto 15,1A0,1way.
  180. .away 15,1A0,1uto 15,1A0,1way.
  181. set %input.return on
  182. }
  183. }
  184.  
  185. alias autoaway120 {
  186. if (!$away && $nick($active,$me).idle >= 7200) {
  187. set %away.time $ctime
  188. amsg 14,1I 15,1A0,1m 15,1N0,1ow 15,1A0,1way15,1 - 15,1R0,1eason15,1: 120 15,1M0,1ins 15,1A0,1uto 15,1A0,1way15,1.
  189. .away 15,1A0,1uto 15,1A0,1way.
  190. set %input.return on
  191. }
  192. }
  193.  
  194.  
  195. on *:input:*:{
  196. if (%input.return == on) {
  197. set %input.return off
  198. .amsg 15,1I 15,1a0,1m 15,1n0,1ow 15,1b0,1ack 15,1f0,1rom15,1: 15,1A0,1uto 15,1A0,1way15,1. 15,1I 15,1w0,1as 15,1g0,1one 15,1f0,1or15,1: $duration($calc($ctime - %away.time))
  199. echo -a $timestamp 15,1[0,1 $+ $me $+ 15,1] 15,1I 15,1a0,1m 15,1n0,1ow 15,1b0,1ack 15,1f0,1rom15,1: 15,1A0,1uto 15,1A0,1way15,1. 15,1I 15,1w0,1as 15,1g0,1one 15,1f0,1or15,1: $duration($calc($ctime - %away.time))
  200. .away
  201. if (%autoaway60 == on) { .timerautoaway60 0 1 autoaway60 }
  202. if (%autoaway90 == on) { .timerautoaway90 0 1 autoaway 90 }
  203. if (%autoaway120 == on) { .timerautoaway120 0 1 autoaway120 }
  204. }
  205. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement