Advertisement
Guest User

Untitled

a guest
Jun 20th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.71 KB | None | 0 0
  1. on *:join:#: {
  2. if ($address($nick,2) == $gettok($readini(users.ini,$chan,$nick),1,32)) && ($gettok($readini(users.ini,$chan,$nick),2,32) == owner) {
  3. mode $chan +qo $nick $nick $nick
  4. }
  5. if ($address($nick,2) == $gettok($readini(users.ini,$chan,$nick),1,32)) && ($gettok($readini(users.ini,$chan,$nick),2,32) == admin) {
  6. mode $chan +ao $nick $nick $nick
  7. }
  8. if ($address($nick,2) == $gettok($readini(users.ini,$chan,$nick),1,32)) && ($gettok($readini(users.ini,$chan,$nick),2,32) == op) {
  9. mode $chan +ov $nick $nick
  10. }
  11. if ($address($nick,2) == $gettok($readini(users.ini,$chan,$nick),1,32)) && ($gettok($readini(users.ini,$chan,$nick),2,32) == helper) {
  12. mode $chan +hv $nick $nick
  13. }
  14. if ($address($nick,2) == $gettok($readini(users.ini,$chan,$nick),1,32)) && ($gettok($readini(users.ini,$chan,$nick),2,32) == voice) {
  15. mode $chan +v $nick
  16. }
  17. }
  18. on *:part:#: {
  19. if ($read($+($chan,loggedin.txt), w, $nick $+ *) == $nick) {
  20. write -ds $+ $nick loggedin.txt
  21. .notice $nick $+(<,$nick,>) Logged out.
  22. }
  23. }
  24. on 1:quit: {
  25. var %com = $comchan($nick,0)
  26. while (%com) {
  27. if ($read($+($chan(%com),loggedin.txt), w, $nick $+ *) == $nick) {
  28. write -ds $+ $nick $+($chan(%com),loggedin.txt)
  29. dec %com
  30. }
  31. else {
  32. dec %com
  33. }
  34. }
  35. }
  36. on *:nick: {
  37. var %com = $comchan($nick,0)
  38. while (%com) {
  39. if ($read($+($chan(%com),loggedin.txt), w, $nick $+ *) == $nick) {
  40. write -ds $+ $nick $+($chan(%com),loggedin.txt)
  41. .notice $newnick $+(<,$nick,>) Logged out.
  42. dec %com
  43. }
  44. else {
  45. dec %com
  46. }
  47. }
  48. }
  49. on *:text:*:*: {
  50. if ($target == $chan) { var %targ = $target }
  51. if ($target == $me) { var %targ = $nick }
  52. ;
  53. ; Login Procedure
  54. if (!login == $strip($1)) {
  55. if ($address($nick,2) != $gettok($readini(login.ini,users,$nick),1,32)) {
  56. .msg %targ $+(<,$nick,>) You do not have user access to this bot. You can request an account by typing !request username password
  57. halt
  58. }
  59. if ($address($nick,2) == $gettok($readini(users.ini,botmaster,$nick),2,32)) {
  60. if (!$3) {
  61. .msg %targ Incorrect login procedure: Please proceed by typing !login username password
  62. }
  63. if ($3) {
  64. if ($2 == $gettok($readini(login.ini,users,$nick),2,32)) {
  65. if ($3 == $gettok($readini(login.ini,users,$nick),3,32)) {
  66. if ($read(loggedin.txt, w, $nick $+ *) == $nick) {
  67. .msg %targ $+(<,$nick,>) You are already Logged in.
  68. }
  69. else {
  70. .msg %targ $+(<,$nick,>) Logged in.
  71. write loggedin.txt $nick
  72. }
  73. }
  74. elseif ($3 != $gettok($readini(login.ini,users,$nick),3,32)) {
  75. .msg %targ Your password did not match.
  76. }
  77. }
  78. elseif ($2 != $gettok($readini(login.ini,users,$nick),2,32)) {
  79. .msg %targ Your username did not match.
  80. }
  81. }
  82. }
  83. else {
  84. if (!$4) {
  85. .msg %targ Incorrect login procedure: Please proceed by typing !login username password channel
  86. }
  87. if ($4) {
  88. if ($2 == $gettok($readini(login.ini,users,$nick),2,32)) {
  89. if ($3 == $gettok($readini(login.ini,users,$nick),3,32)) {
  90. if ($read(loggedin.txt, w, $nick $+ *) == $nick) {
  91. .msg %targ $+(<,$nick,>) You are already Logged in.
  92. }
  93. else {
  94. .msg %targ $+(<,$nick,>) Logged in.
  95. write loggedin.txt $nick
  96. }
  97. }
  98. elseif ($3 != $gettok($readini(login.ini,users,$nick),3,32)) {
  99. .msg %targ Your password did not match.
  100. }
  101. }
  102. elseif ($2 != $gettok($readini(login.ini,users,$nick),2,32)) {
  103. .msg %targ Your username did not match.
  104. }
  105. }
  106. }
  107. }
  108. ;
  109. ; Logout Procedure
  110. if (!logout == $strip($1)) {
  111. if ($read(loggedin.txt, w, $nick $+ *) == $nick) {
  112. if (!$2) {
  113. .msg %targ Please specify a channel to log out of.
  114. }
  115. else {
  116. write -ds $+ $nick $+($2,loggedin.txt)
  117. .msg %targ $+(<,$nick,>) Logged out.
  118. }
  119. }
  120. else {
  121. .msg %targ You are either "not logged in" or did not specify a channel to log out of.
  122. }
  123. }
  124. ;
  125. ; Request user access Procedure ( These users get recognised as Regular Users )
  126. if (!request == $strip($1)) {
  127. if ($address($nick,2) == $gettok($readini(users.ini,$chan,$nick),1,32)) && ($gettok($readini(users.ini,$chan,$nick),2,32) == Owner) {
  128. if (list == $strip($2)) {
  129. if ($lines(requests.txt) == 0) {
  130. .msg %targ There are no requests pending.
  131. }
  132. else {
  133. var %rt = $lines(requests.txt)
  134. while (%rt) {
  135. .msg %targ %rt $+ : $read(requests.txt, %rt)
  136. dec %rt
  137. }
  138. }
  139. }
  140. if (total == $strip($2)) {
  141. .msg %targ There are a total of $lines(requests.txt) requests.
  142. }
  143. if (approve == $strip($2)) {
  144. if ($lines(requests.txt) == 0) {
  145. .msg %targ There are no requests pending.
  146. }
  147. else {
  148. writeini login.ini users $gettok($read(requests.txt,2,$3),1,32) $gettok($read(requests.txt,2,$3),2,32) $gettok($read(requests.txt,2,$3),3,32) $gettok($read(requests.txt,2,$3),4,32)
  149. write -ds $+ $3 $+ * requests.txt
  150. if ($3 ison $chan) {
  151. .notice $3 You now have "Channel Regular" level access to me, login by typing: !login $gettok($readini(login.ini,users,$nick),2,32) $gettok($readini(login.ini,users,$nick),3,32)
  152. .notice $nick Added $3 with "Channel Regular" level access.
  153. }
  154. else {
  155. haltdef
  156. }
  157. }
  158. }
  159. }
  160. else {
  161. if (!$3) {
  162. .msg %targ Request Regular User Access: !request username password
  163. }
  164. else {
  165. write requests.txt $nick $address($nick,2) $2 $3
  166. .msg %targ Your request has been sent.
  167. }
  168. }
  169. }
  170. ;
  171. ; Commands for logged in users
  172. if ($read(loggedin.txt, w, $nick $+ *) == $nick) {
  173. ;
  174. ; Bot Master Commands
  175. if ($address($nick,2) == $gettok($readini(users.ini,botmaster,$nick),2,32)) {
  176. if ($strip($1) == !adduser) {
  177. if (!$6) {
  178. .msg %targ Incorrect Syntax. Please Type: !adduser #channel nick level username password
  179. .msg %targ level can be any of the following: owner - admin - op - helper - voice
  180. }
  181. else {
  182. writeini users.ini $2 $3 $address($3,2) $4
  183. writeini login.ini users $3 $5 $6
  184. .notice $3 You now have $+(",$4,") level access to me, login by typing: !login $5 $6
  185. .notice $nick Added $3 with $+(",$4,") level access.
  186. }
  187. }
  188. if ($strip($1) == !deluser) {
  189. if (!$3) || (!$2) {
  190. .msg %targ Incorrect Syntax. Please Type: !deluser #channel nick
  191. }
  192. else {
  193. remini users.ini $2 $3
  194. remini login.ini users $3
  195. .notice $nick $3 has been removed from my database.
  196. }
  197. }
  198. ;
  199. ; Add Bot Master Commands Here
  200.  
  201.  
  202. }
  203. ;
  204. ; Channel Owner Commands
  205. if ($address($nick,2) == $gettok($readini(users.ini,$chan,$nick),1,32)) && ($gettok($readini(users.ini,$chan,$nick),2,32) == Owner) {
  206. ;
  207. ; Add Channel Owner Commands Here
  208.  
  209.  
  210. }
  211. ;
  212. ; Channel Admin Commands
  213. if ($address($nick,2) == $gettok($readini(users.ini,$chan,$nick),1,32)) && ($gettok($readini(users.ini,$chan,$nick),2,32) == Admin) {
  214. ;
  215. ; Add Channel Admin Commands Here
  216.  
  217.  
  218. }
  219. ;
  220. ; Channel Op Commands
  221. if ($address($nick,2) == $gettok($readini(users.ini,$chan,$nick),1,32)) && ($gettok($readini(users.ini,$chan,$nick),2,32) == Op) {
  222. ;
  223. ; Add Channel Op Commands Here
  224.  
  225.  
  226. }
  227. ;
  228. ; Channel Helper Commands
  229. if ($address($nick,2) == $gettok($readini(users.ini,$chan,$nick),1,32)) && ($gettok($readini(users.ini,$chan,$nick),2,32) == Helper) {
  230. ;
  231. ; Add Channel Helper Commands Here
  232.  
  233.  
  234. }
  235. ;
  236. ; Channel Voice Commands
  237. if ($address($nick,2) == $gettok($readini(users.ini,$chan,$nick),1,32)) && ($gettok($readini(users.ini,$chan,$nick),2,32) == Voice) {
  238. ;
  239. ; Add Channel Voice Commands Here
  240.  
  241.  
  242. }
  243. ;
  244. ; Add Regular User Commands Here ( All other users with higher access may use these commands too. )
  245.  
  246.  
  247. }
  248. ;
  249. ; Add Other Public User Commands Here ( All other users with higher access may use these commands too. )
  250.  
  251.  
  252. }
  253. alias botmaster {
  254. writeini users.ini botmaster $1 $1 $address($1,2)
  255. writeini login.ini users $1 $address($1,2) $1 $2
  256. .notice $1 Username: $1 Password: $2
  257. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement