Advertisement
WacKEDmaN

Untitled

Oct 13th, 2018
367
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.  
  122.  
  123.  
  124. ;$ Custom commands /j and /p /ns and /cs:
  125. function join(%c, %k) {
  126. if ($len(%k) > 0) {
  127. join #%c %k
  128. }
  129. else {
  130. join #%c
  131. }
  132. }
  133.  
  134. function part(%c, %r) {
  135. if ($len(%c) == 0) {
  136. part $target
  137. return
  138. }
  139.  
  140. if ($sstr(%c, 0, 1) != #) {
  141. part $target %c %r
  142. return
  143. }
  144.  
  145. part %c %r
  146. }
  147.  
  148. function nickserv(%c, %k) {
  149. if ($len(%k) > 0) {
  150. nickserv %c %k
  151. }
  152. else {
  153. nickserv %c
  154. }
  155. }
  156.  
  157. function chanserv(%c, %k) {
  158. if ($len(%k) > 0) {
  159. chanserv %c %k
  160. }
  161. else {
  162. chanserv %c
  163. }
  164. }
  165.  
  166.  
  167.  
  168.  
  169.  
  170. ;$ Menu in status window:
  171. function server_stats() {
  172. lusers
  173. }
  174.  
  175. function join_channel() {
  176. var %c $input(Join a channel, Enter a channel name:)
  177. if ($button == Cancel) {
  178. return
  179. }
  180. if ($sstr(%c, 0, 1) != #) {
  181. join #%c
  182. return
  183. }
  184. join %c
  185. del %c
  186. }
  187.  
  188. function change_nickname() {
  189. var %n $input(Change nickname, Enter a new nickname:)
  190. if ($button == Cancel) {
  191. return
  192. }
  193. nick %n
  194. del %n
  195. }
  196.  
  197.  
  198. ;$ Menu in query window:
  199. function query_whois(%n) {
  200. whois %n
  201. }
  202.  
  203. ;$ Menu in channel textbox
  204. function chan_settings(%c) {
  205. chansettings
  206. }
  207.  
  208. ;$ Menu in channel listbox:
  209. function query(...) {
  210. if (%1 == $NULL) {
  211. return
  212. }
  213.  
  214. query %1
  215. }
  216.  
  217. function whois(...) {
  218. if (%1 == $NULL) {
  219. return
  220. }
  221.  
  222. whois %1
  223. }
  224.  
  225. function give_op(...) {
  226. if (%1 == $NULL) {
  227. return
  228. }
  229.  
  230. var %len $token(%0, 0, 32)
  231. if (%len == 0) {
  232. return
  233. }
  234. var %i 1
  235. while (%i <= %len) {
  236. var %letter $glue(%letter,o)
  237. var %nick $glue(%nick, $char(32), %+%i)
  238. inc %i
  239. }
  240. mode $target +%letter%%nick%
  241.  
  242. del %letter
  243. del %nick
  244. }
  245.  
  246. function take_op(...) {
  247. if (%1 == $NULL) {
  248. return
  249. }
  250.  
  251. var %len $token(%0, 0, 32)
  252. if (%len == 0) {
  253. return
  254. }
  255. var %i 1
  256. while (%i <= %len) {
  257. var %letter $glue(%letter,o)
  258. var %nick $glue(%nick, $char(32), %+%i)
  259. inc %i
  260. }
  261. mode $target -%letter%%nick%
  262.  
  263. del %letter
  264. del %nick
  265. }
  266.  
  267. function give_voice(...) {
  268. if (%1 == $NULL) {
  269. return
  270. }
  271.  
  272. var %len $token(%0, 0, 32)
  273. if (%len == 0) {
  274. return
  275. }
  276. var %i 1
  277. while (%i <= %len) {
  278. var %letter $glue(%letter,v)
  279. var %nick $glue(%nick, $char(32), %+%i)
  280. inc %i
  281. }
  282. mode $target +%letter%%nick%
  283.  
  284. del %letter
  285. del %nick
  286. }
  287.  
  288. function take_voice(...) {
  289. if (%1 == $NULL) {
  290. return
  291. }
  292.  
  293. var %len $token(%0, 0, 32)
  294. if (%len == 0) {
  295. return
  296. }
  297. var %i 1
  298. while (%i <= %len) {
  299. var %letter $glue(%letter,v)
  300. var %nick $glue(%nick, $char(32), %+%i)
  301. inc %i
  302. }
  303. mode $target -%letter%%nick%
  304.  
  305. del %letter
  306. del %nick
  307. }
  308.  
  309. function kick(...) {
  310. if (%1 == $NULL) {
  311. return
  312. }
  313.  
  314. var %reason $input(Kick reason, Enter a kick reason:)
  315. if ($button == Cancel) {
  316. return
  317. }
  318.  
  319. kick %1 %reason
  320. }
  321.  
  322. function kickban(...) {
  323. if (%1 == $NULL) {
  324. return
  325. }
  326.  
  327. var %reason $input(Kick reason, Enter a kick reason:)
  328. if ($button == Cancel) {
  329. return
  330. }
  331.  
  332. if ($IALHostMask(%1) == $NULL) {
  333. var %ban %1
  334. userhost %1
  335. return
  336. }
  337.  
  338. mode $target +b $IALHostMask(%1)
  339. kick %1 %reason
  340. }
  341.  
  342. ;$ CTCP menu
  343. function CTCP_ping(...) {
  344. if (%1 == $NULL) {
  345. return
  346. }
  347. ctcp %1 ping
  348. }
  349.  
  350. function CTCP_time(...) {
  351. if (%1 == $NULL) {
  352. return
  353. }
  354. ctcp %1 time
  355. }
  356.  
  357. function CTCP_version(...) {
  358. if (%1 == $NULL) {
  359. return
  360. }
  361. ctcp %1 version
  362. }
  363.  
  364. ;$ Utilities...
  365. function GotHostname(%nickname, %hostmask) {
  366. if (%ban == %nickname) {
  367. mode $target +b %hostmask
  368. kick %nickname %reason
  369. del %ban %reason
  370. }
  371. }
  372.  
  373.  
  374. ;$ ********* ADDONS *********
  375.  
  376. function cycle(%c) {
  377. part %c
  378. join %c
  379. }
  380.  
  381. function info() {
  382. info
  383. }
  384.  
  385. function admin() {
  386. admin
  387. }
  388.  
  389. function credits() {
  390. credits
  391. }
  392.  
  393. function links() {
  394. links
  395. }
  396.  
  397. function list() {
  398. list
  399. }
  400.  
  401. function map() {
  402. map
  403. }
  404.  
  405. function module() {
  406. module
  407. }
  408.  
  409. function motd() {
  410. motd
  411. }
  412.  
  413. function names() {
  414. names
  415. }
  416.  
  417. function quit(...) {
  418. var %reason $input(Quit, Enter a quit reason:)
  419. if ($button == Cancel) {
  420. return
  421. }
  422. if ($sstr(%reason, 0, 1) != #) {
  423. quit %reason
  424. return
  425. }
  426. quit %reason
  427. del %reason
  428. }
  429.  
  430. function time() {
  431. time
  432. }
  433.  
  434. function version() {
  435. version
  436. }
  437.  
  438. function who() {
  439. who
  440. }
  441.  
  442. ;$ channel modes
  443. function modes(%c) {
  444. mode %c
  445. }
  446.  
  447. function modeon(%c) {
  448. mode %c +m
  449. }
  450.  
  451. function modeoff(%c) {
  452. mode %c -m
  453. }
  454.  
  455. function coloron(%c) {
  456. mode %c +c
  457. }
  458.  
  459. function coloroff(%c) {
  460. mode %c -c
  461. }
  462.  
  463. function ctcpon(%c) {
  464. mode %c +C
  465. }
  466.  
  467. function ctcpoff(%c) {
  468. mode %c -C
  469. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement