Guest User

Untitled

a guest
Dec 2nd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.19 KB | None | 0 0
  1. on *:kick:#Helpdesk: {
  2. set %hd.kick $address($knick,2)
  3. if (*!*@*HelpDesk* iswm %hd.kick) {
  4. if ($readini(helpdesk.ini, Duty, $address($knick,2)) == on) {
  5. writeini helpdesk.ini Duty $address($knick,2) off
  6. inc %duty.count -1
  7. describe # sets $knick as off duty due to being kicked.
  8. unset %hd.kick
  9. }
  10. }
  11. }
  12. on *:quit: {
  13. set %hd.quit $address($nick,2)
  14. if (*!*@*HelpDesk* iswm %hd.quit) {
  15. if ($readini(helpdesk.ini, Duty, $address($nick,2)) == on) {
  16. writeini helpdesk.ini Duty $address($nick,2) off
  17. inc %duty.count -1
  18. describe #Helpdesk sets $nick as off duty due to disconnecting.
  19. unset %hd.quit
  20. }
  21. }
  22. }
  23. on *:part:#Helpdesk: {
  24. set %hd.part $address($nick,2)
  25. if (*!*@*HelpDesk* iswm %hd.part) {
  26. if ($readini(helpdesk.ini, Duty, $address($nick,2)) == on) {
  27. writeini helpdesk.ini Duty $address($nick,2) off
  28. inc %duty.count -1
  29. describe # sets $nick as off duty due to /part
  30. unset %hd.part
  31. }
  32. }
  33. }
  34. on *:join:#Helpdesk: {
  35. notice $nick Welcome to # $+ . Type `list to see if there is currently someone on duty to assist you. If there is, type `help to request assistance. If not, see if the instructions in the notice help you. If you still need assistance, /part and come back later.
  36. }
  37. on *:nick: {
  38. set %hd.nickchng $address($newnick,2)
  39. if (*!*@*HelpDesk* iswm %hd.nickchng) {
  40. writeini helpdesk.ini Hosts $address($newnick,2) $newnick
  41. unset %hd.nickchng
  42. }
  43. }
  44.  
  45. on *:text:*:#Helpdesk: {
  46. if ($1 == `add) {
  47. if ($address($nick,2) != *!*@Head.of.HelpDesk.and.Delicate.Affairs) {
  48. msg # It appears you do not have the correct clearance for that command, $nick $+ .
  49. halt
  50. }
  51. else {
  52. if ($2 !ison $chan) {
  53. msg # I'm sorry, but there doesn't appear to be a $2 on this channel.
  54. halt
  55. }
  56. else {
  57. writeini helpdesk.ini Duty $address($2,2) off
  58. writeini helpdesk.ini Hosts $address($2,2) $2
  59. msg # $2 successfully added to the Helpers list, with the default setting 'off duty.' Please note, the address that has been registered to this nick is $address($2,2) $+ . Should this change for any reason, helpdesk.ini will need to be edited manually.
  60. set %help.users $address($2,2) %help.users
  61. set %total.time. $+ $address($2,2) 0
  62. halt
  63. }
  64. }
  65. }
  66. if ($1 == `del) {
  67. if ($address($nick,2) != *!*@Head.of.HelpDesk.and.Delicate.Affairs) {
  68. msg # It appears you do not have the correct clearance for that command, $nick $+ .
  69. halt
  70. }
  71. else {
  72. remini helpdesk.ini Duty $address($2,2) off
  73. remini helpdesk.ini Hosts $address($2,2) $2
  74. msg # $2 successfully removed from the HelpOp list. :)
  75. unset %total.time. $+ $address($2,2) 0
  76. halt
  77. }
  78. }
  79. if ($1 == `on) && ($2 == duty) {
  80. if ($address($nick,2) !isin %help.users) {
  81. msg # Why are you trying to use that command, $nick $+ ?
  82. halt
  83. }
  84. else {
  85. if ($readini(helpdesk.ini, Duty, $address($nick,2)) == on) {
  86. notice $nick You're already marked as on duty, $nick $+ !
  87. halt
  88. }
  89. else {
  90. set %temp.time. $+ $address($nick,2) $ctime
  91. inc %duty.count 1
  92. duty $nick on
  93. msg # $nick is now marked as on duty.
  94. }
  95. }
  96. }
  97. if ($1 == `off) && ($2 == duty) {
  98. if ($address($nick,2) !isin %help.users) {
  99. msg # Why are you trying to use that command, $nick $+ ?
  100. halt
  101. }
  102. else {
  103. if ($readini(helpdesk.ini, Duty, $address($nick,2)) == off) {
  104. notice $nick You're already marked as off duty, $nick $+ !
  105. halt
  106. }
  107. else {
  108. var %x = % [ $+ [ temp.time. ] $+ [ $address($nick,2) ] ]
  109. inc %total.time. $+ $address($nick,2) $calc($ctime - %x)
  110. var %y = % [ $+ [ total.time. ] $+ [ $address($nick,2) ] ]
  111. inc %duty.count -1
  112. duty $nick off
  113. msg # $nick is now marked as off duty. $nick was on duty for $duration($calc($ctime - %x)) $+ , bringing their total time up to $duration(%y)
  114. unset %temp.time. $+ $address($nick,2)
  115. }
  116. }
  117. }
  118. if ($1 == `help) {
  119. if (%duty.count == 0) {
  120. msg # I'm sorry, there doesn't appear to be anyone on duty at the moment. D:
  121. msg $nick If you need ChanServ help, type /cs help. To help with a specific command, type /cs help [command]
  122. msg $nick If you need NickServ help, type /ns help. To help with a specific command, type /ns help [command]
  123. msg $nick If you need BotServ help, type /bs help. To help with a specific command, type /bs help [command]
  124. msg $nick If you need HostServ help, type /hs help. To help with a specific command, type /hs help [command]
  125. msg $nick If you need MemoServ help, type /ms help. To help with a specific command, type /ms help [command]
  126. msg $nick For a list of User commands, type /helpop usercmds
  127. msg $nick For a list of Oper commands, type /helpop opercmds
  128. msg $nick For a list of User modes, type /helpop umodes
  129. msg $nick For a list of Channel modes, type /helpop chmodes
  130. }
  131. else {
  132. if ($readini(helpdesk.ini, Duty, *!*@I.R.Smart.PI.HelpDesk.Operator) == on) {
  133. msg $readini(helpdesk.ini, Hosts, *!*@I.R.Smart.PI.HelpDesk.Operator) $nick requires assistance.
  134. }
  135. if ($readini(helpdesk.ini, Duty, *!*@Cat.Up.Leaf.Helpdesk.Trainee) == on) {
  136. msg $readini(helpdesk.ini, Hosts, *!*@Cat.Up.Leaf.Helpdesk.Trainee) $nick requires assistance.
  137. }
  138. if ($readini(helpdesk.ini, Duty, *!*@Head.of.HelpDesk.and.Delicate.Affairs) == on) {
  139. msg $readini(helpdesk.ini, Hosts, *!*@Head.of.HelpDesk.and.Delicate.Affairs) $nick requires assistance.
  140. }
  141. if ($readini(helpdesk.ini, Duty, *!*@PI.Helpdesk.Admin) == on) {
  142. msg $readini(helpdesk.ini, Hosts, *!*@PI.Helpdesk.Admin) $nick requires assistance.
  143. }
  144. if ($readini(helpdesk.ini, Duty, *!*@Echo.of.Silence.Helpdesk.Trainee) == on) {
  145. msg $readini(helpdesk.ini, Hosts, *!*@Echo.of.Silence.Helpdesk.Trainee) $nick requires assistance.
  146. }
  147. }
  148. }
  149. if ($1 == `list) {
  150. if (%duty.count == 0) {
  151. msg # I'm sorry, there doesn't appear to be anyone on duty at the moment. D:
  152. msg $nick If you need ChanServ help, type /cs help. To help with a specific command, type /cs help [command]
  153. msg $nick If you need NickServ help, type /ns help. To help with a specific command, type /ns help [command]
  154. msg $nick If you need BotServ help, type /bs help. To help with a specific command, type /bs help [command]
  155. msg $nick If you need HostServ help, type /hs help. To help with a specific command, type /hs help [command]
  156. msg $nick If you need MemoServ help, type /ms help. To help with a specific command, type /ms help [command]
  157. msg $nick For a list of User commands, type /helpop usercmds
  158. msg $nick For a list of Oper commands, type /helpop opercmds
  159. msg $nick For a list of User modes, type /helpop umodes
  160. msg $nick For a list of Channel modes, type /helpop chmodes
  161. }
  162. else {
  163. if ($readini(helpdesk.ini, Duty, *!*@Head.of.HelpDesk.and.Delicate.Affairs) == on) {
  164. var %temp = %temp.time.*!*@Head.of.HelpDesk.and.Delicate.Affairs
  165. msg # $readini(helpdesk.ini, Hosts, *!*@Head.of.HelpDesk.and.Delicate.Affairs) is currently on duty, and has been for $duration($calc($ctime - %temp)) $+ .
  166. }
  167. if ($readini(helpdesk.ini, Duty, *!*@Cat.Up.Leaf.Helpdesk.Trainee) == on) {
  168. var %temp = %temp.time.*!*@Cat.Up.Leaf.Helpdesk.Trainee
  169. msg # $readini(helpdesk.ini, Hosts, *!*@Cat.Up.Leaf.Helpdesk.Trainee) is currently on duty, and has been for $duration($calc($ctime - %temp)) $+ .
  170. }
  171. if ($readini(helpdesk.ini, Duty, *!*@I.R.Smart.PI.HelpDesk.Operator) == on) {
  172. var %temp = %temp.time.*!*@I.R.Smart.PI.HelpDesk.Operator
  173. msg # $readini(helpdesk.ini, Hosts, *!*@I.R.Smart.PI.HelpDesk.Operator) is currently on duty, and has been for $duration($calc($ctime - %temp)) $+ .
  174. }
  175. if ($readini(helpdesk.ini, Duty, *!*@PI.Helpdesk.Admin) == on) {
  176. var %temp = %temp.time.*!*@PI.Helpdesk.Admin
  177. msg # $readini(helpdesk.ini, Hosts, *!*@PI.Helpdesk.Admin) is currently on duty, and has been for $duration($calc($ctime - %temp)) $+ .
  178. }
  179. if ($readini(helpdesk.ini, Duty, *!*@Echo.of.Silence.Helpdesk.Trainee) == on) {
  180. var %temp = %temp.time.*!*@Echo.of.Silence.Helpdesk.Trainee
  181. msg # $readini(helpdesk.ini, Hosts, *!*@Echo.of.Silence.Helpdesk.Trainee) is currently on duty, and has been for $duration($calc($ctime - %temp)) $+ .
  182. }
  183. }
  184. }
  185. if ($1 == `time) {
  186. if ($2 ison $chan) {
  187. set %hd.time $address($2,2)
  188. if (*!*@*HelpDesk* iswm %hd.time) {
  189. var %y = % [ $+ [ total.time. ] $+ [ $address($2,2) ] ]
  190. msg # $readini(helpdesk.ini, Hosts, $address($2,2)) has completed a total of $duration(%y) on duty. (This does not include their current session if they're on duty now.)
  191. unset %hd.time
  192. }
  193. }
  194. }
  195. }
  196.  
  197.  
  198.  
  199. alias duty {
  200. writeini helpdesk.ini Duty $address($1,2) $2
  201. }
  202. alias hdreset {
  203. unset %total.time*
  204. unset %help.users
  205. set %duty.count 0
  206. }
Add Comment
Please, Sign In to add comment