Advertisement
WacKEDmaN

Untitled

Aug 23rd, 2018
395
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.42 KB | None | 0 0
  1.  
  2. ;# #
  3. ;# IdealIRC Essentials script #
  4. ;# #
  5. ;# Defines menus and shortened commands. #
  6. ;# Also provides as an example to #
  7. ;# how a script is set up. #
  8. ;# #
  9.  
  10.  
  11. script Essentials {
  12. command j join
  13. command p part
  14. command ns nickserv
  15. command cs chanserv
  16. command cycle cycle
  17.  
  18.  
  19. event IALHostGet GotHostname
  20. }
  21.  
  22. menu status {
  23. Server info {
  24. Server stats = server_stats
  25. Server info = info
  26. Server links = links
  27. Server map = map
  28. sep
  29. Server time = time
  30. sep
  31. Show Server Admin = admin
  32. sep
  33. Server version = version
  34. Unrealircd Credits = credits
  35. }
  36. sep
  37. List All Channels = list
  38. sep
  39. List All Users = who
  40. sep
  41. Join channel... = join_channel
  42. Change nickname... = change_nickname
  43. sep
  44. Quit = quit
  45. }
  46.  
  47. menu query {
  48. Whois = query_whois
  49. sep
  50. CTCP {
  51. Ping = CTCP_ping
  52. Time = CTCP_time
  53. Version = CTCP_version
  54. }
  55. }
  56.  
  57. menu channel {
  58. Channel settings = chan_settings
  59. Channel Modes {
  60. List Current Modes = modes
  61. sep
  62. Moderated (+m) {
  63. ON = modeon
  64. OFF = modeoff
  65. }
  66. Strip Colors (+c) {
  67. ON = coloron
  68. OFF = coloroff
  69. }
  70. CTCP control (+C) {
  71. ON = ctcpon
  72. OFF = ctcpoff
  73. }
  74. sep
  75. Chanserv Help = cshelp
  76. sep
  77. }
  78. sep
  79. List All Channels = list
  80. sep
  81. List All Users = who
  82. sep
  83. Server info {
  84. Server stats = server_stats
  85. Server info = info
  86. Server links = links
  87. Server map = map
  88. sep
  89. Server time = time
  90. sep
  91. Show Server Admin = admin
  92. sep
  93. Server version = version
  94. Unrealircd Credits = credits
  95. }
  96. sep
  97. Cycle Channel = cycle
  98. }
  99.  
  100. menu nicklist {
  101. Query = query
  102. Whois = whois
  103. sep
  104. CTCP {
  105. Ping = CTCP_ping
  106. Time = CTCP_time
  107. Version = CTCP_version
  108. }
  109. sep
  110. Operator {
  111. Give op = give_op
  112. Take op = take_op
  113. Give voice = give_voice
  114. Take voice = take_voice
  115. sep
  116. Kick = kick
  117. Kick, ban = kickban
  118. }
  119. }
  120.  
  121. ;$ Custom commands /j and /p /ns and /cs:
  122. function join(%c, %k) {
  123. if ($len(%k) > 0) {
  124. join #%c %k
  125. }
  126. else {
  127. join #%c
  128. }
  129. }
  130.  
  131. function part(%c, %r) {
  132. if ($len(%c) == 0) {
  133. part $target
  134. return
  135. }
  136.  
  137. if ($sstr(%c, 0, 1) != #) {
  138. part $target %c %r
  139. return
  140. }
  141.  
  142. part %c %r
  143. }
  144.  
  145. function nickserv(%c, %k) {
  146. if ($len(%k) > 0) {
  147. nickserv %c %k
  148. }
  149. else {
  150. nickserv %c
  151. }
  152. }
  153.  
  154. function chanserv(%c, %k) {
  155. if ($len(%k) > 0) {
  156. chanserv %c %k
  157. }
  158. else {
  159. chanserv %c
  160. }
  161. }
  162.  
  163. ;$ Menu in status window:
  164. function server_stats() {
  165. lusers
  166. }
  167.  
  168. function join_channel() {
  169. var %c $input(Join a channel, Enter a channel name:)
  170. if ($button == Cancel) {
  171. return
  172. }
  173. if ($sstr(%c, 0, 1) != #) {
  174. join #%c
  175. return
  176. }
  177. join %c
  178. del %c
  179. }
  180.  
  181. function change_nickname() {
  182. var %n $input(Change nickname, Enter a new nickname:)
  183. if ($button == Cancel) {
  184. return
  185. }
  186. nick %n
  187. del %n
  188. }
  189.  
  190.  
  191. ;$ Menu in query window:
  192. function query_whois(%n) {
  193. whois %n
  194. }
  195.  
  196. ;$ Menu in channel textbox
  197. function chan_settings(%c) {
  198. chansettings
  199. }
  200.  
  201. ;$ Menu in channel listbox:
  202. function query(...) {
  203. if (%1 == $NULL) {
  204. return
  205. }
  206.  
  207. query %1
  208. }
  209.  
  210. function whois(...) {
  211. if (%1 == $NULL) {
  212. return
  213. }
  214.  
  215. whois %1
  216. }
  217.  
  218. function give_op(...) {
  219. if (%1 == $NULL) {
  220. return
  221. }
  222.  
  223. var %len $token(%0, 0, 32)
  224. if (%len == 0) {
  225. return
  226. }
  227. var %i 1
  228. while (%i <= %len) {
  229. var %letter $glue(%letter,o)
  230. var %nick $glue(%nick, $char(32), %+%i)
  231. inc %i
  232. }
  233. mode $target +%letter%%nick%
  234.  
  235. del %letter
  236. del %nick
  237. }
  238.  
  239. function take_op(...) {
  240. if (%1 == $NULL) {
  241. return
  242. }
  243.  
  244. var %len $token(%0, 0, 32)
  245. if (%len == 0) {
  246. return
  247. }
  248. var %i 1
  249. while (%i <= %len) {
  250. var %letter $glue(%letter,o)
  251. var %nick $glue(%nick, $char(32), %+%i)
  252. inc %i
  253. }
  254. mode $target -%letter%%nick%
  255.  
  256. del %letter
  257. del %nick
  258. }
  259.  
  260. function give_voice(...) {
  261. if (%1 == $NULL) {
  262. return
  263. }
  264.  
  265. var %len $token(%0, 0, 32)
  266. if (%len == 0) {
  267. return
  268. }
  269. var %i 1
  270. while (%i <= %len) {
  271. var %letter $glue(%letter,v)
  272. var %nick $glue(%nick, $char(32), %+%i)
  273. inc %i
  274. }
  275. mode $target +%letter%%nick%
  276.  
  277. del %letter
  278. del %nick
  279. }
  280.  
  281. function take_voice(...) {
  282. if (%1 == $NULL) {
  283. return
  284. }
  285.  
  286. var %len $token(%0, 0, 32)
  287. if (%len == 0) {
  288. return
  289. }
  290. var %i 1
  291. while (%i <= %len) {
  292. var %letter $glue(%letter,v)
  293. var %nick $glue(%nick, $char(32), %+%i)
  294. inc %i
  295. }
  296. mode $target -%letter%%nick%
  297.  
  298. del %letter
  299. del %nick
  300. }
  301.  
  302. function kick(...) {
  303. if (%1 == $NULL) {
  304. return
  305. }
  306.  
  307. var %reason $input(Kick reason, Enter a kick reason:)
  308. if ($button == Cancel) {
  309. return
  310. }
  311.  
  312. kick %1 %reason
  313. }
  314.  
  315. function kickban(...) {
  316. if (%1 == $NULL) {
  317. return
  318. }
  319.  
  320. var %reason $input(Kick reason, Enter a kick reason:)
  321. if ($button == Cancel) {
  322. return
  323. }
  324.  
  325. if ($IALHostMask(%1) == $NULL) {
  326. var %ban %1
  327. userhost %1
  328. return
  329. }
  330.  
  331. mode $target +b $IALHostMask(%1)
  332. kick %1 %reason
  333. }
  334.  
  335. ;$ CTCP menu
  336. function CTCP_ping(...) {
  337. if (%1 == $NULL) {
  338. return
  339. }
  340. ctcp %1 ping
  341. }
  342.  
  343. function CTCP_time(...) {
  344. if (%1 == $NULL) {
  345. return
  346. }
  347. ctcp %1 time
  348. }
  349.  
  350. function CTCP_version(...) {
  351. if (%1 == $NULL) {
  352. return
  353. }
  354. ctcp %1 version
  355. }
  356.  
  357. ;$ Utilities...
  358. function GotHostname(%nickname, %hostmask) {
  359. if (%ban == %nickname) {
  360. mode $target +b %hostmask
  361. kick %nickname %reason
  362. del %ban %reason
  363. }
  364. }
  365.  
  366.  
  367. ;$ ********* ADDONS *********
  368.  
  369. function cycle(%c) {
  370. part %c
  371. join %c
  372. }
  373.  
  374. function info() {
  375. info
  376. }
  377.  
  378. function admin() {
  379. admin
  380. }
  381.  
  382. function credits() {
  383. credits
  384. }
  385.  
  386. function links() {
  387. links
  388. }
  389.  
  390. function list() {
  391. list
  392. }
  393.  
  394. function map() {
  395. map
  396. }
  397.  
  398. function module() {
  399. module
  400. }
  401.  
  402. function motd() {
  403. motd
  404. }
  405.  
  406. function names() {
  407. names
  408. }
  409.  
  410. function quit(...) {
  411. var %reason $input(Quit, Enter a quit reason:)
  412. if ($button == Cancel) {
  413. return
  414. }
  415. if ($sstr(%reason, 0, 1) != #) {
  416. quit %reason
  417. return
  418. }
  419. quit %reason
  420. del %reason
  421. }
  422.  
  423. function time() {
  424. time
  425. }
  426.  
  427. function version() {
  428. version
  429. }
  430.  
  431. function who() {
  432. who
  433. }
  434.  
  435. ;$ channel modes
  436. function modes(%c) {
  437. mode %c
  438. }
  439.  
  440. function modeon(%c) {
  441. mode %c +m
  442. }
  443.  
  444. function modeoff(%c) {
  445. mode %c -m
  446. }
  447.  
  448. function coloron(%c) {
  449. mode %c +c
  450. }
  451.  
  452. function coloroff(%c) {
  453. mode %c -c
  454. }
  455.  
  456. function ctcpon(%c) {
  457. mode %c +C
  458. }
  459.  
  460. function ctcpoff(%c) {
  461. mode %c -C
  462. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement