Advertisement
Guest User

dark

a guest
Jun 30th, 2011
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.11 KB | None | 0 0
  1. ;
  2. ; BorkNet Bot Control
  3. ;
  4. ;
  5. ;
  6. ; Copyright (C) 2004 Ozafy - ozafy@borknet.org - http://www.borknet.org
  7. ;
  8. ; This program is free software; you can redistribute it and/or
  9. ; modify it under the terms of the GNU General Public License
  10. ; as published by the Free Software Foundation; either version 2
  11. ; of the License, or (at your option) any later version.
  12. ;
  13. ; This program is distributed in the hope that it will be useful,
  14. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. ; GNU General Public License for more details.
  17. ;
  18. ; You should have received a copy of the GNU General Public License
  19. ; along with this program; if not, write to the Free Software
  20. ; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  21. ;
  22. dialog borknet_bot_control {
  23. title "BorkNet Bot-Control"
  24. size -1 -1 200 200
  25. option dbu
  26. tab "Q ChanControl", 1, 5 5 189 189
  27. edit "#Channel", 2, 10 22 85 10, tab 1
  28. button "Get Channel Info", 3, 105 22 85 10, tab 1
  29. box "ChanFlags", 4, 10 32 180 160, tab 1
  30. edit "Current Flags on #Channel are: ", 5, 15 40 170 10, tab 1 read center
  31. box "(Auto) Limit", 6, 15 63 170 20, tab 1
  32. edit "Current Limit", 7, 20 71 45 10, tab 1
  33. box "Channel Key", 8, 15 84 170 20, tab 1
  34. edit "New Key", 9, 20 92 45 10, tab 1
  35. button "Set Limit", 10, 75 71 30 10, tab 1
  36. button "Set Key", 11, 75 92 50 10, tab 1
  37. button "Set Channel Welcome", 12, 20 177 80 10, tab 1
  38. edit "New Welcome", 13, 20 166 160 10, tab 1 autohs
  39. button "Set Channel Topic", 14, 20 145 80 10, tab 1
  40. edit "New Topic", 15, 20 134 160 10, tab 1 autohs
  41. edit "Current Modes", 16, 20 113 45 10, tab 1
  42. button "Set Modes", 17, 75 113 50 10, tab 1
  43. box "Channel Modes", 18, 15 105 170 20, tab 1
  44. box "Channel Topic", 19, 15 126 170 31, tab 1
  45. box "Channel Welcome", 20, 15 158 170 31, tab 1
  46. check "Bitch Mode", 21, 16 52 50 10, tab 1
  47. check "Protect Users", 22, 78 52 50 10, tab 1
  48. check "Auto-Voice", 23, 147 52 38 10, tab 1
  49. check "Auto Limit", 24, 110 71 35 10, tab 1
  50. check "Force Limit", 25, 147 71 37 10, tab 1
  51. check "Force Key", 26, 130 92 50 10, tab 1
  52. check "Force Modes", 27, 130 113 50 10, tab 1
  53. check "Force Topic", 28, 105 145 50 10, tab 1
  54. check "Enable Welcome Message", 29, 105 177 76 10, tab 1
  55. tab "Q ChanLev", 30
  56. edit "Username's Flags on #Channel: ", 40, 10 35 180 10, tab 30 read center
  57. edit "Username", 41, 10 22 50 10, tab 30 read
  58. edit "#Channel", 42, 75 22 50 10, tab 30
  59. button "Get Info", 43, 140 22 50 10, tab 30
  60. check "Voice (+v)", 44, 10 48 40 10, tab 30
  61. check "Auto Voice (+g)", 45, 70 48 50 10, tab 30
  62. check "Cannot Get Voice (+q)", 46, 125 48 65 10, tab 30
  63. check "Op (+o)", 47, 10 58 40 10, tab 30
  64. check "Auto Op (+a)", 48, 70 58 50 10, tab 30
  65. check "Cannot get Op (+d)", 49, 125 58 60 10, tab 30
  66. check "Topic Changer (+t)", 50, 10 68 60 10, tab 30
  67. check "No Welcome (+w)", 51, 70 68 55 10, tab 30
  68. check "Banned (+b)", 52, 125 68 45 10, tab 30
  69. check "Master (+m)", 53, 10 78 45 10, tab 30
  70. check "Owner (+n)", 54, 70 78 45 10, tab 30
  71. button "Apply", 55, 10 93 180 10, tab 30
  72. list 56, 10 107 90 70, tab 30 size
  73. list 57, 100 107 90 70, disable tab 30 size
  74. edit "Total:", 58, 10 180 180 10, tab 30 read center
  75. tab "L Control", 32
  76. edit "Username", 59, 10 22 50 10, tab 32 read
  77. edit "#Channel", 60, 75 22 50 10, tab 32
  78. button "Get Info", 61, 140 22 50 10, tab 32
  79. edit "Username's Flags on #Channel: ", 62, 10 35 180 10, tab 32 read center
  80. check "Auto Voice (+g)", 63, 70 49 50 10, tab 32
  81. check "Auto Op (+a)", 64, 70 59 50 10, tab 32
  82. check "Owner (+n)", 65, 130 59 45 10, tab 32
  83. check "Master (+m)", 66, 130 49 45 10, tab 32
  84. check "Op (+o)", 67, 10 59 40 10, tab 32
  85. check "Voice (+v)", 68, 10 49 40 10, tab 32
  86. button "Apply", 69, 10 72 180 10, tab 32
  87. list 70, 10 84 90 55, tab 32 size
  88. list 71, 100 84 90 55, disable tab 32 size
  89. edit "Total:", 72, 10 142 180 10, tab 32 read center
  90. box "Channel Control", 73, 10 154 180 35, tab 32
  91. edit "New Welcome", 74, 15 163 50 10, tab 32 autohs
  92. button "Set Welcome", 75, 75 163 50 10, tab 32
  93. button "Clear Welcome", 76, 135 163 50 10, tab 32
  94. button "Enable Invite", 77, 15 175 80 10, tab 32
  95. button "Disable Invite", 78, 105 175 80 10, tab 32
  96. link "http://www.borknet.org", 79, 131 10 62 8
  97. }
  98. on *:DIALOG:borknet_bot_control:*:*:{
  99. if ($devent == sclick) {
  100. if ($did == 3) {
  101. .msg Q chanflags $did(2)
  102. .msg Q limit $did(2)
  103. .msg Q chanmodes $did(2)
  104. }
  105. if ($did == 21) {
  106. if ($did(21).state) {
  107. .msg Q chanflags $did(2) +b
  108. }
  109. else {
  110. .msg Q chanflags $did(2) -b
  111. }
  112. .msg Q chanflags $did(2)
  113. }
  114. if ($did == 22) {
  115. if ($did(22).state) {
  116. .msg Q chanflags $did(2) +p
  117. }
  118. else {
  119. .msg Q chanflags $did(2) -p
  120. }
  121. .msg Q chanflags $did(2)
  122. }
  123. if ($did == 23) {
  124. if ($did(23).state) {
  125. .msg Q chanflags $did(2) +v
  126. }
  127. else {
  128. .msg Q chanflags $did(2) -v
  129. }
  130. .msg Q chanflags $did(2)
  131. }
  132. if ($did == 24) {
  133. if ($did(24).state) {
  134. if ($did(25).state) {
  135. .msg Q chanflags $did(2) -l
  136. }
  137. .msg Q chanflags $did(2) +c
  138. }
  139. else {
  140. .msg Q chanflags $did(2) -c
  141. }
  142. .msg Q chanflags $did(2)
  143. }
  144. if ($did == 25) {
  145. if ($did(25).state) {
  146. if ($did(24).state) {
  147. .msg Q chanflags $did(2) -c
  148. }
  149. .msg Q chanflags $did(2) +l
  150. }
  151. else {
  152. .msg Q chanflags $did(2) -l
  153. }
  154. .msg Q chanflags $did(2)
  155. }
  156. if ($did == 26) {
  157. if ($did(26).state) {
  158. .msg Q chanflags $did(2) +k
  159. }
  160. else {
  161. .msg Q chanflags $did(2) -k
  162. }
  163. .msg Q chanflags $did(2)
  164. }
  165. if ($did == 27) {
  166. if ($did(27).state) {
  167. .msg Q chanflags $did(2) +m
  168. }
  169. else {
  170. .msg Q chanflags $did(2) -m
  171. }
  172. .msg Q chanflags $did(2)
  173. }
  174. if ($did == 28) {
  175. if ($did(28).state) {
  176. .msg Q chanflags $did(2) +f
  177. }
  178. else {
  179. .msg Q chanflags $did(2) -f
  180. }
  181. .msg Q chanflags $did(2)
  182. }
  183. if ($did == 29) {
  184. if ($did(29).state) {
  185. .msg Q chanflags $did(2) +w
  186. }
  187. else {
  188. .msg Q chanflags $did(2) -w
  189. }
  190. .msg Q chanflags $did(2)
  191. }
  192. if ($did == 10) {
  193. .msg Q limit $did(2) $did(7)
  194. }
  195. if ($did == 11) {
  196. .msg Q key $did(2) $did(9)
  197. }
  198. if ($did == 17) {
  199. .msg Q chanmodes $did(2) $did(16)
  200. }
  201. if ($did == 12) {
  202. .msg Q welcome $did(2) $did(13)
  203. }
  204. if ($did == 14) {
  205. .msg Q settopic $did(2) $did(15)
  206. }
  207. if ($did == 43) {
  208. set %borknet_q_chanlev 1
  209. .msg Q chanlev $did(42)
  210. }
  211. if ($did == 55) {
  212. set %borknet_q_chanlev 1
  213. set %borknet_q_userlev 1
  214. unset %borknet_q_changeuser
  215. if ($did(44).state) {
  216. set %borknet_q_changeuser %borknet_q_changeuser $+ +v
  217. }
  218. else {
  219. set %borknet_q_changeuser %borknet_q_changeuser $+ -v
  220. }
  221. if ($did(45).state) {
  222. set %borknet_q_changeuser %borknet_q_changeuser $+ +g
  223. }
  224. else {
  225. set %borknet_q_changeuser %borknet_q_changeuser $+ -g
  226. }
  227. if ($did(46).state) {
  228. set %borknet_q_changeuser %borknet_q_changeuser $+ +q
  229. }
  230. else {
  231. set %borknet_q_changeuser %borknet_q_changeuser $+ -q
  232. }
  233. if ($did(47).state) {
  234. set %borknet_q_changeuser %borknet_q_changeuser $+ +o
  235. }
  236. else {
  237. set %borknet_q_changeuser %borknet_q_changeuser $+ -o
  238. }
  239. if ($did(48).state) {
  240. set %borknet_q_changeuser %borknet_q_changeuser $+ +a
  241. }
  242. else {
  243. set %borknet_q_changeuser %borknet_q_changeuser $+ -a
  244. }
  245. if ($did(49).state) {
  246. set %borknet_q_changeuser %borknet_q_changeuser $+ +d
  247. }
  248. else {
  249. set %borknet_q_changeuser %borknet_q_changeuser $+ -d
  250. }
  251. if ($did(50).state) {
  252. set %borknet_q_changeuser %borknet_q_changeuser $+ +t
  253. }
  254. else {
  255. set %borknet_q_changeuser %borknet_q_changeuser $+ -t
  256. }
  257. if ($did(51).state) {
  258. set %borknet_q_changeuser %borknet_q_changeuser $+ +w
  259. }
  260. else {
  261. set %borknet_q_changeuser %borknet_q_changeuser $+ -w
  262. }
  263. if ($did(52).state) {
  264. set %borknet_q_changeuser %borknet_q_changeuser $+ +b
  265. }
  266. else {
  267. set %borknet_q_changeuser %borknet_q_changeuser $+ -b
  268. }
  269. if ($did(53).state) {
  270. set %borknet_q_changeuser %borknet_q_changeuser $+ +m
  271. }
  272. else {
  273. set %borknet_q_changeuser %borknet_q_changeuser $+ -m
  274. }
  275. if ($did(54).state) {
  276. set %borknet_q_changeuser %borknet_q_changeuser $+ +n
  277. }
  278. else {
  279. set %borknet_q_changeuser %borknet_q_changeuser $+ -n
  280. }
  281. .msg Q chanlev $did(42) $chr(35) $+ $did(41) %borknet_q_changeuser
  282. .msg Q chanlev $did(42)
  283. .msg Q chanlev $did(42) $chr(35) $+ $did(41)
  284. }
  285. if ($did == 61) {
  286. set %borknet_l_chanlev 1
  287. .msg L welcome $did(60)
  288. .msg L chanlev $did(60)
  289. }
  290. if ($did == 69) {
  291. set %borknet_l_chanlev 1
  292. set %borknet_l_userlev 1
  293. unset %borknet_l_changeuser
  294. if ($did(63).state) {
  295. set %borknet_l_changeuser %borknet_l_changeuser $+ +g
  296. }
  297. else {
  298. set %borknet_l_changeuser %borknet_l_changeuser $+ -g
  299. }
  300. if ($did(64).state) {
  301. set %borknet_l_changeuser %borknet_l_changeuser $+ +a
  302. }
  303. else {
  304. set %borknet_l_changeuser %borknet_l_changeuser $+ -a
  305. }
  306. if ($did(65).state) {
  307. set %borknet_l_changeuser %borknet_l_changeuser $+ +n
  308. }
  309. else {
  310. set %borknet_l_changeuser %borknet_l_changeuser $+ -n
  311. }
  312. if ($did(66).state) {
  313. set %borknet_l_changeuser %borknet_l_changeuser $+ +m
  314. }
  315. else {
  316. set %borknet_l_changeuser %borknet_l_changeuser $+ -m
  317. }
  318. if ($did(67).state) {
  319. set %borknet_l_changeuser %borknet_l_changeuser $+ +o
  320. }
  321. else {
  322. set %borknet_l_changeuser %borknet_l_changeuser $+ -o
  323. }
  324. if ($did(68).state) {
  325. set %borknet_l_changeuser %borknet_l_changeuser $+ +v
  326. }
  327. else {
  328. set %borknet_l_changeuser %borknet_l_changeuser $+ -v
  329. }
  330. .msg L chanlev $did(60) $chr(35) $+ $did(59) %borknet_l_changeuser
  331. .msg L whois $did(59)
  332. }
  333. if ($did == 75) {
  334. .msg L welcome $did(60) $did(74)
  335. }
  336. if ($did == 76) {
  337. .msg L welcome $did(60) remove
  338. did -o borknet_bot_control 74 1 New Welcome
  339. }
  340. if ($did == 77) {
  341. .msg l setinvite $did(60)
  342. }
  343. if ($did == 78) {
  344. .msg l clearinvite $did(60)
  345. }
  346. }
  347. if ($devent == dclick) {
  348. if ($did == 56) {
  349. set %borknet_q_userlev 1
  350. .msg Q chanlev $did(42) $chr(35) $+ $did(56,$did(56).sel)
  351. }
  352. if ($did == 70) {
  353. set %borknet_l_userlev 1
  354. .msg L whois $did(70,$did(70).sel)
  355. }
  356. if ($did == 79) {
  357. url -a http://www.borknet.org
  358. }
  359. }
  360. if ($devent == close) {
  361. set %borknet_bot_control 0
  362. unset %q.not.hide. $+ $cid
  363. }
  364. }
  365. on ^*:notice:*:?:{
  366. if (%borknet_bot_control == 1 && $nick == Q) {
  367. haltdef
  368. if ($regex($1-,Current channel flags are:.+)) {
  369. did -o borknet_bot_control 5 1 Current Flags on $did(borknet_bot_control,2) are: $5
  370. did -u borknet_bot_control 21,22,23,24,25,26,27,28,29
  371. if ($regex($5,.*b.*)) {
  372. did -c borknet_bot_control 21
  373. }
  374. if ($regex($5,.*c.*)) {
  375. did -c borknet_bot_control 24
  376. }
  377. else {
  378. did -u borknet_bot_control 24
  379. }
  380. if ($regex($5,.*f.*)) {
  381. did -c borknet_bot_control 28
  382. }
  383. if ($regex($5,.*k.*)) {
  384. did -c borknet_bot_control 26
  385. }
  386. if ($regex($5,.*l.*)) {
  387. did -c borknet_bot_control 25
  388. }
  389. else {
  390. did -u borknet_bot_control 25
  391. }
  392. if ($regex($5,.*m.*)) {
  393. did -c borknet_bot_control 27
  394. }
  395. if ($regex($5,.*p.*)) {
  396. did -c borknet_bot_control 22
  397. }
  398. if ($regex($5,.*v.*)) {
  399. did -c borknet_bot_control 23
  400. }
  401. if ($regex($5,.*w.*)) {
  402. did -c borknet_bot_control 29
  403. }
  404. }
  405. if ($regex($1-,Current limit is:.+)) {
  406. did -o borknet_bot_control 7 1 $4
  407. }
  408. if ($regex($1-,Current enforced modes on .+)) {
  409. did -o borknet_bot_control 16 1 $7
  410. }
  411. if (%borknet_q_chanlev == 1) {
  412. if ($regex($1-,Known users on.+are:)) {
  413. did -r borknet_bot_control 56
  414. did -r borknet_bot_control 57
  415. }
  416. if ($regex($1-,.+Modes:.+)) {
  417. did -a borknet_bot_control 56 $1
  418. did -a borknet_bot_control 57 $3
  419. }
  420. if ($regex($1-,End of list.)) {
  421. set %borknet_q_chanlev 0
  422. }
  423. }
  424. if (%borknet_q_userlev == 1) {
  425. if ($regex($1-,.+modes on channel.+)) {
  426. did -o borknet_bot_control 41 1 $remove($1,$chr(35))
  427. did -o borknet_bot_control 40 1 $remove($1,$chr(35)) $+ 's Flags on $5 $6
  428. did -u borknet_bot_control 44,45,46,47,48,49,50,51,52,53,54
  429. if ($regex($6,.*a.*)) {
  430. did -c borknet_bot_control 48
  431. }
  432. if ($regex($6,.*b.*)) {
  433. did -c borknet_bot_control 52
  434. }
  435. if ($regex($6,.*d.*)) {
  436. did -c borknet_bot_control 49
  437. }
  438. if ($regex($6,.*g.*)) {
  439. did -c borknet_bot_control 45
  440. }
  441. if ($regex($6,.*m.*)) {
  442. did -c borknet_bot_control 53
  443. }
  444. if ($regex($6,.*n.*)) {
  445. did -c borknet_bot_control 54
  446. }
  447. if ($regex($6,.*o.*)) {
  448. did -c borknet_bot_control 47
  449. }
  450. if ($regex($6,.*q.*)) {
  451. did -c borknet_bot_control 46
  452. }
  453. if ($regex($6,.*t.*)) {
  454. did -c borknet_bot_control 50
  455. }
  456. if ($regex($6,.*w.*)) {
  457. did -c borknet_bot_control 51
  458. }
  459. if ($regex($6,.*v.*)) {
  460. did -c borknet_bot_control 44
  461. }
  462. set %borknet_q_userlev 0
  463. }
  464. }
  465. if ($regex($1-,Total:.+)) {
  466. did -o borknet_bot_control 58 1 $1-
  467. }
  468. }
  469. if (%borknet_bot_control == 1 && $nick == L) {
  470. haltdef
  471. if (%borknet_l_chanlev == 1) {
  472. if ($regex($1-,Welcome message for channel .+)) {
  473. did -o borknet_bot_control 74 1 $7-
  474. }
  475. if ($regex($1-,Total:.+)) {
  476. did -o borknet_bot_control 72 1 $1-
  477. }
  478. if ($regex($1-,End of chanlev for.+)) {
  479. set %borknet_l_chanlev 0
  480. set %borknet_l_searching 0
  481. }
  482. if (%borknet_l_searching) {
  483. if (!$regex($1-,-+) && !$regex($1-,Authname Access flags) && !$regex($1-,Total:.+)) {
  484. did -a borknet_bot_control 70 $1
  485. did -a borknet_bot_control 71 $2
  486. }
  487. }
  488. if ($regex($1-,Users for channel :.+)) {
  489. did -r borknet_bot_control 70
  490. did -r borknet_bot_control 71
  491. set %borknet_l_searching 1
  492. }
  493. }
  494. if (%borknet_l_userlev == 1) {
  495. if ($regex($1-,.+is authed as.+)) {
  496. did -o borknet_bot_control 59 1 $remove($1,$chr(35))
  497. did -u borknet_bot_control 63,64,65,66,67,68
  498. }
  499. if ($1 == $did(borknet_bot_control,60)) {
  500. did -o borknet_bot_control 62 1 $did(borknet_bot_control,59) $+ 's Flags on $1 $+ : $2
  501. if ($regex($2,.*a.*)) {
  502. did -c borknet_bot_control 64
  503. }
  504. if ($regex($2,.*g.*)) {
  505. did -c borknet_bot_control 63
  506. }
  507. if ($regex($2,.*m.*)) {
  508. did -c borknet_bot_control 66
  509. }
  510. if ($regex($2,.*n.*)) {
  511. did -c borknet_bot_control 65
  512. }
  513. if ($regex($2,.*o.*)) {
  514. did -c borknet_bot_control 67
  515. }
  516. if ($regex($2,.*v.*)) {
  517. did -c borknet_bot_control 68
  518. }
  519. set %borknet_l_userlev 0
  520. }
  521. }
  522. }
  523. }
  524. alias botcontrol {
  525. set %borknet_bot_control 1
  526. dialog -m borknet_bot_control borknet_bot_control
  527. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement