Advertisement
Guest User

Untitled

a guest
Dec 20th, 2015
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 236.71 KB | None | 0 0
  1. # # # ## ##### # @@@@ @@
  2. # #### # # # # # @ @ @
  3. # # # # # # ### ### # ### @ @ @
  4. # # # # # # # # # # # # @ @ @
  5. #### #### #### ### # ### ### #### ### @ @ @@
  6.  
  7. # [LoL's TooLz 7.0c]
  8. #
  9. # Eggdrop TCL Script: [LoL's TooLz] Copyright (C) 1998-2002 LL Productions.
  10. # This software is free under the terms of GNU GPL 2.
  11. # Type .gpl-lol in party-line for more information.
  12. #
  13. # HomePage: http://www.leonini.net/
  14. #
  15. # ORIGINAL AUTHOR: Lorenzo Leonini alias RB_____
  16. # E-MAIL: lolstoolz@leonini.net ICQ: 22245831
  17. #
  18. # NEW MAINTENER: Yoann SERVANT alias Thor
  19. # E-MAIL: yservant@free.fr ICQ: 50383313
  20. #
  21. # Thanks for bugs reports (and patches):
  22. # Hawkeye, PPSlim, Tim Ballantine and many others.
  23. #
  24. ################################################################################
  25. #
  26. # LEVELS USED IN LOL'S TOOLZ:
  27. #
  28. # +M +N (Masters, Owners) [+B & +0 (Bots with +O) in passive mode]
  29. # +O (Operators)
  30. # +V (Voice)
  31. # +F (Friend)
  32. # - (User without flags)
  33. # * (Nothing = Not a bot user)
  34. #
  35. # MAKE SURE COMMANDS THAT USE THE PRIORITY LEVELS ARE NOT SET SO THAT
  36. # LOWER USERS ARE ALLOWED TO PERFORM A NEGATIVE ACTION ON A USER WITH A HIGHER
  37. # LEVEL. BOTS HAVE THE HIGHEST LEVEL TO PREVENT BOTWARS (THE BOT
  38. # ALWAYS RESPECTS THE COMMANDS OF OTHER BOTS).
  39.  
  40. #########
  41. # SETUP #
  42. #########
  43.  
  44. # THIS SCRIPT REQUIRE ALLTOOLS.TCL COMMING WITH EGGDROP, INSTALL IT.
  45.  
  46. # ENABLE (1) OR DISABLE (0) CHAN-KEY AUTO-UPDATE AND CHAN_KEY MEMORISATION.
  47. # ***** WARNING !!!! *****
  48. # IF YOU USE GETOPS.TCL YOU NEED TO SET 0 HERE.
  49. set lol(chankey) 1
  50.  
  51. # THESE ARE THE DEFAULT FLAGS, YOU CAN CHANGE THEM WHEN THE BOT IS ONLINE.
  52.  
  53. # BAN TYPE
  54. # HOW DO YOU WANT TO BAN THE USER ? DEFAULT 1
  55. # 0 - *!*user@*.domain
  56. # 1 - *!*@host.domain
  57. set lol(bantype) 1
  58.  
  59. # SET THE CHARACTER THAT WILL BE USED BEFORE PUBLIC QUERRIES
  60. # EXAMPLE: "#" => #seen, #op .... DEFAULT: "!"
  61. # IF YOU USE MANY BOTS WITH LoL's TooLz IN THE SAME CHAN, IT CAN BE VERY USEFUL
  62. # TO GIVE EACH BOTS A DIFFERENT COMMAND CHARACTER.
  63. set lol(cmdchar) "*"
  64.  
  65. # ENABLE (1) OR DISABLE (0) SECURITY WARNING WHEN NEWBIE MASTERS JOIN THE PARTY-LINE.
  66. # WITH THE NEW IDENT SYSTEM THERE IS NO BIG SECURITY RISK.
  67. set lol(security) 0
  68.  
  69. # ENABLE (1) OR DISABLE (0) PASSWORD CHECKER WHEN A USER JOINS THE CHAN.
  70. # IF SET TO 1, THE BOT REMEMBERS A USER WITHOUT HAVING A PASSWORD SET.
  71. set lol(nopass) 1
  72.  
  73. # ENABLE (1) OR DISABLE (0) IDENTIFICATION SYSTEM.
  74. # WARNING !!! IF THIS IS DISABLED, SECURITY IS NOT GUARANTED.
  75. # THE BOT WILL USE ONLY USERMASKS TO IDENTIFY USERS.
  76. # USE THIS AT YOUR OWN RISK. DEFAULT: 1
  77. set lol(ident) 1
  78.  
  79. # ENABLE (1) OR DISABLE (0) IDENTIFICATION CONFIRMATION.
  80. set lol(id_confirm) 1
  81.  
  82. # ENABLE (1) OR DISABLE (0) ALERTS A USER TO IDENT HIMSELF IN ORDER TO USE THE CHAN COMMANDS.
  83. # 1 = DON'T WARN.
  84. # WITH THE NEW SILENT, UNSILENT COMMANDS, YOU SHOULD KEEP
  85. # 0 HERE TO ALLOW USERS TO CHOOSE THEIR OWN MODE.
  86. # IF YOU SET 1 HERE, THE USER'S CHOICE IS OVERRIDEN AND SILENT MODE REMAINS.
  87. set lol(silent) 0
  88.  
  89. # SET TO 1 IF YOU WANT CLONES TO BE IDENTIFIED.
  90. # IF SET TO 0, ONLY THE LAST NICK THAT MADE THE IDENT IS IDENTIFIED.
  91. # IF YOU ARE ON A SHELL WITH MULTIPLE ACCOUNTS, YOU MAY WANT TO PLACE 0 HERE.
  92. set lol(clone) 1
  93.  
  94. # ENABLE (1) OR DISABLE (0) JOKES
  95. set lol(jokes) 1
  96.  
  97. # !HELP AND !TROUBLES ARE 2 PUBLIC COMMANDS THAT USE BANDWITH.
  98. # THERE CAN BE WARBOTS THAT FLOOD THE CHAN SAYING !HELP OR
  99. # !TROUBLES MULTIPLES TIMES. IT CAN BE A GOOD IDEA TO DISABLE
  100. # THEM (FOR THE PUBLIC ONLY).
  101.  
  102. # ENABLE (1) OR DISABLE (0) !HELP COMMAND FOR USERS NOT ON THE BOT.
  103. set lol(help) 1
  104.  
  105. # ENABLE (1) OR DISABLE (0) !TROUBLES COMMAND FOR USERS NOT ON THE BOT.
  106. set lol(troubles) 0
  107.  
  108. # ENABLE (1) OR DISABLE (0) !SEEN COMMAND FOR USERS NOT ON THE BOT.
  109. set lol(seen) 0
  110.  
  111. # ENABLE (1) OR DISABLE (0) !TIME COMMAND FOR USERS NOT ON THE BOT.
  112. set lol(time) 1
  113.  
  114. # ADJUST THESE DEFAULT CHAN LINES (USED BY !JOIN, .JOIN...)
  115. #(flood accepted:number of seconds)
  116. set lol(chan_flood) "8:20"
  117. set lol(join_flood) "5:30"
  118. set lol(ctcp_flood) "3:30"
  119. set lol(kick_flood) "3:10"
  120. set lol(chan_parameters) "-clearbans +enforcebans +dynamicbans +userbans -autoop -bitch -greet -statuslog +stopnethack -revenge +autovoice -secret -shared +cycle -seen"
  121. set lol(chanmode) "+nt"
  122.  
  123. # DEFAULT SERVER FLAGS
  124. # CHANGE THIS ONLY IF YOU KNOW THE SERVER FLAGS...
  125. set lol(server_flags) "+iw-s"
  126.  
  127. # ENABLE (1) OR DISABLE (0) BOT PROTECTION AGAINST BANS MADE
  128. # BY LOWER USERS AGAINST HIGHER USERS.
  129. # IF THE BAN IS SET BY A CHAN MASTER, ONLY A WARNING IS DISPLAYED. IF NOT,
  130. # THE FLAG OF THE USER AND OF THE VICTIM(S) ARE COMPARED. IF THE
  131. # VICTIM HAS THE HIGHEST FLAG, THE BAN IS REMOVED BY THE BOT.
  132. # THE BOT ALSO REMOVES BANS THAT MATCH ITSELF.
  133. set lol(ban_protect) 0
  134.  
  135. # AWAY MESSAGE, IF YOU WANT TO SET AN AWAY MESSAGE FOR THE BOT...
  136. set lol(away) ""
  137.  
  138. # ENABLE (1) OR DISABLE (0) WELCOME MESSAGE FOR THE USERS NOT ON THE BOT.
  139. # (WELCOME CAN USE A LOT OF BANDWIDTH IF YOU HAVE HIGH TRAFFIC CHANS)
  140. set lol(welcome) 1
  141.  
  142. # IF YOU WANT A SPECIAL WELCOME MESSAGE ON YOUR CHANS, SET IT HERE. IF YES,
  143. # KEEP IT EMPTY ! (EMPTY = DEFAULT MESSAGE)
  144. set lol(welmsg) "7B5i8e9n10v4e3n6i11d15@"
  145.  
  146. # ENABLE (1) OR DISABLE (0) PROTECTION AGAIN IDLE USERS.
  147. # ALL THE IDLE SETTINGS BELOW APPLY ONLY IF IDLE PROTECTION IS ENABLED.
  148. set lol(idle_protect) 0
  149.  
  150. # HOW LONG UNTIL A USER RECEIVES AN IDLE WARNING BY MSG. IF THIS
  151. # VALUE IS GREATER OR EQUAL THAN max_idle_time, THERE IS NO WARNING.
  152. # VALUE IS IN MINUTES.
  153. set lol(warn_idle_time) 55
  154.  
  155. # HOW LONG A USER CAN BE IDLE ON A CHAN BEFORE BEING BANNED.
  156. # VALUE IS IN MINUTES.
  157. set lol(max_idle_time) 60
  158.  
  159. # HOW LONG UNTIL AN IDLE USER IS KICKED FROM THE CHAN. IF THIS VALUE IS LOWER
  160. # THAN max_idle_time, THE USER IS KICKED AND NEVER BANNED. TO DISABLE IDLE KICK
  161. # AND KEEP ONLY IDLE BAN, SET A VALUE GREATER THAN max_idle_time HERE.
  162. # VALUE IS IN MINUTES.
  163. set lol(kick_idle_time) 100
  164.  
  165. # HOW MANY TIME AN IDLE USER IS BANNED. VALUE IS IN MINUTES.
  166. set lol(idle_ban_time) 1
  167.  
  168. # SET THE FLAGS FOR USERS THAT YOU DO NOT WANT KICKED IN THE EVENT OF
  169. # A !KICK <MASK>, !QUICK <MASK>, CLIENT KICK (!MIRC, !IRCII...). THE OPED
  170. # OR VOICED USERS AT THE MOMENT OF THE KICK ARE NOT KICKED, THIS SETTING ONLY
  171. # AFFECTS THE OTHER USERS IN THE CHAN. FOR EXAMPLE IF YOU WANT TO PROTECT
  172. # +N, +M, +O, +V: set lol(no_kick_flags) "nmov"
  173. set lol(no_kick_flags) "n"
  174.  
  175. # SAME AS ABOVE BUT FOR !BAN <MASK>
  176. set lol(no_ban_flags) "nmo"
  177.  
  178. # SAME AS ABOVE BUT FOR THE IDLE USERS (IF YOU SET "" HERE, ALL THE NON OPED,
  179. # NON VOICED USERS *EVEN IF THE BOT DETECTS THEY HAVE +N OR +O* CAN BE KICKED
  180. # OR BANNED IF THEY ARE IDLE.
  181. set lol(no_idle_flags) "nmo"
  182.  
  183. #########
  184. # BINDS #
  185. #########
  186.  
  187. # CHANGE THE FLAGS AT YOUR OWN RISK !!! FOR EXAMPLE m|m => o|o
  188. # IT CAN CREATE SECURITY HOLES AND SCRIPT PROBLEMS.
  189. # YOU CAN DISABLE ANY COMMANDS PLACING "#" BEFORE THEM.
  190.  
  191. bind pub n [string trim $lol(cmdchar)]param pub_lol_param
  192. bind pub n [string trim $lol(cmdchar)]enable pub_lol_enable
  193. bind pub n [string trim $lol(cmdchar)]disable pub_lol_disable
  194. bind pub n [string trim $lol(cmdchar)]deluser pub_lol_deluser
  195. bind pub n -user pub_lol_deluser
  196. bind pub n [string trim $lol(cmdchar)]join pub_lol_join
  197. bind pub n +chan pub_lol_join
  198. bind pub n [string trim $lol(cmdchar)]remove pub_lol_remove
  199. bind pub n -chan pub_lol_remove
  200. bind pub n [string trim $lol(cmdchar)]part pub_lol_remove
  201. bind pub n [string trim $lol(cmdchar)]addhost pub_lol_addhost
  202. bind pub n +host pub_lol_addhost
  203. bind pub n [string trim $lol(cmdchar)]delhost pub_lol_delhost
  204. bind pub n -host pub_lol_delhost
  205. bind pub n|n [string trim $lol(cmdchar)]addowner pub_lol_addowner
  206. bind pub n|n +owner pub_lol_addowner
  207. bind pub n|n [string trim $lol(cmdchar)]addmaster pub_lol_addmaster
  208. bind pub n|n +master pub_lol_addmaster
  209. bind pub n|n [string trim $lol(cmdchar)]delowner pub_lol_delowner
  210. bind pub n|n -owner pub_lol_delowner
  211. bind pub n|n [string trim $lol(cmdchar)]delmaster pub_lol_delmaster
  212. bind pub n|n -master pub_lol_delmaster
  213. bind pub m [string trim $lol(cmdchar)]jump pub_lol_jump
  214. bind pub m [string trim $lol(cmdchar)]botnick pub_lol_botnick
  215. bind pub m|m [string trim $lol(cmdchar)]adduser pub_lol_adduser
  216. bind pub m|m +user pub_lol_adduser
  217. bind pub m|m [string trim $lol(cmdchar)]addbot pub_lol_addbot
  218. bind pub m|m +bot pub_lol_addbot
  219. bind pub m|m [string trim $lol(cmdchar)]addop pub_lol_addop
  220. bind pub m|m +op pub_lol_addop
  221. bind pub m|m [string trim $lol(cmdchar)]delop pub_lol_delop
  222. bind pub m|m [string trim $lol(cmdchar)]findip pub_lol_findip
  223. bind pub o|o [string trim $lol(cmdchar)]ban pub_lol_ban
  224. bind pub o|o +b pub_lol_ban
  225. bind pub o|o [string trim $lol(cmdchar)]unban pub_lol_unban
  226. bind pub o|o -b pub_lol_unban
  227. bind pub o|o [string trim $lol(cmdchar)]chattr pub_lol_chattr
  228. bind pub o|o [string trim $lol(cmdchar)]mode pub_lol_chan
  229. bind pub o|o [string trim $lol(cmdchar)]op pub_lol_op
  230. bind pub o|o +o pub_lol_op
  231. bind pub o|o [string trim $lol(cmdchar)]banlist pub_lol_banlist
  232. bind pub o|o [string trim $lol(cmdchar)]broadcast pub_lol_broadcast
  233. bind pub o|o [string trim $lol(cmdchar)]addvoice pub_lol_addvoice
  234. bind pub o|o +voice pub_lol_addvoice
  235. bind pub o|o [string trim $lol(cmdchar)]delvoice pub_lol_delvoice
  236. bind pub o|o [string trim $lol(cmdchar)]addfriend pub_lol_addfriend
  237. bind pub o|o +friend pub_lol_addfriend
  238. bind pub o|o [string trim $lol(cmdchar)]delfriend pub_lol_delfriend
  239. bind pub o|o -friend pub_lol_delfriend
  240. bind pub o|o [string trim $lol(cmdchar)]topic pub_lol_topic
  241. bind pub o|o [string trim $lol(cmdchar)]whois pub_lol_whois
  242. bind pub o|o [string trim $lol(cmdchar)]online pub_lol_online
  243. bind pub o|o [string trim $lol(cmdchar)]quick pub_lol_quick
  244. bind pub o|o [string trim $lol(cmdchar)]mirc pub_lol_mirc
  245. bind pub o|o [string trim $lol(cmdchar)]bitchx pub_lol_bitchx
  246. bind pub o|o [string trim $lol(cmdchar)]ircii pub_lol_ircii
  247. bind pub o|o [string trim $lol(cmdchar)]eggdrop pub_lol_eggdrop
  248. bind pub o|o [string trim $lol(cmdchar)]info pub_lol_info
  249. bind pub ov|ov [string trim $lol(cmdchar)]voice pub_lol_voice
  250. bind pub ov|ov +v pub_lol_voice
  251. bind pub ov|ov [string trim $lol(cmdchar)]devoice pub_lol_devoice
  252. bind pub ov|ov [string trim $lol(cmdchar)]kick pub_lol_kick
  253. bind pub ov|ov [string trim $lol(cmdchar)]stats pub_lol_stats
  254. bind pub ov|ov [string trim $lol(cmdchar)]cigarette pub_lol_cigarette
  255. bind pub ov|ov [string trim $lol(cmdchar)]rose pub_lol_rose
  256. bind pub ov|ov [string trim $lol(cmdchar)]pastis pub_lol_pastis
  257. bind pub ov|ov [string trim $lol(cmdchar)]pastaga pub_lol_pastis
  258. bind pub ov|ov [string trim $lol(cmdchar)]51 pub_lol_pastis
  259. bind pub ov|ov [string trim $lol(cmdchar)]coca-cola pub_lol_coke
  260. bind pub ov|ov [string trim $lol(cmdchar)]coke pub_lol_coke
  261. bind pub ov|ov [string trim $lol(cmdchar)]beer pub_lol_beer
  262. bind pub ov|ov [string trim $lol(cmdchar)]penalty pub_lol_penalty
  263. bind pub - [string trim $lol(cmdchar)]silent pub_lol_silent
  264. bind pub - [string trim $lol(cmdchar)]unsilent pub_lol_unsilent
  265. bind pub - [string trim $lol(cmdchar)]unident pub_lol_unident
  266. bind pub - [string trim $lol(cmdchar)]unpermident pub_lol_unpermident
  267. bind pub - [string trim $lol(cmdchar)]uid pub_lol_unident
  268. bind pub - [string trim $lol(cmdchar)]upid pub_lol_unpermident
  269. bind pub - [string trim $lol(cmdchar)]time pub_lol_time
  270. bind pub - [string trim $lol(cmdchar)]seen pub_lol_seen
  271. bind pub - [string trim $lol(cmdchar)]help pub_lol_help
  272. bind pub - [string trim $lol(cmdchar)]troubles pub_lol_troubles
  273.  
  274. # DCC
  275. bind dcc n param dcc_lol_param
  276. bind dcc n enable dcc_lol_enable
  277. bind dcc n disable dcc_lol_disable
  278. bind dcc n join dcc_lol_join
  279. bind dcc n j dcc_lol_join
  280. bind dcc m notice dcc_lol_notice
  281. bind dcc m partyban dcc_lol_partyban
  282. bind dcc m botnick dcc_lol_botnick
  283. bind dcc m|m part dcc_lol_part
  284. bind dcc m|m p dcc_lol_part
  285. bind dcc m|m security dcc_lol_security
  286. bind dcc m|m addop dcc_lol_addop
  287. bind dcc m|m delop dcc_lol_delop
  288. bind dcc o userlist dcc_lol_userlist
  289. bind dcc o chanlist dcc_lol_chanlist
  290. bind dcc o online dcc_lol_online
  291. bind dcc ot|o whois dcc_lol_whois
  292. bind dcc o|o onotice dcc_lol_onotice
  293. bind dcc o|o channel dcc_lol_channel
  294. bind dcc o|o mode dcc_lol_mode
  295. bind dcc - seen dcc_lol_seen
  296. bind dcc - silent dcc_lol_silent
  297. bind dcc - unsilent dcc_lol_unsilent
  298. bind dcc - unident dcc_lol_unident
  299. bind dcc - unpermident dcc_lol_unpermident
  300. bind dcc - permident dcc_lol_permident
  301. bind dcc - uid dcc_lol_unident
  302. bind dcc - upid dcc_lol_unpermident
  303. bind dcc - pid dcc_lol_permident
  304. bind dcc - help-lol dcc_lol_help-lol
  305. bind dcc - gpl-lol dcc_lol_gpl-lol
  306. bind dcc - chanhelp dcc_lol_chanhelp
  307. bind dcc - identhelp dcc_lol_identhelp
  308.  
  309. # MSG
  310. bind msg n param msg_lol_param
  311. bind msg n enable msg_lol_enable
  312. bind msg n disable msg_lol_disable
  313. bind msg n join msg_lol_join
  314. bind msg n j msg_lol_join
  315. bind msg n remove msg_lol_remove
  316. bind msg n r msg_lol_remove
  317. bind msg n part msg_lol_remove
  318. bind msg n p msg_lol_remove
  319. bind msg n deluser msg_lol_deluser
  320. bind msg n addhost msg_lol_addhost
  321. bind msg n delhost msg_lol_delhost
  322. bind msg n|n addmaster msg_lol_addmaster
  323. bind msg m msg msg_lol_msg
  324. bind msg m botnick msg_lol_botnick
  325. bind msg m|m part msg_lol_part
  326. bind msg m|m p msg_lol_part
  327. bind msg m|m addop msg_lol_addop
  328. bind msg m|m adduser msg_lol_adduser
  329. bind msg m|m addbot msg_lol_addbot
  330. bind msg o|o chattr msg_lol_chattr
  331. bind msg o|o broadcast msg_lol_broadcast
  332. bind msg o|o addvoice msg_lol_addvoice
  333. bind msg o|o key msg_lol_key
  334. bind msg o|o quick msg_lol_quick
  335. bind msg o|o banlist msg_lol_banlist
  336. bind msg o|o ban msg_lol_ban
  337. bind msg o|o unban msg_lol_unban
  338. bind msg o|o mode msg_lol_chan
  339. bind msg o|o online msg_lol_online
  340. bind msg ov|ov invite msg_lol_invite
  341. bind msg ov|ov whois msg_lol_whois
  342. bind msg ov|ov kick msg_lol_kick
  343. bind msg - seen msg_lol_seen
  344. bind msg - silent msg_lol_silent
  345. bind msg - unsilent msg_lol_unsilent
  346. bind msg - ident msg_lol_ident
  347. bind msg - permident msg_lol_permident
  348. bind msg - unpermident msg_lol_unpermident
  349. bind msg - unident msg_lol_unident
  350. bind msg - id msg_lol_ident
  351. bind msg - pid msg_lol_permident
  352. bind msg - upid msg_lol_unpermident
  353. bind msg - uid msg_lol_unident
  354. bind msg - help msg_lol_help
  355.  
  356. ################
  357. # END OF SETUP #
  358. ################
  359.  
  360. ###############################################################
  361. ## ##
  362. ## USUALLY YOU DON'T HAVE TO CHANGE ANY OF THE FOLLOWING LINES ##
  363. ## ##
  364. ###############################################################
  365.  
  366. ################# MISC #################
  367. set lol(version_number) "7.0"
  368. set lol(version) "\002LoL's TooLz $lol(version_number)\002"
  369.  
  370. bind dcc - help dcc_lol_help
  371. bind chon - * chon_security
  372. bind join - * join_welcome
  373. bind mode - * lol_watch_mode
  374. unbind dcc - su *dcc:su
  375. unbind msg - ident *msg:ident
  376. bind dcc n su *dcc:su
  377. #unbind pub -|- seen *pub:seen
  378. unbind msg - invite *msg:invite
  379. bind ctcr * VERSION lol_ctcp_version
  380. bind mode - "* +k" see_new_pass
  381. bind nick - * chidentnick
  382. bind sign - * deident
  383. bind join - * joinident
  384. bind kick - * kickident
  385. bind rejn - * rejnident
  386. bind raw * 311 lol_whois_reply
  387. bind raw * 318 lol_whois_unknow
  388. bind raw * 401 lol_whois_nofound
  389. set init-server {initserv}
  390.  
  391. ################# START OF JOIN PROCEDURES #################
  392.  
  393. proc chon_security {hand idx} {
  394. global lol
  395. if {$lol(security) == 0} {return 0}
  396. set find 0
  397. foreach chan [channels] {
  398. if {[matchattr $hand -|m $chan]} {
  399. set find 1
  400. break
  401. }
  402. }
  403. if {[matchattr $hand m]} {set find 1}
  404. if {[matchattr $hand n]} {set find 0}
  405. if {$find == 0} {return 0}
  406. putdcc $idx "\002*** WARNING !!!! ***\r"
  407. putdcc $idx "For security reasons masters must NOT SET THE +a FLAG (auto-op) !!!\r"
  408. putdcc $idx "Type \002.security\002 for more information...\r"
  409. putdcc $idx "!!! Type \002.help-lol\002 to see the special commands for $lol(version) !!!\r"
  410. }
  411.  
  412. proc join_welcome {nick host hand chan} {
  413. global lol botnick
  414. if {![validuser $hand]} {
  415. if {$lol(welcome) == 1 && $nick != $botnick} {
  416. if {$lol(welmsg) != ""} {
  417. puthelp "NOTICE $nick :$lol(welmsg)"
  418. } {
  419. if {$lol(help) == 1} {
  420. puthelp "NOTICE $nick :Welcome to $chan $nick !!! Type \002[string trim $lol(cmdchar)]help\002 for more..."
  421. } {
  422. puthelp "NOTICE $nick :Welcome to $chan $nick !!!"
  423. }
  424. }
  425. }
  426. }
  427. if {[passwdok $hand ""] && ![matchattr $hand b]} {
  428. if {$lol(nopass) == 1} {
  429. puthelp "NOTICE $nick :\002You haven't still a password set !!! YOU MUST SET YOUR PASSWORD !!!"
  430. puthelp "NOTICE $nick :\002To set your password type: /msg $botnick pass <your_new_password>"
  431. }
  432. }
  433. }
  434.  
  435. ################# END OF JOIN PROCEDURES #################
  436.  
  437. ################# START OF CHAN COMMANDS #################
  438.  
  439. ### !INFO <INFO LINE>
  440.  
  441. proc pub_lol_info {nick host hand chan arg} {
  442. set arg [charfilter $arg]
  443. global lol botnick
  444. if {![check $hand $nick $host]} {
  445. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  446. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no longer receive this alert."
  447. return 0
  448. }
  449. if {[llength $arg] < 1} {
  450. puthelp "NOTICE $nick :\002Usage:\002 [string trim $lol(cmdchar)]info <info line>"
  451. return 0
  452. }
  453. if {[string length $arg] > 80} {
  454. puthelp "NOTICE $nick :Your infoline is too long and has not been stored. (MAX: 80 Chars)"
  455. return 0
  456. }
  457. setchaninfo $hand $chan $arg
  458. puthelp "NOTICE $nick :\002$arg\002 stored in your info line for $chan."
  459. return 0
  460. }
  461.  
  462. ### !SILENT
  463.  
  464. proc pub_lol_silent {nick host hand chan arg} {
  465. set arg [charfilter $arg]
  466. global lol botnick
  467. if {![check $hand $mynick $host]} {
  468. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  469. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no longer receive this alert."
  470. return 0
  471. }
  472. setuser $hand xtra silent 1
  473. }
  474.  
  475. ### !UNSILENT
  476.  
  477. proc pub_lol_unsilent {nick host hand chan arg} {
  478. set arg [charfilter $arg]
  479. global lol botnick
  480. if {![check $hand $nick $host]} {
  481. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  482. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no longer receive this alert."
  483. return 0
  484. }
  485. setuser $hand xtra silent 0
  486. puthelp "NOTICE $nick :You are no longer in silent mode.\r"
  487. }
  488.  
  489. ### !UNPERMIDENT
  490.  
  491. proc pub_lol_unpermident {nick host hand chan arg} {
  492. setuser $hand xtra permident ""
  493. if {[getuser $hand xtra auth] != "DEAD"} { setuser $hand xtra auth 0 }
  494. chattr $hand -3
  495. puthelp "NOTICE $nick :You are no longer using a permident mask."
  496. }
  497.  
  498. ### !UNIDENT
  499.  
  500. proc pub_lol_unident {nick host hand chan arg} {
  501. if {![check $hand $nick $host]} { return 0 }
  502. if {[getuser $hand xtra auth] != "DEAD"} { setuser $hand xtra auth 0 }
  503. chattr $hand -3
  504. }
  505.  
  506. ### !BOTNICK <nick>
  507.  
  508. proc pub_lol_botnick {mynick host hand chan arg} {
  509. set arg [charfilter $arg]
  510. global lol botnick nick
  511. if {![check $hand $mynick $host]} {
  512. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  513. puthelp "NOTICE $mynick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no longer receive this alert."
  514. return 0
  515. }
  516. if {[llength $arg] != 1} {
  517. puthelp "NOTICE $mynick :\002Usage:\002 [string trim $lol(cmdchar)]botnick <nick>"
  518. return 0
  519. }
  520. set nick [lindex $arg 0]
  521. }
  522.  
  523. ### !JUMP [server] [port]
  524.  
  525. proc pub_lol_jump {nick host hand chan arg} {
  526. set arg [charfilter $arg]
  527. global lol botnick
  528. if {![check $hand $nick $host]} {
  529. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  530. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no longer receive this alert."
  531. return 0
  532. }
  533. set server [lindex $arg 0]
  534. set port [lindex $arg 1]
  535. if {![isnumber $port]} {set port ""}
  536. if {$server == ""} { jump ; return 0 }
  537. if {[isnumber $port]} {
  538. jump $server $port
  539. } {
  540. jump $server
  541. }
  542. return 0
  543. }
  544.  
  545. ### !ADDHOST <nick|hand> [host]
  546.  
  547. proc pub_lol_addhost {nick host hand chan arg} {
  548. set arg [charfilter $arg]
  549. global lol botnick
  550. if {![check $hand $nick $host]} {
  551. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  552. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no longer receive this alert."
  553. return 0
  554. }
  555. if {[llength $arg] < 1} {
  556. puthelp "NOTICE $nick :\002Usage:\002 [string trim $lol(cmdchar)]addhost <nick|hand> \[host\]"
  557. return 0
  558. }
  559. set who [lindex $arg 0]
  560. set host [lindex $arg 1]
  561. if {$host == ""} {
  562. set ipmask [lindex [split [maskhost $who![getchanhost $who $chan]] "@"] 1]
  563. set userm [lindex [split [getchanhost $who $chan] "@"] 0]
  564. set host *!*$userm@$ipmask
  565. if {[nick2hand $who $chan] == "*"} {
  566. if {[validuser $who]} {
  567. setuser $who hosts $host
  568. puthelp "NOTICE $nick :$host added for $who."
  569. return 0
  570. }
  571. puthelp "NOTICE $nick :$who is not a user on the bot."
  572. return 0
  573. }
  574. puthelp "NOTICE $nick :$who is already recognized by the bot with this hand: [nick2hand $who $chan]."
  575. return 0
  576. }
  577. if {![onchan $who $chan]} {
  578. if {[validuser $who]} {
  579. setuser $who hosts $host
  580. puthelp "NOTICE $nick :$host added for $who."
  581. return 0
  582. } {
  583. puthelp "NOTICE $nick :$who is not in $chan, and there is no user with this hand."
  584. return 0
  585. }
  586. } {
  587. set whohand [nick2hand $who $chan]
  588. if {$whohand == "*"} {
  589. if {![validuser $who]} {
  590. puthelp "NOTICE $nick :$who is not a registered user and no user in the bot has the hand $who."
  591. return 0
  592. } {
  593. setuser $who hosts $host
  594. puthelp "NOTICE $nick :$host added for $who."
  595. return 0
  596. }
  597. } {
  598. setuser $whohand hosts $host
  599. puthelp "NOTICE $nick :$host added for $who ($whohand)."
  600. return 0
  601. }
  602. }
  603. return 0
  604. }
  605.  
  606. ### !DELHOST <nick|hand> <host>
  607.  
  608. proc pub_lol_delhost {nick host hand chan arg} {
  609. set arg [charfilter $arg]
  610. global lol botnick
  611. if {![check $hand $nick $host]} {
  612. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  613. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no longer receive this alert."
  614. return 0
  615. }
  616. if {[llength $arg] != 2} {
  617. puthelp "NOTICE $nick :\002Usage:\002 [string trim $lol(cmdchar)]delhost <nick|hand> <host>"
  618. return 0
  619. }
  620. set who [lindex $arg 0]
  621. set host [lindex $arg 1]
  622. if {![onchan $who $chan]} {
  623. set whohand $who
  624. if {[validuser $whohand]} {
  625. if {[delhost $whohand $host]} {
  626. puthelp "NOTICE $nick :$host removed for $who."
  627. return 0
  628. } {
  629. puthelp "NOTICE $nick :I can't remove $host from $who."
  630. return 0
  631. }
  632. } {
  633. puthelp "NOTICE $nick :$who is not in $chan, and there is no user with this hand."
  634. return 0
  635. }
  636. }
  637. set whohand [nick2hand $who $chan]
  638. if {$whohand == "*"} {
  639. puthelp "NOTICE $nick :$who is not a registered user."
  640. return 0
  641. }
  642. if {[delhost $whohand $host]} {
  643. puthelp "NOTICE $nick :$host removed for $who."
  644. return 0
  645. } {
  646. puthelp "NOTICE $nick :I can't remove $host from $who."
  647. return 0
  648. }
  649. return 0
  650. }
  651.  
  652. ### !CHATTR <nick> <flags>
  653.  
  654. proc pub_lol_chattr {nick host hand chan arg} {
  655. set arg [charfilter $arg]
  656. global lol botnick
  657. if {![check $hand $nick $host]} {
  658. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  659. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  660. return 0
  661. }
  662. if {[llength $arg] != 2} {
  663. puthelp "NOTICE $nick :\002Usage:\002 [string trim $lol(cmdchar)]chattr <nick> <flags>"
  664. return 0
  665. }
  666. set who [lindex $arg 0]
  667. set flags [lindex $arg 1]
  668. if {![onchan $who $chan]} {
  669. puthelp "NOTICE $nick :Sorry, but I don't see $who in $chan."
  670. return 0
  671. }
  672. set whohand [nick2hand $who $chan]
  673. if {$whohand == "*"} {
  674. puthelp "NOTICE $nick :$who is not a registered user."
  675. return 0
  676. }
  677. if {[matchattr $hand n|n $chan]} {
  678. set change [chattr $whohand -|$flags $chan]
  679. if {$change != ""} {
  680. set change [lindex [split $change "|"] 1]
  681. puthelp "NOTICE $nick :$who now has these flags in $chan: $change"
  682. return 0
  683. }
  684. puthelp "NOTICE $nick :The flags for $who have not changed."
  685. return 0
  686. }
  687. regsub -all -- "n" $flags "" flags
  688. regsub -all -- "m" $flags "" flags
  689. if {[matchattr $hand m|m $chan]} {
  690. set change [chattr $whohand -|$flags $chan]
  691. if {$change != ""} {
  692. set change [lindex [split $change "|"] 1]
  693. puthelp "NOTICE $nick :$who now has these flags in $chan: $change"
  694. return 0
  695. }
  696. puthelp "NOTICE $nick :The flags for $who have not changed."
  697. return 0
  698. }
  699. regsub -all -- "o" $flags "" flags
  700. if {[matchattr $hand o|o $chan]} {
  701. set change [chattr $whohand -|$flags $chan]
  702. if {$change != ""} {
  703. set change [lindex [split $change "|"] 1]
  704. puthelp "NOTICE $nick :$who now has these flags in $chan: $change"
  705. return 0
  706. }
  707. puthelp "NOTICE $nick :The flags for $who have not changed."
  708. return 0
  709. }
  710. puthelp "NOTICE $nick :You do not have not enough rights to use this function."
  711. return 0
  712. }
  713.  
  714. ### !JOIN <chan> [chan pass]
  715.  
  716. proc pub_lol_join {nick host hand chan arg} {
  717. set arg [charfilter $arg]
  718. global lol botnick
  719. if {![check $hand $nick $host]} {
  720. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  721. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  722. return 0
  723. }
  724. if {[llength $arg] < 1} {
  725. puthelp "NOTICE $nick :\002Usage:\002 [string trim $lol(cmdchar)]join <chan> \[chan pass\]"
  726. return 0
  727. }
  728. set chan [lindex $arg 0]
  729. if {$chan != ""} {set chan [chanaddapt $chan]}
  730. set pass [lindex $arg 1]
  731. if {[validchan $chan]} {
  732. puthelp "NOTICE $nick :I'm already monitoring $chan. "
  733. if {$pass != ""} {
  734. if {$lol(chankey) == 1} {
  735. puthelp "NOTICE $nick :New pass set for $chan: $pass."
  736. channel set $chan need-key "chankey $chan $pass"
  737. } {
  738. puthelp "NOTICE $nick :I can't memorize password to keep compatibility with getops.tcl"
  739. }
  740. }
  741. if {![onchan [strlwr $botnick] $chan]} {
  742. puthelp "NOTICE $nick :I'll now try to join it."
  743. putserv "JOIN $chan $pass"
  744. return 0
  745. }
  746. puthelp "NOTICE $nick :I'm already in $chan."
  747. return 0
  748. }
  749. puthelp "NOTICE $nick :New chan monitoring : $chan."
  750. channel add $chan
  751. channel set $chan chanmode $lol(chanmode)
  752. channel set $chan flood-chan $lol(chan_flood)
  753. channel set $chan flood-kick $lol(kick_flood)
  754. channel set $chan flood-join $lol(join_flood)
  755. channel set $chan flood-ctcp $lol(ctcp_flood)
  756. foreach param $lol(chan_parameters) { channel set $chan $param }
  757. if {$pass != ""} {
  758. if {$lol(chankey) == 1} {
  759. puthelp "NOTICE $nick :New pass set for $chan : $pass. "
  760. channel set $chan need-key "chankey $chan $pass"
  761. } {
  762. puthelp "NOTICE $nick :I can't memorize password to keep compatibility with getops.tcl"
  763. }
  764. }
  765. puthelp "NOTICE $nick :$chan is now configured. I'll now try to join it."
  766. puthelp "NOTICE $nick :Use \002.-chan\002 to remove a chan (chan userlist will be deleted)."
  767. putserv "JOIN $chan $pass"
  768. }
  769.  
  770. ### !REMOVE [chan]
  771.  
  772. proc pub_lol_remove {nick host hand chan arg} {
  773. set arg [charfilter $arg]
  774. global lol botnick
  775. if {![check $hand $nick $host]} {
  776. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  777. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  778. return 0
  779. }
  780. set ch [lindex $arg 0]
  781. if {$ch != ""} {set ch [chanaddapt $ch]}
  782. if {$ch == ""} {set ch $chan}
  783. if {![validchan $ch]} { puthelp "NOTICE $nick :I'm not on $ch " ; return 0 }
  784. channel remove $ch
  785. puthelp "NOTICE $nick :$ch has been removed."
  786. }
  787.  
  788. ### !PARAM <parameter> <value>
  789.  
  790. proc pub_lol_param {nick host hand chan arg} {
  791. set arg [charfilter $arg]
  792. global lol botnick
  793. if {![check $hand $nick $host]} {
  794. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  795. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  796. return 0
  797. }
  798. if {[llength $arg] < 2} {
  799. puthelp "NOTICE $nick :\002Usage:\002 [string trim $lol(cmdchar)]param <parameter> <value>"
  800. set param_display ""
  801. append param_display "\002cmdchar:\002 $lol(cmdchar)"
  802. append param_display " "
  803. append param_display "\002security:\002 $lol(security)"
  804. append param_display " "
  805. append param_display "\002nopass:\002 $lol(nopass)"
  806. append param_display " "
  807. append param_display "\002chankey:\002 $lol(chankey)"
  808. append param_display " "
  809. append param_display "\002silent:\002 $lol(silent)"
  810. append param_display " "
  811. append param_display "\002ident:\002 $lol(ident)"
  812. append param_display " "
  813. append param_display "\002id_confirm:\002 $lol(id_confirm)"
  814. append param_display " "
  815. append param_display "\002clone:\002 $lol(clone)"
  816. append param_display " "
  817. append param_display "\002jokes:\002 $lol(jokes)"
  818. append param_display " "
  819. append param_display "\002help:\002 $lol(help)"
  820. append param_display " "
  821. append param_display "\002troubles:\002 $lol(troubles)"
  822. append param_display " "
  823. append param_display "\002seen:\002 $lol(seen)"
  824. append param_display " "
  825. append param_display "\002time:\002 $lol(time)"
  826. append param_display " "
  827. append param_display "\002chan_flood:\002 $lol(chan_flood)"
  828. append param_display " "
  829. append param_display "\002join_flood:\002 $lol(join_flood)"
  830. append param_display " "
  831. append param_display " "
  832. append param_display "\002ctcp_flood:\002 $lol(ctcp_flood)"
  833. append param_display " "
  834. append param_display "\002kick_flood:\002 $lol(kick_flood)"
  835. append param_display " "
  836. append param_display "\002chan_parameters:\002 $lol(chan_parameters)"
  837. puthelp "NOTICE $nick :$param_display"
  838. set param_display ""
  839. append param_display "\002ban_protect:\002 $lol(ban_protect)"
  840. append param_display " "
  841. append param_display "\002chanmode:\002 $lol(chanmode)"
  842. append param_display " "
  843. append param_display "\002server_flags:\002 $lol(server_flags)"
  844. append param_display " "
  845. append param_display "\002welcome:\002 $lol(welcome)"
  846. append param_display " "
  847. append param_display "\002idle_protect:\002 $lol(idle_protect)"
  848. append param_display " "
  849. append param_display "\002warn_idle_time:\002 $lol(warn_idle_time)"
  850. append param_display " "
  851. append param_display "\002max_idle_time:\002 $lol(max_idle_time)"
  852. append param_display " "
  853. append param_display "\002kick_idle_time:\002 $lol(kick_idle_time)"
  854. append param_display " "
  855. append param_display "\002idle_ban_time:\002 $lol(idle_ban_time)"
  856. append param_display " "
  857. append param_display "\002no_kick_flags:\002 $lol(no_kick_flags)"
  858. append param_display " "
  859. append param_display "\002no_ban_flags:\002 $lol(no_ban_flags)"
  860. append param_display " "
  861. append param_display "\002no_idle_flags:\002 $lol(no_idle_flags)"
  862. puthelp "NOTICE $nick :$param_display"
  863. set param_display ""
  864. append param_display "\002welmsg:\002 $lol(welmsg)"
  865. puthelp "NOTICE $nick :$param_display"
  866. set param_display ""
  867. append param_display "\002away:\002 $lol(away)"
  868. puthelp "NOTICE $nick :$param_display"
  869. return 0
  870. }
  871. set lol([strlwr [lindex $arg 0]]) [lrange $arg 1 end]
  872. puthelp "NOTICE $nick :The new value of [strlwr [lindex $arg 0]] is [lrange $arg 1 end]."
  873. return 0
  874. }
  875.  
  876. ### !ENABLE <nick>
  877.  
  878. proc pub_lol_enable {nick host hand chan arg} {
  879. set arg [charfilter $arg]
  880. global lol botnick
  881. if {![check $hand $nick $host]} {
  882. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  883. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  884. return 0
  885. }
  886. if {[llength $arg] != 1} {
  887. puthelp "NOTICE $nick :\002Usage:\002 [string trim $lol(cmdchar)]enable <nick>"
  888. return 0
  889. }
  890. set who [lindex $arg 0]
  891. set whohand [nick2hand $who $chan]
  892. if {![onchan $who $chan]} {
  893. puthelp "NOTICE $nick :Sorry, but I don't see $who in $chan."
  894. return 0
  895. }
  896. if {[strlwr $who] == [strlwr $botnick]} {
  897. puthelp "NOTICE $nick :I don't need to be enabled."
  898. return 0
  899. }
  900. if {$whohand == "*"} {
  901. puthelp "NOTICE $nick :I don't recognize $who as a user."
  902. return 0
  903. }
  904. if {[getuser $whohand xtra auth] != "DEAD"} {
  905. puthelp "NOTICE $nick :$who is already enabled."
  906. return 0
  907. }
  908. setuser $whohand xtra auth 0
  909. puthelp "NOTICE $nick :$who is now enabled."
  910. return 0
  911. }
  912.  
  913. ### !DISABLE <nick>
  914.  
  915. proc pub_lol_disable {nick host hand chan arg} {
  916. set arg [charfilter $arg]
  917. global lol botnick
  918. if {![check $hand $nick $host]} {
  919. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  920. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  921. return 0
  922. }
  923. if {[llength $arg] != 1} {
  924. puthelp "NOTICE $nick :\002Usage:\002 [string trim $lol(cmdchar)]disable <nick>"
  925. return 0
  926. }
  927. set who [lindex $arg 0]
  928. set whohand [nick2hand $who $chan]
  929. if {![onchan $who $chan]} {
  930. puthelp "NOTICE $nick :Sorry, but I don't see $who in $chan."
  931. return 0
  932. }
  933. if {[strlwr $who] == [strlwr $botnick]} {
  934. puthelp "NOTICE $nick :I can't be disabled."
  935. return 0
  936. }
  937. if {$whohand == "*"} {
  938. puthelp "NOTICE $nick :I don't recognize $who as a user."
  939. return 0
  940. }
  941. if {[getuser $whohand xtra auth] == "DEAD"} {
  942. puthelp "NOTICE $nick :$who is already disabled."
  943. return 0
  944. }
  945. setuser $whohand xtra auth DEAD
  946. chattr $whohand -3
  947. puthelp "NOTICE $nick :$who is now disabled."
  948. return 0
  949. }
  950.  
  951. ### !ONLINE
  952.  
  953. proc pub_lol_online {nick host hand chan arg} {
  954. set arg [charfilter $arg]
  955. global lol server {server-online} uptime botnick
  956. if {![check $hand $nick $host]} {
  957. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  958. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  959. return 0
  960. }
  961. set ip [lindex [split $server ":"] 0]
  962. set port [lindex [split [lindex [split $server ":"] 1] "-"] 0]
  963. set timeon [time_diff ${server-online}]
  964. set numbots 0
  965. foreach bot [bots] { incr numbots }
  966. set numchans 0
  967. foreach ch [channels] { incr numchans }
  968. set msg ""
  969. append msg "*** ONLINE info !!! ***"
  970. append msg "I have not crashed since [time_diff $uptime] ;) "
  971. append msg "\002I'm on $ip since $timeon.\002 "
  972. append msg "I'm on $numchans chans. "
  973. if {$numbots != 0} {
  974. append msg "\002I'm linked with $numbots bots.\002 "
  975. } {
  976. append msg "\002I'm not linked with bots.\002 "
  977. }
  978. puthelp "PRIVMSG $chan :$msg"
  979. }
  980.  
  981. ### !BROADCAST <text>
  982.  
  983. proc pub_lol_broadcast {nick host hand chan arg} {
  984. set arg [charfilter $arg]
  985. global lol botnick
  986. if {![check $hand $nick $host]} {
  987. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  988. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  989. return 0
  990. }
  991. if {[llength $arg] < 1} {
  992. puthelp "NOTICE $nick :\002Usage:\002 [string trim $lol(cmdchar)]broadcast <text>"
  993. return 0
  994. }
  995. foreach c [channels] {
  996. if {[matchattr $hand o|o $c] && [strlwr $c] != [strlwr $chan]} {
  997. puthelp "PRIVMSG $c :\00314\[\003\002$nick\002\00314\]\003 $arg"
  998. }
  999. }
  1000. }
  1001.  
  1002. ### !STATS
  1003.  
  1004. proc pub_lol_stats {nick host han chan arg} {
  1005. set arg [charfilter $arg]
  1006. global lol botnick
  1007. if {![check $han $nick $host]} {
  1008. if {$lol(silent) == 1 || [checksilent $han]} {return 0}
  1009. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  1010. return 0
  1011. }
  1012. set op 0
  1013. set voice 0
  1014. set reco 0
  1015. set normal 0
  1016. set total 0
  1017. foreach vnick [chanlist $chan] {
  1018. if {[nick2hand $vnick $chan] != "*"} { incr reco }
  1019. if {[isop $vnick $chan]} { incr op }
  1020. if {[isvoice $vnick $chan] && ![isop $vnick $chan]} { incr voice }
  1021. if {![isvoice $vnick $chan] && ![isop $vnick $chan] && [nick2hand $vnick $chan] == "*" && [strlwr $vnick] != [strlwr $botnick]} {
  1022. incr normal
  1023. }
  1024. incr total
  1025. }
  1026. set reco_pc [expr (100 / $total) * $reco]
  1027. set op_pc [expr (100 / $total) * $op]
  1028. set voice_pc [expr (100 / $total) * $voice]
  1029. set normal_pc [expr (100 / $total) * $normal]
  1030. puthelp "PRIVMSG $chan :*** $chan STATS !!! *** \002Oped:\002 $op ($op_pc%) \002Voiced:\002 $voice ($voice_pc%) \002Bot users:\002 $reco ($reco_pc%) \002Other:\002 $normal ($normal_pc%) \002Total:\002 $total"
  1031. }
  1032.  
  1033. ### !SEEN <nick|hand>
  1034.  
  1035. proc pub_lol_seen {nick host hand chan arg} {
  1036. set arg [charfilter $arg]
  1037. global lol
  1038. if {![validuser $hand] && $lol(seen) == 0} {return 0}
  1039. if {[llength $arg] != 1} {
  1040. puthelp "NOTICE $nick :\002Usage\002: !seen <nick|hand>"
  1041. return 0
  1042. }
  1043. set who [lindex $arg 0]
  1044. set prefix "\0039\[\003\002$nick\002\0039\]\003 "
  1045. append msg $prefix [lol_seen $nick $hand $who $chan]
  1046. puthelp "PRIVMSG $chan :$msg"
  1047. return 0
  1048. }
  1049.  
  1050. ### !BANLIST
  1051.  
  1052. proc pub_lol_banlist {nick host hand chan arg} {
  1053. set arg [charfilter $arg]
  1054. global lol botnick
  1055. if {![check $hand $nick $host]} {
  1056. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  1057. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  1058. return 0
  1059. }
  1060. set num 1
  1061. puthelp "NOTICE $nick :*** $chan BANS info !!! ***"
  1062. foreach bans [banlist $chan] {
  1063. set victim [lindex $bans 0]
  1064. set why [lindex $bans 1]
  1065. set expire [lindex $bans 2]
  1066. set who [lindex $bans 5]
  1067. set remain [expr $expire - [unixtime]]
  1068. if {$remain > 0} {
  1069. set remain "expire in [time_diff2 $expire]."
  1070. } {
  1071. set remain "PermBan"
  1072. }
  1073. puthelp "NOTICE $nick :\002BAN $num:\002 $victim, $remain"
  1074. puthelp "NOTICE $nick :$who: $why"
  1075. incr num
  1076. }
  1077. if {$num == 1} {puthelp "NOTICE $nick :There are no bans on the bot for chan $chan."}
  1078. return 0
  1079. }
  1080.  
  1081. ### !BAN <nick|mask> [time] [reason]
  1082.  
  1083. proc pub_lol_ban {nick host hand chan arg} {
  1084. set arg [charfilter $arg]
  1085. global lol botnick
  1086. if {![check $hand $nick $host]} {
  1087. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  1088. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  1089. return 0
  1090. }
  1091. if {[llength $arg] < 1} {
  1092. puthelp "NOTICE $nick :\002Usage:\002 [string trim $lol(cmdchar)]ban <nick|mask> \[time\] \[reason\]"
  1093. return 0
  1094. }
  1095. set who [lindex $arg 0]
  1096. if {[strlwr $who] == [strlwr $botnick]} {
  1097. puthelp "NOTICE $nick :Yeah right, like I'm going to let you ban ME!"
  1098. return 0
  1099. }
  1100.  
  1101. set ti [lindex $arg 1]
  1102. if {[isnumber $ti]} {
  1103. set reason [lrange $arg 2 end]
  1104. } {
  1105. set ti ""
  1106. set reason [lrange $arg 1 end]
  1107. }
  1108.  
  1109. if {$reason == ""} { set reason "9,1» O0p9T0019M0u9S «" }
  1110.  
  1111. if {[onchan $who $chan]} {
  1112. if { $lol(bantype) == 0 } {
  1113. set ipmask [lindex [split [maskhost $who![getchanhost $who $chan]] "@"] 1]
  1114. set usermask [lindex [split [getchanhost $who $chan] "@"] 0]
  1115. set banmask *!*$usermask@$ipmask
  1116. } else {
  1117. set banmask [getchanhost $who $chan]
  1118. set banmask "*!*[string range $banmask [string first @ $banmask] e]"
  1119. }
  1120. } else {
  1121. set banmask [lindex $arg 0]
  1122. if {[string first "!" $banmask] == -1 && [string first "@" $banmask] == -1} {
  1123. if {[isnumber [string index $banmask 0]]} {
  1124. set banmask *!*@$banmask
  1125. } else {
  1126. set banmask $banmask*!*@*
  1127. }
  1128. }
  1129. if {[string first "!" $banmask] == -1} { set banmask *!*$banmask }
  1130. if {[string first "@" $banmask] == -1} { set banmask $banmask*@* }
  1131. }
  1132.  
  1133. if {![botisop $chan]} { return 0 }
  1134. putserv "MODE $chan +b $banmask"
  1135.  
  1136. foreach chanuser [chanlist $chan] {
  1137. if {[string match [strlwr $banmask] [strlwr "$chanuser![getchanhost $chanuser $chan]"]] && $chanuser != $botnick } {
  1138. if {[nick2hand $chanuser $chan] != "*"} {
  1139. if {$hand != [nick2hand $chanuser $chan]} {
  1140. if {[matchattr [nick2hand $chanuser $chan] o|o $chan] && ![matchattr $hand o|o $chan]} {
  1141. puthelp "NOTICE $nick :Sorry, you must be an operator to ban an operator."
  1142. return 0
  1143. }
  1144. if {([matchattr [nick2hand $chanuser $chan] m|m $chan] || [matchattr [nick2hand $who $chan] b]) && ![matchattr $hand m|m $chan]} {
  1145. puthelp "NOTICE $nick :Sorry, you must be a master to ban a master or a bot."
  1146. return 0
  1147. }
  1148. }
  1149. }
  1150. putkick $chan $chanuser $reason
  1151. }
  1152. }
  1153.  
  1154. switch $ti {
  1155. ""
  1156. {
  1157. newchanban $chan $banmask $nick $reason
  1158. puthelp "NOTICE $nick :New mask added : $banmask"
  1159. }
  1160. 0
  1161. {
  1162. newchanban $chan $banmask $nick $reason $ti
  1163. puthelp "NOTICE $nick :New mask added permanently : $banmask"
  1164. }
  1165. default
  1166. {
  1167. newchanban $chan $banmask $nick $reason $ti
  1168. puthelp "NOTICE $nick :New mask added for $ti minutes : $banmask"
  1169. }
  1170. }
  1171. return 0
  1172. }
  1173.  
  1174. ### !UNBAN <mask|number>
  1175.  
  1176. proc pub_lol_unban {nick host hand chan arg} {
  1177. set arg [charfilter $arg]
  1178. global lol botnick
  1179. if {![check $hand $nick $host]} {
  1180. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  1181. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  1182. return 0
  1183. }
  1184. if {[llength $arg] != 1} {
  1185. puthelp "NOTICE $nick :\002Usage:\002 [string trim $lol(cmdchar)]unban <mask|number>"
  1186. return 0
  1187. }
  1188. set find 0
  1189. set mask [lindex $arg 0]
  1190.  
  1191. if {[isnumber $mask]} {
  1192. foreach bans [banlist $chan] {
  1193. incr find
  1194. if {$find == $mask} { set mask [lindex $bans 0] ; break }
  1195. }
  1196. if {[isnumber $mask]} {
  1197. puthelp "NOTICE $nick :There is no ban number $mask in this chan, type !banlist."
  1198. return 0
  1199. }
  1200. } else { if {[string first "!" $mask] == -1 && [string first "@" $mask] == -1} {
  1201. if {[isnumber [string index $mask 0]]} { set mask *!*@$mask
  1202. } else { set mask $mask*!*@* }
  1203. }
  1204. if {[string first "!" $mask] == -1} {set mask *!*$mask}
  1205. if {[string first "@" $mask] == -1} {set mask $mask*@*}
  1206. }
  1207.  
  1208. if {[isban $mask $chan]} {
  1209. killchanban $chan $mask
  1210. killban $mask
  1211. puthelp "NOTICE $nick :Ban successfully removed on $chan."
  1212. return 0
  1213. }
  1214.  
  1215. foreach bans [chanbans $chan] {
  1216. set victim [lindex $bans 0]
  1217. if {[strlwr $victim] == [strlwr $mask]} {set find 1}
  1218. }
  1219.  
  1220. if {[botisop $chan] && $find == 1} {
  1221. pushmode $chan -b $mask
  1222. puthelp "NOTICE $nick :Ban successfully removed."
  1223. return 0
  1224. }
  1225.  
  1226. puthelp "NOTICE $nick :No such ban on $chan."
  1227. return 0
  1228. }
  1229.  
  1230. ### !MODE <chanmode>
  1231.  
  1232. proc pub_lol_chan {nick host hand chan mode} {
  1233. if {![botisop $chan]} {return 0}
  1234. set arg [charfilter $mode]
  1235. global lol botnick
  1236. if {![check $hand $nick $host]} {
  1237. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  1238. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  1239. return 0
  1240. }
  1241. if {[llength $arg] < 1} {
  1242. puthelp "NOTICE $nick :\002Usage:\002 [string trim $lol(cmdchar)]mode <chanmode>"
  1243. return 0
  1244. }
  1245. if {$lol(chankey) == 1} {
  1246. if {[string first k [lindex $mode 0]] != -1} {
  1247. set posmode [string first k [lindex $mode 0]]
  1248. if {[string first l [lindex $mode 0]] != -1} {
  1249. set poslim [string first l [lindex $mode 0]]
  1250. if {$posmode < $poslim} {
  1251. channel set $chan need-key "chankey $chan [lindex $mode 1]"
  1252. } {
  1253. channel set $chan need-key "chankey $chan [lindex $mode 2]"
  1254. }
  1255. } {
  1256. channel set $chan need-key "chankey $chan [lindex $mode 1]"
  1257. }
  1258. }
  1259. }
  1260. putserv "MODE $chan $mode"
  1261. return 0
  1262. }
  1263.  
  1264. ### !ADDUSER <nick> [hand]
  1265.  
  1266. proc pub_lol_adduser {me b c chan arg} {
  1267. set arg [charfilter $arg]
  1268. global lol botnick
  1269. if {![check $c $me $b]} {
  1270. if {$lol(silent) == 1 || [checksilent $c]} {return 0}
  1271. puthelp "NOTICE $me :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  1272. return 0
  1273. }
  1274. if {[llength $arg] < 1} {
  1275. puthelp "NOTICE $me :\002Usage:\002 [string trim $lol(cmdchar)]adduser <nick> \[hand\]"
  1276. return 0
  1277. }
  1278. set nick [lindex $arg 0]
  1279. set alternate [lindex $arg 1]
  1280. set bot [strlwr $botnick]
  1281. set hostmask "$nick![getchanhost $nick $chan]"
  1282. set hand [nick2hand $nick $chan]
  1283. if {![onchan $nick $chan]} {
  1284. puthelp "NOTICE $me :Sorry, but I don't see $nick in $chan."
  1285. return 0
  1286. }
  1287. if {[strlwr $nick] == $bot} {
  1288. puthelp "NOTICE $me :Sorry, but I can't adduser myself."
  1289. return 0
  1290. }
  1291. if {[getting-users]} {
  1292. puthelp "NOTICE $me :Sorry, but I'm transferring the userfile, try later."
  1293. return 0
  1294. }
  1295. if {[validuser $hand]} {
  1296. puthelp "NOTICE $me :$nick is already recognized with this hand: $hand"
  1297. } {
  1298. if {[validuser $nick] && $alternate == ""} {
  1299. puthelp "NOTICE $me :The hand $nick already exist. \002Usage:\002 !adduser <nick> <hand> "
  1300. return 0
  1301. }
  1302. if {$alternate != ""} {
  1303. if {[validuser $alternate]} {
  1304. puthelp "NOTICE $me :The hand $alternate already exists. Choose another. \002Usage:\002 !adduser <nick> <hand>"
  1305. return 0
  1306. }
  1307. adduser $alternate [maskhost $hostmask]
  1308. puthelp "NOTICE $me :New user: $alternate ([maskhost $hostmask])"
  1309. puthelp "NOTICE $nick :You have been added in $botnick userlist by $me with the hand: $alternate."
  1310. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick pass <your_password>\002"
  1311. return 0
  1312. }
  1313. adduser $nick [maskhost $hostmask]
  1314. puthelp "NOTICE $me :New user: $nick ([maskhost $hostmask])"
  1315. puthelp "NOTICE $nick :You have been added in $botnick userlist by $me with the hand: $nick."
  1316. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick pass <your_password>\002"
  1317. return 0
  1318. }
  1319. if {$alternate != ""} {
  1320. if {[validuser $alternate]} {
  1321. puthelp "NOTICE $me :The hand $alternate already exist. \002Usage:\002 !adduser <nick> <hand>"
  1322. return 0
  1323. }
  1324. adduser $alternate [maskhost $hostmask]
  1325. puthelp "NOTICE $me :New user: $alternate ([maskhost $hostmask])"
  1326. puthelp "NOTICE $nick :You have been added in $botnick userlist by $me with the hand: $alternate."
  1327. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick PASS <your_password>\002"
  1328. return 0
  1329. }
  1330. return 0
  1331. }
  1332.  
  1333. ### !DELUSER <nick>
  1334.  
  1335. proc pub_lol_deluser {me b c chan arg} {
  1336. set arg [charfilter $arg]
  1337. global lol botnick
  1338. if {![check $c $me $b]} {
  1339. if {$lol(silent) == 1 || [checksilent $c]} {return 0}
  1340. puthelp "NOTICE $me :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  1341. return 0
  1342. }
  1343. if {[llength $arg] != 1} {
  1344. puthelp "NOTICE $me :\002Usage:\002 [string trim $lol(cmdchar)]deluser <nick>"
  1345. return 0
  1346. }
  1347. set nick [lindex $arg 0]
  1348. set bot [strlwr $botnick]
  1349. set hand [nick2hand $nick $chan]
  1350. if {![onchan $nick $chan]} {
  1351. puthelp "NOTICE $me :Sorry, but I don't see $nick in $chan."
  1352. return 0
  1353. }
  1354. if {[strlwr $nick] == $bot} {
  1355. puthelp "NOTICE $me :Yeah right, like I'm going to let you delete ME!"
  1356. return 0
  1357. }
  1358. if {[getting-users]} {
  1359. puthelp "NOTICE $me :Sorry, but I'm transferring the userfile, try later."
  1360. return 0
  1361. }
  1362. if {![validuser $hand]} {
  1363. puthelp "NOTICE $me :$nick is not a registered user."
  1364. return 0
  1365. }
  1366. if {[matchattr $hand n]} {
  1367. puthelp "NOTICE $me :You can't delete a bot owner."
  1368. return 0
  1369. }
  1370. deluser $hand
  1371. boot $hand "You have been deleted"
  1372. puthelp "NOTICE $me :$nick has been removed from the userlist."
  1373. puthelp "NOTICE $nick :You have been removed from the userlist by $me."
  1374. if {[botisop $chan]} {pushmode }
  1375. return 0
  1376. }
  1377.  
  1378. ### !ADDOWNER <nick> [hand]
  1379.  
  1380. proc pub_lol_addowner {me b c chan arg} {
  1381. set arg [charfilter $arg]
  1382. global lol botnick
  1383. if {![check $c $me $b]} {
  1384. if {$lol(silent) == 1 || [checksilent $c]} {return 0}
  1385. puthelp "NOTICE $me :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  1386. return 0
  1387. }
  1388. if {[llength $arg] < 1} {
  1389. puthelp "NOTICE $me :\002Usage:\002 [string trim $lol(cmdchar)]addowner <nick> \[hand\]"
  1390. return 0
  1391. }
  1392. set nick [lindex $arg 0]
  1393. set alternate [lindex $arg 1]
  1394. set bot [strlwr $botnick]
  1395. set hostmask "$nick![getchanhost $nick $chan]"
  1396. set hand [nick2hand $nick $chan]
  1397. if {![onchan $nick $chan]} {
  1398. puthelp "NOTICE $me :Sorry, but I don't see $nick in $chan."
  1399. return 0
  1400. }
  1401. if {[strlwr $nick] == $bot} {
  1402. puthelp "NOTICE $me :Sorry, but I can't addowner myself."
  1403. return 0
  1404. }
  1405. if {[getting-users]} {
  1406. puthelp "NOTICE $me :Sorry, but I'm transferring the userfile, try later."
  1407. return 0
  1408. }
  1409. if {![validuser $hand]} {
  1410. if {[validuser $nick] && $alternate == ""} {
  1411. puthelp "NOTICE $me :The hand $nick already exists. \002Usage:\002 !addowner <nick> <hand>"
  1412. return 0
  1413. }
  1414. if {$alternate != ""} {
  1415. if {[validuser $alternate]} {
  1416. puthelp "NOTICE $me :The hand $alternate already exists. Choose another. \002Usage:\002 !addowner <nick> <hand>"
  1417. return 0
  1418. }
  1419. adduser $alternate [maskhost $hostmask]
  1420. chattr $alternate +p|+n $chan
  1421. puthelp "NOTICE $me :New user: $alternate ([maskhost $hostmask])"
  1422. puthelp "NOTICE $me :$nick added to the $chan ownerlist and party-line with the hand: $alternate."
  1423. puthelp "NOTICE $nick :You have been added to the $chan ownerlist and party-line by $me with the hand: $alternate."
  1424. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick pass <your_password>\002"
  1425. if {[botisop $chan] && ![isop $nick $chan]} { pushmode $chan +o $nick }
  1426. return 0
  1427. }
  1428. adduser $nick [maskhost $hostmask]
  1429. chattr $nick +p|+n $chan
  1430. puthelp "NOTICE $me :New user: $nick ([maskhost $hostmask])"
  1431. puthelp "NOTICE $me :$nick added to the $chan ownerlist and party-line with the hand: $nick."
  1432. puthelp "NOTICE $nick :You have been added to the $chan ownerlist and party-line by $me with the hand: $nick."
  1433. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick pass <your_password>\002"
  1434. if {[botisop $chan] && ![isop $nick $chan]} { pushmode $chan +o $nick }
  1435. return 0
  1436. }
  1437. if {$alternate != ""} {
  1438. if {[validuser $alternate]} {
  1439. puthelp "NOTICE $me :The hand $alternate already exists. \002Usage:\002 !addowner <nick> <hand>"
  1440. return 0
  1441. }
  1442. adduser $alternate [maskhost $hostmask]
  1443. chattr $alternate +p|+n $chan
  1444. puthelp "NOTICE $me :New user: $alternate ([maskhost $hostmask])"
  1445. puthelp "NOTICE $me :$nick added to the $chan ownerlist and party-line with the hand: $alternate."
  1446. puthelp "NOTICE $nick :You have been added to the $chan ownerlist and party-line by $me with the hand: $alternate."
  1447. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick PASS <your_password>\002"
  1448. if {[botisop $chan] && ![isop $nick $chan]} { pushmode $chan +o $nick }
  1449. return 0
  1450. }
  1451. if {[matchattr $hand -|+n $chan]} {
  1452. puthelp "NOTICE $me :$nick is already an owner in $chan with this hand: $hand"
  1453. } {
  1454. chattr $hand -|+n $chan
  1455. puthelp "NOTICE $me :$nick added to the $chan ownerlist with this hand: $hand."
  1456. puthelp "NOTICE $nick :You have been added to the $chan ownerlist by $me."
  1457. }
  1458. if {[botisop $chan] && ![isop $nick $chan]} { pushmode $chan +o $nick ; return 0 }
  1459. return 0
  1460. }
  1461.  
  1462. ### !DELOWNER <nick>
  1463.  
  1464. proc pub_lol_delowner {me b c chan arg} {
  1465. set arg [charfilter $arg]
  1466. global lol botnick
  1467. if {![check $c $me $b]} {
  1468. if {$lol(silent) == 1 || [checksilent $c]} {return 0}
  1469. puthelp "NOTICE $me :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  1470. return 0
  1471. }
  1472. if {[llength $arg] != 1} {
  1473. puthelp "NOTICE $me :\002Usage:\002 [string trim $lol(cmdchar)]delowner <nick>"
  1474. return 0
  1475. }
  1476. set nick [lindex $arg 0]
  1477. set bot [strlwr $botnick]
  1478. set hand [nick2hand $nick $chan]
  1479. if {![onchan $nick $chan]} {
  1480. puthelp "NOTICE $me :Sorry, but I don't see $nick in $chan."
  1481. return 0
  1482. }
  1483. if {[strlwr $nick] == $bot} {
  1484. puthelp "NOTICE $me :Yeah right, like I'm going to let you delowner ME!"
  1485. return 0
  1486. }
  1487. if {![validuser $hand]} {
  1488. puthelp "NOTICE $me :$nick is not a registered user."
  1489. if {[botisop $chan] && [isop $nick $chan]} { pushmode }
  1490. return 0
  1491. }
  1492. if {[getting-users]} {
  1493. puthelp "NOTICE $me :Sorry, but I'm transferring the userfile, try later."
  1494. return 0
  1495. }
  1496. if {![matchattr $hand -|+n $chan]} {
  1497. puthelp "NOTICE $me :$nick is not an owner in $chan"
  1498. } {
  1499. chattr $hand -|-n $chan
  1500. puthelp "NOTICE $me :$nick has been removed from the $chan ownerlist."
  1501. puthelp "NOTICE $nick :You have been removed from the $chan ownerlist by $me."
  1502. }
  1503. return 0
  1504. }
  1505.  
  1506.  
  1507. ### !ADDMASTER <nick> [hand]
  1508.  
  1509. proc pub_lol_addmaster {me b c chan arg} {
  1510. set arg [charfilter $arg]
  1511. global lol botnick
  1512. if {![check $c $me $b]} {
  1513. if {$lol(silent) == 1 || [checksilent $c]} {return 0}
  1514. puthelp "NOTICE $me :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  1515. return 0
  1516. }
  1517. if {[llength $arg] < 1} {
  1518. puthelp "NOTICE $me :\002Usage:\002 [string trim $lol(cmdchar)]addmaster <nick> \[hand\]"
  1519. return 0
  1520. }
  1521. set nick [lindex $arg 0]
  1522. set alternate [lindex $arg 1]
  1523. set bot [strlwr $botnick]
  1524. set hostmask "$nick![getchanhost $nick $chan]"
  1525. set hand [nick2hand $nick $chan]
  1526. if {![onchan $nick $chan]} {
  1527. puthelp "NOTICE $me :Sorry, but I don't see $nick in $chan."
  1528. return 0
  1529. }
  1530. if {[strlwr $nick] == $bot} {
  1531. puthelp "NOTICE $me :Sorry, but I can't addmaster myself."
  1532. return 0
  1533. }
  1534. if {[getting-users]} {
  1535. puthelp "NOTICE $me :Sorry, but I'm transferring the userfile, try later."
  1536. return 0
  1537. }
  1538. if {![validuser $hand]} {
  1539. if {[validuser $nick] && $alternate == ""} {
  1540. puthelp "NOTICE $me :The hand $nick already exists. \002Usage:\002 !addmaster <nick> <hand>"
  1541. return 0
  1542. }
  1543. if {$alternate != ""} {
  1544. if {[validuser $alternate]} {
  1545. puthelp "NOTICE $me :The hand $alternate already exists. Choose another. \002Usage:\002 !addmaster <nick> <hand>"
  1546. return 0
  1547. }
  1548. adduser $alternate [maskhost $hostmask]
  1549. chattr $alternate +p|+m $chan
  1550. puthelp "NOTICE $me :New user: $alternate ([maskhost $hostmask])"
  1551. puthelp "NOTICE $me :$nick added to the $chan masterlist and party-line with the hand: $alternate."
  1552. puthelp "NOTICE $nick :You have been added to the $chan masterlist and party-line by $me with the hand: $alternate."
  1553. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick pass <your_password>\002"
  1554. if {[botisop $chan] && ![isop $nick $chan]} { pushmode $chan +o $nick }
  1555. return 0
  1556. }
  1557. adduser $nick [maskhost $hostmask]
  1558. chattr $nick +p|+m $chan
  1559. puthelp "NOTICE $me :New user: $nick ([maskhost $hostmask])"
  1560. puthelp "NOTICE $me :$nick added to the $chan masterlist and party-line with the hand: $nick."
  1561. puthelp "NOTICE $nick :You have been added to the $chan masterlist and party-line by $me with the hand: $nick."
  1562. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick pass <your_password>\002"
  1563. if {[botisop $chan] && ![isop $nick $chan]} { pushmode $chan +o $nick }
  1564. return 0
  1565. }
  1566. if {$alternate != ""} {
  1567. if {[validuser $alternate]} {
  1568. puthelp "NOTICE $me :The hand $alternate already exists. \002Usage:\002 !addmaster <nick> <hand>"
  1569. return 0
  1570. }
  1571. adduser $alternate [maskhost $hostmask]
  1572. chattr $alternate +p|+m $chan
  1573. puthelp "NOTICE $me :New user: $alternate ([maskhost $hostmask])"
  1574. puthelp "NOTICE $me :$nick added to the $chan masterlist and party-line with the hand: $alternate."
  1575. puthelp "NOTICE $nick :You have been added to the $chan masterlist and party-line by $me with the hand: $alternate."
  1576. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick PASS <your_password>\002"
  1577. if {[botisop $chan] && ![isop $nick $chan]} { pushmode $chan +o $nick }
  1578. return 0
  1579. }
  1580. if {[matchattr $hand -|+m $chan]} {
  1581. puthelp "NOTICE $me :$nick is already a master in $chan with this hand: $hand"
  1582. } {
  1583. chattr $hand -|+m $chan
  1584. puthelp "NOTICE $me :$nick added to the $chan masterlist with this hand: $hand."
  1585. puthelp "NOTICE $nick :You have been added to the $chan masterlist by $me."
  1586. }
  1587. if {[botisop $chan] && ![isop $nick $chan]} { pushmode $chan +o $nick ; return 0 }
  1588. return 0
  1589. }
  1590.  
  1591. ### !DELMASTER <nick>
  1592.  
  1593. proc pub_lol_delmaster {me b c chan arg} {
  1594. set arg [charfilter $arg]
  1595. global lol botnick
  1596. if {![check $c $me $b]} {
  1597. if {$lol(silent) == 1 || [checksilent $c]} {return 0}
  1598. puthelp "NOTICE $me :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  1599. return 0
  1600. }
  1601. if {[llength $arg] != 1} {
  1602. puthelp "NOTICE $me :\002Usage:\002 [string trim $lol(cmdchar)]delmaster <nick>"
  1603. return 0
  1604. }
  1605. set nick [lindex $arg 0]
  1606. set bot [strlwr $botnick]
  1607. set hand [nick2hand $nick $chan]
  1608. if {![onchan $nick $chan]} {
  1609. puthelp "NOTICE $me :Sorry, but I don't see $nick in $chan."
  1610. return 0
  1611. }
  1612. if {[strlwr $nick] == $bot} {
  1613. puthelp "NOTICE $me :Yeah right, like I'm going to let you delmaster ME!"
  1614. return 0
  1615. }
  1616. if {![validuser $hand]} {
  1617. puthelp "NOTICE $me :$nick is not a registered user."
  1618. if {[botisop $chan] && [isop $nick $chan]} { pushmode }
  1619. return 0
  1620. }
  1621. if {[getting-users]} {
  1622. puthelp "NOTICE $me :Sorry, but I'm transferring the userfile, try later."
  1623. return 0
  1624. }
  1625. if {![matchattr $hand -|+m $chan]} {
  1626. puthelp "NOTICE $me :$nick is not a master in $chan"
  1627. } {
  1628. chattr $hand -|-m $chan
  1629. puthelp "NOTICE $me :$nick has been removed from the $chan masterlist."
  1630. puthelp "NOTICE $nick :You have been removed from the $chan masterlist by $me."
  1631. }
  1632. return 0
  1633. }
  1634.  
  1635. ### !ADDFRIEND <nick> [hand]
  1636.  
  1637. proc pub_lol_addfriend {me b c chan arg} {
  1638. set arg [charfilter $arg]
  1639. global lol botnick
  1640. if {![check $c $me $b]} {
  1641. if {$lol(silent) == 1 || [checksilent $c]} {return 0}
  1642. puthelp "NOTICE $me :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  1643. return 0
  1644. }
  1645. if {[llength $arg] < 1} {
  1646. puthelp "NOTICE $me :\002Usage:\002 [string trim $lol(cmdchar)]addfriend <nick> \[hand\]"
  1647. return 0
  1648. }
  1649. set nick [lindex $arg 0]
  1650. set alternate [lindex $arg 1]
  1651. set bot [strlwr $botnick]
  1652. set hostmask "$nick![getchanhost $nick $chan]"
  1653. set hand [nick2hand $nick $chan]
  1654. if {![onchan $nick $chan]} {
  1655. puthelp "NOTICE $me :Sorry, but I don't see $nick in $chan."
  1656. return 0
  1657. }
  1658. if {[strlwr $nick] == $bot} {
  1659. puthelp "NOTICE $me :Sorry, but I can't addfriend myself."
  1660. return 0
  1661. }
  1662. if {[getting-users]} {
  1663. puthelp "NOTICE $me :Sorry, but I'm transferring the userfile, try later."
  1664. return 0
  1665. }
  1666. if {![validuser $hand]} {
  1667. if {[validuser $nick] && $alternate == ""} {
  1668. puthelp "NOTICE $me :The hand $nick already exists. \002Usage:\002 !addfriend <nick> <hand>"
  1669. return 0
  1670. }
  1671. if {$alternate != ""} {
  1672. if {[validuser $alternate]} {
  1673. puthelp "NOTICE $me :The hand $alternate already exists. Choose another. \002Usage:\002 !addfriend <nick> <hand>"
  1674. return 0
  1675. }
  1676. adduser $alternate [maskhost $hostmask]
  1677. chattr $alternate +p|+f $chan
  1678. puthelp "NOTICE $me :New user: $alternate ([maskhost $hostmask])"
  1679. puthelp "NOTICE $me :$nick added to the $chan friendlist and party-line with the hand: $alternate."
  1680. puthelp "NOTICE $nick :You have been added to the $chan friendlist and party-line by $me with the hand: $alternate."
  1681. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick pass <your_password>\002"
  1682. return 0
  1683. }
  1684. adduser $nick [maskhost $hostmask]
  1685. chattr $nick +p|+f $chan
  1686. puthelp "NOTICE $me :New user: $nick ([maskhost $hostmask])"
  1687. puthelp "NOTICE $me :$nick added to the $chan friendlist and party-line with the hand: $nick."
  1688. puthelp "NOTICE $nick :You have been added to the $chan friendlist and party-line by $me with the hand: $nick."
  1689. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick pass <your_password>\002"
  1690. return 0
  1691. }
  1692. if {$alternate != ""} {
  1693. if {[validuser $alternate]} {
  1694. puthelp "NOTICE $me :The hand $alternate already exists. \002Usage:\002 !addfriend <nick> <hand>"
  1695. return 0
  1696. }
  1697. adduser $alternate [maskhost $hostmask]
  1698. chattr $alternate +p|+f $chan
  1699. puthelp "NOTICE $me :New user: $alternate ([maskhost $hostmask])"
  1700. puthelp "NOTICE $me :$nick added to the $chan friendlist and party-line with the hand: $alternate."
  1701. puthelp "NOTICE $nick :You have been added to the $chan friendlist and party-line by $me with the hand: $alternate."
  1702. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick PASS <your_password>\002"
  1703. return 0
  1704. }
  1705. if {[matchattr $hand -|+f $chan]} {
  1706. puthelp "NOTICE $me :$nick is already a friend in $chan with this hand: $hand"
  1707. } {
  1708. chattr $hand -|+f $chan
  1709. puthelp "NOTICE $me :$nick added to the $chan friendlist with this hand: $hand."
  1710. puthelp "NOTICE $nick :You have been added to the $chan friendlist by $me."
  1711. }
  1712. return 0
  1713. }
  1714.  
  1715. ### !DELFRIEND <nick>
  1716.  
  1717. proc pub_lol_delfriend {me b c chan arg} {
  1718. set arg [charfilter $arg]
  1719. global lol botnick
  1720. if {![check $c $me $b]} {
  1721. if {$lol(silent) == 1 || [checksilent $c]} {return 0}
  1722. puthelp "NOTICE $me :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  1723. return 0
  1724. }
  1725. if {[llength $arg] != 1} {
  1726. puthelp "NOTICE $me :\002Usage:\002 [string trim $lol(cmdchar)]delfriend <nick>"
  1727. return 0
  1728. }
  1729. set nick [lindex $arg 0]
  1730. set bot [strlwr $botnick]
  1731. set hand [nick2hand $nick $chan]
  1732. if {![onchan $nick $chan]} {
  1733. puthelp "NOTICE $me :Sorry, but I don't see $nick in $chan."
  1734. return 0
  1735. }
  1736. if {[strlwr $nick] == $bot} {
  1737. puthelp "NOTICE $me :Yeah right, like I'm going to let you delfriend ME!"
  1738. return 0
  1739. }
  1740. if {![validuser $hand]} {
  1741. puthelp "NOTICE $me :$nick is not a registered user."
  1742. return 0
  1743. }
  1744. if {[getting-users]} {
  1745. puthelp "NOTICE $me :Sorry, but I'm transferring the userfile, try later."
  1746. return 0
  1747. }
  1748. if {![matchattr $hand -|+f $chan]} {
  1749. puthelp "NOTICE $me :$nick is not a friend in $chan"
  1750. } {
  1751. chattr $hand -|-f $chan
  1752. puthelp "NOTICE $me :$nick has been removed from the $chan friendlist."
  1753. puthelp "NOTICE $nick :You have been removed from the $chan friendlist by $me."
  1754. }
  1755. return 0
  1756. }
  1757.  
  1758. ### !ADDOP <nick> [hand]
  1759.  
  1760. proc pub_lol_addop {me b c chan arg} {
  1761. set arg [charfilter $arg]
  1762. global lol botnick
  1763. if {![check $c $me $b]} {
  1764. if {$lol(silent) == 1 || [checksilent $c]} {return 0}
  1765. puthelp "NOTICE $me :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  1766. return 0
  1767. }
  1768. if {[llength $arg] < 1} {
  1769. puthelp "NOTICE $me :\002Usage:\002 [string trim $lol(cmdchar)]addop <nick> \[hand\]"
  1770. return 0
  1771. }
  1772. set nick [lindex $arg 0]
  1773. set alternate [lindex $arg 1]
  1774. set bot [strlwr $botnick]
  1775. set hostmask "$nick![getchanhost $nick $chan]"
  1776. set hand [nick2hand $nick $chan]
  1777. if {![onchan $nick $chan]} {
  1778. puthelp "NOTICE $me :Sorry, but I don't see $nick in $chan."
  1779. return 0
  1780. }
  1781. if {[strlwr $nick] == $bot} {
  1782. puthelp "NOTICE $me :Sorry, but I can't addop myself."
  1783. return 0
  1784. }
  1785. if {[getting-users]} {
  1786. puthelp "NOTICE $me :Sorry, but I'm transferring the userfile, try later."
  1787. return 0
  1788. }
  1789. if {![validuser $hand]} {
  1790. if {[validuser $nick] && $alternate == ""} {
  1791. puthelp "NOTICE $me :The hand $nick already exists. \002Usage:\002 !addop <nick> <hand>"
  1792. return 0
  1793. }
  1794. if {$alternate != ""} {
  1795. if {[validuser $alternate]} {
  1796. puthelp "NOTICE $me :The hand $alternate already exists. Choose another. \002Usage:\002 !addop <nick> <hand>"
  1797. return 0
  1798. }
  1799. adduser $alternate [maskhost $hostmask]
  1800. chattr $alternate +p|+o $chan
  1801. puthelp "NOTICE $me :New user: $alternate ([maskhost $hostmask])"
  1802. puthelp "NOTICE $me :$nick added to the $chan oplist and party-line with the hand: $alternate."
  1803. puthelp "NOTICE $nick :You have been added to the $chan oplist and party-line by $me with the hand: $alternate."
  1804. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick pass <your_password>\002"
  1805. if {[botisop $chan] && ![isop $nick $chan]} {
  1806. pushmode $chan +o $nick
  1807. }
  1808. return 0
  1809. }
  1810. adduser $nick [maskhost $hostmask]
  1811. chattr $nick +p|+o $chan
  1812. puthelp "NOTICE $me :New user: $nick ([maskhost $hostmask])"
  1813. puthelp "NOTICE $me :$nick added to the $chan oplist and party-line with the hand: $nick."
  1814. puthelp "NOTICE $nick :You have been added to the $chan oplist and party-line by $me with the hand: $nick."
  1815. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick pass <your_password>\002"
  1816. if {[botisop $chan] && ![isop $nick $chan]} {
  1817. pushmode $chan +o $nick
  1818. }
  1819. return 0
  1820. }
  1821. if {$alternate != ""} {
  1822. if {[validuser $alternate]} {
  1823. puthelp "NOTICE $me :The hand $alternate already exists. \002Usage:\002 !addop <nick> <hand>"
  1824. return 0
  1825. }
  1826. adduser $alternate [maskhost $hostmask]
  1827. chattr $alternate +p|+o $chan
  1828. puthelp "NOTICE $me :New user: $alternate ([maskhost $hostmask])"
  1829. puthelp "NOTICE $me :$nick added to the $chan oplist and party-line with the hand: $alternate."
  1830. puthelp "NOTICE $nick :You have been added to the $chan oplist and party-line by $me with the hand: $alternate."
  1831. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick PASS <your_password>\002"
  1832. if {[botisop $chan] && ![isop $nick $chan]} {
  1833. pushmode $chan +o $nick
  1834. }
  1835. return 0
  1836. }
  1837. if {[matchattr $hand -|+o $chan]} {
  1838. puthelp "NOTICE $me :$nick is already an op in $chan with this hand: $hand"
  1839. } {
  1840. chattr $hand -|+o $chan
  1841. puthelp "NOTICE $me :$nick added to the $chan oplist with this hand: $hand."
  1842. puthelp "NOTICE $nick :You have been added to the $chan oplist by $me."
  1843. }
  1844. if {[botisop $chan] && ![isop $nick $chan]} { pushmode $chan +o $nick ; return 0 }
  1845. return 0
  1846. }
  1847.  
  1848. ### !DELOP <nick>
  1849.  
  1850. proc pub_lol_delop {me b c chan arg} {
  1851. set arg [charfilter $arg]
  1852. global lol botnick
  1853. if {![check $c $me $b]} {
  1854. if {$lol(silent) == 1 || [checksilent $c]} {return 0}
  1855. puthelp "NOTICE $me :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  1856. return 0
  1857. }
  1858. if {[llength $arg] != 1} {
  1859. puthelp "NOTICE $me :\002Usage:\002 [string trim $lol(cmdchar)]delop <nick>"
  1860. return 0
  1861. }
  1862. set nick [lindex $arg 0]
  1863. set bot [strlwr $botnick]
  1864. set hand [nick2hand $nick $chan]
  1865. if {![onchan $nick $chan]} {
  1866. puthelp "NOTICE $me :Sorry, but I don't see $nick in $chan."
  1867. return 0
  1868. }
  1869. if {[strlwr $nick] == $bot} {
  1870. puthelp "NOTICE $me :Yeah right, like I'm going to let you delop ME!"
  1871. return 0
  1872. }
  1873. if {![validuser $hand]} {
  1874. puthelp "NOTICE $me :$nick is not a registered user."
  1875. if {[botisop $chan] && [isop $nick $chan]} { pushmode }
  1876. return 0
  1877. }
  1878. if {[getting-users]} {
  1879. puthelp "NOTICE $me :Sorry, but I'm transferring the userfile, try later."
  1880. return 0
  1881. }
  1882. if {![matchattr $hand -|+o $chan]} {
  1883. puthelp "NOTICE $me :$nick is not an op in $chan"
  1884. } {
  1885. chattr $hand -|- $chan
  1886. puthelp "NOTICE $me :$nick has been removed from the $chan oplist."
  1887. puthelp "NOTICE $nick :You have been removed from the $chan oplist by $me."
  1888. }
  1889. if {[botisop $chan]} {
  1890. if {[botisop $chan] && [isop $nick $chan]} { pushmode }
  1891. return 0
  1892. }
  1893. return 0
  1894. }
  1895.  
  1896. ### !OP [nick]
  1897.  
  1898. proc pub_lol_op {a b c chan arg} {
  1899. if {![botisop $chan]} {return 0}
  1900. set arg [charfilter $arg]
  1901. global lol botnick
  1902. if {![check $c $a $b]} {
  1903. if {$lol(silent) == 1 || [checksilent $c]} {return 0}
  1904. puthelp "NOTICE $a :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  1905. return 0
  1906. }
  1907. set nick [lindex $arg 0]
  1908. set hand [nick2hand $nick $chan]
  1909. if {$nick == ""} {
  1910. if {![isop $a $chan]} { pushmode $chan +o $a }
  1911. return 0
  1912. }
  1913.  
  1914. if {![onchan $nick $chan]} {
  1915. puthelp "NOTICE $a :Sorry, but I don't see $nick in $chan."
  1916. return 0
  1917. }
  1918. if {![isop $nick $chan] && [strlwr $nick] != [strlwr $botnick]} { pushmode $chan +o $nick ; return 0 }
  1919. return 0
  1920. }
  1921.  
  1922. ### !DEOP [nick]
  1923.  
  1924. proc pub_lol_deop {a b c chan arg} {
  1925. if {![botisop $chan]} {return 0}
  1926. set arg [charfilter $arg]
  1927. global lol botnick
  1928. if {![check $c $a $b]} {
  1929. if {$lol(silent) == 1 || [checksilent $c]} {return 0}
  1930. puthelp "NOTICE $a :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  1931. return 0
  1932. }
  1933. set nick [lindex $arg 0]
  1934. set bot [strlwr $botnick]
  1935. set hand [nick2hand $nick $chan]
  1936. if {$nick == ""} {
  1937. if {[isop $a $chan]} { pushmode }
  1938. return 0
  1939. }
  1940. if {![onchan $nick $chan]} {
  1941. puthelp "NOTICE $a :Sorry, but I don't see $nick in $chan."
  1942. return 0
  1943. }
  1944. if {[strlwr $nick] == $bot} {
  1945. puthelp "NOTICE $a :Yeah right, like I'm going to let you deop ME!"
  1946. return 0
  1947. }
  1948. if {$hand != "*"} {
  1949. if {$c != $hand} {
  1950. if {[matchattr $hand o|o $chan] && ![matchattr $c o|o $chan]} {
  1951. puthelp "NOTICE $a :Sorry, you must to be an operator to deop an operator."
  1952. return 0
  1953. }
  1954. if {([matchattr $hand m|m $chan] || [matchattr $hand b]) && ![matchattr $c m|m $chan]} {
  1955. puthelp "NOTICE $a :Sorry, you must to be a master to deop a master or a bot."
  1956. return 0
  1957. }
  1958. }
  1959. }
  1960. if {[isop $nick $chan]} { pushmode }
  1961. return 0
  1962. }
  1963.  
  1964. ### !ADDVOICE <nick> [hand]
  1965.  
  1966. proc pub_lol_addvoice {me b c chan arg} {
  1967. set arg [charfilter $arg]
  1968. global lol botnick
  1969. if {![check $c $me $b]} {
  1970. if {$lol(silent) == 1 || [checksilent $c]} {return 0}
  1971. puthelp "NOTICE $me :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  1972. return 0
  1973. }
  1974. if {[llength $arg] < 1} {
  1975. puthelp "NOTICE $me :\002Usage:\002 [string trim $lol(cmdchar)]addvoice <nick> \[hand\]"
  1976. return 0
  1977. }
  1978. set nick [lindex $arg 0]
  1979. set alternate [lindex $arg 1]
  1980. set bot [strlwr $botnick]
  1981. set hostmask "$nick![getchanhost $nick $chan]"
  1982. set hand [nick2hand $nick $chan]
  1983. if {![onchan $nick $chan]} {
  1984. puthelp "NOTICE $me :Sorry, but I don't see $nick in $chan."
  1985. return 0
  1986. }
  1987. if {[strlwr $nick] == $bot} {
  1988. puthelp "NOTICE $me :Sorry, but I can't addvoice myself."
  1989. return 0
  1990. }
  1991. if {[getting-users]} {
  1992. puthelp "NOTICE $me :Sorry, but I'm transferring the userfile, try later."
  1993. return 0
  1994. }
  1995. if {![validuser $hand]} {
  1996. if {[validuser $nick] && $alternate == ""} {
  1997. puthelp "NOTICE $me :The hand $nick already exists. \002Usage:\002 !addvoice <nick> <hand>"
  1998. return 0
  1999. }
  2000. if {$alternate != ""} {
  2001. if {[validuser $alternate]} {
  2002. puthelp "NOTICE $me :The hand $alternate already exists. Choose another. \002Usage:\002 !addvoice <nick> <hand>"
  2003. return 0
  2004. }
  2005. adduser $alternate [maskhost $hostmask]
  2006. chattr $alternate +p|+v $chan
  2007. puthelp "NOTICE $me :New user: $alternate ([maskhost $hostmask])"
  2008. puthelp "NOTICE $me :$nick added to the $chan voicelist and party-line with the hand: $alternate."
  2009. puthelp "NOTICE $nick :You have been added to the $chan voicelist and party-line by $me with the hand: $alternate."
  2010. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick pass <your_password>\002"
  2011. if {[botisop $chan] && ![isop $nick $chan] && ![isvoice $nick $chan]} {
  2012. pushmode $chan +v $nick
  2013. }
  2014. return 0
  2015. }
  2016. adduser $nick [maskhost $hostmask]
  2017. chattr $nick +p|+v $chan
  2018. puthelp "NOTICE $me :New user: $nick ([maskhost $hostmask])"
  2019. puthelp "NOTICE $me :$nick added to the $chan voicelist and party-line with the hand: $nick."
  2020. puthelp "NOTICE $nick :You have been added to the $chan voicelist and party-line by $me with the hand: $nick."
  2021. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick pass <your_password>\002"
  2022. if {[botisop $chan] && ![isop $nick $chan] && ![isvoice $nick $chan]} {
  2023. pushmode $chan +v $nick
  2024. }
  2025. return 0
  2026. }
  2027. if {$alternate != ""} {
  2028. if {[validuser $alternate]} {
  2029. puthelp "NOTICE $me :The hand $alternate already exists. \002Usage:\002 !addvoice <nick> <hand>"
  2030. return 0
  2031. }
  2032. adduser $alternate [maskhost $hostmask]
  2033. chattr $alternate +p|+v $chan
  2034. puthelp "NOTICE $me :New user: $alternate ([maskhost $hostmask])"
  2035. puthelp "NOTICE $me :$nick added to the $chan voicelist and party-line with the hand: $alternate."
  2036. puthelp "NOTICE $nick :You have been added to the $chan voicelist and party-line by $me with the hand: $alternate."
  2037. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick PASS <your_password>\002"
  2038. if {[botisop $chan] && ![isop $nick $chan] && ![isvoice $nick $chan]} {
  2039. pushmode $chan +v $nick
  2040. }
  2041. return 0
  2042. }
  2043. if {[matchattr $hand -|+v $chan]} {
  2044. puthelp "NOTICE $me :$nick already has voice in $chan with this hand: $hand"
  2045. } {
  2046. chattr $hand -|+v $chan
  2047. puthelp "NOTICE $me :$nick added to the $chan voicelist with this hand: $hand."
  2048. puthelp "NOTICE $nick :You have been added to the $chan voicelist by $me."
  2049. }
  2050. if {[botisop $chan] && ![isop $nick $chan] && ![isvoice $nick $chan]} {
  2051. pushmode $chan +v $nick
  2052. return 0
  2053. }
  2054. return 0
  2055. }
  2056.  
  2057. ### !DELVOICE <nick>
  2058.  
  2059. proc pub_lol_delvoice {me b c chan arg} {
  2060. set arg [charfilter $arg]
  2061. global lol botnick
  2062. if {![check $c $me $b]} {
  2063. if {$lol(silent) == 1 || [checksilent $c]} {return 0}
  2064. puthelp "NOTICE $me :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  2065. return 0
  2066. }
  2067. if {[llength $arg] != 1} {
  2068. puthelp "NOTICE $me :\002Usage:\002 [string trim $lol(cmdchar)]delvoice <nick>"
  2069. return 0
  2070. }
  2071. set nick [lindex $arg 0]
  2072. set bot [strlwr $botnick]
  2073. set hand [nick2hand $nick $chan]
  2074. if {![onchan $nick $chan]} {
  2075. puthelp "NOTICE $me :Sorry, but I don't see $nick in $chan."
  2076. return 0
  2077. }
  2078. if {[strlwr $nick] == $bot} {
  2079. puthelp "NOTICE $me :Yeah right, like I'm going to let you delvoice ME!"
  2080. return 0
  2081. }
  2082. if {![validuser $hand]} {
  2083. puthelp "NOTICE $me :$nick is not a registered user."
  2084. if {[botisop $chan] && [isvoice $nick $chan]} {
  2085. pushmode
  2086. }
  2087. return 0
  2088. }
  2089. if {[getting-users]} {
  2090. puthelp "NOTICE $me :Sorry, but I'm transferring the userfile, try later."
  2091. return 0
  2092. }
  2093. if {![matchattr $hand -|+v $chan]} {
  2094. puthelp "NOTICE $me :$nick does not have voice in $chan"
  2095. } {
  2096. chattr $hand -|- $chan
  2097. puthelp "NOTICE $me :$nick has been removed from the $chan voicelist."
  2098. puthelp "NOTICE $nick :You have been removed from the $chan voicelist by $me."
  2099. }
  2100. if {[botisop $chan] && [isvoice $nick $chan]} {
  2101. pushmode
  2102. return 0
  2103. }
  2104. return 0
  2105. }
  2106.  
  2107. ### !VOICE [nick]
  2108.  
  2109. proc pub_lol_voice {a b c chan arg} {
  2110. if {![botisop $chan]} {return 0}
  2111. set arg [charfilter $arg]
  2112. global lol botnick
  2113. if {![check $c $a $b]} {
  2114. if {$lol(silent) == 1 || [checksilent $c]} {return 0}
  2115. puthelp "NOTICE $a :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  2116. return 0
  2117. }
  2118. set nick [lindex $arg 0]
  2119. set bot [strlwr $botnick]
  2120. set hand [nick2hand $nick $chan]
  2121. if {$nick == ""} {
  2122. if {![isvoice $a $chan]} { pushmode $chan +v $a }
  2123. return 0
  2124. }
  2125. if {![onchan $nick $chan]} {
  2126. puthelp "NOTICE $a :Sorry, but I don't see $nick in $chan."
  2127. return 0
  2128. }
  2129.  
  2130. if {![isvoice $nick $chan]} { pushmode $chan +v $nick }
  2131. return 0
  2132. }
  2133.  
  2134. ### !DEVOICE [nick]
  2135.  
  2136. proc pub_lol_devoice {a b c chan arg} {
  2137. if {![botisop $chan]} {return 0}
  2138. set arg [charfilter $arg]
  2139. global lol botnick
  2140. if {![check $c $a $b]} {
  2141. if {$lol(silent) == 1 || [checksilent $c]} {return 0}
  2142. puthelp "NOTICE $a :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  2143. return 0
  2144. }
  2145. set nick [lindex $arg 0]
  2146. set bot [strlwr $botnick]
  2147. set hand [nick2hand $nick $chan]
  2148. if {$nick == ""} {
  2149. if {[isvoice $a $chan]} { pushmode }
  2150. return 0
  2151. }
  2152.  
  2153. if {![onchan $nick $chan]} {
  2154. puthelp "NOTICE $a :Sorry, but I don't see $nick in $chan."
  2155. return 0
  2156. }
  2157. if {[isvoice $nick $chan]} { pushmode }
  2158. return 0
  2159. }
  2160.  
  2161. ### !ADDBOT <nick> [port] [hand]
  2162.  
  2163. proc pub_lol_addbot {me b c chan arg} {
  2164. set arg [charfilter $arg]
  2165. global lol botnick
  2166. if {![check $c $me $b]} {
  2167. if {$lol(silent) == 1 || [checksilent $c]} {return 0}
  2168. puthelp "NOTICE $me :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  2169. return 0
  2170. }
  2171. if {[llength $arg] < 1} {
  2172. puthelp "NOTICE $me :\002Usage:\002 [string trim $lol(cmdchar)]addbot <nick> \[port\] \[hand\]"
  2173. return 0
  2174. }
  2175. set nick [lindex $arg 0]
  2176. set port [lindex $arg 1]
  2177. if {[isnumber $port]} {
  2178. set alternate [lindex $arg 2]
  2179. } {
  2180. set port 3333
  2181. set alternate [lindex $arg 1]
  2182. }
  2183. set host [lindex [split [getchanhost $nick $chan] "@"] 1]
  2184. set hostmask "*!*[getchanhost $nick $chan]"
  2185. set hand [nick2hand $nick $chan]
  2186. if {![onchan $nick $chan]} {
  2187. puthelp "NOTICE $me :Sorry, but I don't see $nick in $chan."
  2188. return 0
  2189. }
  2190. if {[strlwr $nick] == [strlwr $botnick]} {
  2191. puthelp "NOTICE $me :Sorry, but I can't addbot myself."
  2192. return 0
  2193. }
  2194. if {[getting-users]} {
  2195. puthelp "NOTICE $me :Sorry, but I'm transferring the userfile, try later."
  2196. return 0
  2197. }
  2198. if {[validuser $hand]} {
  2199. puthelp "NOTICE $me :$nick is already recognized with this hand: $hand"
  2200. return 0
  2201. } {
  2202. if {[validuser $nick] && $alternate == ""} {
  2203. puthelp "NOTICE $me :The hand $nick already exists. \002Usage:\002 !addbot <nick> <port> <hand>"
  2204. return 0
  2205. }
  2206. if {$alternate != ""} {
  2207. if {[validuser $alternate]} {
  2208. puthelp "NOTICE $me :The hand $alternate already exists. Choose another. \002Usage:\002 !addbot <nick> <port> <hand>"
  2209. return 0
  2210. }
  2211. addbot $alternate $host:$port
  2212. setuser $alternate hosts $hostmask
  2213. puthelp "NOTICE $me :New bot: $alternate ($hostmask)"
  2214. return 0
  2215. }
  2216. addbot $nick $host:$port
  2217. setuser $nick hosts $hostmask
  2218. puthelp "NOTICE $me :New bot: $nick ($hostmask)"
  2219. return 0
  2220. }
  2221. if {$alternate != ""} {
  2222. if {[validuser $alternate]} {
  2223. puthelp "NOTICE $me :The hand $alternate already exists. \002Usage:\002 !addbot <nick> <port> <hand>"
  2224. return 0
  2225. }
  2226. addbot $alternate $host:$port
  2227. setuser $alternate hosts $hostmask
  2228. puthelp "NOTICE $me :New bot: $alternate ($hostmask)"
  2229. return 0
  2230. }
  2231. return 0
  2232. }
  2233.  
  2234. ### !KICK <nick|mask> [reason]
  2235.  
  2236. proc pub_lol_kick {nick host hand chan arg} {
  2237. if {![botisop $chan]} {return 0}
  2238. set arg [charfilter $arg]
  2239. global lol botnick
  2240. if {![check $hand $nick $host]} {
  2241. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  2242. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  2243. return 0
  2244. }
  2245. if {[llength $arg] < 1} {
  2246. puthelp "NOTICE $nick :\002Usage:\002 [string trim $lol(cmdchar)]kick <nick|mask> \[reason\]"
  2247. return 0
  2248. }
  2249. set who [lindex $arg 0]
  2250. set reason [lrange $arg 1 end]
  2251. if {$reason == ""} {set reason "requested"}
  2252. if {[string first "*" $who] != -1 || [string first "?" $who] != -1} {
  2253. if {$reason == "requested"} {set reason "MaskKick: $who"}
  2254. if {![matchattr $hand o|o $chan]} {
  2255. puthelp "NOTICE $nick :You need to be an op to use mask kick."
  2256. return 0
  2257. }
  2258. set who [strlwr $who]
  2259. set kickcount 0
  2260. set flags "-$lol(no_kick_flags)&-$lol(no_kick_flags)"
  2261. if {$lol(no_kick_flags) == ""} {
  2262. set list [strlwr [chanlist $chan]]
  2263. } {
  2264. set list [strlwr [chanlist $chan $flags]]
  2265. }
  2266. foreach chanuser $list {
  2267. if {[string match [strlwr $who] [strlwr $chanuser]] && $chanuser != [strlwr $botnick] && $chanuser != [strlwr $nick] && ![isop $chanuser $chan] && ![isvoice $chanuser $chan]} {
  2268. incr kickcount
  2269. putserv "KICK $chan $chanuser :$nick: $reason"
  2270. }
  2271. }
  2272. if {$kickcount == 0} {
  2273. puthelp "NOTICE $nick :Sorry but nobody matches this mask."
  2274. }
  2275. } {
  2276. if {![onchan $who $chan]} {
  2277. puthelp "NOTICE $nick :Sorry, but I don't see $who in $chan."
  2278. return 0
  2279. }
  2280. if {[strlwr $who] == [strlwr $botnick]} {
  2281. puthelp "NOTICE $nick :Yeah right, like I'm going to let you kick ME!"
  2282. return 0
  2283. }
  2284. if {[nick2hand $who $chan] != "*"} {
  2285. if {$hand != [nick2hand $who $chan]} {
  2286. if {[matchattr [nick2hand $who $chan] o|o $chan] && ![matchattr $hand o|o $chan]} {
  2287. puthelp "NOTICE $nick :Sorry, you must to be an operator to kick an operator."
  2288. return 0
  2289. }
  2290. if {([matchattr [nick2hand $who $chan] m|m $chan] || [matchattr [nick2hand $who $chan] b]) && ![matchattr $hand m|m $chan]} {
  2291. puthelp "NOTICE $nick :Sorry, you must to be a master to kick a master or a bot."
  2292. return 0
  2293. }
  2294. }
  2295. }
  2296. putserv "KICK $chan $who :$nick: $reason"
  2297. }
  2298. return 0
  2299. }
  2300.  
  2301. ### !QUICK <nick|mask> [reason]
  2302.  
  2303. proc pub_lol_quick {nick host hand chan arg} {
  2304. if {![botisop $chan]} {return 0}
  2305. set arg [charfilter $arg]
  2306. global lol botnick
  2307. if {![check $hand $nick $host]} {
  2308. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  2309. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  2310. return 0
  2311. }
  2312. if {[llength $arg] < 1} {
  2313. puthelp "NOTICE $nick :\002Usage:\002 [string trim $lol(cmdchar)]quick <nick|mask> \[reason\]"
  2314. return 0
  2315. }
  2316. set who [lindex $arg 0]
  2317. set reason [lrange $arg 1 end]
  2318. if {$reason == ""} {set reason "requested"}
  2319. if {[string first "*" $who] != -1 || [string first "?" $who] != -1} {
  2320. if {$reason == "requested"} {set reason "MaskQuick: $who"}
  2321. set who [strlwr $who]
  2322. set kickcount 0
  2323. set flags "-$lol(no_kick_flags)&-$lol(no_kick_flags)"
  2324. if {$lol(no_kick_flags) == ""} {
  2325. set list [strlwr [chanlist $chan]]
  2326. } {
  2327. set list [strlwr [chanlist $chan $flags]]
  2328. }
  2329. foreach chanuser $list {
  2330. if {[string match [strlwr $who] [strlwr $chanuser]] && $chanuser != [strlwr $botnick] && $chanuser != [strlwr $nick] && ![isop $chanuser $chan] && ![isvoice $chanuser $chan]} {
  2331. incr kickcount
  2332. set hostmask "*!*[getchanhost $chanuser $chan]"
  2333. putserv "MODE $chan +b $hostmask"
  2334. putserv "KICK $chan $chanuser :$nick: $reason"
  2335. utimer 7 "deban $chan $hostmask"
  2336. }
  2337. }
  2338. if {$kickcount == 0} {
  2339. puthelp "NOTICE $nick :Sorry but nobody matches this mask."
  2340. }
  2341. } {
  2342. if {![onchan $who $chan]} {
  2343. puthelp "NOTICE $nick :Sorry, but I don't see $who in $chan."
  2344. return 0
  2345. }
  2346. if {[strlwr $who] == [strlwr $botnick]} {
  2347. puthelp "NOTICE $nick :Yeah right, like I'm going to let you kick ME!"
  2348. return 0
  2349. }
  2350. if {[nick2hand $who $chan] != "*"} {
  2351. if {$hand != [nick2hand $who $chan]} {
  2352. if {[matchattr [nick2hand $who $chan] o|o $chan] && ![matchattr $hand o|o $chan]} {
  2353. puthelp "NOTICE $nick :Sorry, you must to be an operator to kick an operator."
  2354. return 0
  2355. }
  2356. if {([matchattr [nick2hand $who $chan] m|m $chan] || [matchattr [nick2hand $who $chan] b]) && ![matchattr $hand m|m $chan]} {
  2357. puthelp "NOTICE $nick :Sorry, you must to be a master to kick a master or a bot."
  2358. return 0
  2359. }
  2360. }
  2361. }
  2362. set hostmask "*!*[getchanhost $who $chan]"
  2363. putserv "MODE $chan +b $hostmask"
  2364. putserv "KICK $chan $who :$nick: $reason"
  2365. utimer 7 "deban $chan $hostmask"
  2366. }
  2367. return 0
  2368. }
  2369.  
  2370. proc deban {chan hostmask} {
  2371. if{[botisop $chan]} {pushmode $chan -b $hostmask}
  2372. }
  2373.  
  2374. ### CLIENT KICK
  2375.  
  2376. proc pub_lol_mirc {nick host hand chan arg} {
  2377. if {![botisop $chan]} {return 0}
  2378. set arg [charfilter $arg]
  2379. global lol botnick lol_mirc_kick remove_kickmirc_timer
  2380. if {![check $hand $nick $host]} {
  2381. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  2382. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  2383. return 0
  2384. }
  2385. set flags "-$lol(no_kick_flags)&-$lol(no_kick_flags)"
  2386. if {$lol(no_kick_flags) == ""} {
  2387. set list [strlwr [chanlist $chan]]
  2388. } {
  2389. set list [strlwr [chanlist $chan $flags]]
  2390. }
  2391. foreach chanuser $list {
  2392. if {[strlwr $chanuser] != [strlwr $botnick] && [strlwr $chanuser] != [strlwr $nick] && ![isop $chanuser $chan] && ![isvoice $chanuser $chan]} {
  2393. puthelp "PRIVMSG $chanuser :\001VERSION\001"
  2394. }
  2395. }
  2396. if {$remove_kickmirc_timer != ""} {
  2397. killutimer $remove_kickmirc_timer
  2398. }
  2399. set lol_mirc_kick $chan
  2400. set remove_kickmirc_timer [utimer 60 {
  2401. set lol_mirc_kick ""
  2402. set remove_kickmirc_timer ""
  2403. }]
  2404. kick_chan_check $chan mirc
  2405. return 0
  2406. }
  2407.  
  2408. proc pub_lol_bitchx {nick host hand chan arg} {
  2409. if {![botisop $chan]} {return 0}
  2410. set arg [charfilter $arg]
  2411. global lol botnick lol_bitchx_kick remove_kickbitchx_timer
  2412. if {![check $hand $nick $host]} {
  2413. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  2414. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  2415. return 0
  2416. }
  2417. set flags "-$lol(no_kick_flags)&-$lol(no_kick_flags)"
  2418. if {$lol(no_kick_flags) == ""} {
  2419. set list [strlwr [chanlist $chan]]
  2420. } {
  2421. set list [strlwr [chanlist $chan $flags]]
  2422. }
  2423. foreach chanuser $list {
  2424. if {[strlwr $chanuser] != [strlwr $botnick] && [strlwr $chanuser] != [strlwr $nick] && ![isop $chanuser $chan] && ![isvoice $chanuser $chan]} {
  2425. puthelp "PRIVMSG $chanuser :\001VERSION\001"
  2426. }
  2427. }
  2428. if {$remove_kickbitchx_timer != ""} {
  2429. killutimer $remove_kickbitchx_timer
  2430. }
  2431. set lol_bitchx_kick $chan
  2432. set remove_kickbitchx_timer [utimer 60 {
  2433. set lol_bitchx_kick ""
  2434. set remove_kickbitchx_timer ""
  2435. }]
  2436. kick_chan_check $chan bitchx
  2437. return 0
  2438. }
  2439.  
  2440. proc pub_lol_ircii {nick host hand chan arg} {
  2441. if {![botisop $chan]} {return 0}
  2442. set arg [charfilter $arg]
  2443. global lol botnick lol_ircii_kick remove_kickircii_timer
  2444. if {![check $hand $nick $host]} {
  2445. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  2446. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  2447. return 0
  2448. }
  2449. set flags "-$lol(no_kick_flags)&-$lol(no_kick_flags)"
  2450. if {$lol(no_kick_flags) == ""} {
  2451. set list [strlwr [chanlist $chan]]
  2452. } {
  2453. set list [strlwr [chanlist $chan $flags]]
  2454. }
  2455. foreach chanuser $list {
  2456. if {[strlwr $chanuser] != [strlwr $botnick] && [strlwr $chanuser] != [strlwr $nick] && ![isop $chanuser $chan] && ![isvoice $chanuser $chan]} {
  2457. puthelp "PRIVMSG $chanuser :\001VERSION\001"
  2458. }
  2459. }
  2460. if {$remove_kickircii_timer != ""} {
  2461. killutimer $remove_kickircii_timer
  2462. }
  2463. set lol_ircii_kick $chan
  2464. set remove_kickircii_timer [utimer 60 {
  2465. set lol_ircii_kick ""
  2466. set remove_kickircii_timer ""
  2467. }]
  2468. kick_chan_check $chan ircii
  2469. return 0
  2470. }
  2471.  
  2472. proc pub_lol_eggdrop {nick host hand chan arg} {
  2473. if {![botisop $chan]} {return 0}
  2474. set arg [charfilter $arg]
  2475. global lol botnick lol_eggdrop_kick remove_kickeggdrop_timer
  2476. if {![check $hand $nick $host]} {
  2477. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  2478. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  2479. return 0
  2480. }
  2481. set flags "-$lol(no_kick_flags)&-$lol(no_kick_flags)"
  2482. if {$lol(no_kick_flags) == ""} {
  2483. set list [strlwr [chanlist $chan]]
  2484. } {
  2485. set list [strlwr [chanlist $chan $flags]]
  2486. }
  2487. foreach chanuser $list {
  2488. if {[strlwr $chanuser] != [strlwr $botnick] && [strlwr $chanuser] != [strlwr $nick] && ![isop $chanuser $chan] && ![isvoice $chanuser $chan]} {
  2489. puthelp "PRIVMSG $chanuser :\001VERSION\001"
  2490. }
  2491. }
  2492. if {$remove_kickeggdrop_timer != ""} {
  2493. killutimer $remove_kickeggdrop_timer
  2494. }
  2495. set lol_eggdrop_kick $chan
  2496. set remove_kickeggdrop_timer [utimer 60 {
  2497. set lol_eggdrop_kick ""
  2498. set remove_kickeggdrop_timer ""
  2499. }]
  2500. kick_chan_check $chan eggdrop
  2501. return 0
  2502. }
  2503.  
  2504. proc kick_chan_check {chan client} {
  2505. global lol_mirc_kick lol_bitchx_kick lol_ircii_kick lol_eggdrop_kick
  2506. if {$client == "mirc"} {
  2507. if {$lol_bitchx_kick == $chan} { set lol_bitchx_kick "" }
  2508. if {$lol_ircii_kick == $chan} { set lol_ircii_kick "" }
  2509. if {$lol_eggdrop_kick == $chan} { set lol_eggdrop_kick "" }
  2510. }
  2511. if {$client == "bitchx"} {
  2512. if {$lol_mirc_kick == $chan} { set lol_mirc_kick "" }
  2513. if {$lol_ircii_kick == $chan} { set lol_ircii_kick "" }
  2514. if {$lol_eggdrop_kick == $chan} { set lol_eggdrop_kick "" }
  2515. }
  2516. if {$client == "ircii"} {
  2517. if {$lol_bitchx_kick == $chan} { set lol_bitchx_kick "" }
  2518. if {$lol_mirc_kick == $chan} { set lol_mirc_kick "" }
  2519. if {$lol_eggdrop_kick == $chan} { set lol_eggdrop_kick "" }
  2520. }
  2521. if {$client == "eggdrop"} {
  2522. if {$lol_bitchx_kick == $chan} { set lol_bitchx_kick "" }
  2523. if {$lol_ircii_kick == $chan} { set lol_ircii_kick "" }
  2524. if {$lol_mirc_kick == $chan} { set lol_mirc_kick "" }
  2525. }
  2526. return 0
  2527. }
  2528.  
  2529. ### CTCP VERSION CLIENT KICK
  2530.  
  2531. proc lol_ctcp_version {nick host hand dest key arg} {
  2532. global lol lol_mirc_kick lol_bitchx_kick lol_ircii_kick lol_eggdrop_kick
  2533. if {[string first "mirc" [strlwr $arg]] != -1} { set version "mirc" }
  2534. if {[string first "ircii" [strlwr $arg]] != -1} { set version "ircii" }
  2535. if {[string first "bitchx" [strlwr $arg]] != -1} { set version "bitchx" }
  2536. if {[string first "eggsrop" [strlwr $arg]] != -1} { set version "eggdrop" }
  2537. set flags "-$lol(no_kick_flags)&-$lol(no_kick_flags)"
  2538. set chan [lindex $lol_mirc_kick 0]
  2539. if {$version == "mirc" && [validchan $chan]} {
  2540. if {[botisop $chan] && ![isop $nick $chan] && ![isvoice $nick $chan]} {
  2541. if {$hand != "*" && $lol(no_kick_flags) != "" } {
  2542. if {[matchattr $hand $flags $chan]} { return 0 }
  2543. }
  2544. putserv "KICK $chan $nick :Mirc kick !"
  2545. }
  2546. return 0
  2547. }
  2548. set chan [lindex $lol_bitchx_kick 0]
  2549. if {$version == "bitchx" && [validchan $chan]} {
  2550. if {[botisop $chan] && ![isop $nick $chan] && ![isvoice $nick $chan]} {
  2551. if {$hand != "*" && $lol(no_kick_flags) != ""} {
  2552. if {[matchattr $hand $flags $chan]} { return 0 }
  2553. }
  2554. putserv "KICK $chan $nick :BitchX kick !"
  2555. }
  2556. return 0
  2557. }
  2558. set chan [lindex $lol_ircii_kick 0]
  2559. if {$version == "ircii" && [validchan $chan]} {
  2560. if {[botisop $chan] && ![isop $nick $chan] && ![isvoice $nick $chan]} {
  2561. if {$hand != "*" && $lol(no_kick_flags) != ""} {
  2562. if {[matchattr $hand $flags $chan]} { return 0 }
  2563. }
  2564. putserv "KICK $chan $nick :IrcII kick !"
  2565. }
  2566. return 0
  2567. }
  2568. set chan [lindex $lol_eggdrop_kick 0]
  2569. if {$version == "eggdrop" && [validchan $chan]} {
  2570. if {[botisop $chan] && ![isop $nick $chan] && ![isvoice $nick $chan]} {
  2571. if {$hand != "*" && $lol(no_kick_flags) != ""} {
  2572. if {[matchattr $hand $flags $chan]} { return 0 }
  2573. }
  2574. putserv "KICK $chan $nick :Eggdrop kick !"
  2575. }
  2576. return 0
  2577. }
  2578. return 0
  2579. }
  2580.  
  2581. ### !FINDIP <mask>
  2582.  
  2583. proc pub_lol_findip {nick host hand chan arg} {
  2584. set arg [charfilter $arg]
  2585. global lol botnick
  2586. if {![check $hand $nick $host]} {
  2587. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  2588. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  2589. return 0
  2590. }
  2591. if {[llength $arg] != 1} {
  2592. puthelp "NOTICE $nick :\002Usage:\002 [string trim $lol(cmdchar)]findip <mask>"
  2593. return 0
  2594. }
  2595. set mask [lindex $arg 0]
  2596. set msg "These users have been found: "
  2597. set find 0
  2598. foreach chans [channels] {
  2599. foreach chanuser [strlwr [chanlist $chans]] {
  2600. if {$chanuser == [strlwr $nick] || $chanuser == [strlwr $botnick]} {continue}
  2601. set ipmask [strlwr [lindex [split [maskhost $chanuser![getchanhost $chanuser $chan]] "@"] 1]]
  2602. set ip [lindex [split [getchanhost $chanuser $chans] @] 1]
  2603. if {[string match [strlwr $mask] [strlwr $ip]]} {
  2604. append msg "* \002$chanuser :$ip\002 on $chans "
  2605. incr find
  2606. }
  2607. if {[string length $msg] > 200} {
  2608. puthelp "NOTICE $nick :$msg"
  2609. set msg ""
  2610. }
  2611. }
  2612. }
  2613. if {$find != 0} {
  2614. if {$msg != ""} {puthelp "NOTICE $nick :$msg"}
  2615. } {
  2616. puthelp "NOTICE $nick :No IPs that match $mask were found on my chans."
  2617. }
  2618. return 0
  2619. }
  2620.  
  2621. ### !TOPIC <topic>
  2622.  
  2623. proc pub_lol_topic {nick host hand chan arg} {
  2624. if {![botisop $chan]} {return 0}
  2625. global lol botnick
  2626. if {![check $hand $nick $host]} {
  2627. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  2628. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  2629. return 0
  2630. }
  2631. if {[llength $arg] < 1} {
  2632. puthelp "NOTICE $nick :\002Usage\002: [string trim $lol(cmdchar)]topic <topic>"
  2633. return 0
  2634. }
  2635. puthelp "TOPIC $chan :$arg"
  2636. return 0
  2637. }
  2638.  
  2639. ### !WHOIS <nick>
  2640.  
  2641. proc pub_lol_whois {nick host hand chan arg} {
  2642. set arg [charfilter $arg]
  2643. global lol botnick
  2644. if {![check $hand $nick $host]} {
  2645. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  2646. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  2647. return 0
  2648. }
  2649. if {[llength $arg] != 1} {
  2650. puthelp "NOTICE $nick :\002Usage:\002 [string trim $lol(cmdchar)]whois <nick>"
  2651. return 0
  2652. }
  2653. set who [lindex $arg 0]
  2654. set handle [nick2hand $who $chan]
  2655. set host2 [getchanhost $who $chan]
  2656. puthelp "NOTICE $nick :[lol_whois $who $host2 $handle $chan]"
  2657. return 0
  2658. }
  2659.  
  2660. ### BOT JOKES ;)
  2661.  
  2662. proc pub_lol_cigarette {nick host hand chan arg} {
  2663. set arg [charfilter $arg]
  2664. set arg [lindex $arg 0]
  2665. global lol botnick
  2666. if {$lol(jokes) == 0} {return 0}
  2667. if {![check $hand $nick $host]} {
  2668. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  2669. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  2670. return 0
  2671. }
  2672. if {$arg != ""} {
  2673. puthelp "PRIVMSG $chan :$nick offers this \002(\037)¯¯¯¯)¯¯¯¯¯¯¯¯¯¯¯\037)~~~\002 at $arg !!!"
  2674. return 0
  2675. }
  2676. puthelp "PRIVMSG $chan :I offer this \002(\037)¯¯¯¯)¯¯¯¯¯¯¯¯¯¯¯\037)~~~\002 at $nick !!!"
  2677. return 0
  2678. }
  2679.  
  2680. proc pub_lol_rose {nick host hand chan arg} {
  2681. set arg [charfilter $arg]
  2682. set arg [lindex $arg 0]
  2683. global lol botnick
  2684. if {$lol(jokes) == 0} {return 0}
  2685. if {![check $hand $nick $host]} {
  2686. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  2687. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  2688. return 0
  2689. }
  2690. if {$arg != ""} {
  2691. puthelp "PRIVMSG $chan :$nick ofrece esta hermosa rosa \0034@\003\0033\} >-`--,--`---\003 a $arg !!!"
  2692. return 0
  2693. }
  2694. puthelp "PRIVMSG $chan :Ofrezco esta hermosa rosa \0034@\003\0033\} >-`--,--`---\003 a $nick !!!"
  2695. return 0
  2696. }
  2697.  
  2698. proc pub_lol_pastis {nick host hand chan arg} {
  2699. set arg [charfilter $arg]
  2700. set arg [lindex $arg 0]
  2701. global lol botnick
  2702. if {$lol(jokes) == 0} {return 0}
  2703. if {![check $hand $nick $host]} {
  2704. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  2705. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  2706. return 0
  2707. }
  2708. if {$arg != ""} {
  2709. puthelp "PRIVMSG $chan :$nick offers a glass full of pastaga at $arg, enjoy !!!"
  2710. return 0
  2711. }
  2712. puthelp "PRIVMSG $chan :I offer a glass full of pastaga at $nick, enjoy !!!"
  2713. return 0
  2714. }
  2715.  
  2716. proc pub_lol_coke {nick host hand chan arg} {
  2717. set arg [charfilter $arg]
  2718. set arg [lindex $arg 0]
  2719. global lol botnick
  2720. if {$lol(jokes) == 0} {return 0}
  2721. if {![check $hand $nick $host]} {
  2722. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  2723. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  2724. return 0
  2725. }
  2726. if {$arg != ""} {
  2727. puthelp "PRIVMSG $chan :$nick offers a delicious bottle of Coca-Cola at $arg, enjoy !!!"
  2728. return 0
  2729. }
  2730. puthelp "PRIVMSG $chan :I offer a delicious bottle of Coca-Cola at $nick, enjoy !!!"
  2731. return 0
  2732. }
  2733.  
  2734. proc pub_lol_beer {nick host hand chan arg} {
  2735. set arg [charfilter $arg]
  2736. set arg [lindex $arg 0]
  2737. global lol botnick
  2738. if {$lol(jokes) == 0} {return 0}
  2739. if {![check $hand $nick $host]} {
  2740. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  2741. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  2742. return 0
  2743. }
  2744. if {$arg != ""} {
  2745. puthelp "PRIVMSG $chan :$nick offers a bottle of Beer to $arg, enjoy !!!"
  2746. return 0
  2747. }
  2748. puthelp "PRIVMSG $chan :I offer a of Beer to $nick, enjoy !!!"
  2749. return 0
  2750. }
  2751.  
  2752. proc pub_lol_penalty {nick host hand chan arg} {
  2753. set arg [charfilter $arg]
  2754. set joueur [lindex $arg 0]
  2755. set balle [lindex $arg 1]
  2756. if {$balle == ""} {
  2757. set text "S'ELANCE SUR LA BALLE ET IL SHOOOT !!!!!!!"
  2758. } {
  2759. set text "S'ELANCE SUR [string toupper $balle] ET LE FRAPPE DE TOUTE SES FORCES !!!!!"
  2760. }
  2761. global lol botnick
  2762. if {$lol(jokes) == 0} {return 0}
  2763. if {![check $hand $nick $host]} {
  2764. if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
  2765. puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
  2766. return 0
  2767. }
  2768. set results {
  2769. {!!! GGGOOOOOOOOOAAAAAAAAAAAAAAAAAAALLLLLLLLLLLLL !!!!!!!!! dans la lucarne gauche :))))}
  2770. {EVIVAAAAAAAAAAAAAAAA dans la lucarne droite :))))}
  2771. {!!! GGGOOOOOOOOOAAAAAAAAAAAAAAAAAAALLLLLLLLLLLLL !!!!!!!!! en plein centre :))))}
  2772. {!!! GGGOOOOOOOOOAAAAAAAAAAAAAAAAAAALLLLLLLLLLLLL !!!!!!!!! en force a gauche, le gardien a frolé le ballon :))))}
  2773. {IL L'A FAIT !!!!!!!!!! YEAHHHHHHH en force a droite, le gardien a frolé le ballon :))))}
  2774. {EVIVAAAAAAAAAAAAAAAA !!!!!!!!! en finnesse a gauche, le gardien pris a contre-pied :))))}
  2775. {Sans problèmes en finnesse a droite, le gardien pris a contre-pied :))))}
  2776. {!!! GOAL GOAL GOOOOOOOOOOOOOOAAAAAAAAAAL \/\/ Tout en puissance sous la transversale.}
  2777. {AHHHHHHRGGGGG :(( Par dessus la transversale !!!!}
  2778. {OOOOOOOHHUUUUUU :(((( Plein poteau :(}
  2779. {NOOOOOOOOON :((((( pleine transversale :(((((((}
  2780. {PUUTTTTTAAAIIINNNN !!! Il a tiré a coté :-/}
  2781. {Salopard de gardien !!! :((( Il a plongé du bon coté :((}
  2782. {En plein centre mais le gardien n'avait hélas pas anticipé :(}
  2783. {ARRGGGHHHH Tir central, mais le gardien devie la balle du pied :/}
  2784. }
  2785. if {$arg != ""} {
  2786. puthelp "PRIVMSG $chan :$joueur doit à tout prix marquer le penalty pour sauver son équipe..."
  2787. puthelp "PRIVMSG $chan :[string toupper $joueur] $text"
  2788. puthelp "PRIVMSG $chan :[lindex $results [rand [llength $results]]]"
  2789. return 0
  2790. }
  2791. puthelp "PRIVMSG $chan :$nick doit à tout prix marquer le penalty pour sauver son équipe..."
  2792. puthelp "PRIVMSG $chan :[string toupper $nick] S'ELANCE SUR LA BALLE ET IL SHOOOT !!!!!!!"
  2793. puthelp "PRIVMSG $chan :[lindex $results [rand [llength $results]]]"
  2794. return 0
  2795. }
  2796.  
  2797. ### !TIME
  2798.  
  2799. proc pub_lol_time {a b c d e} {
  2800. global lol
  2801. if {![validuser $c] && $lol(time) == 0} {return 0}
  2802. puthelp "NOTICE $a :The date is [date], and it's [time] !"
  2803. return 0
  2804. }
  2805.  
  2806. ### !HELP
  2807.  
  2808. proc pub_lol_help {nick host hand chan arg} {
  2809. set arg [charfilter $arg]
  2810. global lol
  2811. if {![validuser $hand] && $lol(help) == 0} {return 0}
  2812. puthelp "NOTICE $nick :*** $lol(version) CHAN HELP ***"
  2813. set help ""
  2814. if {[matchattr $hand n]} {
  2815. append help "\002[string trim $lol(cmdchar)]param\002 <parameter> <value> \002[string trim $lol(cmdchar)]enable\002 <nick> \002[string trim $lol(cmdchar)]disable\002 <nick> \002[string trim $lol(cmdchar)]deluser\002 <nick>"
  2816. append help " "
  2817. append help "\002[string trim $lol(cmdchar)]join\002 <chan> \[chanpass\] \002[string trim $lol(cmdchar)]remove\002 \[chan\]"
  2818. append help " "
  2819. append help "\002[string trim $lol(cmdchar)]addhost\002 <nick|hand> \[host\] \002[string trim $lol(cmdchar)]delhost\002 <nick|hand> <host>"
  2820. append help " "
  2821. }
  2822. if {[matchattr $hand n|n $chan]} {
  2823. append help "\002[string trim $lol(cmdchar)]addowner\002 <nick> \[hand\] \002[string trim $lol(cmdchar)]delowner\002 <nick>"
  2824. append help " "
  2825. append help "\002[string trim $lol(cmdchar)]addmaster\002 <nick> \[hand\] \002[string trim $lol(cmdchar)]delmaster\002 <nick>"
  2826. append help " "
  2827.  
  2828. }
  2829. if {[matchattr $hand m]} {
  2830. append help "\002[string trim $lol(cmdchar)]jump\002 <server> \[port\]"
  2831. append help " "
  2832. append help "\002[string trim $lol(cmdchar)]botnick\002 <nick>"
  2833. append help " "
  2834. }
  2835. if {[matchattr $hand m|m $chan]} {
  2836. append help " "
  2837. append help "\002[string trim $lol(cmdchar)]adduser\002 <nick> \[hand\] \002[string trim $lol(cmdchar)]addbot\002 <nick> \[port\] \[hand\]"
  2838. append help " "
  2839. append help "\002[string trim $lol(cmdchar)]addop\002 <nick> \[hand\] \002[string trim $lol(cmdchar)]delop\002 <nick> \002[string trim $lol(cmdchar)]banmask\002 <mask> \[time\] \[reason\] \002[string trim $lol(cmdchar)]findip\002 <mask>"
  2840. }
  2841. puthelp "NOTICE $nick :$help"
  2842. set help ""
  2843. if {[matchattr $hand o|o $chan]} {
  2844. append help "\002[string trim $lol(cmdchar)]banlist\002 \002[string trim $lol(cmdchar)]ban\002 <nick|mask> \[time\] \[reason\] \002[string trim $lol(cmdchar)]unban\002 <mask|number> \002[string trim $lol(cmdchar)]chattr\002 <nick> <flags>"
  2845. append help " "
  2846. append help "\002[string trim $lol(cmdchar)]mode\002 <chanmode> \002[string trim $lol(cmdchar)]op\002 \[nick\] "
  2847. append help " "
  2848. append help "\002[string trim $lol(cmdchar)]addvoice\002 <nick> \[hand\] \002[string trim $lol(cmdchar)]delvoice\002 <nick>"
  2849. append help " "
  2850. append help "\002[string trim $lol(cmdchar)]addfriend\002 <nick> \[hand\] \002[string trim $lol(cmdchar)]delfriend\002 <nick>"
  2851. append help " "
  2852. append help "\002[string trim $lol(cmdchar)]topic\002 <topic> \002[string trim $lol(cmdchar)]whois\002 <nick> \002[string trim $lol(cmdchar)]online\002"
  2853. append help " "
  2854. append help "\002[string trim $lol(cmdchar)]quick\002 <nick|mask> \[reason\] \002[string trim $lol(cmdchar)]mirc\002 \002[string trim $lol(cmdchar)]ircii\002 \002[string trim $lol(cmdchar)]bitchx\002 \002[string trim $lol(cmdchar)]eggdrop\002"
  2855. append help " "
  2856. }
  2857. puthelp "NOTICE $nick :$help"
  2858. set help ""
  2859. if {[matchattr $hand ov|ov $chan]} {
  2860. append help "\002[string trim $lol(cmdchar)]kick\002 <nick|mask> \[reason\] \002[string trim $lol(cmdchar)]stats\002 \002[string trim $lol(cmdchar)]voice\002 \[nick\] \002[string trim $lol(cmdchar)]devoice\002 \[nick\]"
  2861. append help " "
  2862. if {$lol(jokes) == 1} {
  2863. append help "\002[string trim $lol(cmdchar)]cigarette\002 \[nick\] \002[string trim $lol(cmdchar)]rose\002 \[nick\]"
  2864. append help " "
  2865. append help "\002[string trim $lol(cmdchar)]pastaga ([string trim $lol(cmdchar)]pastis, [string trim $lol(cmdchar)]51)\002 \[nick\] \002[string trim $lol(cmdchar)]beer\002 \[nick\]"
  2866. append help " "
  2867. append help "\002[string trim $lol(cmdchar)]coca-cola ([string trim $lol(cmdchar)]coke)\002 \[nick\] \002[string trim $lol(cmdchar)]penalty\002 \[player\] \[ball\]"
  2868. append help " "
  2869. }
  2870. }
  2871. if {$lol(time) == 1} {append help " \002[string trim $lol(cmdchar)]time\002"}
  2872. if {$lol(seen) == 1} {append help " \002[string trim $lol(cmdchar)]seen\002"}
  2873. if {$lol(troubles) == 1} {append help " \002[string trim $lol(cmdchar)]troubles\002"}
  2874. append help " \002[string trim $lol(cmdchar)]help\002"
  2875. puthelp "NOTICE $nick :$help"
  2876. if {[validuser $hand]} {
  2877. puthelp "NOTICE $nick :For a complete description, use dcc chat: \002.chanhelp\002"
  2878. }
  2879. }
  2880.  
  2881. ### !TROUBLES
  2882.  
  2883. proc pub_lol_troubles {nick host hand chan arg} {
  2884. set arg [charfilter $arg]
  2885. global lol botnick
  2886. if {![validuser $hand] && $lol(troubles) == 0} {return 0}
  2887. puthelp "NOTICE $nick :*** $lol(version) TROUBLES ***"
  2888. append help "*** 1_You are a registered user but the bot does not recognize you: ***"
  2889. append help " "
  2890. append help "You have probably changed your user@hostmask...Try:"
  2891. append help " "
  2892. append help "\002/msg $botnick id <password> <nick>\002"
  2893. append help " "
  2894. append help "Use the <nick> that you had, when you registered in the bot. You must do this each time your hostmask changes."
  2895. puthelp "NOTICE $nick :$help"
  2896.  
  2897. set help ""
  2898. append help "*** 2_The bot doesn't auto-op you: ***"
  2899. append help " "
  2900. append help "The bot probably doesn't have auto-op enabled, to get ops type:"
  2901. append help " "
  2902. append help "\002/MSG $botnick OP \[#chan\]\002"
  2903. puthelp "NOTICE $nick :$help"
  2904.  
  2905. set help ""
  2906. append help "*** 3_The bot recognizes you, but doesn't answer to a DCC CHAT: ***"
  2907. append help " "
  2908. append help "You don't have DCC CHAT rights / You are using mIRC and it don't always use standard DCC CHAT, try:"
  2909. append help " "
  2910. append help "\002/CTCP $botnick CHAT\002"
  2911. append help " "
  2912. append help "If that doesn't work change your DCC CHAT config or change your script."
  2913. puthelp "NOTICE $nick :$help"
  2914.  
  2915. set help ""
  2916. if {![check $hand $nick $host]} {
  2917. append help "*** 4_Chan commands do not work : ***"
  2918. append help " "
  2919. append help "You are not identified, type:"
  2920. append help " "
  2921. append help "\002/msg $botnick id <password>\002"
  2922. puthelp "NOTICE $nick :$help"
  2923. }
  2924. return 0
  2925. }
  2926.  
  2927. ################# END OF CHAN COMMANDS #################
  2928.  
  2929. ################# START OF DCC COMMANDS #################
  2930.  
  2931. ### .whois
  2932.  
  2933. proc dcc_lol_whois {hand idx arg} {
  2934. global lol
  2935. *dcc:whois $hand $idx $arg
  2936. set arg [charfilter $arg]
  2937. set whohand [lindex $arg 0]
  2938. if {[strlwr $hand] == [strlwr $whohand] || ([validuser $whohand] && [matchattr $hand m|m])} {
  2939. putdcc $idx "$lol(version) Specific information.\r"
  2940. putdcc $idx "\r"
  2941. putdcc $idx "Ident Statut: [getuser $whohand xtra auth] Last Ident Nick: [getuser $whohand xtra authnick]\r"
  2942. putdcc $idx "Silent: [getuser $whohand xtra silent] Permident Mask: [getuser $whohand xtra permident]\r"
  2943. }
  2944. return 0
  2945. }
  2946.  
  2947. ### .unident
  2948.  
  2949. proc dcc_lol_unident {hand idx arg} {
  2950. if {[getuser $hand xtra auth] != 1} {
  2951. putdcc $idx "You are already unidentified.\r"
  2952. return 0
  2953. }
  2954. if {[getuser $hand xtra auth] != "DEAD"} { setuser $hand xtra auth 0 }
  2955. chattr $hand -3
  2956. putdcc $idx "You are no longer identified.\r"
  2957. }
  2958.  
  2959. ### .permident <nick!user@host>
  2960.  
  2961. proc dcc_lol_permident {hand idx arg} {
  2962. set arg [charfilter $arg]
  2963. if {[llength $arg] != 1} {
  2964. putdcc $idx "\002Usage:\002 .permident <nick!user@host>\r"
  2965. return 0
  2966. }
  2967. set host [lindex $arg 0]
  2968. setuser $hand xtra permident $host
  2969. putdcc $idx "You are now permidentified with this mask: $host. Use \002unpermident\002 to remove it.\r"
  2970. }
  2971.  
  2972. ### .unpermident
  2973.  
  2974. proc dcc_lol_unpermident {hand idx arg} {
  2975. setuser $hand xtra permident ""
  2976. if {[getuser $hand xtra auth] != "DEAD"} { setuser $hand xtra auth 0 }
  2977. chattr $hand -3
  2978. putdcc $idx "You have deleted your permident mask.\r"
  2979. }
  2980.  
  2981. ### .silent
  2982.  
  2983. proc dcc_lol_silent {hand idx arg} {
  2984. set arg [charfilter $arg]
  2985. setuser $hand xtra silent 1
  2986. putdcc $idx "You are now in silent mode.\r"
  2987. putdcc $idx "You will not be notified if you try a command without first being identified.\r"
  2988. putdcc $idx "Use \002.unsilent\002 or message \002unsilent <password>\002 to remove the silent mode.\r"
  2989. }
  2990.  
  2991. ### .unsilent
  2992.  
  2993. proc dcc_lol_unsilent {hand idx arg} {
  2994. set arg [charfilter $arg]
  2995. setuser $hand xtra silent 0
  2996. putdcc $idx "You are no longer in silent mode.\r"
  2997. putdcc $idx "You will be notified if you try a command without first being identified.\r"
  2998. putdcc $idx "Use \002.silent\002 or message \002silent <password>\002 to return to the silent mode.\r"
  2999. }
  3000.  
  3001. ### .botnick <nick>
  3002.  
  3003. proc dcc_lol_botnick {hand idx arg} {
  3004. set arg [charfilter $arg]
  3005. global botnick nick
  3006. if {[llength $arg] != 1} {
  3007. putdcc $idx "\002Usage:\002 .botnick <nick>\r"
  3008. return 0
  3009. }
  3010. set nick [lindex $arg 0]
  3011. }
  3012.  
  3013. ### .param <parameter> <value>
  3014.  
  3015. proc dcc_lol_param {hand idx arg} {
  3016. set arg [charfilter $arg]
  3017. global lol botnick
  3018. if {[llength $arg] != 2} {
  3019. putdcc $idx "\002Usage:\002 .param <parameter> <value>"
  3020. putdcc $idx "\002cmdchar:\002 $lol(cmdchar)"
  3021. putdcc $idx "\002security:\002 $lol(security)"
  3022. putdcc $idx "\002nopass:\002 $lol(nopass)"
  3023. putdcc $idx "\002chankey:\002 $lol(chankey)"
  3024. putdcc $idx "\002silent:\002 $lol(silent)"
  3025. putdcc $idx "\002ident:\002 $lol(ident)"
  3026. putdcc $idx "\002id_confirm:\002 $lol(id_confirm)"
  3027. putdcc $idx "\002clone:\002 $lol(clone)"
  3028. putdcc $idx "\002jokes:\002 $lol(jokes)"
  3029. putdcc $idx "\002help:\002 $lol(help)"
  3030. putdcc $idx "\002troubles:\002 $lol(troubles)"
  3031. putdcc $idx "\002seen:\002 $lol(seen)"
  3032. putdcc $idx "\002time:\002 $lol(time)"
  3033. putdcc $idx "\002chan_flood:\002 $lol(chan_flood)"
  3034. putdcc $idx "\002join_flood:\002 $lol(join_flood)"
  3035. putdcc $idx "\002ctcp_flood:\002 $lol(ctcp_flood)"
  3036. putdcc $idx "\002kick_flood:\002 $lol(kick_flood)"
  3037. putdcc $idx "\002ban_protect:\002 $lol(ban_protect)"
  3038. putdcc $idx "\002chan_parameters:\002 $lol(chan_parameters)"
  3039. putdcc $idx "\002chanmode:\002 $lol(chanmode)"
  3040. putdcc $idx "\002server_flags:\002 $lol(server_flags)"
  3041. putdcc $idx "\002away:\002 $lol(away)"
  3042. putdcc $idx "\002welcome:\002 $lol(welcome)"
  3043. putdcc $idx "\002welmsg:\002 $lol(welmsg)"
  3044. putdcc $idx "\002idle_protect:\002 $lol(idle_protect)"
  3045. putdcc $idx "\002warn_idle_time:\002 $lol(warn_idle_time)"
  3046. putdcc $idx "\002max_idle_time:\002 $lol(max_idle_time)"
  3047. putdcc $idx "\002kick_idle_time:\002 $lol(kick_idle_time)"
  3048. putdcc $idx "\002idle_ban_time:\002 $lol(idle_ban_time)"
  3049. putdcc $idx "\002no_kick_flags:\002 $lol(no_kick_flags)"
  3050. putdcc $idx "\002no_ban_flags:\002 $lol(no_ban_flags)"
  3051. putdcc $idx "\002no_idle_flags:\002 $lol(no_idle_flags)"
  3052. return 0
  3053. }
  3054. set lol([strlwr [lindex $arg 0]]) [lrange $arg 1 end]
  3055. putdcc $idx "The new value of [strlwr [lindex $arg 0]] is [lrange $arg 1 end]."
  3056. return 0
  3057. }
  3058.  
  3059. ### .partyban <user> [reason]
  3060.  
  3061. proc dcc_lol_partyban {hand idx arg} {
  3062. set arg [charfilter $arg]
  3063. global botnick
  3064. if {[llength $arg] < 1} {
  3065. putdcc $idx "\002Usage:\002 .partyban <user> \[reason\]\r"
  3066. return 0
  3067. }
  3068. set user [lindex $arg 0]
  3069. set reason [lrange $arg 1 end]
  3070. if {[matchattr $user o] && ![matchattr $hand o]} {
  3071. putdcc $idx "You can't partyban an op, without being an op.\r"
  3072. return 0
  3073. }
  3074. if {[matchattr $user m] && ![matchattr $hand m]} {
  3075. putdcc $idx "You can't partyban a master, without being a master.\r"
  3076. return 0
  3077. }
  3078. if {[matchattr $user n] && ![matchattr $hand n]} {
  3079. putdcc $idx "You can't partyban an owner, without being an owner.\r"
  3080. return 0
  3081. }
  3082. boot $user $reason
  3083. chattr $user -p
  3084. putdcc $idx "$user has been partybaned.\r"
  3085. }
  3086.  
  3087. ### .chanlist
  3088.  
  3089. proc dcc_lol_chanlist {hand idx arg} {
  3090. set arg [charfilter $arg]
  3091. if {[channels] == ""} {
  3092. putdcc $idx "I'm not on any chans"
  3093. return 0
  3094. }
  3095. putdcc $idx "I'm on these chans:\r"
  3096. foreach chan [channels] { putdcc $idx "$chan\r" }
  3097. }
  3098.  
  3099. ### .seen <nick|hand>
  3100.  
  3101. proc dcc_lol_seen {hand idx arg} {
  3102. set arg [charfilter $arg]
  3103. if {[llength $arg] != 1} {
  3104. putdcc $idx "\002Usage\002: seen <nick|hand>\r"
  3105. return 0
  3106. }
  3107. set who [lindex $arg 0]
  3108. putdcc $idx "[lol_seen $hand $hand $who ""]\r"
  3109. }
  3110.  
  3111. ### .enable <hand>
  3112.  
  3113. proc dcc_lol_enable {hand idx arg} {
  3114. set arg [charfilter $arg]
  3115. if {[llength $arg] != 1} {
  3116. putdcc $idx "\002Usage:\002 .enable <hand>\r"
  3117. return 0
  3118. }
  3119. set who [lindex $arg 0]
  3120. if {![validuser $who]} {
  3121. putdcc $idx "I don't see $who in my user database.\r"
  3122. return 0
  3123. }
  3124. if {[getuser $who xtra auth] != "DEAD"} {
  3125. putdcc $idx "$who is already enabled.\r"
  3126. return 0
  3127. }
  3128. setuser $who xtra auth 0
  3129. putdcc $idx "$who is now enabled.\r"
  3130. return 0
  3131. }
  3132.  
  3133. ### .disable <hand>
  3134.  
  3135. proc dcc_lol_disable {hand idx arg} {
  3136. set arg [charfilter $arg]
  3137. if {[llength $arg] != 1} {
  3138. putdcc $idx "\002Usage:\002 .disable <hand>\r"
  3139. return 0
  3140. }
  3141. set who [lindex $arg 0]
  3142. if {![validuser $who]} {
  3143. putdcc $idx "I don't see $who in my user database.\r"
  3144. return 0
  3145. }
  3146. if {[getuser $who xtra auth] == "DEAD"} {
  3147. putdcc $idx "$who is already disabled.\r"
  3148. return 0
  3149. }
  3150. setuser $who xtra auth DEAD
  3151. chattr $who -3
  3152. putdcc $idx "$who is now disabled.\r"
  3153. return 0
  3154. }
  3155.  
  3156. ### .online
  3157.  
  3158. proc dcc_lol_online {hand idx arg} {
  3159. set arg [charfilter $arg]
  3160. global server {server-online} uptime
  3161. set ip [lindex [split $server ":"] 0]
  3162. set port [lindex [split [lindex [split $server ":"] 1] "-"] 0]
  3163. set timeon [time_diff ${server-online}]
  3164. set numbots 0
  3165. foreach bot [bots] { incr numbots }
  3166. set numchans 0
  3167. foreach ch [channels] { incr numchans }
  3168. putdcc $idx "*** ONLINE info !!! ***\r"
  3169. putdcc $idx "I have not crashed since [time_diff $uptime] ;)\r"
  3170. if {$ip != ""} {
  3171. putdcc $idx "I'm on $ip since $timeon.\r"
  3172. } {
  3173. putdcc $idx "I'm not on a server.\r"
  3174. }
  3175. if {![matchattr $hand o]} {
  3176. putdcc $idx "I'm in $numchans chan(s).\r"
  3177. } {
  3178. if {$numchans != 0} {
  3179. putdcc $idx "I'm in these chans: [channels]\r"
  3180. } {
  3181. putdcc $idx "I'm not in any chans.\r"
  3182. }
  3183. }
  3184. if {![matchattr $hand o]} {
  3185. putdcc $idx "I'm linked with $numbots bot(s).\r"
  3186. } {
  3187. if {$numbots != 0} {
  3188. putdcc $idx "I'm linked with these bots: [bots]\r"
  3189. } {
  3190. putdcc $idx "I'm not linked with any bots.\r"
  3191. }
  3192. }
  3193. }
  3194.  
  3195. ### .join <chan> [chan pass]
  3196.  
  3197. proc dcc_lol_join {han idx arg} {
  3198. set arg [charfilter $arg]
  3199. global lol botnick
  3200. if {[llength $arg] < 1} {
  3201. putdcc $idx "\002Usage:\002 .join <chan> \[chan pass\]\r"
  3202. return 0
  3203. }
  3204. set chan [lindex $arg 0]
  3205. set pass [lindex $arg 1]
  3206. if {$chan != ""} {set chan [chanaddapt $chan]}
  3207. if {[validchan $chan]} {
  3208. putdcc $idx "I'm already monitoring $chan. \r"
  3209. if {$pass != ""} {
  3210. if {$lol(chankey) == 1} {
  3211. putdcc $idx "New pass set for $chan: $pass. \r"
  3212. channel set $chan need-key "chankey $chan $pass"
  3213. } {
  3214. putdcc $idx "I can't memorize password to keep compatibility with getops.tcl\r"
  3215. }
  3216. }
  3217. if {![onchan [strlwr $botnick] $chan]} {
  3218. putdcc $idx "I'll now try to join $chan.\r"
  3219. putserv "JOIN $chan $pass"
  3220. return 0
  3221. }
  3222. putdcc $idx "I'm already in $chan. \r"
  3223. return 0
  3224. }
  3225. putdcc $idx "New chan monitoring: $chan.\r"
  3226. channel add $chan
  3227. channel set $chan chanmode $lol(chanmode)
  3228. channel set $chan flood-chan $lol(chan_flood)
  3229. channel set $chan flood-kick $lol(kick_flood)
  3230. channel set $chan flood-join $lol(join_flood)
  3231. channel set $chan flood-ctcp $lol(ctcp_flood)
  3232. foreach param $lol(chan_parameters) {
  3233. channel set $chan $param
  3234. }
  3235. if {$pass != ""} {
  3236. if {$lol(chankey) == 1} {
  3237. putdcc $idx "New pass set for $chan: $pass. \r"
  3238. channel set $chan need-key "chankey $chan $pass"
  3239. } {
  3240. putdcc $idx "I can't memorize the chan password to keep compatibility with getops.tcl\r"
  3241. }
  3242. }
  3243. putdcc $idx "$chan is now configured. I'll now try to join it.\r"
  3244. putdcc $idx "Use \002.-chan\002 to remove a chan (chan userlist will be deleted).\r"
  3245. putserv "JOIN $chan $pass"
  3246. }
  3247.  
  3248. ### .notice <#chan or nick>
  3249.  
  3250. proc dcc_lol_notice {hand idx arg} {
  3251. if {$arg == ""} { putdcc $idx "Usage: .notice <#chan or nick> <message>." ; return 0 }
  3252. set argument [lindex $arg 0]
  3253. set espace [expr [strlen $argument]+1]
  3254. set text [string range $arg $espace end]
  3255. if {[string first "#" $argument] == 0} {
  3256. if {![validchan $argument] } {putdcc $idx "I'm not on $argument." ; return 0 }
  3257. }
  3258. puthelp "NOTICE $argument :$text"
  3259. putdcc $idx "- $text - has been sent by notice to $argument"
  3260. return 0
  3261. }
  3262.  
  3263. ### .onotice <#chan>
  3264.  
  3265. proc dcc_lol_onotice {hand idx arg} {
  3266. if {$arg == ""} { putdcc $idx "Usage: .onotice <#chan> <message>" ; return 0 }
  3267. set chan [lindex $arg 0]
  3268. set espace [expr [strlen $chan]+1]
  3269. set text [string range $arg $espace end]
  3270. if {![validchan $chan] } {putdcc $idx "I'm not on $chan." ; return 0 }
  3271. puthelp "NOTICE @$chan :$text"
  3272. putdcc $idx "- $text - has been sent by notice to ops on $chan"
  3273. return 0
  3274. }
  3275.  
  3276. ### .part <chan>
  3277.  
  3278. proc dcc_lol_part {han idx arg} {
  3279. set arg [charfilter $arg]
  3280. if {[llength $arg] != 1} {
  3281. putdcc $idx "\002Usage:\002 .part <chan>\r"
  3282. return 0
  3283. }
  3284. set chan [lindex $arg 0]
  3285. if {$chan != ""} {set chan [chanaddapt $chan]}
  3286. if {![validchan $chan]} {
  3287. putdcc $idx "I'm not monitoring $chan. \r"
  3288. return 0
  3289. }
  3290. if {![matchattr $han m|m $chan]} {
  3291. putdcc $idx "Sorry, but you are not a master in $chan."
  3292. return 0
  3293. }
  3294. putdcc $idx "I'll part $chan. \r"
  3295. putdcc $idx "To delete monitoring of this chan, use: \002.-chan $chan\002. \r"
  3296. putserv "PART $chan"
  3297. }
  3298.  
  3299. ### .userlist [flags]
  3300.  
  3301. proc dcc_lol_userlist {hand idx arg} {
  3302. set arg [charfilter $arg]
  3303. set param [lindex $arg 0]
  3304. if {[string match #* $param]} {putdcc $idx "Usage : .userlist flags <#chan>" ; return 0 }
  3305. set chan [lindex $arg 1]
  3306. if { $chan == "" } { set list [userlist $param]
  3307. } else {
  3308. if {![validchan $chan]} { putdcc $idx "I'm not on $chan\r" ; return 0 }
  3309. set list [userlist -|$param $chan]
  3310. }
  3311. putdcc $idx "List of my users : $list\r"
  3312. putdcc $idx "on the whole, your request includes [llength $list] users."
  3313. }
  3314.  
  3315. ### .security
  3316.  
  3317. proc dcc_lol_security {hand idx arg} {
  3318. set arg [charfilter $arg]
  3319. global lol
  3320. putdcc $idx " \002********************************************\r"
  3321. putdcc $idx " \002*** SECURITY RISK WITH DYNAMIC IP by LoL ***\r"
  3322. putdcc $idx " \002********************************************\r"
  3323. putdcc $idx "\r"
  3324. putdcc $idx "Auto-op is dangerous because the majority of people do not have a fixed IP, but a\r"
  3325. putdcc $idx "dynamic IP that changes every time that person connects. When the bot makes the mask value\r"
  3326. putdcc $idx "that it will recognize you by, it uses wildcards (*). For example Bill is identified\r"
  3327. putdcc $idx "on the net like this:\r"
  3328. putdcc $idx "\r"
  3329. putdcc $idx " | nick | | user | | ip addresse |\r"
  3330. putdcc $idx " Complete mask: bill ! bgates @ 195.135.14.28\r"
  3331. putdcc $idx "\r"
  3332. putdcc $idx "But the bot thinks that bill doesn't have a fixed IP address so it wont recognize\r"
  3333. putdcc $idx "bill even if he has a different one. So it decides to recognize bill with this:\r"
  3334. putdcc $idx "\r"
  3335. putdcc $idx " | nick | | user | | ip addresse |\r"
  3336. putdcc $idx " Partial mask: * ! bgates @ 195.135.14.*\r"
  3337. putdcc $idx "\r"
  3338. putdcc $idx "The user part is not secure, any user can take the same user value.\r"
  3339. putdcc $idx "\r"
  3340. putdcc $idx "All users with an IP beginning with 195.135.14 can make\r"
  3341. putdcc $idx "the bot think that they are bill....\r"
  3342. putdcc $idx " "
  3343. putdcc $idx "In this case, all the commands that bill used without a password can now be used by\r"
  3344. putdcc $idx "anyone that matches that IP. If bill used !op !ban !kick command in a chan, anyone with a matching IP\r"
  3345. putdcc $idx "can use them also.\r"
  3346. putdcc $idx "\r"
  3347. putdcc $idx "Now you know where the security hole is, you can change that....You know\r"
  3348. putdcc $idx "that bill has a fixed IP, you tell the bot to use bill's complete IP \r"
  3349. putdcc $idx "to recognize him.\r"
  3350. putdcc $idx "\r"
  3351. putdcc $idx ".-host bill *!bgates@195.135.14.*\r"
  3352. putdcc $idx ".+host bill *!*@195.135.14.28\r"
  3353. putdcc $idx "\r"
  3354. putdcc $idx "Now bill is safe, no one can take his place. What about users\r"
  3355. putdcc $idx "without a fixed ips ? For them you must use * in IPs, so you are never\r"
  3356. putdcc $idx "sure that someone else can't take their place... It's because of this that there is in LoL's Toolz\r"
  3357. putdcc $idx "a complete password protected ident system before any dangerous commands.\r"
  3358. putdcc $idx "\r"
  3359. putdcc $idx "Now back to auto-op :) We face exactly the same problem...So if a user has a fixed\r"
  3360. putdcc $idx "IP address, you must check that the bot has taken the complete address, and then\r"
  3361. putdcc $idx "you can use the auto-op flag, if this user doesn't have a fixed IP address you shouldn't\r"
  3362. putdcc $idx "use the +a flag (+a flag = !OP function).\r"
  3363. putdcc $idx "\r"
  3364. putdcc $idx " $lol(version)\r"
  3365. }
  3366.  
  3367. ### .identhelp
  3368.  
  3369. proc dcc_lol_identhelp {hand idx arg} {
  3370. set arg [charfilter $arg]
  3371. global botnick
  3372. putdcc $idx " \002**************************************\r"
  3373. putdcc $idx " \002*** IDENTIFICATION TUTORIAL BY LOL ***\r"
  3374. putdcc $idx " \002**************************************\r"
  3375. putdcc $idx "\r"
  3376. putdcc $idx "With version 4 of my toolz, the identification system has been added. Before you\r"
  3377. putdcc $idx "can use the chan commands, you must type:\r"
  3378. putdcc $idx "\r"
  3379. putdcc $idx "/msg $botnick ident <password>\r"
  3380. putdcc $idx "\r"
  3381. putdcc $idx "or\r"
  3382. putdcc $idx "\r"
  3383. putdcc $idx "/msg $botnick id <password>\r"
  3384. putdcc $idx "\r"
  3385. putdcc $idx "If you have a recognized user@hostname the bot will identify you. Now you\r"
  3386. putdcc $idx "can use the chan commands.\r"
  3387. putdcc $idx "\r"
  3388. putdcc $idx "If you are an owner you can disable or enable the chan commands for a user:\r"
  3389. putdcc $idx "\r"
  3390. putdcc $idx "partyline:\r"
  3391. putdcc $idx " .enable <hand>\r"
  3392. putdcc $idx " .disable <hand>\r"
  3393. putdcc $idx "msg:\r"
  3394. putdcc $idx " enable <password> <nick|hand> \[chan\]\r"
  3395. putdcc $idx " disable <password> <nick|hand> \[chan\]\r"
  3396. putdcc $idx "chan:\r"
  3397. putdcc $idx " !enable <nick>\r"
  3398. putdcc $idx " !disable <nick>\r"
  3399. putdcc $idx "\r"
  3400. putdcc $idx "The identification is kept as long as the bot can see the user in a chan.\r"
  3401. putdcc $idx "When the user parts all the chans, the bot is on, the identification is removed.\r"
  3402. putdcc $idx "I have make identification 100% compatible with chantoolz and normally\r"
  3403. putdcc $idx "compatible with eggtoolz (concurrent tcl scripts).\r"
  3404. putdcc $idx "\r"
  3405. putdcc $idx "If \"CLONE=1\" all the others that are recognized as you by the bot AND have the same\r"
  3406. putdcc $idx "IP address as the nick that made the identification are allowed to use chan commands.\r"
  3407. putdcc $idx "\r"
  3408. putdcc $idx "Example: your mask is *!darkvador@193.143.*.* and your IP: 193.143.12.23\r"
  3409. putdcc $idx "=> anyone with *!darkvador@193.143.12.23 is recognized as your clones.\r"
  3410. putdcc $idx "\r"
  3411. putdcc $idx "If \"CLONE=0\" only the last nick identified is authorized to use the commands.\r"
  3412. putdcc $idx "Use this for maximum security (against IP spoofing for example). \r"
  3413. putdcc $idx ""
  3414. putdcc $idx "LoL's TooLz detects if you change your nick.\r"
  3415. putdcc $idx "\r"
  3416. putdcc $idx "The variable SILENT alerts a user if he wants to use chan commands without being\r"
  3417. putdcc $idx "identified. Set SILENT = 1 (no warning) can be good for example is there is more\r"
  3418. putdcc $idx "than one bot in the chan using my script, and also to limit the help queue of\r"
  3419. putdcc $idx "the bot. But at the beginning it is good to set SILENT = 0 because without it\r"
  3420. putdcc $idx "the users will not understand why the chan's commands do not work.\r"
  3421. putdcc $idx "\r"
  3422. putdcc $idx "(You can now manually remove the identification using !unident, .unident...)\r"
  3423. putdcc $idx "\r"
  3424. putdcc $idx "Still one thing !!!\r"
  3425. putdcc $idx "\r"
  3426. putdcc $idx "ident <password>\r"
  3427. putdcc $idx "\r"
  3428. putdcc $idx "and\r"
  3429. putdcc $idx "\r"
  3430. putdcc $idx "ident <password> <hand>\r"
  3431. putdcc $idx "\r"
  3432. putdcc $idx "ARE NOT THE SAME COMMANDS !!!\r"
  3433. putdcc $idx "\r"
  3434. putdcc $idx "The first is an LoL TooLz command to enable chan commands.\r"
  3435. putdcc $idx "The second is an eggdrop command to add a host when you have changed hostmasks\r"
  3436. putdcc $idx "or anything...\r"
  3437. putdcc $idx "\r"
  3438. putdcc $idx "Example:\r"
  3439. putdcc $idx "You have changed hostmasks and you come back on IRC:\r"
  3440. putdcc $idx "ident <password> <hand(original nick)> (to add you new address)\r"
  3441. putdcc $idx "ident <password> (to enable chan commands)\r"
  3442. putdcc $idx "\r"
  3443. putdcc $idx "With LoL's TooLz 5.1, a new feature has been added:\r"
  3444. putdcc $idx "PERMIDENT (msg and party-line)\r"
  3445. putdcc $idx "With this, you can set a mask where the bot no longer asks for\r"
  3446. putdcc $idx "identification if you match it.\r"
  3447. putdcc $idx "\r"
  3448. putdcc $idx "Example:\r"
  3449. putdcc $idx "/msg $botnick permident <password>\r"
  3450. putdcc $idx "The mask added is your current *!user@IP, the COMPLETE IP is used by\r"
  3451. putdcc $idx "default. If you want to specify another mask you can make it like that:\r"
  3452. putdcc $idx "/msg $botnick permident <password> <mask>\r"
  3453. putdcc $idx "Be careful choosing it!\r"
  3454. putdcc $idx "\r"
  3455. putdcc $idx "Hope this has helped you.\r"
  3456. }
  3457.  
  3458. ### .addop <nick> <chan> [hand]
  3459.  
  3460. proc dcc_lol_addop {handy idx arg} {
  3461. set arg [charfilter $arg]
  3462. global botnick
  3463. if {[llength $arg] < 2} {
  3464. putdcc $idx "\002Usage:\002 .addop <nick> <chan> \[hand\]\r"
  3465. return 0
  3466. }
  3467. set nick [lindex $arg 0]
  3468. set chan [strlwr [lindex $arg 1]]
  3469. if {$chan != ""} {set chan [chanaddapt $chan]}
  3470. set alternate [lindex $arg 2]
  3471. if {![validchan $chan]} {
  3472. putdcc $idx "I'm not on $chan\r"
  3473. return 0
  3474. }
  3475. if {![matchattr $handy m|m $chan]} {
  3476. putdcc $idx "Sorry, but you are not a master in $chan.\r"
  3477. return 0
  3478. }
  3479. set hostmask "$nick![getchanhost $nick $chan]"
  3480. set hand [nick2hand $nick $chan]
  3481. if {![onchan $nick $chan]} {
  3482. putdcc $idx "Sorry, but I don't see $nick in $chan.\r"
  3483. return 0
  3484. }
  3485. if {[strlwr $nick] == [strlwr $botnick]} {
  3486. putdcc $idx "Sorry, but I can't addop myself.\r"
  3487. return 0
  3488. }
  3489. if {[getting-users]} {
  3490. putdcc $idx "Sorry, but I'm transferring the userfile, try later.\r"
  3491. return 0
  3492. }
  3493. if {![validuser $hand]} {
  3494. if {[validuser $nick] && $alternate == ""} {
  3495. putdcc $idx "The hand $nick already exists. \002Usage:\002 .addop <nick> <chan> <hand>\r"
  3496. return 0
  3497. }
  3498. if {$alternate != ""} {
  3499. if {[validuser $alternate]} {
  3500. putdcc $idx "The hand $alternate already exists. Choose another. \002Usage:\002 .addop <nick> <chan> <hand>\r"
  3501. return 0
  3502. }
  3503. adduser $alternate [maskhost $hostmask]
  3504. chattr $alternate +p|+o $chan
  3505. putdcc $idx "New user: $alternate ([maskhost $hostmask])\r"
  3506. putdcc $idx "$nick added to the $chan oplist and party-line with the hand: $alternate.\r"
  3507. puthelp "NOTICE $nick :You have been added to the $chan oplist and party-line by $handy with the hand: $alternate."
  3508. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick pass <your_password>\002"
  3509. if {[botisop $chan]} {pushmode $chan +o $nick}
  3510. return 0
  3511. }
  3512. adduser $nick [maskhost $hostmask]
  3513. chattr $nick +p|+o $chan
  3514. putdcc $idx "New user: $nick ([maskhost $hostmask])\r"
  3515. putdcc $idx "$nick added to the $chan oplist and party-line with the hand: $nick.\r"
  3516. puthelp "NOTICE $nick :You have been added to the $chan oplist and party-line by $handy with the hand: $nick."
  3517. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick pass <your_password>\002"
  3518. if {[botisop $chan]} {pushmode $chan +o $nick}
  3519. return 0
  3520. }
  3521. if {$alternate != ""} {
  3522. if {[validuser $alternate]} {
  3523. putdcc $idx "The hand $alternate already exists. \002Usage:\002 .addop <nick> <chan> <hand>\r"
  3524. return 0
  3525. }
  3526. adduser $alternate [maskhost $hostmask]
  3527. chattr $alternate +p|+o $chan
  3528. putdcc $idx "New user: $alternate ([maskhost $hostmask])\r"
  3529. putdcc $idx "$nick added to the $chan oplist and party-line with the hand: $alternate.\r"
  3530. puthelp "NOTICE $nick :You have been added to the $chan oplist and party-line by $handy with the hand: $alternate."
  3531. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick PASS <your_password>\002"
  3532. if {[botisop $chan]} {pushmode $chan +o $nick}
  3533. return 0
  3534. }
  3535. if {[matchattr $hand -|+o $chan]} {
  3536. putdcc $idx "$nick is already an op in $chan with this hand: $hand\r"
  3537. } {
  3538. chattr $hand -|+o $chan
  3539. putdcc $idx "$nick added to the $chan oplist with this hand: $hand.\r"
  3540. puthelp "NOTICE $nick :You have been added to the $chan oplist by $handy."
  3541. }
  3542. if {[botisop $chan]} {pushmode $chan +o $nick}
  3543. return 0
  3544. }
  3545.  
  3546. ### .delop <nick> <chan>
  3547.  
  3548. proc dcc_lol_delop {handy idx arg} {
  3549. set arg [charfilter $arg]
  3550. global botnick
  3551. if {[llength $arg] != 2} {
  3552. putdcc $idx "\002Usage:\002 .delop <nick> <chan>\r"
  3553. return 0
  3554. }
  3555. set nick [lindex $arg 0]
  3556. set chan [strlwr [lindex $arg 1]]
  3557. if {$chan != ""} {set chan [chanaddapt $chan]}
  3558.  
  3559. if {![validchan $chan]} {
  3560. putdcc $idx "I'm not on $chan "
  3561. return 0
  3562. }
  3563. if {![matchattr $handy m|m $chan]} {
  3564. putdcc $idx "Sorry, but you are not a master in $chan.\r"
  3565. return 0
  3566. }
  3567. set hand [nick2hand $nick $chan]
  3568. if {![onchan $nick $chan]} {
  3569. putdcc $idx "Sorry, but I don't see $nick in $chan.\r"
  3570. return 0
  3571. }
  3572. if {[strlwr $nick] == [strlwr $botnick]} {
  3573. putdcc $idx "Yeah right, like I'm going to let you delop ME!\r"
  3574. return 0
  3575. }
  3576. if {![validuser $hand]} {
  3577. putdcc $idx "$nick is not a registered user.\r"
  3578. if {[botisop $chan]} {pushmode }
  3579. return 0
  3580. }
  3581. if {[getting-users]} {
  3582. putdcc $idx "Sorry, but I'm transferring the userfile, try later.\r"
  3583. return 0
  3584. }
  3585. if {![matchattr $hand -|+o $chan]} {
  3586. putdcc $idx "$nick is not an op in $chan\r"
  3587. } {
  3588. chattr $hand -|- $chan
  3589. putdcc $idx "$nick has been removed from the $chan oplist.\r"
  3590. puthelp "NOTICE $nick :You have been removed from the $chan oplist by $handy."
  3591. }
  3592. if {[botisop $chan]} {pushmode }
  3593. return 0
  3594. }
  3595.  
  3596. ### .channel <chan>
  3597.  
  3598. proc dcc_lol_channel {a b arg} {
  3599. set arg [charfilter $arg]
  3600. if {[llength $arg] != 1} {
  3601. putdcc $b "\002Usage:\002 .channel <chan>\r"
  3602. return 0
  3603. }
  3604. set chan [lindex $arg 0]
  3605. if {$chan != ""} {set chan [chanaddapt $chan]}
  3606. if {[validchan $chan]} {
  3607. if {![isdynamic $chan]} {
  3608. putdcc $b "$chan is a STATIC channel\r"
  3609. if {![matchattr $a o|o $chan]} {
  3610. putdcc $b "You are not an operator in $chan.\r"
  3611. return 0
  3612. }
  3613. *dcc:channel $a $b $chan
  3614. return 0
  3615. } {
  3616. putdcc $b "$chan is a DYNAMIC channel\r"
  3617. if {![matchattr $a o|o $chan]} {
  3618. putdcc $b "You are not an operator in $chan.\r"
  3619. return 0
  3620. }
  3621. *dcc:channel $a $b $chan
  3622. return 0
  3623. }
  3624. } {
  3625. if {![matchattr $a o]} {
  3626. putdcc $b "You need to be a global op to join a new chan.\r"
  3627. return 0
  3628. }
  3629. putdcc $b "Joining $chan...\r"
  3630. channel add $chan
  3631. utimer 10 "*dcc:channel $a $b $chan"
  3632. utimer 15 "partchan $b $chan"
  3633. }
  3634. return 0
  3635. }
  3636.  
  3637. proc partchan {b chan} {
  3638. putdcc $b "Parting $chan...\r"
  3639. channel remove $chan
  3640. }
  3641.  
  3642. ### .mode <chan> <flags>
  3643.  
  3644. proc dcc_lol_mode {a b arg} {
  3645. set arg [charfilter $arg]
  3646. if {[llength $arg] < 2} {
  3647. putdcc $b "\002Usage:\002 .mode <chan> <flags>\r"
  3648. return 0
  3649. }
  3650. set chan [lindex $arg 0]
  3651. if {$chan != ""} {set chan [chanaddapt $chan]}
  3652. set flags [lrange $arg 1 end]
  3653. if {![validchan $chan]} { putdcc $b "I'm not on $chan \r" ; return 0 }
  3654. if {![botisop $chan]} { putdcc $b "Sorry, I'm not an op in $chan\r" ; return 0 }
  3655. if {[matchattr $a o|o $chan]} {
  3656. putserv "MODE $chan $flags"
  3657. putdcc $b "Mode of $chan changed.\r"
  3658. } {
  3659. putdcc $b "You are not an operator in $chan.\r"
  3660. }
  3661. }
  3662.  
  3663. ### .help
  3664.  
  3665. proc dcc_lol_help {a b c} {
  3666. set arg [charfilter $c]
  3667. global lol
  3668. *dcc:help $a $b $c
  3669. putdcc $b "\r"
  3670. putdcc $b "!!! Type \002.help-lol\002 to see the special commands for $lol(version) !!!\r"
  3671. }
  3672.  
  3673. ### .gpl-lol
  3674.  
  3675. proc dcc_lol_gpl-lol {hand idx arg} {
  3676. set arg [charfilter $arg]
  3677. global lol
  3678. putdcc $idx "\r"
  3679. putdcc $idx "Eggdrop TCL Script: $lol(version).\r"
  3680. putdcc $idx "Copyright (C) 1998-2002 LL Productions.\r"
  3681. putdcc $idx "\r"
  3682. putdcc $idx "LoL's TooLz HomePage: http://www.leonini.net/\r"
  3683. putdcc $idx "\r"
  3684. putdcc $idx "This program is free software; you can redistribute it and/or\r"
  3685. putdcc $idx "modify it under the terms of the GNU General Public License 2\r"
  3686. putdcc $idx "\r"
  3687. putdcc $idx "This program is distributed in the hope that it will be useful,\r"
  3688. putdcc $idx "but WITHOUT ANY WARRANTY; without even the implied warranty of\r"
  3689. putdcc $idx "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r"
  3690. putdcc $idx "GNU General Public License for more details.\r"
  3691. putdcc $idx "\r"
  3692. putdcc $idx "You should have received a copy of the GNU General Public License\r"
  3693. putdcc $idx "along with this program; if not, write to the Free Software\r"
  3694. putdcc $idx "Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\r"
  3695. putdcc $idx "\r"
  3696. }
  3697.  
  3698. ### .help-lol
  3699.  
  3700. proc dcc_lol_help-lol {hand idx arg} {
  3701. set arg [charfilter $arg]
  3702. global lol
  3703. if {[lindex $arg 0] == ""} {
  3704. putdcc $idx " \002******************************************\r"
  3705. putdcc $idx " \002* Party-line commands for LOL's Toolz ***\r"
  3706. putdcc $idx " \002******************************************\r"
  3707. putdcc $idx "\r"
  3708. putdcc $idx "\037TYPE | COMMAND | DESCRIPTION | FLAGS\r"
  3709. putdcc $idx "DCC .param <parameter> <value> Set a bot's global variable. n\r"
  3710. putdcc $idx "DCC .enable <hand> Enable chan commands for a disabled user. n\r"
  3711. putdcc $idx "DCC .disable <hand> Disable chan commands for a user. n\r"
  3712. putdcc $idx "DCC .userlist \[flags\] Sort the bot's users. n\r"
  3713. putdcc $idx "DCC .join <chan> \[chan pass\] Join or create a new chan. n\r"
  3714. putdcc $idx "DCC .partyban <hand> Boot a user and remove partyline flag. m\r"
  3715. putdcc $idx "DCC .botnick <nick> Change the botnick. m\r"
  3716. putdcc $idx "DCC .part <chan> Parts a chan but doesn't delete the chan's userlist. m|m\r"
  3717. putdcc $idx "DCC .security Security risk with dynamic IP. m|m\r"
  3718. putdcc $idx "DCC .addop <nick> <chan> \[hand\] Add op and partyline flags. m|m\r"
  3719. putdcc $idx "DCC .delop <nick> <chan> Remove op flag. m|m\r"
  3720. putdcc $idx "DCC .userlist <flags> Show bot's userlist. o\r"
  3721. putdcc $idx "DCC .chanlist <chan> Show bot's channels. o\r"
  3722. putdcc $idx "DCC .online Show bot's online info. o\r"
  3723. putdcc $idx "DCC .channel <chan> Show who is in a chan. o|o\r"
  3724. putdcc $idx "DCC .mode <chan> <flags> Change the channel attributes. o|o\r"
  3725. putdcc $idx "DCC .unident Disable the chan commands. -\r"
  3726. putdcc $idx "DCC .seen <nick|hand> Show the last time a user was online. -\r"
  3727. putdcc $idx "DCC .permident <mask> Set a permident mask. -\r"
  3728. putdcc $idx "DCC .unpermident Remove the permident mask. -\r"
  3729. putdcc $idx "DCC .silent Disable ident alert for chan commands. -\r"
  3730. putdcc $idx "DCC .unsilent Enable ident alert for chan commands. -\r"
  3731. putdcc $idx "DCC .help-lol \[chan or msg\] This help and more... -\r"
  3732. putdcc $idx "DCC .chanhelp Help on chan commands. -\r"
  3733. putdcc $idx "DCC .identhelp Tutorial on ident system. -\r"
  3734. putdcc $idx "\r"
  3735. putdcc $idx "For chan commands type: .help-lol chan \r"
  3736. putdcc $idx "For messages commands type: .help-lol msg \r"
  3737. putdcc $idx "\r"
  3738. putdcc $idx "Please report me the bugs to \002lolstoolz@leonini.net\002. Thanks\r"
  3739. return 0
  3740. }
  3741. if {[lindex $arg 0] == "chan"} {
  3742. putdcc $idx " \002************************************\r"
  3743. putdcc $idx " \002*** Chan commands for LOL's Toolz ***\r"
  3744. putdcc $idx " \002************************************\r"
  3745. putdcc $idx "\r"
  3746. putdcc $idx "\037TYPE | COMMAND | DESCRIPTION | FLAGS\r"
  3747. putdcc $idx "CHAN [string trim $lol(cmdchar)]param <parameter> <value> Set a global bot variable n\r"
  3748. putdcc $idx "CHAN [string trim $lol(cmdchar)]enable <nick> Enable chan commands for a disabled user. n\r"
  3749. putdcc $idx "CHAN [string trim $lol(cmdchar)]disable <nick> Disable chan commands for a user. n\r"
  3750. putdcc $idx "CHAN [string trim $lol(cmdchar)]deluser <nick|hand> \[chan\] Remove a user or a bot. n\r"
  3751. putdcc $idx "CHAN [string trim $lol(cmdchar)]addhost <nick|hand> \[host\] Add a host. n\r"
  3752. putdcc $idx "CHAN [string trim $lol(cmdchar)]delhost <nick|hand> <host> Delete a host. n\r"
  3753. putdcc $idx "CHAN [string trim $lol(cmdchar)]join <chan> \[chan pass\] Join or create a new chan. n\r"
  3754. putdcc $idx "CHAN [string trim $lol(cmdchar)]remove <chan> Remove a chan and it's userlist. n\r"
  3755. putdcc $idx "CHAN [string trim $lol(cmdchar)]addmaster <nick> \[hand\] Add chan masterflag. n|n\r"
  3756. putdcc $idx "CHAN [string trim $lol(cmdchar)]delmaster <nick> Delete chan masterflag. n|n\r"
  3757. putdcc $idx "CHAN [string trim $lol(cmdchar)]jump <server> \[port\] Jump to a new server. m\r"
  3758. putdcc $idx "CHAN [string trim $lol(cmdchar)]botnick <nick> Change the botnick. m\r"
  3759. putdcc $idx "CHAN [string trim $lol(cmdchar)]adduser <nick> \[hand\] Add a user. m|m\r"
  3760. putdcc $idx "CHAN [string trim $lol(cmdchar)]addbot <nick> \[port\] \[hand\] Add a bot. m|m\r"
  3761. putdcc $idx "CHAN [string trim $lol(cmdchar)]addop <nick> \[hand\] See .addop. m|m\r"
  3762. putdcc $idx "CHAN [string trim $lol(cmdchar)]delop <nick> See .delop. m|m\r"
  3763. putdcc $idx "CHAN [string trim $lol(cmdchar)]findip <mask> Search users that match IP mask. m|m\r"
  3764. putdcc $idx "CHAN [string trim $lol(cmdchar)]online Show bot's online information. o|o\r"
  3765. putdcc $idx "CHAN [string trim $lol(cmdchar)]mode <flags> Changes chan attributes. o|o\r"
  3766. putdcc $idx "CHAN [string trim $lol(cmdchar)]ban <nick|mask> \[time\] \[reason\] Ban a user (time 0 = perm ban). o|o\r"
  3767. putdcc $idx "CHAN [string trim $lol(cmdchar)]unban <mask|number> Unban a mask. o|o\r"
  3768. putdcc $idx "CHAN [string trim $lol(cmdchar)]broadcast <text> Send text to all the chans you have ops on. o|o\r"
  3769. putdcc $idx "CHAN [string trim $lol(cmdchar)]addvoice <nick> \[hand\] Add voice and partyline flags. o|o\r"
  3770. putdcc $idx "CHAN [string trim $lol(cmdchar)]delvoice <nick> Remove voice flag. o|o\r"
  3771. putdcc $idx "CHAN [string trim $lol(cmdchar)]op \[nick\] Op a user. o|o\r"
  3772. putdcc $idx "CHAN [string trim $lol(cmdchar)]whois <nick> Show a user's handle. o|o\r"
  3773. putdcc $idx "CHAN [string trim $lol(cmdchar)]quick <nick|mask> \[reason\] Kick a user and ban him 7 seconds. o|o\r"
  3774. putdcc $idx "CHAN [string trim $lol(cmdchar)]mirc Kick the mIRC users. o|o\r"
  3775. putdcc $idx "CHAN [string trim $lol(cmdchar)]eggdrop Kick the Eggdrops. o|o\r"
  3776. putdcc $idx "CHAN [string trim $lol(cmdchar)]ircii Kick the IRCII users. o|o\r"
  3777. putdcc $idx "CHAN [string trim $lol(cmdchar)]bitchx Kick the BitchX users. o|o\r"
  3778. putdcc $idx "CHAN [string trim $lol(cmdchar)]topic <topic> Set a new topic. o|o\r"
  3779. putdcc $idx "CHAN [string trim $lol(cmdchar)]chattr <nick> <flags> Change a user's flags. o|o\r"
  3780. putdcc $idx "CHAN [string trim $lol(cmdchar)]voice \[nick\] Voice a user. v|v\r"
  3781. putdcc $idx "CHAN [string trim $lol(cmdchar)]devoice \[nick\] Devoice a user. v|v\r"
  3782. putdcc $idx "CHAN [string trim $lol(cmdchar)]kick <nick|mask> \[reason\] Kick a user. v|v\r"
  3783. putdcc $idx "CHAN [string trim $lol(cmdchar)]stats Show channel stats. v|v\r"
  3784. putdcc $idx "CHAN [string trim $lol(cmdchar)]cigarette \[nick\] Offer a cigarette :) v|v\r"
  3785. putdcc $idx "CHAN [string trim $lol(cmdchar)]rose \[nick\] Offer a beautiful rose :) v|v\r"
  3786. putdcc $idx "CHAN [string trim $lol(cmdchar)]pastaga \[nick\] Give a glass of pastaga :) v|v\r"
  3787. putdcc $idx "CHAN [string trim $lol(cmdchar)]beer \[nick\] Give a beer :) v|v\r"
  3788. putdcc $idx "CHAN [string trim $lol(cmdchar)]coke \[nick\] Give a delicious coke :) v|v\r"
  3789. putdcc $idx "CHAN [string trim $lol(cmdchar)]penalty \[player\] \[ball\] Shoot a penalty (french joke). v|v\r"
  3790. putdcc $idx "CHAN [string trim $lol(cmdchar)]unident Disable the chan commands. -\r"
  3791. putdcc $idx "CHAN [string trim $lol(cmdchar)]unpermident Remove the permident mask. -\r"
  3792. putdcc $idx "CHAN [string trim $lol(cmdchar)]seen <nick|hand> Show the last time a user was online. -\r"
  3793. putdcc $idx "CHAN [string trim $lol(cmdchar)]help Show a short help in chan. -\r"
  3794. putdcc $idx "CHAN [string trim $lol(cmdchar)]time Show the actual time. -\r"
  3795. putdcc $idx "CHAN [string trim $lol(cmdchar)]troubles A help to resolve certain problems. -\r"
  3796. putdcc $idx "\r"
  3797. putdcc $idx "Try .chanhelp too ;) another version of this help.\r"
  3798. putdcc $idx "For party-line commands type: .help-lol \r"
  3799. putdcc $idx "For messages commands type: .help-lol msg \r"
  3800. putdcc $idx "\r"
  3801. putdcc $idx "$lol(version)\r"
  3802. putdcc $idx "Report me the bugs, thanks. \002lolstoolz@leonini.net\002\r"
  3803. return 0
  3804. }
  3805. if {[lindex $arg 0] == "msg"} {
  3806. putdcc $idx " \002****************************************\r"
  3807. putdcc $idx " \002*** Messages commands for LOL's Toolz ***\r"
  3808. putdcc $idx " \002****************************************\r"
  3809. putdcc $idx "\r"
  3810. putdcc $idx "\002 THE FIRST PARAMETER OF ALL THESE COMMANDS IS ALWAYS YOUR PASSWORD.\r"
  3811. putdcc $idx "\r"
  3812. putdcc $idx "\037TYPE | COMMAND | DESCRIPTION | FLAGS\r"
  3813. putdcc $idx "MSG param <parameter> <value> Set a global variable. n\r"
  3814. putdcc $idx "MSG enable <hand> Enable chan commands for a disabled user. n\r"
  3815. putdcc $idx "MSG disable <hand> Disable chan commands for a user. n\r"
  3816. putdcc $idx "MSG join <chan> \[chan pass\] Join or create a new chan. n\r"
  3817. putdcc $idx "MSG remove <chan> Remove a chan and chan's users. n\r"
  3818. putdcc $idx "MSG deluser <hand> Remove a user from the bot. n\r"
  3819. putdcc $idx "MSG addhost <hand> <host> See !addhost. n\r"
  3820. putdcc $idx "MSG delhost <hand> <host> See !delhost. n\r"
  3821. putdcc $idx "MSG addmaster <nick> <chan> \[hand\] See !addmaster. n|n\r"
  3822. putdcc $idx "MSG msg <chan or nick> <message> Send a message. m\r"
  3823. putdcc $idx "MSG botnick <nick> Change the botnick. m\r"
  3824. putdcc $idx "MSG part <chan> Part a chan but doesn't remove the userlist. m|m\r"
  3825. putdcc $idx "MSG addop <nick> <chan> \[hand\] See !addop. m|m\r"
  3826. putdcc $idx "MSG adduser <nick> <chan> \[hand\] See !adduser. m|m\r"
  3827. putdcc $idx "MSG addbot <nick> <chan> \[port\] \[hand\] See !addbot. m|m\r"
  3828. putdcc $idx "MSG chattr <hand> <flags> \[chan\] See !chattr. o|o\r"
  3829. putdcc $idx "MSG broadcast <password> <text> See !broadcast. o|o\r"
  3830. putdcc $idx "MSG addvoice <nick> <chan> \[hand\] See !addvoice. o|o\r"
  3831. putdcc $idx "MSG ban <nick|mask> <chan> \[time\] \[reason\] See !ban. o|o\r"
  3832. putdcc $idx "MSG unban <mask|number> <chan> See !unban. o|o\r"
  3833. putdcc $idx "MSG mode <chan> <flags> See !mode. o|o\r"
  3834. putdcc $idx "MSG key <chan> Send the chan key if you have op there. o|o\r"
  3835. putdcc $idx "MSG quick <nick|mask> <chan> See !quick. o|o\r"
  3836. putdcc $idx "MSG banlist <chan> See !banlist. o|o\r"
  3837. putdcc $idx "MSG unban <mask> <chan> See !unban. o|o\r"
  3838. putdcc $idx "MSG whois <nick> Show the hand of an user. o|o\r"
  3839. putdcc $idx "MSG invite \[chan\] Invite you to a chan. v|v\r"
  3840. putdcc $idx "MSG seen <nick|hand> Show the last time a user was online. -\r"
  3841. putdcc $idx "MSG ident Enable the chan commands. -\r"
  3842. putdcc $idx "MSG unident Disable the chan commands. -\r"
  3843. putdcc $idx "MSG permident \[mask\] Set a permident mask. -\r"
  3844. putdcc $idx "MSG unpermident Disable the permident mask. -\r"
  3845. putdcc $idx "MSG silent Disable bot alert for ident. -\r"
  3846. putdcc $idx "MSG unsilent Enable bot alert for ident. -\r"
  3847. putdcc $idx "MSG help Bot help + LoL's toolz msg quick help. -\r"
  3848. putdcc $idx "\r"
  3849. putdcc $idx "For party-line commands type: .help-lol\r"
  3850. putdcc $idx "For chan commands type: .help-lol chan\r"
  3851. putdcc $idx "\r"
  3852. putdcc $idx "$lol(version)\r"
  3853. putdcc $idx "Report the bugs please, thanks. \002lolstoolz@leonini.net\002\r"
  3854. return 0
  3855. }
  3856. putdcc $idx "\002Usage\002: .help-lol \[chan or msg\]\r"
  3857. return 0
  3858. }
  3859.  
  3860. ### .chanhelp
  3861.  
  3862. proc dcc_lol_chanhelp {hand idx arg} {
  3863. set arg [charfilter $arg]
  3864. global lol botnick
  3865. putdcc $idx " \002****************************\r"
  3866. putdcc $idx " \002*** CHAN'S COMMANDS HELP ***\r"
  3867. putdcc $idx " \002****************************\r"
  3868. putdcc $idx "\r"
  3869. putdcc $idx "Before to use the chan functions, you need to identify yourself:\r"
  3870. putdcc $idx "\002/msg $botnick id <password>\002\r"
  3871. putdcc $idx " \r"
  3872. putdcc $idx "\037Global owners:\r"
  3873. putdcc $idx "\002[string trim $lol(cmdchar)]param <parameter> <value>\002 to set a global bot variable.\r"
  3874. putdcc $idx "\002[string trim $lol(cmdchar)]enable <nick>\002 to enable chan commands for a disabled user.\r"
  3875. putdcc $idx "\002[string trim $lol(cmdchar)]disable <nick>\002 to disable chan commands for a user.\r"
  3876. putdcc $idx "\002[string trim $lol(cmdchar)]deluser <nick>\002 to delete a user or a bot.\r"
  3877. putdcc $idx "\002[string trim $lol(cmdchar)]join <chan> \[chan pass\]\002 to join or create a new chan.\r"
  3878. putdcc $idx "\002[string trim $lol(cmdchar)]remove \[chan\]\002 to remove a chan and it's userfile.\r"
  3879. putdcc $idx "\002[string trim $lol(cmdchar)]jump <server> \[port\]\002 to jump to a new server.\r"
  3880. putdcc $idx "\002[string trim $lol(cmdchar)]addhost <nick|hand> \[host\]\002 to add a host.\r"
  3881. putdcc $idx "\002[string trim $lol(cmdchar)]delhost <nick|hand> <host>\002 to delete a host.\r"
  3882. putdcc $idx " \r"
  3883. putdcc $idx "\037Chan owners:\r"
  3884. putdcc $idx "\002[string trim $lol(cmdchar)]addmaster <nick> \[hand\] \002 to give master and partyline flags.\r"
  3885. putdcc $idx "\002[string trim $lol(cmdchar)]delmaster <nick>\002 to remove master flag.\r"
  3886. putdcc $idx " \r"
  3887. putdcc $idx "\037Global masters:\r"
  3888. putdcc $idx "\002[string trim $lol(cmdchar)]jump <server> \[port\]\002 to jump to a new server.\r"
  3889. putdcc $idx "\002[string trim $lol(cmdchar)]botnick <nick>\002 to change the botnick.\r"
  3890. putdcc $idx " \r"
  3891. putdcc $idx "\037Chan masters:\r"
  3892. putdcc $idx "\002[string trim $lol(cmdchar)]addop <nick> \[hand\] \002 to give op and partyline flags.\r"
  3893. putdcc $idx "\002[string trim $lol(cmdchar)]delop <nick>\002 to remove op flag.\r"
  3894. putdcc $idx "\002[string trim $lol(cmdchar)]adduser <nick> \[hand\]\002 to add a user.\r"
  3895. putdcc $idx "\002[string trim $lol(cmdchar)]addbot <nick> \[port\] \[hand\]\002 to add a bot.\r"
  3896. putdcc $idx "\002[string trim $lol(cmdchar)]findip <mask>\002 Search users that match IP mask.\r"
  3897. putdcc $idx " \r"
  3898. putdcc $idx "\037Chan ops:\r"
  3899. putdcc $idx "\002[string trim $lol(cmdchar)]chattr <nick> <flags>\002 to set specifics flags for a user.\r"
  3900. putdcc $idx "\002[string trim $lol(cmdchar)]online\002 to see bot's online information.\r"
  3901. putdcc $idx "\002[string trim $lol(cmdchar)]mode <flags>\002 to change the chan modes.\r"
  3902. putdcc $idx "\002[string trim $lol(cmdchar)]banlist\002 show chan banlist.\r"
  3903. putdcc $idx "\002[string trim $lol(cmdchar)]ban <nick|mask> \[time\]\002 to ban someone (time 0 = perm ban).\r"
  3904. putdcc $idx "\002[string trim $lol(cmdchar)]unban <mask|number>\002 to unban a mask.\r"
  3905. putdcc $idx "\002[string trim $lol(cmdchar)]addvoice <nick> \[hand\] \002 to give voice and partyline flags.\r"
  3906. putdcc $idx "\002[string trim $lol(cmdchar)]delvoice <nick>\002 to remove voice flag.\r"
  3907. putdcc $idx "\002[string trim $lol(cmdchar)]op \[nick\]\002 to op.\r"
  3908. putdcc $idx "\002[string trim $lol(cmdchar)]broadcast <text>\002 to send a message to all the chans you have op on.\r"
  3909. putdcc $idx "\002[string trim $lol(cmdchar)]topic <topic>\002 to change topic.\r"
  3910. putdcc $idx "\002[string trim $lol(cmdchar)]whois <nick>\002 to see the a user's hand.\r"
  3911. putdcc $idx "\002[string trim $lol(cmdchar)]quick <nick|mask> \[reason\]\002 to kick someone and ban him 7 seconds.\r"
  3912. putdcc $idx "\002[string trim $lol(cmdchar)]mirc\002 to kick the mIRC users.\r"
  3913. putdcc $idx "\002[string trim $lol(cmdchar)]eggdrop\002 to kick the Eggdrops.\r"
  3914. putdcc $idx "\002[string trim $lol(cmdchar)]ircii\002 to kick the IRCII users.\r"
  3915. putdcc $idx "\002[string trim $lol(cmdchar)]bitchx\002 to kick the BitchX users.\r"
  3916. putdcc $idx " \r"
  3917. putdcc $idx "\037Chan voiced:\r"
  3918. putdcc $idx "\002[string trim $lol(cmdchar)]voice \[nick\]\002 to voice.\r"
  3919. putdcc $idx "\002[string trim $lol(cmdchar)]devoice \[nick\]\002 to devoice.\r"
  3920. putdcc $idx "\002[string trim $lol(cmdchar)]kick <nick|mask> \[reason\]\002 to kick someone.\r"
  3921. putdcc $idx "\002[string trim $lol(cmdchar)]stats\002 to see channel stats.\r"
  3922. putdcc $idx "\002[string trim $lol(cmdchar)]cigarette \[nick\]\002 to offer a cigarette :)\r"
  3923. putdcc $idx "\002[string trim $lol(cmdchar)]rose \[nick\]\002 to offer beautiful rose :)\r"
  3924. putdcc $idx "\002[string trim $lol(cmdchar)]pastaga (or [string trim $lol(cmdchar)]pastis or [string trim $lol(cmdchar)]51) \[nick\]\002 to give a glass of pastaga :)\r"
  3925. putdcc $idx "\002[string trim $lol(cmdchar)]coke (or [string trim $lol(cmdchar)]coca-cola) \[nick\]\002 to give a delicious coke :)\r"
  3926. putdcc $idx "\002[string trim $lol(cmdchar)]beer \[nick\]\002 to give a beer :)\r"
  3927. putdcc $idx " \r"
  3928. putdcc $idx "\037Public:\r"
  3929. putdcc $idx "\002[string trim $lol(cmdchar)]unident\002 to disable the chan commands.\r"
  3930. putdcc $idx "\002[string trim $lol(cmdchar)]unpermident\002 to disable the permident mask.\r"
  3931. putdcc $idx "\002[string trim $lol(cmdchar)]time\002 to get time.\r"
  3932. putdcc $idx "\002[string trim $lol(cmdchar)]seen <nick|hand>\002 to view when a user was last on irc.\r"
  3933. putdcc $idx "\002[string trim $lol(cmdchar)]troubles\002 if you have certain problems with ident especially.\r"
  3934. putdcc $idx "\002[string trim $lol(cmdchar)]help\002 to receive a short help.\r"
  3935. putdcc $idx " \r"
  3936. putdcc $idx "If some commands don't work, it's probably because the administrator has\r"
  3937. putdcc $idx "disabled them.\r"
  3938. putdcc $idx " \r"
  3939. putdcc $idx "Report the bugs please, thanks. \002lolstoolz@leonini.net\002\r"
  3940. return 0
  3941. }
  3942.  
  3943. ################# END OF DCC COMMANDS #################
  3944.  
  3945. ################# START OF MSG COMMANDS #################
  3946.  
  3947. ### seen <nick|hand>
  3948.  
  3949. proc msg_lol_seen {nick host hand arg} {
  3950. set arg [charfilter $arg]
  3951. if {$hand == "*"} {return 0}
  3952. if {[llength $arg] != 1} {
  3953. puthelp "PRIVMSG $nick :\002Usage\002: seen <nick|hand>"
  3954. return 0
  3955. }
  3956. set who [lindex $arg 0]
  3957. puthelp "PRIVMSG $nick :[lol_seen $nick $hand $who ""]"
  3958. return 0
  3959. }
  3960.  
  3961. ### silent <password>
  3962.  
  3963. proc msg_lol_silent {nick host hand arg} {
  3964. set arg [charfilter $arg]
  3965. if {$hand == "*"} {return 0}
  3966. if {[llength $arg] != 1} {
  3967. puthelp "PRIVMSG $nick :\002Usage:\002 silent <password>"
  3968. return 0
  3969. }
  3970. if {![passwdok $hand [lindex $arg 0]]} {
  3971. puthelp "PRIVMSG $nick :Invalid password. \002Usage:\002 silent <password>"
  3972. return 0
  3973. }
  3974. setuser $hand xtra silent 1
  3975. puthelp "PRIVMSG $nick :You are now in silent mode. You won't be notified if you try a command without first being identified. Use \002unsilent\002 to remove the silent mode."
  3976. }
  3977.  
  3978. ### unsilent <password>
  3979.  
  3980. proc msg_lol_unsilent {nick host hand arg} {
  3981. set arg [charfilter $arg]
  3982. if {$hand == "*"} {return 0}
  3983. if {[llength $arg] != 1} {
  3984. puthelp "PRIVMSG $nick :\002Usage:\002 unsilent <password>"
  3985. return 0
  3986. }
  3987. if {![passwdok $hand [lindex $arg 0]]} {
  3988. puthelp "PRIVMSG $nick :Invalid password. \002Usage:\002 unsilent <password>"
  3989. return 0
  3990. }
  3991. setuser $hand xtra silent 0
  3992. puthelp "PRIVMSG $nick :You are no longer in silent mode. You will be notified if you try a command without first being identified. Use \002silent\002 to return in the silent mode."
  3993. }
  3994.  
  3995. ### unpermident <password>
  3996.  
  3997. proc msg_lol_unpermident {nick host hand arg} {
  3998. set arg [charfilter $arg]
  3999. if {$hand == "*"} {return 0}
  4000. if {[llength $arg] != 1} {
  4001. puthelp "PRIVMSG $nick :\002Usage:\002 unpermident <password>"
  4002. return 0
  4003. }
  4004. if {![passwdok $hand [lindex $arg 0]]} {
  4005. puthelp "PRIVMSG $nick :Invalid password. \002Usage:\002 unpermident <password>"
  4006. return 0
  4007. }
  4008. setuser $hand xtra permident ""
  4009. if {[getuser $hand xtra auth] != "DEAD"} {
  4010. setuser $hand xtra auth 0
  4011. }
  4012. chattr $hand -3
  4013. puthelp "PRIVMSG $nick :You are no longer using a permident mask.\r"
  4014. }
  4015.  
  4016. ### unident <password>
  4017.  
  4018. proc msg_lol_unident {nick host hand arg} {
  4019. set arg [charfilter $arg]
  4020. if {$hand == "*"} {return 0}
  4021. if {[llength $arg] != 1} {
  4022. puthelp "PRIVMSG $nick :\002Usage:\002 unident <password>"
  4023. return 0
  4024. }
  4025. if {![passwdok $hand [lindex $arg 0]]} {
  4026. puthelp "PRIVMSG $nick :Invalid password. \002Usage:\002 unident <password>"
  4027. return 0
  4028. }
  4029. if {![check $hand $nick $host]} {
  4030. puthelp "PRIVMSG $nick :You are already unidentified."
  4031. return 0
  4032. }
  4033. if {[getuser $hand xtra auth] != "DEAD"} {
  4034. setuser $hand xtra auth 0
  4035. }
  4036. chattr $hand -3
  4037. puthelp "PRIVMSG $nick :You are no longer identified."
  4038. }
  4039.  
  4040. ### botnick <password> <nick>
  4041.  
  4042. proc msg_lol_botnick {mynick host hand arg} {
  4043. set arg [charfilter $arg]
  4044. global nick
  4045. if {[llength $arg] != 2} {
  4046. puthelp "PRIVMSG $mynick :\002Usage:\002 botnick <password> <nick>"
  4047. return 0
  4048. }
  4049. if {![passwdok $hand [lindex $arg 0]]} {
  4050. puthelp "PRIVMSG $mynick :Invalid password. \002Usage:\002 botnick <password> <nick>"
  4051. return 0
  4052. }
  4053. set nick [lindex $arg 1]
  4054. }
  4055.  
  4056. ### addhost <password> <hand> <host>
  4057.  
  4058. proc msg_lol_addhost {nick host hand arg} {
  4059. set arg [charfilter $arg]
  4060. if {[llength $arg] != 3} {
  4061. puthelp "PRIVMSG $nick :\002Usage:\002 addhost <password> <hand> <host>"
  4062. return 0
  4063. }
  4064. set who [lindex $arg 1]
  4065. set host [lindex $arg 2]
  4066. if {![passwdok $hand [lindex $arg 0]]} {
  4067. puthelp "PRIVMSG $nick :Invalid password. \002Usage:\002 addhost <password> <hand> <host>"
  4068. return 0
  4069. }
  4070. if {[passwdok $hand ""]} {
  4071. puthelp "PRIVMSG $nick :You must set a password: pass <your_new_password>"
  4072. return 0
  4073. }
  4074. if {[validuser $who] == "*"} {
  4075. puthelp "PRIVMSG $nick :$who is not a registered user."
  4076. return 0
  4077. }
  4078. if {![matchattr $hand m]} {
  4079. puthelp "PRIVMSG $nick :Sorry, but you are not a global master."
  4080. return 0
  4081. }
  4082. setuser $who hosts $host
  4083. puthelp "PRIVMSG $nick :$host added for $who."
  4084. return 0
  4085. }
  4086.  
  4087. ### delhost <password> <hand> <host>
  4088.  
  4089. proc msg_lol_delhost {nick host hand arg} {
  4090. set arg [charfilter $arg]
  4091. if {[llength $arg] != 3} {
  4092. puthelp "PRIVMSG $nick :\002Usage:\002 delhost <password> <hand> <host>"
  4093. return 0
  4094. }
  4095. set who [lindex $arg 1]
  4096. set host [lindex $arg 2]
  4097. if {![passwdok $hand [lindex $arg 0]]} {
  4098. puthelp "PRIVMSG $nick :Invalid password \002Usage:\002 delhost <password> <hand> <host>"
  4099. return 0
  4100. }
  4101. if {[passwdok $hand ""]} {
  4102. puthelp "PRIVMSG $nick :You must set a password: pass <your_new_password>"
  4103. return 0
  4104. }
  4105. if {[validuser $who] == "*"} {
  4106. puthelp "PRIVMSG $nick :$who is not a registered user."
  4107. return 0
  4108. }
  4109. if {![matchattr $hand m]} {
  4110. puthelp "PRIVMSG $nick :Sorry, but you are not a global master."
  4111. return 0
  4112. }
  4113. if {[delhost $who $host]} {
  4114. puthelp "PRIVMSG $nick :$host removed for $who."
  4115. return 0
  4116. } {
  4117. puthelp "PRIVMSG $nick :I can't remove $host at $who."
  4118. return 0
  4119. }
  4120. }
  4121.  
  4122. ### chattr <password> <hand> <flags> [chan]
  4123.  
  4124. proc msg_lol_chattr {nick host hand arg} {
  4125. set arg [charfilter $arg]
  4126. if {[llength $arg] < 3} {
  4127. puthelp "PRIVMSG $nick :\002Usage:\002 chattr <password> <hand> <flags> \[chan\]"
  4128. return 0
  4129. }
  4130. set who [lindex $arg 1]
  4131. set flags [lindex $arg 2]
  4132. set chan [lindex $arg 3]
  4133. if {![passwdok $hand [lindex $arg 0]]} {
  4134. puthelp "PRIVMSG $nick :Invalid password \002Usage:\002 chattr <password> <hand> <flags> \[chan\]"
  4135. return 0
  4136. }
  4137. if {[passwdok $hand ""]} {
  4138. puthelp "PRIVMSG $nick :You must set a password: pass <your_new_password>"
  4139. return 0
  4140. }
  4141. if {[validuser $who] == "*"} {
  4142. puthelp "PRIVMSG $nick :$who is not a registered user."
  4143. return 0
  4144. }
  4145. if {$chan != ""} {
  4146. if {[matchattr $hand n|n $chan]} {
  4147. set change [chattr $who -|$flags $chan]
  4148. if {$change != ""} {
  4149. set change [lindex [split $change "|"] 1]
  4150. puthelp "PRIVMSG $nick :$who now has these flags in $chan: $change"
  4151. return 0
  4152. }
  4153. puthelp "PRIVMSG $nick :The flags for $who have not changed."
  4154. return 0
  4155. }
  4156. regsub -all -- "n" $flags "" flags
  4157. regsub -all -- "m" $flags "" flags
  4158. if {[matchattr $hand m|m $chan]} {
  4159. set change [chattr $who -|$flags $chan]
  4160. if {$change != ""} {
  4161. set change [lindex [split $change "|"] 1]
  4162. puthelp "PRIVMSG $nick :$who now has these flags in $chan: $change"
  4163. return 0
  4164. }
  4165. puthelp "PRIVMSG $nick :The flags for $who have not changed."
  4166. return 0
  4167. }
  4168. regsub -all -- "o" $flags "" flags
  4169. if {[matchattr $hand o|o $chan]} {
  4170. set change [chattr $who -|$flags $chan]
  4171. if {$change != ""} {
  4172. set change [lindex [split $change "|"] 1]
  4173. puthelp "PRIVMSG $nick :$who now has these flags in $chan: $change"
  4174. return 0
  4175. }
  4176. puthelp "PRIVMSG $nick :The flags for $who have not changed."
  4177. return 0
  4178. }
  4179. } {
  4180. if {[matchattr $hand n]} {
  4181. set change [chattr $who $flags]
  4182. if {$change != ""} {
  4183. puthelp "PRIVMSG $nick :$who now has global flags: $change"
  4184. return 0
  4185. }
  4186. puthelp "PRIVMSG $nick :The flags for $who have not changed."
  4187. return 0
  4188. }
  4189. regsub -all -- "n" $flags "" flags
  4190. regsub -all -- "m" $flags "" flags
  4191. if {[matchattr $hand m]} {
  4192. set change [chattr $who $flags]
  4193. if {$change != ""} {
  4194. puthelp "PRIVMSG $nick :$who now has these global flags: $change"
  4195. return 0
  4196. }
  4197. puthelp "PRIVMSG $nick :The flags for $who have not changed."
  4198. return 0
  4199. }
  4200. regsub -all -- "o" $flags "" flags
  4201. if {[matchattr $hand o]} {
  4202. set change [chattr $who $flags]
  4203. if {$change != ""} {
  4204. puthelp "PRIVMSG $nick :$who now has these global flags: $change"
  4205. return 0
  4206. }
  4207. puthelp "PRIVMSG $nick :The flags for $who have not changed."
  4208. return 0
  4209. }
  4210. }
  4211. puthelp "PRIVMSG $nick :You do not have enough rights to use this function."
  4212. return 0
  4213. }
  4214.  
  4215. ### param <password> <parameter> <value>
  4216.  
  4217. proc msg_lol_param {nick host hand arg} {
  4218. set arg [charfilter $arg]
  4219. global lol botnick
  4220. if {[llength $arg] != 3} {
  4221. puthelp "PRIVMSG $nick :\002Usage:\002 param <password> <parameter> <value>"
  4222. return 0
  4223. }
  4224. if {![passwdok $hand [lindex $arg 0]]} {
  4225. puthelp "PRIVMSG $nick :Invalid password \002Usage:\002 param <password> <parameter> <value>"
  4226. return 0
  4227. }
  4228. if {[passwdok $hand ""]} {
  4229. puthelp "PRIVMSG $nick :You must set a password: pass <your_new_password>"
  4230. return 0
  4231. }
  4232. if {[lindex $arg 2] == ""} {
  4233. puthelp "PRIVMSG $nick :\002Usage:\002 [string trim $lol(cmdchar)]param <parameter> <value>"
  4234. set param_display ""
  4235. append param_display "\002cmdchar:\002 $lol(cmdchar)"
  4236. append param_display " "
  4237. append param_display "\002security:\002 $lol(security)"
  4238. append param_display " "
  4239. append param_display "\002nopass:\002 $lol(nopass)"
  4240. append param_display " "
  4241. append param_display "\002chankey:\002 $lol(chankey)"
  4242. append param_display " "
  4243. append param_display "\002silent:\002 $lol(silent)"
  4244. append param_display " "
  4245. append param_display "\002ident:\002 $lol(ident)"
  4246. append param_display " "
  4247. append param_display "\002id_confirm:\002 $lol(id_confirm)"
  4248. append param_display " "
  4249. append param_display "\002clone:\002 $lol(clone)"
  4250. append param_display " "
  4251. append param_display "\002jokes:\002 $lol(jokes)"
  4252. append param_display " "
  4253. append param_display "\002help:\002 $lol(help)"
  4254. append param_display " "
  4255. append param_display "\002troubles:\002 $lol(troubles)"
  4256. append param_display " "
  4257. append param_display "\002seen:\002 $lol(seen)"
  4258. append param_display " "
  4259. append param_display "\002time:\002 $lol(time)"
  4260. append param_display " "
  4261. append param_display "\002chan_flood:\002 $lol(chan_flood)"
  4262. append param_display " "
  4263. append param_display "\002join_flood:\002 $lol(join_flood)"
  4264. append param_display " "
  4265. append param_display " "
  4266. append param_display "\002ctcp_flood:\002 $lol(ctcp_flood)"
  4267. append param_display " "
  4268. append param_display "\002kick_flood:\002 $lol(kick_flood)"
  4269. append param_display " "
  4270. append param_display "\002chan_parameters:\002 $lol(chan_parameters)"
  4271. puthelp "PRIVMSG $nick :$param_display"
  4272. set param_display ""
  4273. append param_display "\002ban_protect:\002 $lol(ban_protect)"
  4274. append param_display " "
  4275. append param_display "\002chanmode:\002 $lol(chanmode)"
  4276. append param_display " "
  4277. append param_display "\002server_flags:\002 $lol(server_flags)"
  4278. append param_display " "
  4279. append param_display "\002welcome:\002 $lol(welcome)"
  4280. append param_display " "
  4281. append param_display "\002idle_protect:\002 $lol(idle_protect)"
  4282. append param_display " "
  4283. append param_display "\002warn_idle_time:\002 $lol(warn_idle_time)"
  4284. append param_display " "
  4285. append param_display "\002max_idle_time:\002 $lol(max_idle_time)"
  4286. append param_display " "
  4287. append param_display "\002kick_idle_time:\002 $lol(kick_idle_time)"
  4288. append param_display " "
  4289. append param_display "\002idle_ban_time:\002 $lol(idle_ban_time)"
  4290. append param_display " "
  4291. append param_display "\002no_kick_flags:\002 $lol(no_kick_flags)"
  4292. append param_display " "
  4293. append param_display "\002no_ban_flags:\002 $lol(no_ban_flags)"
  4294. append param_display " "
  4295. append param_display "\002no_idle_flags:\002 $lol(no_idle_flags)"
  4296. puthelp "PRIVMSG $nick :$param_display"
  4297. set param_display ""
  4298. append param_display "\002welmsg:\002 $lol(welmsg)"
  4299. puthelp "PRIVMSG $nick :$param_display"
  4300. set param_display ""
  4301. append param_display "\002away:\002 $lol(away)"
  4302. puthelp "PRIVMSG $nick :$param_display"
  4303. return 0
  4304. }
  4305. set lol([strlwr [lindex $arg 1]]) [lrange $arg 2 end]
  4306. puthelp "PRIVMSG $nick :The new value for [strlwr [lindex $arg 1]] is [lrange $arg 2 end]."
  4307. return 0
  4308. }
  4309.  
  4310. ### enable <password> <hand>
  4311.  
  4312. proc msg_lol_enable {nick host hand arg} {
  4313. set arg [charfilter $arg]
  4314. global botnick
  4315. if {[llength $arg] != 2} {
  4316. puthelp "PRIVMSG $nick :\002Usage:\002 enable <password> <hand>"
  4317. return 0
  4318. }
  4319. set who [lindex $arg 1]
  4320. if {![passwdok $hand [lindex $arg 0]]} {
  4321. puthelp "PRIVMSG $nick :Invalid password \002Usage:\002 enable <password> <hand>"
  4322. return 0
  4323. }
  4324. if {[passwdok $hand ""]} {
  4325. puthelp "PRIVMSG $nick :You must set a password: pass <your_new_password>"
  4326. return 0
  4327. }
  4328. if {[validuser $who] == "*"} {
  4329. puthelp "PRIVMSG $nick :$who is not a registered user."
  4330. return 0
  4331. }
  4332. if {[getuser $who xtra auth] != "DEAD"} {
  4333. puthelp "PRIVMSG $nick :$who is already enabled."
  4334. return 0
  4335. }
  4336. setuser $who xtra auth 0
  4337. puthelp "PRIVMSG $nick :$who is now enabled."
  4338. return 0
  4339. }
  4340.  
  4341. ### disable <password> <hand>
  4342.  
  4343. proc msg_lol_disable {nick host hand arg} {
  4344. set arg [charfilter $arg]
  4345. global botnick
  4346. if {[llength $arg] != 2} {
  4347. puthelp "PRIVMSG $nick :\002Usage:\002 disable <password> <hand>"
  4348. return 0
  4349. }
  4350. set who [lindex $arg 1]
  4351. if {![passwdok $hand [lindex $arg 0]]} {
  4352. puthelp "PRIVMSG $nick :Invalid password \002Usage:\002 disable <password> <hand>"
  4353. return 0
  4354. }
  4355. if {[passwdok $hand ""]} {
  4356. puthelp "PRIVMSG $nick :You must set a password: pass <your_new_password>"
  4357. return 0
  4358. }
  4359. if {[validuser $who] == "*"} {
  4360. puthelp "PRIVMSG $nick :$who is not a registered user."
  4361. return 0
  4362. }
  4363. if {[getuser $who xtra auth] == "DEAD"} {
  4364. puthelp "PRIVMSG $nick :$who is already disabled."
  4365. return 0
  4366. }
  4367. setuser $who xtra auth DEAD
  4368. chattr $who -3
  4369. puthelp "PRIVMSG $nick :$who is now disabled."
  4370. return 0
  4371. }
  4372.  
  4373. ### ident <password> [username]
  4374.  
  4375. proc msg_lol_ident {nick host hand arg} {
  4376. set arg [charfilter $arg]
  4377. global lol botnick
  4378. if {$hand == "*"} {
  4379. if {[llength $arg] < 2 || [llength $arg] > 2} {return 0}
  4380. set find 0
  4381. foreach user [userlist] {
  4382. if {[strlwr $user] == [strlwr [lindex $arg 1]]} {
  4383. set find 1
  4384. break
  4385. }
  4386. }
  4387. if {$find == 0} {return 0}
  4388. if {[passwdok [strlwr [lindex $arg 1]] [lindex $arg 0]]} {
  4389. *msg:ident $nick $host $hand $arg
  4390. }
  4391. return 0
  4392. }
  4393. if {[llength $arg] > 2} {return 0}
  4394. set pass [lindex $arg 0]
  4395. if {[passwdok $hand ""]} {
  4396. puthelp "PRIVMSG $nick :You must set a new password: pass <your_new_password>"
  4397. return 0
  4398. }
  4399. if {[llength $arg] < 1} {
  4400. puthelp "PRIVMSG $nick :\002Usage:\002 ident <password>"
  4401. return 0
  4402. }
  4403. if {[llength $arg] > 1} {
  4404. if {[strlwr [lindex $arg 1]] != [strlwr $hand]} {
  4405. return 0
  4406. } {
  4407. if {![passwdok $hand $pass]} {return 0}
  4408. }
  4409. puthelp "PRIVMSG $nick :You are already recognized by the bot :-) Don't worry about your mask ! \002Usage:\002 ident <password>"
  4410. return 0
  4411. }
  4412. if {![passwdok $hand $pass]} {
  4413. puthelp "PRIVMSG $nick :Invalid password \002Usage:\002 ident <password>"
  4414. return 0
  4415. }
  4416. if {[getuser $hand xtra auth] == "DEAD"} {
  4417. puthelp "PRIVMSG $nick :Sorry, your chan commands are disabled."
  4418. return 0
  4419. }
  4420. set find 0
  4421. foreach ch [channels] {
  4422. if {[onchan $nick $ch]} {
  4423. set find 1
  4424. break
  4425. }
  4426. }
  4427. if {$find == 0} {
  4428. puthelp "PRIVMSG $nick :You must be in one of my chans to be identified."
  4429. return 0
  4430. }
  4431. setuser $hand xtra auth 1
  4432. setuser $hand xtra authnick $nick
  4433. set host [lindex [split $host "@"] 1]
  4434. setuser $hand xtra authhost $host
  4435. chattr $hand +3
  4436. if {$lol(id_confirm) == 1} {
  4437. puthelp "PRIVMSG $nick :You have been identified. You can unident yourself with \002unident\002, set a perm ident mask with \002permident\002 and remove chan ident alert with \002silent\002."
  4438. }
  4439. return 0
  4440. }
  4441.  
  4442. ### permident <password> [nick!user@host]
  4443.  
  4444. proc msg_lol_permident {nick host hand arg} {
  4445. set arg [charfilter $arg]
  4446. if {$hand == "*"} {return 0}
  4447. global botnick
  4448. if {[llength $arg] < 1} {
  4449. puthelp "PRIVMSG $nick :\002Usage:\002 permident <password> \[nick!user@host\]"
  4450. return 0
  4451. }
  4452. set mask [lindex $arg 1]
  4453. if {![passwdok $hand [lindex $arg 0]]} {
  4454. puthelp "PRIVMSG $nick :Invalid password \002Usage:\002 permident <password> \[user@host\]"
  4455. return 0
  4456. }
  4457. if {[passwdok $hand ""]} {
  4458. puthelp "PRIVMSG $nick :You must set a password: pass <your_new_password>"
  4459. return 0
  4460. }
  4461. set find 0
  4462. foreach ch [channels] {
  4463. if {[onchan $nick $ch]} {
  4464. set find 1
  4465. break
  4466. }
  4467. }
  4468. if {$find == 0 && $mask == ""} {
  4469. puthelp "PRIVMSG $nick :You must be in one of my chans to be permidentified, or use: permident <password> <user@host>."
  4470. return 0
  4471. }
  4472. if {$mask == ""} {
  4473. setuser $hand xtra permident *!$host
  4474. } {
  4475. setuser $hand xtra permident $mask
  4476. }
  4477. puthelp "PRIVMSG $nick :You are now permidentified with this mask: [getuser $hand xtra permident]. Use \002unpermident\002 to remove it."
  4478. }
  4479.  
  4480. ### online <password>
  4481.  
  4482. proc msg_lol_online {nick host hand arg} {
  4483. set arg [charfilter $arg]
  4484. global server {server-online} uptime
  4485. if {[llength $arg] != 1} {
  4486. puthelp "PRIVMSG $nick :\002Usage:\002 online <password>"
  4487. return 0
  4488. }
  4489. set ip [lindex [split $server ":"] 0]
  4490. set port [lindex [split [lindex [split $server ":"] 1] "-"] 0]
  4491. set timeon [time_diff ${server-online}]
  4492. if {![passwdok $hand [lindex $arg 0]]} {
  4493. puthelp "PRIVMSG $nick :Invalid password \002Usage:\002 online <password>"
  4494. return 0
  4495. }
  4496. if {[passwdok $hand ""]} {
  4497. puthelp "PRIVMSG $nick :You must set a password: pass <your_new_password>"
  4498. return 0
  4499. }
  4500. set numbots 0
  4501. foreach bot [bots] { incr numbots }
  4502. set numchans 0
  4503. foreach ch [channels] { incr numchans }
  4504.  
  4505. set msg ""
  4506. append msg "*** ONLINE info !!! ***"
  4507. append msg "I have not crashed since [time_diff $uptime] ;) "
  4508. append msg "\002I'm on $ip since $timeon.\002 "
  4509. if {![matchattr $hand o]} {
  4510. append msg "I'm in $numchans chan(s)."
  4511. } {
  4512. if {$numchans != 0} {
  4513. append msg "I'm in these chans: [channels]. "
  4514. } {
  4515. append msg "I'm not in any chans. "
  4516. }
  4517. }
  4518. if {![matchattr $hand o]} {
  4519. append msg "\002I'm linked with $numbots bot(s).\002 "
  4520. } {
  4521. if {$numbots != 0} {
  4522. append msg "\002I'm linked with these bots: [bots]\002 "
  4523. } {
  4524. append msg "\002I'm not linked with any bots.\002 "
  4525. }
  4526. }
  4527. puthelp "PRIVMSG $nick :$msg"
  4528. }
  4529.  
  4530. ### broadcast <password> <text>
  4531.  
  4532. proc msg_lol_broadcast {nick host c arg} {
  4533. set arg [charfilter $arg]
  4534. if {[llength $arg] < 2} {
  4535. puthelp "PRIVMSG $nick :\002Usage:\002 broadcast <password> <text>"
  4536. return 0
  4537. }
  4538. set text [lrange $arg 1 end]
  4539. if {![passwdok $hand [lindex $arg 0]]} {
  4540. puthelp "PRIVMSG $nick :Invalid password \002Usage:\002 broadcast <password> <text>"
  4541. return 0
  4542. }
  4543. if {[passwdok $hand ""]} {
  4544. puthelp "PRIVMSG $nick :You must set a password: pass <your_new_password>"
  4545. return 0
  4546. }
  4547. foreach chan [channels] {
  4548. if {[matchattr $c o|o $chan]} {
  4549. puthelp "PRIVMSG $chan :\002<$nick>:\002 $text"
  4550. }
  4551. }
  4552. }
  4553.  
  4554. ### key <password> <chan>
  4555.  
  4556. proc msg_lol_key {nick host hand arg} {
  4557. set arg [charfilter $arg]
  4558. if {[llength $arg] != 2} {
  4559. puthelp "PRIVMSG $nick :\002Usage\002: key <password> <chan>"
  4560. return 0
  4561. }
  4562. set chan [lindex $arg 1]
  4563. if {$chan != ""} {set chan [chanaddapt $chan]}
  4564. if {![passwdok $hand [lindex $arg 0]]} {
  4565. puthelp "PRIVMSG $nick :Invalid password \002Usage:\002 key <password> <chan>"
  4566. return 0
  4567. }
  4568. if {[passwdok $hand ""]} {
  4569. puthelp "PRIVMSG $nick :You must set a password: pass <your_new_password>"
  4570. return 0
  4571. }
  4572. if {![validchan $chan]} {
  4573. puthelp "PRIVMSG $nick :I'm not in $chan "
  4574. return 0
  4575. }
  4576. if {![matchattr $hand o|o $chan]} {
  4577. puthelp "PRIVMSG $nick :Sorry, but you are not an operator in $chan."
  4578. return 0
  4579. }
  4580. set mode [getchanmode $chan]
  4581. if {[string first k [lindex $mode 0]] != -1} {
  4582. set posmode [string first k [lindex $mode 0]]
  4583. if {[string first l [lindex $mode 0]] != -1} {
  4584. set poslim [string first l [lindex $mode 0]]
  4585. if {$posmode < $poslim} {
  4586. puthelp "PRIVMSG $nick :The key for $chan is [lindex $mode 1]."
  4587. } {
  4588. puthelp "PRIVMSG $nick :The key for $chan is [lindex $mode 2]."
  4589. }
  4590. } {
  4591. puthelp "PRIVMSG $nick :The key for $chan is [lindex $mode 1]."
  4592. }
  4593. return 0
  4594. }
  4595. puthelp "PRIVMSG $nick :$chan does not require a key to enter."
  4596. }
  4597.  
  4598. ## kick <password> <nick|mask> <chan> [reason]
  4599.  
  4600. proc msg_lol_kick {nick host hand arg} {
  4601. set arg [charfilter $arg]
  4602. global botnick
  4603. if {[llength $arg] < 2} {
  4604. puthelp "PRIVMSG $nick :\002Usage:\002 kick <password> <nick|mask> <chan> \[reason\]"
  4605. return 0
  4606. }
  4607. set who [lindex $arg 1]
  4608. set chan [lindex $arg 2]
  4609. set reason [lrange $arg 3 end]
  4610. if {$chan != ""} {set chan [chanaddapt $chan]}
  4611. if {$reason == ""} {
  4612. set reason "requested"
  4613. }
  4614. if {![passwdok $hand [lindex $arg 0]]} {
  4615. puthelp "PRIVMSG $nick :Invalid password \002Usage:\002 kick <password> <nick|mask> <chan> \[reason\]"
  4616. return 0
  4617. }
  4618. if {[passwdok $hand ""]} {
  4619. puthelp "PRIVMSG $nick :You must set a password: pass <your_new_password>"
  4620. return 0
  4621. }
  4622. if {![validchan $chan]} {
  4623. puthelp "PRIVMSG $nick :I'm not in $chan "
  4624. return 0
  4625. }
  4626. if {![botisop $chan]} {
  4627. puthelp "PRIVMSG $nick :Sorry, I'm not an op in $chan"
  4628. return 0
  4629. }
  4630. if {![matchattr $hand ov|ov $chan]} {
  4631. puthelp "PRIVMSG $nick :Sorry, but you are not an operator nor do you have voice in $chan."
  4632. return 0
  4633. }
  4634. ### GLOBAL nick hand chan who
  4635. if {[string first "*" $who] != -1 || [string first "?" $who] != -1} {
  4636. if {![matchattr $hand o|o $chan]} {
  4637. puthelp "PRIVMSG $nick :You need to be an op in $chan to use mask kick."
  4638. return 0
  4639. }
  4640. if {$reason == "requested"} {set reason "MaskKick: $who"}
  4641. set who [strlwr $who]
  4642. set kickcount 0
  4643.  
  4644. if {$kickcount == 0} {
  4645. puthelp "PRIVMSG $nick :Sorry but nobody matches this mask in $chan."
  4646. }
  4647. } {
  4648. if {![onchan $who $chan]} {
  4649. puthelp "PRIVMSG $nick :Sorry, but I don't see $who in $chan."
  4650. return 0
  4651. }
  4652. if {[strlwr $who] == [strlwr $botnick]} {
  4653. puthelp "PRIVMSG $nick :Yeah right, like I'm going to let you kick ME!"
  4654. return 0
  4655. }
  4656. if {[nick2hand $who $chan] != "*"} {
  4657. if {$hand != [nick2hand $who $chan]} {
  4658. if {[matchattr [nick2hand $who $chan] o|o $chan] && ![matchattr $hand o|o $chan]} {
  4659. puthelp "PRIVMSG $nick :Sorry, you must to be an operator in $chan to kick an operator."
  4660. return 0
  4661. }
  4662. if {([matchattr [nick2hand $who $chan] m|m $chan] || [matchattr [nick2hand $who $chan] b]) && ![matchattr $hand m|m $chan]} {
  4663. puthelp "PRIVMSG $nick :Sorry, you must to be a master in $chan to kick a master or a bot."
  4664. return 0
  4665. }
  4666. }
  4667. }
  4668. putserv "KICK $chan $who :$reason"
  4669. }
  4670. return 0
  4671. }
  4672.  
  4673. ### quick <password> <nick|mask> <chan> [reason]
  4674.  
  4675. proc msg_lol_quick {nick host hand arg} {
  4676. set arg [charfilter $arg]
  4677. global botnick
  4678. if {[llength $arg] < 2} {
  4679. puthelp "PRIVMSG $nick :\002Usage:\002 quick <password> <nick|mask> <chan> \[reason\]"
  4680. return 0
  4681. }
  4682. set who [lindex $arg 1]
  4683. set chan [lindex $arg 2]
  4684. set reason [lrange $arg 3 end]
  4685. if {$chan != ""} {set chan [chanaddapt $chan]}
  4686. if {$reason == ""} {
  4687. set reason "requested"
  4688. }
  4689. if {![passwdok $hand [lindex $arg 0]]} {
  4690. puthelp "PRIVMSG $nick :Invalid password \002Usage:\002 kick <password> <nick|mask> <chan> \[reason\]"
  4691. return 0
  4692. }
  4693. if {[passwdok $hand ""]} {
  4694. puthelp "PRIVMSG $nick :You must set a password: pass <your_new_password>"
  4695. return 0
  4696. }
  4697. if {![validchan $chan]} {
  4698. puthelp "PRIVMSG $nick :I'm not in $chan "
  4699. return 0
  4700. }
  4701. if {![botisop $chan]} {
  4702. puthelp "PRIVMSG $nick :Sorry, I'm not an op in $chan"
  4703. return 0
  4704. }
  4705. if {![matchattr $hand ov|ov $chan]} {
  4706. puthelp "PRIVMSG $nick :Sorry, but you are not an operator nor do you have voice in $chan."
  4707. return 0
  4708. }
  4709. ### GLOBAL nick hand chan who
  4710. if {[string first "*" $who] != -1 || [string first "?" $who] != -1} {
  4711. if {![matchattr $hand o|o $chan]} {
  4712. puthelp "PRIVMSG $nick :You need to be an op in $chan to use mask kick."
  4713. return 0
  4714. }
  4715. if {$reason == "requested"} {set reason "MaskQuick: $who"}
  4716. set who [strlwr $who]
  4717. set kickcount 0
  4718. foreach chanuser [strlwr [chanlist $chan -mnovfb&-mnovfb]] {
  4719. if {[string match [strlwr $who] [strlwr $chanuser]] && $chanuser != [strlwr $botnick]} {
  4720. incr kickcount
  4721. set hostmask "*!*[getchanhost $chanuser $chan]"
  4722. if {[isop $chanuser $chan]} {pushmode }
  4723. putserv "MODE $chan +b $hostmask"
  4724. putserv "KICK $chan $chanuser :$reason"
  4725. utimer 7 "deban $chan $hostmask"
  4726. }
  4727. }
  4728. if {$kickcount == 0} {
  4729. puthelp "PRIVMSG $nick :Sorry but nobody matches this mask in $chan."
  4730. }
  4731. } {
  4732. if {![onchan $who $chan]} {
  4733. puthelp "PRIVMSG $nick :Sorry, but I don't see $who in $chan."
  4734. return 0
  4735. }
  4736. if {[strlwr $who] == [strlwr $botnick]} {
  4737. puthelp "PRIVMSG $nick :Yeah right, like I'm going to let you kick ME!"
  4738. return 0
  4739. }
  4740. if {[nick2hand $who $chan] != "*"} {
  4741. if {$hand != [nick2hand $who $chan]} {
  4742. if {[matchattr [nick2hand $who $chan] o|o $chan] && ![matchattr $hand o|o $chan]} {
  4743. puthelp "PRIVMSG $nick :Sorry, you must to be an operator in $chan to kick an operator."
  4744. return 0
  4745. }
  4746. if {([matchattr [nick2hand $who $chan] m|m $chan] || [matchattr [nick2hand $who $chan] b]) && ![matchattr $hand m|m $chan]} {
  4747. puthelp "PRIVMSG $nick :Sorry, you must to be a master in $chan to kick a master or a bot."
  4748. return 0
  4749. }
  4750. }
  4751. }
  4752. set hostmask "*!*[getchanhost $who $chan]"
  4753. if {[isop $who $chan]} {pushmode }
  4754. putserv "MODE $chan +b $hostmask"
  4755. putserv "KICK $chan $who :$reason"
  4756. utimer 7 "deban $chan $hostmask"
  4757. }
  4758. return 0
  4759. }
  4760.  
  4761. ### banlist <password> <chan>
  4762.  
  4763. proc msg_lol_banlist {nick host hand arg} {
  4764. set arg [charfilter $arg]
  4765. if {[llength $arg] != 2} {
  4766. puthelp "PRIVMSG $nick :\002Usage:\002 banlist <password> <chan>"
  4767. return 0
  4768. }
  4769. set chan [lindex $arg 1]
  4770. if {$chan != ""} {set chan [chanaddapt $chan]}
  4771. if {![passwdok $hand [lindex $arg 0]]} {
  4772. puthelp "PRIVMSG $nick :Invalid password \002Usage:\002 banlist <password> <chan>"
  4773. return 0
  4774. }
  4775. if {[passwdok $hand ""]} {
  4776. puthelp "PRIVMSG $nick :You must set a password: pass <your_new_password>"
  4777. return 0
  4778. }
  4779. if {![validchan $chan]} {
  4780. puthelp "PRIVMSG $nick :I'm not in $chan "
  4781. return 0
  4782. }
  4783. if {![matchattr $hand o|o $chan]} {
  4784. puthelp "PRIVMSG $nick :Sorry, but you are not an operator in $chan."
  4785. return 0
  4786. }
  4787. set num 1
  4788. puthelp "PRIVMSG $nick :*** $chan BANS info !!! ***"
  4789. foreach bans [banlist $chan] {
  4790. set victim [lindex $bans 0]
  4791. set why [lindex $bans 1]
  4792. set expire [lindex $bans 2]
  4793. set who [lindex $bans 5]
  4794. set remain [expr $expire - [unixtime]]
  4795. if {$remain > 0} {
  4796. set remain "expire in [time_diff2 $expire]."
  4797. } {
  4798. set remain "PermBan"
  4799. }
  4800. puthelp "PRIVMSG $nick :\002BAN $num:\002 $victim, $remain"
  4801. puthelp "PRIVMSG $nick :$who: $why"
  4802. incr num
  4803. }
  4804. if {$num == 1} {puthelp "PRIVMSG $nick :There are no bans in $chan."}
  4805. return 0
  4806. }
  4807.  
  4808. ### ban <password> <nick> <chan> [time] [reason]
  4809.  
  4810. proc msg_lol_ban {nick host hand arg} {
  4811. set arg [charfilter $arg]
  4812. global botnick lol
  4813. if {[llength $arg] < 3} {
  4814. puthelp "PRIVMSG $nick :\002Usage:\002 ban <password> <nick|mask> <chan> \[time\] \[reason\]"
  4815. return 0
  4816. }
  4817. set chan [lindex $arg 2]
  4818. if {$chan != ""} {set chan [chanaddapt $chan]}
  4819. set who [lindex $arg 1]
  4820. set ti [lindex $arg 3]
  4821. if {[isnumber $ti]} {
  4822. set reason [lrange $arg 4 end]
  4823. } {
  4824. set ti ""
  4825. set reason [lrange $arg 3 end]
  4826. }
  4827.  
  4828. if {![passwdok $hand [lindex $arg 0]]} {
  4829. puthelp "PRIVMSG $nick :Invalid password \002Usage:\002 ban <password> <nick> <chan> \[time\] \[reason\]"
  4830. return 0
  4831. }
  4832. if {[passwdok $hand ""]} {
  4833. puthelp "PRIVMSG $nick :You must set a password: pass <your_new_password>"
  4834. return 0
  4835. }
  4836. if {![validchan $chan]} {
  4837. puthelp "PRIVMSG $nick :I'm not in $chan "
  4838. return 0
  4839. }
  4840.  
  4841. if {![matchattr $hand o|o $chan]} {
  4842. puthelp "PRIVMSG $nick :Sorry, but you are not an op in $chan."
  4843. return 0
  4844. }
  4845.  
  4846. if {$reason == ""} { set reason "requested" }
  4847.  
  4848. if {[onchan $who $chan]} {
  4849. if { $lol(bantype) == 0 } {
  4850. set ipmask [lindex [split [maskhost $who![getchanhost $who $chan]] "@"] 1]
  4851. set usermask [lindex [split [getchanhost $who $chan] "@"] 0]
  4852. set banmask *!*$usermask@$ipmask
  4853. } else {
  4854. set banmask [getchanhost $who $chan]
  4855. set banmask "*!*[string range $banmask [string first @ $banmask] e]"
  4856. }
  4857. } else {
  4858. set banmask [lindex $arg 1]
  4859. if {[string first "!" $banmask] == -1 && [string first "@" $banmask] == -1} {
  4860. if {[isnumber [string index $banmask 0]]} {
  4861. set banmask *!*@$banmask
  4862. } else {
  4863. set banmask $banmask*!*@*
  4864. }
  4865. }
  4866. if {[string first "!" $banmask] == -1} { set banmask *!*$banmask }
  4867. if {[string first "@" $banmask] == -1} { set banmask $banmask*@* }
  4868. }
  4869.  
  4870. if {![botisop $chan]} { return 0 }
  4871. putserv "MODE $chan +b $banmask"
  4872.  
  4873. foreach chanuser [chanlist $chan] {
  4874. if {[string match [strlwr $banmask] [strlwr "$chanuser![getchanhost $chanuser $chan]"]] && $chanuser != $botnick } {
  4875. if {[nick2hand $chanuser $chan] != "*"} {
  4876. if {$hand != [nick2hand $chanuser $chan]} {
  4877. if {[matchattr [nick2hand $chanuser $chan] o|o $chan] && ![matchattr $hand o|o $chan]} {
  4878. puthelp "NOTICE $nick :Sorry, you must be an operator to ban an operator."
  4879. return 0
  4880. }
  4881. if {([matchattr [nick2hand $chanuser $chan] m|m $chan] || [matchattr [nick2hand $who $chan] b]) && ![matchattr $hand m|m $chan]} {
  4882. puthelp "NOTICE $nick :Sorry, you must be a master to ban a master or a bot."
  4883. return 0
  4884. }
  4885. }
  4886. }
  4887. putkick $chan $chanuser $reason
  4888. }
  4889. }
  4890.  
  4891. switch $ti {
  4892. ""
  4893. {
  4894. newchanban $chan $banmask $nick $reason
  4895. puthelp "NOTICE $nick :New mask added : $banmask"
  4896. }
  4897. 0
  4898. {
  4899. newchanban $chan $banmask $nick $reason $ti
  4900. puthelp "NOTICE $nick :New mask added permanently : $banmask"
  4901. }
  4902. default
  4903. {
  4904. newchanban $chan $banmask $nick $reason $ti
  4905. puthelp "NOTICE $nick :New mask added for $ti minutes : $banmask"
  4906. }
  4907. }
  4908. return 0
  4909. }
  4910.  
  4911. ### unban <password> <mask|number> <chan>
  4912.  
  4913. proc msg_lol_unban {nick host hand arg} {
  4914. set arg [charfilter $arg]
  4915. if {[llength $arg] != 3} {
  4916. puthelp "PRIVMSG $nick :\002Usage:\002 unban <password> <mask> <chan>"
  4917. return 0
  4918. }
  4919. set mask [lindex $arg 1]
  4920. set chan [lindex $arg 2]
  4921. if {$chan != ""} {set chan [chanaddapt $chan]}
  4922. if {![passwdok $hand [lindex $arg 0]]} {
  4923. puthelp "PRIVMSG $nick :Invalid password \002Usage:\002 unban <password> <mask> <chan>"
  4924. return 0
  4925. }
  4926. if {[passwdok $hand ""]} {
  4927. puthelp "PRIVMSG $nick :You must set a password: pass <your_new_password>"
  4928. return 0
  4929. }
  4930. if {![validchan $chan]} {
  4931. puthelp "PRIVMSG $nick :I'm not on $chan "
  4932. return 0
  4933. }
  4934. if {![matchattr $hand o|o $chan]} {
  4935. puthelp "PRIVMSG $nick :Sorry, but you are not an operator in $chan."
  4936. return 0
  4937. }
  4938.  
  4939. if {[isnumber $mask]} {
  4940. foreach bans [banlist $chan] {
  4941. incr find
  4942. if {$find == $mask} { set mask [lindex $bans 0] ; break }
  4943. }
  4944. if {[isnumber $mask]} {
  4945. puthelp "NOTICE $nick :There is no ban number $mask in this chan, type !banlist."
  4946. return 0
  4947. }
  4948. } else { if {[string first "!" $mask] == -1 && [string first "@" $mask] == -1} {
  4949. if {[isnumber [string index $mask 0]]} { set mask *!*@$mask
  4950. } else { set mask $mask*!*@* }
  4951. }
  4952. if {[string first "!" $mask] == -1} {set mask *!*$mask}
  4953. if {[string first "@" $mask] == -1} {set mask $mask*@*}
  4954. }
  4955.  
  4956. if {[isban $mask $chan]} {
  4957. killchanban $chan $mask
  4958. killban $mask
  4959. puthelp "NOTICE $nick :Ban successfully removed on $chan."
  4960. return 0
  4961. }
  4962.  
  4963. foreach bans [chanbans $chan] {
  4964. set victim [lindex $bans 0]
  4965. if {[strlwr $victim] == [strlwr $mask]} {set find 1}
  4966. }
  4967.  
  4968. if {[botisop $chan] && $find == 1} {
  4969. pushmode $chan -b $mask
  4970. puthelp "NOTICE $nick :Ban successfully removed."
  4971. return 0
  4972. }
  4973.  
  4974. puthelp "NOTICE $nick :No such ban on $chan."
  4975. return 0
  4976. }
  4977.  
  4978. ### mode <password> <chan> <flags>
  4979.  
  4980. proc msg_lol_chan {nick host hand arg} {
  4981. set arg [charfilter $arg]
  4982. global lol
  4983. if {[llength $arg] < 3} {
  4984. puthelp "PRIVMSG $nick :\002Usage:\002 mode <password> <chan> <chan mode>"
  4985. return 0
  4986. }
  4987. set chan [lindex $arg 1]
  4988. if {$chan != ""} {set chan [chanaddapt $chan]}
  4989. set mode [lrange $arg 2 end]
  4990. if {![passwdok $hand [lindex $arg 0]]} {
  4991. puthelp "PRIVMSG $nick :Invalid password \002Usage:\002 mode <password> <chan> <chan mode>"
  4992. return 0
  4993. }
  4994. if {[passwdok $hand ""]} {
  4995. puthelp "PRIVMSG $nick :You must set a password: pass <your_new_password>"
  4996. return 0
  4997. }
  4998. if {![validchan $chan]} {
  4999. puthelp "PRIVMSG $nick :I'm not in $chan "
  5000. return 0
  5001. }
  5002. if {![botisop $chan]} {
  5003. puthelp "PRIVMSG $nick :Sorry, but I'm not an op in $chan"
  5004. return 0
  5005. }
  5006. if {![matchattr $hand o|o $chan]} {
  5007. puthelp "PRIVMSG $nick :Sorry, but you are not an operator in $chan."
  5008. return 0
  5009. }
  5010. if {$lol(chankey) == 1} {
  5011. if {[string first k [lindex $mode 0]] != -1} {
  5012. set posmode [string first k [lindex $mode 0]]
  5013. if {[string first l [lindex $mode 0]] != -1} {
  5014. set poslim [string first l [lindex $mode 0]]
  5015. if {$posmode < $poslim} {
  5016. channel set $chan need-key "chankey $chan [lindex $mode 1]"
  5017. } {
  5018. channel set $chan need-key "chankey $chan [lindex $mode 2]"
  5019. }
  5020. } {
  5021. channel set $chan need-key "chankey $chan [lindex $mode 1]"
  5022. }
  5023. }
  5024. }
  5025. putserv "MODE $chan $mode"
  5026. puthelp "PRIVMSG $nick :Mode changed in $chan."
  5027. return 0
  5028. }
  5029.  
  5030. ### whois <password> <nick>
  5031.  
  5032. proc msg_lol_whois {a b c arg} {
  5033. set arg [charfilter $arg]
  5034. global lol_whois
  5035. if {[llength $arg] != 2} {
  5036. puthelp "PRIVMSG $a :\002Usage:\002 whois <password> <nick>"
  5037. return 0
  5038. }
  5039. set who [lindex $arg 1]
  5040. if {![passwdok $c [lindex $arg 0]]} {
  5041. puthelp "PRIVMSG $a :Invalid password \002Usage:\002 whois <password> <nick>"
  5042. return 0
  5043. }
  5044. if {[passwdok $c ""]} {
  5045. puthelp "PRIVMSG $a :You must set a password: pass <your_new_password>"
  5046. return 0
  5047. }
  5048. set find 0
  5049. foreach chan [channels] {
  5050. foreach user [chanlist $chan] {
  5051. if {[strlwr $user] == [strlwr $who]} {
  5052. set find $chan
  5053. break
  5054. }
  5055. }
  5056. }
  5057. if {$find != 0} {
  5058. set handle [nick2hand $who $find]
  5059. set host [getchanhost $who $find]
  5060. puthelp "PRIVMSG $a :[lol_whois $who $host $handle ""]"
  5061. return 0
  5062. } {
  5063. if {![matchattr $c o]} {
  5064. puthelp "PRIVMSG $a :Sorry $who is not in one of my chans right now. I can't analyze him."
  5065. return 0
  5066. }
  5067. }
  5068. if {$lol_whois != ""} {
  5069. puthelp "PRIVMSG $a :Too much whois in queue, one moment please."
  5070. return 0
  5071. }
  5072. puthelp "PRIVMSG $a :$who is not in one of my chans right now, I'll try a whois request to the server, hold on."
  5073. putserv "whois $who"
  5074. set lol_whois $a:$who
  5075. }
  5076.  
  5077. ### adduser <password> <nick> <chan> [hand]
  5078.  
  5079. proc msg_lol_adduser {me b c arg} {
  5080. set arg [charfilter $arg]
  5081. global botnick
  5082. if {[llength $arg] < 3} {
  5083. puthelp "PRIVMSG $me :\002Usage:\002 adduser <password> <nick> <chan> \[hand\]"
  5084. return 0
  5085. }
  5086. set nick [lindex $arg 1]
  5087. set chan [strlwr [lindex $arg 2]]
  5088. if {$chan != ""} {set chan [chanaddapt $chan]}
  5089. set alternate [lindex $arg 3]]
  5090. if {![passwdok $c [lindex $arg 0]]} {
  5091. puthelp "PRIVMSG $me :Invalid password \002Usage:\002 adduser <password> <nick> <chan> \[hand\]"
  5092. return 0
  5093. }
  5094. if {[passwdok $c ""]} {
  5095. puthelp "PRIVMSG $me :You must set a password: pass <your_new_password>"
  5096. return 0
  5097. }
  5098. if {![validchan $chan]} {
  5099. puthelp "PRIVMSG $me :I'm not in $chan "
  5100. return 0
  5101. }
  5102. set hostmask "$nick![getchanhost $nick $chan]"
  5103. set hand [nick2hand $nick $chan]
  5104. if {![onchan $nick $chan]} {
  5105. puthelp "PRIVMSG $me :Sorry, but I don't see $nick in $chan."
  5106. return 0
  5107. }
  5108. if {[strlwr $nick] == [strlwr $botnick]} {
  5109. puthelp "PRIVMSG $me :Sorry, but I can't adduser myself."
  5110. return 0
  5111. }
  5112. if {[getting-users]} {
  5113. puthelp "PRIVMSG $me :Sorry, but I'm transferring the userfile, try later."
  5114. return 0
  5115. }
  5116. if {[validuser $hand]} {
  5117. puthelp "PRIVMSG $me :$nick is already recognized with this hand: $hand"
  5118. } {
  5119. if {[validuser $nick] && $alternate == ""} {
  5120. puthelp "PRIVMSG $me :The hand $nick already exists. \002Usage:\002 adduser <password> <nick> <chan>"
  5121. return 0
  5122. }
  5123. if {$alternate != ""} {
  5124. if {[validuser $alternate]} {
  5125. puthelp "PRIVMSG $me :The hand $alternate already exists. Choose another. \002Usage:\002 adduser <password> <nick> <chan>"
  5126. return 0
  5127. }
  5128. adduser $alternate [maskhost $hostmask]
  5129. puthelp "PRIVMSG $me :New user: $alternate ([maskhost $hostmask])"
  5130. puthelp "NOTICE $nick :You have been added to $botnick userlist by $me with the hand: $alternate."
  5131. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick pass <your_password>\002"
  5132. return 0
  5133. }
  5134. adduser $nick [maskhost $hostmask]
  5135. puthelp "PRIVMSG $me :New user: $nick ([maskhost $hostmask])"
  5136. puthelp "NOTICE $nick :You have been added to $botnick userlist by $me with the hand: $nick."
  5137. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick pass <your_password>\002"
  5138. return 0
  5139. }
  5140. if {$alternate != ""} {
  5141. if {[validuser $alternate]} {
  5142. puthelp "PRIVMSG $me :The hand $alternate already exists. \002Usage:\002 adduser <password> <nick> <chan>"
  5143. return 0
  5144. }
  5145. adduser $alternate [maskhost $hostmask]
  5146. puthelp "PRIVMSG $me :New user: $alternate ([maskhost $hostmask])"
  5147. puthelp "NOTICE $nick :You have been added to $botnick userlist by $me with the hand: $alternate."
  5148. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick PASS <your_password>\002"
  5149. return 0
  5150. }
  5151. return 0
  5152. }
  5153.  
  5154. ### deluser <password> <hand>
  5155.  
  5156. proc msg_lol_deluser {me b c arg} {
  5157. set arg [charfilter $arg]
  5158. global botnick
  5159. if {[llength $arg] != 2} {
  5160. puthelp "PRIVMSG $me :\002Usage:\002 deluser <password> <hand>"
  5161. return 0
  5162. }
  5163. set hand [lindex $arg 1]
  5164. if {![passwdok $c [lindex $arg 0]]} {
  5165. puthelp "PRIVMSG $me :Invalid password \002Usage:\002 deluser <password> <hand>"
  5166. return 0
  5167. }
  5168. if {[passwdok $c ""]} {
  5169. puthelp "PRIVMSG $me :You must set a password: pass <your_new_password>"
  5170. return 0
  5171. }
  5172. if {[getting-users]} {
  5173. puthelp "PRIVMSG $me :Sorry, but I'm transferring the userfile, try later."
  5174. return 0
  5175. }
  5176. if {![validuser $hand]} {
  5177. puthelp "PRIVMSG $me :$nick is not a registered user."
  5178. return 0
  5179. }
  5180. if {[matchattr $hand n]} {
  5181. puthelp "PRIVMSG $me :You can't delete a bot owner."
  5182. return 0
  5183. }
  5184. deluser $hand
  5185. boot $hand "You have been deleted of the bot userlist"
  5186. puthelp "PRIVMSG $me :$hand has been removed from userlist."
  5187. return 0
  5188. }
  5189.  
  5190. ### addbot <password> <nick> <chan> [port] [hand]
  5191.  
  5192. proc msg_lol_addbot {me b c arg} {
  5193. set arg [charfilter $arg]
  5194. global botnick
  5195. if {[llength $arg] < 3} {
  5196. puthelp "PRIVMSG $me :\002Usage:\002 addbot <password> <nick> <chan> \[port\] \[hand\]"
  5197. return 0
  5198. }
  5199. set nick [lindex $arg 1]
  5200. set chan [strlwr [lindex $arg 2]]
  5201. if {$chan != ""} {set chan [chanaddapt $chan]}
  5202. set port [lindex $arg 3]
  5203. if {[isnumber $port]} {
  5204. set alternate [lindex $arg 4]
  5205. } {
  5206. set port 3333
  5207. set alternate [lindex $arg 3]
  5208. }
  5209. if {![passwdok $c [lindex $arg 0]]} {
  5210. puthelp "PRIVMSG $me :Invalid password \002Usage:\002 addbot <password> <nick> <chan> \[port\] \[hand\]"
  5211. return 0
  5212. }
  5213. if {[passwdok $c ""]} {
  5214. puthelp "PRIVMSG $me :You must set a password: pass <your_new_password>"
  5215. return 0
  5216. }
  5217. if {![validchan $chan]} {
  5218. puthelp "PRIVMSG $me :I'm not in $chan "
  5219. return 0
  5220. }
  5221. set host [lindex [split [getchanhost $nick $chan] "@"] 1]
  5222. set hostmask "*!*[getchanhost $nick $chan]"
  5223. set hand [nick2hand $nick $chan]
  5224. if {![onchan $nick $chan]} {
  5225. puthelp "PRIVMSG $me :Sorry, but I don't see $nick in $chan."
  5226. return 0
  5227. }
  5228. if {[strlwr $nick] == [strlwr $botnick]} {
  5229. puthelp "PRIVMSG $me :Sorry, but I can't addbot myself."
  5230. return 0
  5231. }
  5232. if {[getting-users]} {
  5233. puthelp "PRIVMSG $me :Sorry, but I'm transferring the userfile, try later."
  5234. return 0
  5235. }
  5236. if {[validuser $hand]} {
  5237. puthelp "PRIVMSG $me :$nick is already recognized with this hand: $hand"
  5238. return 0
  5239. } {
  5240. if {[validuser $nick] && $alternate == ""} {
  5241. puthelp "PRIVMSG $me :The hand $nick already exists. \002Usage:\002 addbot <password> <nick> <chan> <port> <hand>"
  5242. return 0
  5243. }
  5244. if {$alternate != ""} {
  5245. if {[validuser $alternate]} {
  5246. puthelp "PRIVMSG $me :The hand $alternate already exists. Choose another. \002Usage:\002 addbot <password> <nick> <chan> <port> <hand>"
  5247. return 0
  5248. }
  5249. addbot $alternate $host:$port
  5250. setuser $alternate hosts $hostmask
  5251. puthelp "PRIVMSG $me :New bot: $alternate ($hostmask)"
  5252. return 0
  5253. }
  5254. addbot $nick $host:$port
  5255. setuser $nick hosts $hostmask
  5256. puthelp "PRIVMSG $me :New bot: $nick ($hostmask)"
  5257. return 0
  5258. }
  5259. if {$alternate != ""} {
  5260. if {[validuser $alternate]} {
  5261. puthelp "PRIVMSG $me :The hand $alternate already exists. \002Usage:\002 addbot <password> <nick> <chan> <port> <hand>"
  5262. return 0
  5263. }
  5264. addbot $alternate $host:$port
  5265. setuser $alternate hosts $hostmask
  5266. puthelp "PRIVMSG $me :New bot: $alternate ($hostmask)"
  5267. return 0
  5268. }
  5269. return 0
  5270. }
  5271.  
  5272. ### addmaster <password> <nick> <chan> [hand]
  5273.  
  5274. proc msg_lol_addmaster {me b c arg} {
  5275. set arg [charfilter $arg]
  5276. global botnick
  5277. if {[llength $arg] < 3} {
  5278. puthelp "PRIVMSG $me :\002Usage:\002 addmaster <password> <nick> <chan> \[hand\]"
  5279. return 0
  5280. }
  5281. set nick [lindex $arg 1]
  5282. set chan [strlwr [lindex $arg 2]]
  5283. if {$chan != ""} {set chan [chanaddapt $chan]}
  5284. set alternate [lindex $arg 3]
  5285. if {![passwdok $c [lindex $arg 0]]} {
  5286. puthelp "PRIVMSG $me :Invalid password \002Usage:\002 addmaster <password> <nick> <chan> \[hand\]"
  5287. return 0
  5288. }
  5289. if {[passwdok $c ""]} {
  5290. puthelp "PRIVMSG $me :You must set a password: pass <your_new_password>"
  5291. return 0
  5292. }
  5293. if {![validchan $chan]} {
  5294. puthelp "PRIVMSG $me :I'm not in $chan "
  5295. return 0
  5296. }
  5297. set hostmask "$nick![getchanhost $nick $chan]"
  5298. set hand [nick2hand $nick $chan]
  5299. if {![matchattr $c n|n $chan]} {
  5300. puthelp "PRIVMSG $me :Sorry, but you are not an owner in $chan."
  5301. return 0
  5302. }
  5303. if {![onchan $nick $chan]} {
  5304. puthelp "PRIVMSG $me :Sorry, but I don't see $nick in $chan."
  5305. return 0
  5306. }
  5307. if {[strlwr $nick] == [strlwr $botnick]} {
  5308. puthelp "PRIVMSG $me :Sorry, but I can't addmaster myself."
  5309. return 0
  5310. }
  5311. if {[getting-users]} {
  5312. puthelp "PRIVMSG $me :Sorry, but I'm transferring the userfile, try later."
  5313. return 0
  5314. }
  5315. if {![validuser $hand]} {
  5316. if {[validuser $nick] && $alternate == ""} {
  5317. puthelp "PRIVMSG $me :The hand $nick already exists. \002Usage:\002 addmaster <password> <nick> <chan> <hand> "
  5318. return 0
  5319. }
  5320. if {$alternate != ""} {
  5321. if {[validuser $alternate]} {
  5322. puthelp "PRIVMSG $me :The hand $alternate already exists. Choose another. \002Usage:\002 addmaster <password> <nick> <chan> <hand>"
  5323. return 0
  5324. }
  5325. adduser $alternate [maskhost $hostmask]
  5326. chattr $alternate +p|+m $chan
  5327. puthelp "PRIVMSG $me :New user: $alternate ([maskhost $hostmask])"
  5328. puthelp "PRIVMSG $me :$nick added to the $chan masterlist and party-line with the hand: $alternate."
  5329. puthelp "NOTICE $nick :You have been added to the $chan masterlist and party-line by $me with the hand: $alternate."
  5330. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick pass <your_password>\002"
  5331. if {[botisop $chan]} {pushmode $chan +o $nick}
  5332. return 0
  5333. }
  5334. adduser $nick [maskhost $hostmask]
  5335. chattr $nick +p|+m $chan
  5336. puthelp "PRIVMSG $me :New user: $nick ([maskhost $hostmask])"
  5337. puthelp "PRIVMSG $me :$nick added to the $chan masterlist and party-line with the hand: $nick."
  5338. puthelp "NOTICE $nick :You have been added to the $chan masterlist and party-line by $me with the hand: $nick."
  5339. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick pass <your_password>\002"
  5340. if {[botisop $chan]} {pushmode $chan +o $nick}
  5341. return 0
  5342. }
  5343. if {$alternate != ""} {
  5344. if {[validuser $alternate]} {
  5345. puthelp "PRIVMSG $me :The hand $alternate already exists. \002Usage:\002 addmaster <password> <nick> <chan> <hand>"
  5346. return 0
  5347. }
  5348. adduser $alternate [maskhost $hostmask]
  5349. chattr $alternate +p|+m $chan
  5350. puthelp "PRIVMSG $me :New user: $alternate ([maskhost $hostmask])"
  5351. puthelp "PRIVMSG $me :$nick added to the $chan masterlist and party-line with the hand: $alternate."
  5352. puthelp "NOTICE $nick :You have been added to the $chan masterlist and party-line by $me with the hand: $alternate."
  5353. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick PASS <your_password>\002"
  5354. if {[botisop $chan]} {pushmode $chan +o $nick}
  5355. return 0
  5356. }
  5357. if {[matchattr $hand -|+m $chan]} {
  5358. puthelp "PRIVMSG $me :$nick is already a master in $chan with this hand: $hand"
  5359. } {
  5360. chattr $hand -|+m $chan
  5361. puthelp "PRIVMSG $me :$nick added to the $chan masterlist with this hand: $hand."
  5362. puthelp "NOTICE $nick :You have been added to the $chan masterlist by $me."
  5363. }
  5364. if {[botisop $chan]} {pushmode $chan +o $nick}
  5365. return 0
  5366. }
  5367.  
  5368. ### addop <password> <nick> <chan> [hand]
  5369.  
  5370. proc msg_lol_addop {me b c arg} {
  5371. set arg [charfilter $arg]
  5372. global botnick
  5373. if {[llength $arg] < 3} {
  5374. puthelp "PRIVMSG $me :\002Usage:\002 addop <password> <nick> <chan> \[hand\]"
  5375. return 0
  5376. }
  5377. set nick [lindex $arg 1]
  5378. set chan [strlwr [lindex $arg 2]]
  5379. if {$chan != ""} {set chan [chanaddapt $chan]}
  5380. set alternate [lindex $arg 3]
  5381. if {![passwdok $c [lindex $arg 0]]} {
  5382. puthelp "PRIVMSG $me :Invalid password \002Usage:\002 addop <password> <nick> <chan> \[hand\]"
  5383. return 0
  5384. }
  5385. if {[passwdok $c ""]} {
  5386. puthelp "PRIVMSG $me :You must set a password: pass <your_new_password>"
  5387. return 0
  5388. }
  5389. if {![validchan $chan]} {
  5390. puthelp "PRIVMSG $me :I'm not in $chan "
  5391. return 0
  5392. }
  5393. set hostmask "$nick![getchanhost $nick $chan]"
  5394. set hand [nick2hand $nick $chan]
  5395. if {![matchattr $c m|m $chan]} {
  5396. puthelp "PRIVMSG $me :Sorry, but you are not a master in $chan."
  5397. return 0
  5398. }
  5399. if {![onchan $nick $chan]} {
  5400. puthelp "PRIVMSG $me :Sorry, but I don't see $nick in $chan."
  5401. return 0
  5402. }
  5403. if {[strlwr $nick] == [strlwr $botnick]} {
  5404. puthelp "PRIVMSG $me :Sorry, but I can't addop myself."
  5405. return 0
  5406. }
  5407. if {[getting-users]} {
  5408. puthelp "PRIVMSG $me :Sorry, but I'm transferring the userfile, try later."
  5409. return 0
  5410. }
  5411. if {![validuser $hand]} {
  5412. if {[validuser $nick] && $alternate == ""} {
  5413. puthelp "PRIVMSG $me :The hand $nick already exists. \002Usage:\002 addop <password> <nick> <chan> <hand>"
  5414. return 0
  5415. }
  5416. if {$alternate != ""} {
  5417. if {[validuser $alternate]} {
  5418. puthelp "PRIVMSG $me :The hand $alternate already exists. Choose another. \002Usage:\002 addop <password> <nick> <chan> <hand>"
  5419. return 0
  5420. }
  5421. adduser $alternate [maskhost $hostmask]
  5422. chattr $alternate +p|+o $chan
  5423. puthelp "PRIVMSG $me :New user: $alternate ([maskhost $hostmask])"
  5424. puthelp "PRIVMSG $me :$nick added to the $chan oplist and party-line with the hand: $alternate."
  5425. puthelp "NOTICE $nick :You have been added to the $chan oplist and party-line by $me with the hand: $alternate."
  5426. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick pass <your_password>\002"
  5427. if {[botisop $chan]} {pushmode $chan +o $nick}
  5428. return 0
  5429. }
  5430. adduser $nick [maskhost $hostmask]
  5431. chattr $nick +p|+o $chan
  5432. puthelp "PRIVMSG $me :New user: $nick ([maskhost $hostmask])"
  5433. puthelp "PRIVMSG $me :$nick added to the $chan oplist and party-line with the hand: $nick."
  5434. puthelp "NOTICE $nick :You have been added to the $chan oplist and party-line by $me with the hand: $nick."
  5435. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick pass <your_password>\002"
  5436. if {[botisop $chan]} {pushmode $chan +o $nick}
  5437. return 0
  5438. }
  5439. if {$alternate != ""} {
  5440. if {[validuser $alternate]} {
  5441. puthelp "PRIVMSG $me :The hand $alternate already exists. \002Usage:\002 addop <password> <nick> <chan> <hand>"
  5442. return 0
  5443. }
  5444. adduser $alternate [maskhost $hostmask]
  5445. chattr $alternate +p|+o $chan
  5446. puthelp "PRIVMSG $me :New user: $alternate ([maskhost $hostmask])"
  5447. puthelp "PRIVMSG $me :$nick added to the $chan oplist and party-line with the hand: $alternate."
  5448. puthelp "NOTICE $nick :You have been added to the $chan oplist and party-line by $me with the hand: $alternate."
  5449. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick PASS <your_password>\002"
  5450. if {[botisop $chan]} {pushmode $chan +o $nick}
  5451. return 0
  5452. }
  5453. if {[matchattr $hand -|+o $chan]} {
  5454. puthelp "PRIVMSG $me :$nick is already an op in $chan with this hand: $hand"
  5455. } {
  5456. chattr $hand -|+o $chan
  5457. puthelp "PRIVMSG $me :$nick added to the $chan oplist with this hand: $hand."
  5458. puthelp "NOTICE $nick :You have been added to the $chan oplist by $me."
  5459. }
  5460. if {[botisop $chan]} {pushmode $chan +o $nick}
  5461. return 0
  5462. }
  5463.  
  5464. ### addvoice <password> <nick> <chan> [hand]
  5465.  
  5466. proc msg_lol_addvoice {me b c arg} {
  5467. set arg [charfilter $arg]
  5468. global botnick
  5469. if {[llength $arg] < 3} {
  5470. puthelp "PRIVMSG $me :\002Usage:\002 addvoice <password> <nick> <chan> \[hand\]"
  5471. return 0
  5472. }
  5473. set nick [lindex $arg 1]
  5474. set chan [strlwr [lindex $arg 2]]
  5475. if {$chan != ""} {set chan [chanaddapt $chan]}
  5476. set alternate [lindex $arg 3]
  5477. if {![passwdok $c [lindex $arg 0]]} {
  5478. puthelp "PRIVMSG $me :Invalid password \002Usage:\002 addvoice <password> <nick> <chan> \[hand\]"
  5479. return 0
  5480. }
  5481. if {[passwdok $c ""]} {
  5482. puthelp "PRIVMSG $me :You must set a password: pass <your_new_password>"
  5483. return 0
  5484. }
  5485. if {![validchan $chan]} {
  5486. puthelp "PRIVMSG $me :I'm not in $chan "
  5487. return 0
  5488. }
  5489. set hostmask "$nick![getchanhost $nick $chan]"
  5490. set hand [nick2hand $nick $chan]
  5491. if {![matchattr $c o|o $chan]} {
  5492. puthelp "PRIVMSG $me :Sorry, but you are not an operator in $chan."
  5493. return 0
  5494. }
  5495. if {![onchan $nick $chan]} {
  5496. puthelp "PRIVMSG $me :Sorry, but I don't see $nick in $chan."
  5497. return 0
  5498. }
  5499. if {[strlwr $nick] == [strlwr $botnick]} {
  5500. puthelp "PRIVMSG $me :Sorry, but I can't addvoice myself."
  5501. return 0
  5502. }
  5503. if {[getting-users]} {
  5504. puthelp "PRIVMSG $me :Sorry, but I'm transferring the userfile, try later."
  5505. return 0
  5506. }
  5507. if {![validuser $hand]} {
  5508. if {[validuser $nick] && $alternate == ""} {
  5509. puthelp "PRIVMSG $me :The hand $nick already exists. \002Usage:\002 addvoice <password> <nick> <chan> <hand>"
  5510. return 0
  5511. }
  5512. if {$alternate != ""} {
  5513. if {[validuser $alternate]} {
  5514. puthelp "PRIVMSG $me :The hand $alternate already exists. Choose another. \002Usage:\002 addvoice <password> <nick> <chan> <hand>"
  5515. return 0
  5516. }
  5517. adduser $alternate [maskhost $hostmask]
  5518. chattr $alternate +p|+v $chan
  5519. puthelp "PRIVMSG $me :New user: $alternate ([maskhost $hostmask])"
  5520. puthelp "PRIVMSG $me :$nick added to the $chan voicelist and party-line with the hand: $alternate."
  5521. puthelp "NOTICE $nick :You have been added to the $chan voicelist and party-line by $me with the hand: $alternate."
  5522. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick pass <your_password>\002"
  5523. if {[botisop $chan]} {pushmode $chan +v $nick}
  5524. return 0
  5525. }
  5526. adduser $nick [maskhost $hostmask]
  5527. chattr $nick +p|+v $chan
  5528. puthelp "PRIVMSG $me :New user: $nick ([maskhost $hostmask])"
  5529. puthelp "PRIVMSG $me :$nick added to the $chan voicelist and party-line with the hand: $nick."
  5530. puthelp "NOTICE $nick :You have been added to the $chan voicelist and party-line by $me with the hand: $nick."
  5531. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick pass <your_password>\002"
  5532. if {[botisop $chan]} {pushmode $chan +v $nick}
  5533. return 0
  5534. }
  5535. if {$alternate != ""} {
  5536. if {[validuser $alternate]} {
  5537. puthelp "PRIVMSG $me :The hand $alternate already exists. \002Usage:\002 addvoice <password> <nick> <chan> <hand>"
  5538. return 0
  5539. }
  5540. adduser $alternate [maskhost $hostmask]
  5541. chattr $alternate +p|+v $chan
  5542. puthelp "PRIVMSG $me :New user: $alternate ([maskhost $hostmask])"
  5543. puthelp "PRIVMSG $me :$nick added to the $chan voicelist and party-line with the hand: $alternate."
  5544. puthelp "NOTICE $nick :You have been added to the $chan voicelist and party-line by $me with the hand: $alternate."
  5545. puthelp "NOTICE $nick :You must set a password type: \002/msg $botnick PASS <your_password>\002"
  5546. if {[botisop $chan]} {pushmode $chan +v $nick}
  5547. return 0
  5548. }
  5549. if {[matchattr $hand -|+v $chan]} {
  5550. puthelp "PRIVMSG $me :$nick already has voice in $chan with this hand: $hand"
  5551. } {
  5552. chattr $hand -|+v $chan
  5553. puthelp "PRIVMSG $me :$nick added to the $chan voicelist with this hand: $hand."
  5554. puthelp "NOTICE $nick :You have been added to the $chan voicelist by $me."
  5555. }
  5556. if {[botisop $chan]} {pushmode $chan +v $nick}
  5557. return 0
  5558. }
  5559.  
  5560. ### help
  5561.  
  5562. proc msg_lol_help {nick host hand arg} {
  5563. set arg [charfilter $arg]
  5564. if {$hand == "*"} {return 0}
  5565. global lol
  5566. append flags [chattr $hand]
  5567. foreach chan [channels] { append flags [chattr $hand - $chan] }
  5568. puthelp "PRIVMSG $nick :Msg commands of $lol(version):"
  5569. set help ""
  5570. if {[matchattr $hand n]} {
  5571. append help "\002param\002 <parameter> <value> \002enable\002 <hand>"
  5572. append help " "
  5573. append help "\002disable\002 <hand> \002deluser\002 <hand>"
  5574. append help " "
  5575. append help "\002join\002 <chan> \[chanpassword\] \002remove\002 <chan>"
  5576. append help " "
  5577. append help "\002addhost\002 <hand> <host>"
  5578. append help " "
  5579. append help "\002delhost\002 <hand> <host>"
  5580. append help " "
  5581. }
  5582. if {[string first n $flags] != -1} {
  5583. append help "\002addmaster\002 <nick> <chan> \[hand\]"
  5584. append help " "
  5585. }
  5586. puthelp "PRIVMSG $nick :$help"
  5587. set help ""
  5588. if {[matchattr $hand m]} {
  5589. append help "\002msg\002 <nick|chan> <message>"
  5590. append help " "
  5591. }
  5592. if {[string first m $flags] != -1} {
  5593. append help "\002part\002 <chan> \002banmask\002 <mask> <chan>"
  5594. append help " "
  5595. append help "\002addop\002 <nick> <chan> \[hand\]"
  5596. append help " "
  5597. append help "\002adduser\002 <nick> <chan> \[hand\]"
  5598. append help " "
  5599. append help "\002addbot\002 <nick> <chan> \[port\] \[hand\]"
  5600. append help " "
  5601. }
  5602. puthelp "PRIVMSG $nick :$help"
  5603. set help ""
  5604. if {[string first o $flags] != -1} {
  5605. append help "\002chattr\002 <hand> <flags> <chan>"
  5606. append help " "
  5607. append help "\002broadcast\002 <text> \002key\002 <chan>"
  5608. append help " "
  5609. append help "\002addvoice\002 <nick> <chan> \[hand\]"
  5610. append help " "
  5611. append help "\002quick\002 <nick\mask> <chan> \[reason\]"
  5612. append help " "
  5613. append help "\002banlist\002 <chan> \002ban\002 <nick|mask> <chan> \[time\] \[reason\]"
  5614. append help " "
  5615. append help "\002unban\002 <mask|number> <chan>"
  5616. append help " "
  5617. append help "\002online\002 \002mode\002 <chan> <flags> \002whois\002 <nick>"
  5618. append help " "
  5619. }
  5620. if {[string first v $flags] != -1} {
  5621. append help "\002invite\002 \[chan\] \002kick\002 <nick|mask> <chan> \[reason\]"
  5622. append help " "
  5623. }
  5624. append help "\002ident\002 \002permident\002 \[nick!user@host\] \002seen\002 <nick|hand>"
  5625. puthelp "PRIVMSG $nick :$help"
  5626. puthelp "PRIVMSG $nick :All these commands require your \002password\002 as first argument."
  5627. *msg:help $nick $host $hand $arg
  5628. }
  5629.  
  5630. ### invite <password> [chan]
  5631.  
  5632. proc msg_lol_invite {a b c arg} {
  5633. set arg [charfilter $arg]
  5634. if {[llength $arg] < 1} {
  5635. puthelp "PRIVMSG $a :\002Usage:\002 invite <password> \[chan\]"
  5636. return 0
  5637. }
  5638. set chan [strlwr [lindex $arg 1]]
  5639. if {$chan != ""} {set chan [chanaddapt $chan]}
  5640. if {![passwdok $c [lindex $arg 0]]} {
  5641. puthelp "PRIVMSG $a :Invalid password \002Usage:\002 invite <password> \[chan\]"
  5642. return 0
  5643. }
  5644. if {[passwdok $c ""]} {
  5645. puthelp "PRIVMSG $a :You must set a password: pass <your_new_password>"
  5646. return 0
  5647. }
  5648. if {$chan != ""} {
  5649. if {$chan != ""} {set chan [chanaddapt $chan]}
  5650. if {![validchan $chan]} { puthelp "PRIVMSG $a :I'm not in $chan " ; return 0 }
  5651. if {[onchan $a $chan]} { puthelp "PRIVMSG $a :You are already in $chan." ; return 0 }
  5652. set flags [lindex [getchanmode $chan] 0]
  5653. if {[string first i $flags] == -1} { puthelp "PRIVMSG $a :$chan is not invite only." ; return 0 }
  5654. if {[matchattr $c o|o $chan]} { puthelp "INVITE $a $chan" ; return 0 }
  5655. puthelp "PRIVMSG $a :Sorry, you are not an op in $chan."
  5656. return 0
  5657. }
  5658. set count 0
  5659. foreach chan [channels] {
  5660. set flags [lindex [getchanmode $chan] 0]
  5661. if {[string first i $flags] != -1} {
  5662. if {![onchan $a $chan]} {
  5663. if {[matchattr $c o|o $chan]} {
  5664. puthelp "PRIVMSG $a :You can be invited on $chan."
  5665. set invitchan $chan
  5666. incr count
  5667. }
  5668. }
  5669. }
  5670. }
  5671. if {$count == 0} {
  5672. puthelp "PRIVMSG $a :There are no invite only chans for you to be invited to."
  5673. return 0
  5674. } {
  5675. puthelp "INVITE $a $invitchan"
  5676. return 0
  5677. }
  5678. puthelp "PRIVMSG $a :You can be invited to $count chans, make your choice !"
  5679. puthelp "PRIVMSG $a :\002Usage:\002 invite <password> \[chan\]"
  5680. }
  5681.  
  5682. ### join <password> <chan> [chan pass]
  5683.  
  5684. proc msg_lol_join {a b c arg} {
  5685. set arg [charfilter $arg]
  5686. global lol botnick
  5687. if {[llength $arg] < 2} {
  5688. puthelp "PRIVMSG $a :\002Usage:\002 join <passsword> <chan> \[chan pass\]"
  5689. return 0
  5690. }
  5691. set chan [lindex $arg 1]
  5692. if {$chan != ""} {set chan [chanaddapt $chan]}
  5693. set pass [lindex $arg 2]
  5694. if {![passwdok $c [lindex $arg 0]]} {
  5695. puthelp "PRIVMSG $a :Invalid password \002Usage:\002 join <password> <chan> \[chan pass\]"
  5696. return 0
  5697. }
  5698. if {[passwdok $c ""]} {
  5699. puthelp "PRIVMSG $a :You must set a password: pass <your_new_password>"
  5700. return 0
  5701. }
  5702. if {[validchan $chan]} {
  5703. puthelp "PRIVMSG $a :I'm already monitoring $chan."
  5704. if {$pass != ""} {
  5705. if {$lol(chankey) == 1} {
  5706. puthelp "PRIVMSG $a :New pass set for $chan: $pass."
  5707. channel set $chan need-key "chankey $chan $pass"
  5708. } {
  5709. puthelp "PRIVMSG $a :I can't memorize password to keep compatibility with getops.tcl\r"
  5710. }
  5711. }
  5712. if {![onchan [strlwr $botnick] $chan]} {
  5713. puthelp "PRIVMSG $a :I'll now try to join $chan."
  5714. putserv "JOIN $chan $pass"
  5715. return 0
  5716. }
  5717. puthelp "PRIVMSG $a :I'm already in $chan."
  5718. return 0
  5719. }
  5720. puthelp "PRIVMSG $a :New chan monitoring: $chan."
  5721. channel add $chan
  5722. channel set $chan chanmode $lol(chanmode)
  5723. channel set $chan flood-chan $lol(chan_flood)
  5724. channel set $chan flood-kick $lol(kick_flood)
  5725. channel set $chan flood-join $lol(join_flood)
  5726. channel set $chan flood-ctcp $lol(ctcp_flood)
  5727. foreach param $lol(chan_parameters) { channel set $chan $param }
  5728. if {$pass != ""} {
  5729. if {$lol(chankey) == 1} {
  5730. puthelp "PRIVMSG $a :New pass set for $chan: $pass."
  5731. channel set $chan need-key "chankey $chan $pass"
  5732. } {
  5733. puthelp "PRIVMSG $a :I can't memorize password to keep compatibility with getops.tcl\r"
  5734. }
  5735. }
  5736. puthelp "PRIVMSG $a :$chan is now configured. I'll now try to join it.\r"
  5737. puthelp "PRIVMSG $a :Use \002.-chan\002 to remove a chan (chan userlist will be deleted)."
  5738. putserv "JOIN $chan $pass"
  5739. }
  5740.  
  5741. ### part <password> <chan>
  5742.  
  5743. proc msg_lol_part {a b c arg} {
  5744. set arg [charfilter $arg]
  5745. if {[llength $arg] != 2} {
  5746. puthelp "PRIVMSG $a :\002Usage:\002 part <password> <chan>"
  5747. return 0
  5748. }
  5749. set chan [lindex $arg 1]
  5750. if {$chan != ""} {set chan [chanaddapt $chan]}
  5751. if {![passwdok $c [lindex $arg 0]]} {
  5752. puthelp "PRIVMSG $a :Invalid password \002Usage:\002 part <password> <chan>"
  5753. return 0
  5754. }
  5755. if {[passwdok $c ""]} {
  5756. puthelp "PRIVMSG $a :You must set a password: pass <your_new_password>"
  5757. return 0
  5758. }
  5759. if {![validchan $chan]} {
  5760. puthelp "PRIVMSG $a :I'm not monitoring $chan."
  5761. return 0
  5762. }
  5763. if {![matchattr $c m|m $chan]} {
  5764. puthelp "PRIVMSG $a :Sorry, but you are not a master in $chan."
  5765. return 0
  5766. }
  5767. puthelp "PRIVMSG $a :I'll part $chan. \r"
  5768. puthelp "PRIVMSG $a :To delete monitoring of this chan, use: remove <password> <chan>"
  5769. puthelp "PART $chan"
  5770. }
  5771.  
  5772. ### remove <password> <chan>
  5773.  
  5774. proc msg_lol_remove {a b c arg} {
  5775. set arg [charfilter $arg]
  5776. if {[llength $arg] != 2} {
  5777. puthelp "PRIVMSG $a :\002Usage:\002 remove <password> <chan>"
  5778. return 0
  5779. }
  5780. set chan [lindex $arg 1]
  5781. if {$chan != ""} {set chan [chanaddapt $chan]}
  5782. if {![passwdok $c [lindex $arg 0]]} {
  5783. puthelp "PRIVMSG $a :Invalid password \002Usage:\002 remove <password> <chan<"
  5784. return 0
  5785. }
  5786. if {[passwdok $c ""]} {
  5787. puthelp "PRIVMSG $a :You must set a password: pass <your_new_password>"
  5788. return 0
  5789. }
  5790. if {![validchan $chan]} {
  5791. puthelp "PRIVMSG $a :I'm not monitoring $chan."
  5792. return 0
  5793. }
  5794. puthelp "PRIVMSG $a :$chan and $chan's users are deleted. \r"
  5795. channel remove $chan
  5796. }
  5797.  
  5798. ### msg <password> <chan or nick> <message>
  5799.  
  5800. proc msg_lol_msg {a b c arg} {
  5801. set arg [charfilter $arg]
  5802. if {[llength $arg] < 3} {
  5803. puthelp "PRIVMSG $a :\002Usage:\002 msg <password> <chan or nick> <message>"
  5804. return 0
  5805. }
  5806. set chan_nick [lindex $arg 1]
  5807. set message [lrange $arg 2 end]
  5808. if {![passwdok $c [lindex $arg 0]]} {
  5809. puthelp "PRIVMSG $a :Invalid password \002Usage:\002 msg <password> <chan or nick> <message>"
  5810. return 0
  5811. }
  5812. if {[passwdok $c ""]} {
  5813. puthelp "PRIVMSG $a :You must set a password: pass <your_new_password>"
  5814. return 0
  5815. }
  5816. puthelp "PRIVMSG $chan_nick :$message"
  5817. }
  5818.  
  5819. ################# END OF MSG COMMANDS #################
  5820.  
  5821. ################# START OF MISC #################
  5822.  
  5823. proc initserv {} {
  5824. global lol botnick server lol_whois lol_mirc_kick remove_kickmirc_timer lol_bitchx_kick remove_kickbitchx_timer lol_ircii_kick remove_kickircii_timer lol_eggdrop_kick remove_kickeggdrop_timer lol_oldserver lol_newserver
  5825. puthelp "MODE $botnick $lol(server_flags)"
  5826. # DETECT SERVER CHANGE BUT NOT SERVER DECONNECTION
  5827. # set lol_newserver $server
  5828. # if {[info exists lol_oldserver]} {
  5829. # if {$lol_oldserver == $lol_newserver} {return 0}
  5830. # }
  5831. alldeident
  5832. if {$lol(away) != ""} {
  5833. utimer 20 {
  5834. puthelp "AWAY :$lol(away)"
  5835. }
  5836. }
  5837. set lol_whois ""
  5838. set lol_mirc_kick ""
  5839. set lol_bitchx_kick ""
  5840. set lol_ircii_kick ""
  5841. set lol_eggdrop_kick ""
  5842. if {![info exist remove_kickmirc_timer]} { set remove_kickmirc_timer "" }
  5843. if {![info exist remove_kickbitchx_timer]} { set remove_kickbitchx_timer "" }
  5844. if {![info exist remove_kickircii_timer]} { set remove_kickircii_timer "" }
  5845. if {![info exist remove_kickeggdrop_timer]} { set remove_kickeggdrop_timer "" }
  5846. # set lol_oldserver $server
  5847. }
  5848.  
  5849. proc lol_whois {who host2 handle chan} {
  5850. if {$handle == "*"} {return "$who is not registered in the bot."}
  5851. if {$handle != ""} {
  5852. set msg "\002The hand of $who is $handle.\002 "
  5853. if {$chan != ""} {
  5854. set chanflags [lindex [split [chattr $handle - $chan] |] 1]
  5855. if {$chanflags == "-"} {set chanflags "no flags"}
  5856. }
  5857. set globalflags [lindex [split [chattr $handle - ] |] 0]
  5858. if {$globalflags == "-"} {set globalflags "no flags"}
  5859. if {$chan != ""} {
  5860. append msg "He has these flags on this chan: \002$chanflags\002 "
  5861. append msg "and these global flags: \002$globalflags\002. "
  5862. } {
  5863. append msg "He has these global flags: \002$globalflags\002 "
  5864. }
  5865. if {[check $handle $who $host2]} {
  5866. if {[string match [strlwr [getuser $handle xtra permident]] [strlwr $who!$host2]]} {
  5867. append msg "He is \002IDENTIFIED\002 right now, with his permident mask: \002[getuser $handle xtra permident]\002. "
  5868. } {
  5869. append msg "He is \002IDENTIFIED\002 right now (nick used for identification: [getuser $handle xtra authnick]). "
  5870. if {[getuser $handle xtra permident] != ""} {
  5871. append msg "Permident mask: \002[getuser $handle xtra permident]\002. "
  5872. } {
  5873. append msg "No permident mask. "
  5874. }
  5875. }
  5876. } {
  5877. append msg "He is not identified right now. "
  5878. if {[getuser $handle xtra permident] != ""} {
  5879. append msg "Permident mask: [getuser $handle xtra permident]. "
  5880. } {
  5881. append msg "No permident mask. "
  5882. }
  5883. }
  5884. if {[getuser $handle xtra silent] == 1} {
  5885. append msg "Silent mode \002ENABLED\002. "
  5886. } {
  5887. append msg "Silent mode \002DISABLED\002. "
  5888. }
  5889. if {$chan != ""} {
  5890. if {[getchaninfo $handle $chan] != ""} {
  5891. append msg "Info line: [getchaninfo $handle $chan]. "
  5892. } {
  5893. append msg "No info line. "
  5894. }
  5895. }
  5896. return "$msg"
  5897. } {
  5898. return "I don't see $who."
  5899. }
  5900. }
  5901.  
  5902. proc lol_whois_reply {from signal arg} {
  5903. global lol_whois
  5904. set arg [charfilter $arg]
  5905. set nick [lindex $arg 1]
  5906. set user [lindex $arg 2]
  5907. set ip [lindex $arg 3]
  5908. set c [lindex [split $lol_whois ":"] 0]
  5909. if {[strlwr $nick] != [strlwr [lindex [split $lol_whois ":"] 1]]} {
  5910. return 0
  5911. }
  5912. set who $nick!$user@$ip
  5913. set handle [finduser $who]
  5914. if {$handle != "*"} {
  5915. puthelp "PRIVMSG $c :[lol_whois $nick $user@$ip $handle ""]"
  5916. } {
  5917. puthelp "PRIVMSG $c :$who is not recognized as one of my users."
  5918. }
  5919. set lol_whois ""
  5920. return 0
  5921. }
  5922.  
  5923. proc lol_whois_unknow {from signal arg} {
  5924. global lol_whois
  5925. set arg [charfilter $arg]
  5926. set nick [lindex $arg 1]
  5927. set c [lindex [split $lol_whois ":"] 0]
  5928. set nick2 [lindex [split $lol_whois ":"] 1]
  5929. if {$lol_whois != "" && [strlwr $nick] == [strlwr $nick2]} {
  5930. puthelp "PRIVMSG $c :$nick is on IRC but I have no information about this person."
  5931. set lol_whois ""
  5932. }
  5933. return 0
  5934. }
  5935.  
  5936. proc lol_whois_nofound {from signal arg} {
  5937. global lol_whois
  5938. if {![info exists lol_whois]} {return 0}
  5939. set arg [charfilter $arg]
  5940. set nick [lindex $arg 1]
  5941. set c [lindex [split $lol_whois ":"] 0]
  5942. set nick2 [lindex [split $lol_whois ":"] 1]
  5943. if {$lol_whois != "" && [strlwr $nick] == [strlwr $nick2]} {
  5944. puthelp "PRIVMSG $c :$nick is not on IRC."
  5945. set lol_whois ""
  5946. }
  5947. return 0
  5948. }
  5949.  
  5950. proc lol_seen {nick hand who chan} {
  5951. global botnick
  5952. if {[strlwr $who] == [strlwr $nick]} { return "Go look in a mirror. " }
  5953. if {[strlwr $who] == [strlwr $botnick]} { return "You found me ! " }
  5954. if {$chan != ""} {
  5955. if {[onchan $who $chan]} { return "Open your eyes, $who is in THIS chan !" }
  5956. foreach user [chanlist $chan] {
  5957. set userh [nick2hand $user $chan]
  5958. if {[strlwr $userh] == [strlwr $who]} {
  5959. if {[strlwr $hand] == [strlwr $who]} {
  5960. return "$who is $user, and $user is YOU :P "
  5961. } {
  5962. return "$who is $user, and $user is on this chan ! "
  5963. }
  5964. }
  5965. }
  5966. } {
  5967. if {[strlwr $hand] == [strlwr $who]} {return "$who is your hand :P "}
  5968. }
  5969. foreach fchan [channels] {
  5970. if {[onchan $who $fchan]} {
  5971. return "$who is actually on $fchan ! "
  5972. }
  5973. foreach user [chanlist $fchan] {
  5974. set userh [nick2hand $user $fchan]
  5975. if {[strlwr $userh] == [strlwr $who]} {
  5976. return "$who is $user, and $user is on $fchan ! "
  5977. }
  5978. }
  5979. }
  5980. foreach fchan [channels] {
  5981. if {[onchansplit $who $fchan]} {
  5982. return "$who was in $fchan, but there was a netsplit... "
  5983. }
  5984. }
  5985. if {[hand2idx $who] >= 0} {
  5986. return "$who is actually in the party-line. "
  5987. }
  5988. if {[validuser $who]} {
  5989. set info [getuser $who laston]
  5990. if {$info == ""} { return "I have never seen $who. " }
  5991. set time [lindex $info 0]
  5992. set ochand [lindex $info 1]
  5993. if {$ochand == "*"} {set ochand "party-line"}
  5994. return "$who was in $ochand [time_diff $time] ago. "
  5995. }
  5996. return "Sorry, I don't know $who. "
  5997. }
  5998.  
  5999. proc lol_watch_mode {nick host hand chan mode who} {
  6000. global lol botnick botname
  6001. if {$mode != "+b" || ![botisop $chan] || $lol(ban_protect) == 0} {return 0}
  6002. set victim ""
  6003.  
  6004. set numbanlist [llength [chanbans $chan]]
  6005. if {$numbanlist > 26 } {
  6006. set banhost ""
  6007. set b_count 0
  6008. for {set loop 0} {$loop < 6} {incr loop} {
  6009. set banhost "$banhost [lindex [lindex [chanbans $chan] $loop] 0]"
  6010. set b_count [expr $b_count + 1]
  6011. if {$loop == 5 } { putserv "MODE $chan -bbbbbb $banhost"
  6012. set banhost ""
  6013. set b_count 0
  6014. }
  6015. }
  6016. }
  6017.  
  6018. if {[string first "!" $who] == -1 && [string first "@" $who] == -1} {set who $who!*@*}
  6019. # if {[string first "!" $who] == -1} {set who *!*$who}
  6020. if {[string first "@" $who] == -1} {set who $who*@*}
  6021. foreach user [userlist] {
  6022. foreach userhost [getuser $user HOSTS] {
  6023. if {[string match [strlwr $who] [strlwr $userhost]] && ([matchattr $user n|n $chan] || [matchattr $user m|m $chan] || [matchattr $user o|o $chan] || [matchattr $user v|v $chan])} {
  6024. append victim "$user "
  6025. break
  6026. }
  6027. }
  6028. }
  6029. foreach user [chanlist $chan] {
  6030. set userhand [nick2hand $user $chan]
  6031. if {$userhand != "*"} {
  6032. set userhost $user![getchanhost $user $chan]
  6033. if {[string match [strlwr $who] [strlwr $userhost]]} {
  6034. if {[matchattr $userhand n|n $chan] || [matchattr $userhand m|m $chan] || [matchattr $userhand o|o $chan] || [matchattr $userhand v|v $chan]} {
  6035. if {[string first $userhand $victim] == -1} {append victim "$userhand "}
  6036. }
  6037. }
  6038. }
  6039. }
  6040. if {[string match [strlwr $who] [strlwr $botname]]} {
  6041. if {![matchattr $hand m|m $chan] && !([matchattr $hand b] && [matchattr $hand o|o $chan])} {
  6042. putserv "MODE $chan -b $who"
  6043. puthelp "NOTICE $nick :Don't set bans that match me !"
  6044. return 0
  6045. } {
  6046. append victim "$botnick"
  6047. }
  6048. }
  6049. if {$victim != ""} {lol_ban_warn $nick $hand $who $chan $victim}
  6050. return 0
  6051. }
  6052.  
  6053. proc lol_ban_warn {nick hand ban chan victims} {
  6054. global lol
  6055. if {![botisop $chan] || [strlwr $hand] == [string trimright [strlwr $victims] " "] || $lol(ban_protect) == 0} {return 0}
  6056. if {$hand == "*"} {
  6057. if {[string first +userbans [channel info $chan]] != -1} {
  6058. puthelp "NOTICE $nick :Your ban matches my users ! Be careful !"
  6059. putserv "MODE $chan -b $ban"
  6060. }
  6061. return 0
  6062. }
  6063. set remove 0
  6064. foreach user $victims {
  6065. if {([matchattr $user m|m $chan] || [matchattr $user b]) && !([matchattr $hand m|m $chan] || ([matchattr $hand o|o $chan] && [matchattr $hand b]))} {
  6066. set remove 1
  6067. break
  6068. }
  6069. if {([matchattr $user o|o $chan] || [matchattr $user v|v $chan]) && ![matchattr $hand o|o $chan]} {
  6070. set remove 1
  6071. break
  6072. }
  6073. }
  6074. if {$remove == 1} {putserv "MODE $chan -b $ban"}
  6075. if {![matchattr $hand b]} {
  6076. if {[llength $victims] > 1} {
  6077. puthelp "NOTICE $nick :Your ban in $chan ($ban), matches my users: $victims"
  6078. } {
  6079. puthelp "NOTICE $nick :Your ban in $chan ($ban), matches one of my users: $victims"
  6080. }
  6081. }
  6082. return 0
  6083. }
  6084.  
  6085. proc rmuser {hand idx arg} {
  6086. boot $arg
  6087. *dcc:-user $hand $idx [lindex $arg 0]
  6088. }
  6089.  
  6090. proc checksilent {hand} {
  6091. set temp [getuser $hand xtra silent]
  6092. if {$temp == 1} {return 1}
  6093. return 0
  6094. }
  6095.  
  6096. proc check {hand nick host} {
  6097. global lol
  6098. if {$lol(ident) == 0} {return 1}
  6099. if {[getuser $hand xtra auth] != "DEAD"} {
  6100. set perm_host [getuser $hand xtra permident]
  6101. if {[string match [strlwr $perm_host] [strlwr $nick!$host]]} { return 1 }
  6102. }
  6103. set host [lindex [split $host "@"] 1]
  6104. if {[getuser $hand xtra auth] == 1} {
  6105. if {$lol(clone) == 1} {
  6106. if {[getuser $hand xtra authhost] == $host} { return 1 }
  6107. }
  6108. if {[getuser $hand xtra authnick] == $nick} { return 1 }
  6109. }
  6110. return 0
  6111. }
  6112.  
  6113. proc chidentnick {nick host hand chan newnick} {
  6114. global botnick
  6115. if {$hand == "*"} {return 0}
  6116. if {[getuser $hand xtra auth] == 1} {
  6117. if {[getuser $hand xtra authnick] == $nick} {
  6118. setuser $hand xtra authnick $newnick
  6119. }
  6120. }
  6121. }
  6122.  
  6123. proc kickident {nick host hand chan kick arg} {
  6124. global botnick
  6125. if {$kick == $botnick} {
  6126. foreach user [chanlist $chan] {
  6127. set find 0
  6128. foreach ch [channels] {
  6129. if {[onchan $user $ch] && $ch != $chan} { incr find }
  6130. }
  6131. set userhand [nick2hand $user $chan]
  6132. if {$userhand != "*"} {
  6133. if {$find == 0} {
  6134. if {[getuser $userhand xtra auth] != "DEAD"} {
  6135. setuser $userhand xtra auth 0
  6136. }
  6137. chattr $userhand -3
  6138. }
  6139. }
  6140. }
  6141. }
  6142. return 0
  6143. }
  6144.  
  6145. proc partident {nick host hand chan} {
  6146. if {$hand == "*"} {return 0}
  6147. set find 0
  6148. foreach ch [channels] {
  6149. if {[onchan $nick $ch] && $ch != $chan} { set find 1 }
  6150. }
  6151. if {$find == 0} {
  6152. if {[getuser $hand xtra auth] != "DEAD"} { setuser $hand xtra auth 0 }
  6153. chattr $hand -3
  6154. }
  6155. }
  6156.  
  6157. proc rejnident {nick host hand chan} {
  6158. if {$hand == "*"} {return 0}
  6159. set find 0
  6160. foreach ch [channels] {
  6161. if {[onchan $nick $ch] && $ch != $chan} { incr find }
  6162. }
  6163. if {$find == 0} {
  6164. if {[getuser $hand xtra auth] != "DEAD"} { setuser $hand xtra auth 0 }
  6165. chattr $hand -3
  6166. }
  6167. }
  6168.  
  6169. proc joinident {nick host hand chan} {
  6170. if {$hand == "*"} { return 0 }
  6171. set find 0
  6172. foreach ch [channels] {
  6173. if {[onchan $nick $ch] && $ch != $chan} { incr find }
  6174. }
  6175. if {$find == 0} {
  6176. if {[getuser $hand xtra auth] != "DEAD"} { setuser $hand xtra auth 0 }
  6177. chattr $hand -3
  6178. }
  6179. }
  6180.  
  6181. proc alldeident {} {
  6182. foreach user [userlist] {
  6183. if {[getuser $user xtra auth] != "DEAD"} { setuser $user xtra auth 0 }
  6184. chattr $user -3
  6185. }
  6186. }
  6187.  
  6188. proc deident {nick host hand chan reason} {
  6189. if {$hand == "*"} {return 0}
  6190. if {[getuser $hand xtra auth] != "DEAD"} { setuser $hand xtra auth 0 }
  6191. chattr $hand -3
  6192. }
  6193.  
  6194. proc chankey {chan pass} {
  6195. putserv "JOIN $chan $pass"
  6196. }
  6197.  
  6198. proc chanaddapt {chan} {
  6199. if {[string index $chan 0] != "#" && [string index $chan 0] != "&"} { set chan #$chan }
  6200. return $chan
  6201. }
  6202.  
  6203. proc see_new_pass {a b c d e f} {
  6204. global lol
  6205. if {$lol(chankey) == 0} {return 0}
  6206. set k [lindex $e 0]
  6207. set pass [lindex $f 0]
  6208. channel set $d need-key "chankey $d $pass"
  6209. }
  6210.  
  6211. proc time_diff2 {time} {
  6212. set ltime [expr $time - [unixtime]]
  6213. set seconds [expr $ltime % 60]
  6214. set ltime [expr ($ltime - $seconds) / 60]
  6215. set minutes [expr $ltime % 60]
  6216. set ltime [expr ($ltime - $minutes) / 60]
  6217. set hours [expr $ltime % 24]
  6218. set days [expr ($ltime - $hours) / 24]
  6219. set result ""
  6220. if {$days} {
  6221. append result "$days "
  6222. if {$days} {
  6223. append result "day "
  6224. } {
  6225. append result "days "
  6226. }
  6227. }
  6228. if {$hours} {
  6229. append result "$hours "
  6230. if {$hours} {
  6231. append result "hour "
  6232. } {
  6233. append result "hours "
  6234. }
  6235. }
  6236. if {$minutes} {
  6237. append result "$minutes "
  6238. if {$minutes} {
  6239. append result "minute"
  6240. } {
  6241. append result "minutes"
  6242. }
  6243. }
  6244. if {$seconds} {
  6245. append result " $seconds "
  6246. if {$seconds} {
  6247. append result "second"
  6248. } {
  6249. append result "seconds"
  6250. }
  6251. }
  6252. return $result
  6253. }
  6254.  
  6255. proc time_diff {time} {
  6256. set ltime [expr [unixtime] - $time]
  6257. set seconds [expr $ltime % 60]
  6258. set ltime [expr ($ltime - $seconds) / 60]
  6259. set minutes [expr $ltime % 60]
  6260. set ltime [expr ($ltime - $minutes) / 60]
  6261. set hours [expr $ltime % 24]
  6262. set days [expr ($ltime - $hours) / 24]
  6263. set result ""
  6264. if {$days} {
  6265. append result "$days "
  6266. if {$days} {
  6267. append result "day "
  6268. } {
  6269. append result "days "
  6270. }
  6271. }
  6272. if {$hours} {
  6273. append result "$hours "
  6274. if {$hours} {
  6275. append result "hour "
  6276. } {
  6277. append result "hours "
  6278. }
  6279. }
  6280. if {$minutes} {
  6281. append result "$minutes "
  6282. if {$minutes} {
  6283. append result "minute"
  6284. } {
  6285. append result "minutes"
  6286. }
  6287. }
  6288. if {$seconds} {
  6289. append result " $seconds "
  6290. if {$seconds} {
  6291. append result "second"
  6292. } {
  6293. append result "seconds"
  6294. }
  6295. }
  6296. return $result
  6297. }
  6298.  
  6299. proc charfilter {x {y ""} } {
  6300. for {set i 0} {$i < [string length $x]} {incr i} {
  6301. switch -- [string index $x $i] {
  6302. "\"" {append y "\\\""}
  6303. "\\" {append y "\\\\"}
  6304. "\[" {append y "\\\["}
  6305. "\]" {append y "\\\]"}
  6306. "\} " {append y "\\\} "}
  6307. "\{" {append y "\\\{"}
  6308. default {append y [string index $x $i]}
  6309. }
  6310. }
  6311. return $y
  6312. }
  6313.  
  6314. proc lol_idle_check {} {
  6315. global lol botnick remove_lol_idle_check
  6316. set remove_lol_idle_check [timer 1 lol_idle_check]
  6317. if {$lol(idle_protect) == 0} { return 0 }
  6318. set flags "-$lol(no_idle_flags)&-$lol(no_idle_flags)"
  6319. foreach chan [channels] {
  6320. if {![botisop $chan]} {continue}
  6321. if {$lol(no_idle_flags) == ""} {
  6322. set list [strlwr [chanlist $chan]]
  6323. } {
  6324. set list [strlwr [chanlist $chan $flags]]
  6325. }
  6326. foreach nick $list {
  6327. if {[strlwr $nick] != [strlwr $botnick] && ![isop $nick $chan] && ![isvoice $nick $chan]} {
  6328. set idle_time [getchanidle $nick $chan]
  6329. if {$idle_time >= $lol(kick_idle_time)} {
  6330. set reason "Idle Kick ($lol(kick_idle_time) minutes of idle time)."
  6331. putserv "KICK $chan $nick :$reason"
  6332. return 0
  6333. }
  6334. if {$idle_time == $lol(warn_idle_time) && $lol(max_idle_time) < $lol(kick_idle_time)} {
  6335. puthelp "PRIVMSG $nick :You are idle on $chan since $idle_time minutes, after $lol(max_idle_time) minutes of idle, you'll be banned for $lol(idle_ban_time) minutes. Part the chan or make anything !"
  6336. return 0
  6337. }
  6338. if {$idle_time >= $lol(max_idle_time)} {
  6339. set ipmask [lindex [split [maskhost $nick![getchanhost $nick $chan]] "@"] 1]
  6340. set userm [lindex [split [getchanhost $nick $chan] "@"] 0]
  6341. set banmask *!*$userm@$ipmask
  6342. set reason "Banned for $lol(idle_ban_time) minutes, because of $lol(max_idle_time) minutes idle."
  6343. newchanban $chan $banmask IdleBan $reason $lol(idle_ban_time)
  6344. putserv "MODE $chan +b $banmask"
  6345. putserv "KICK $chan $nick :$reason"
  6346. return 0
  6347. }
  6348. }
  6349. }
  6350. }
  6351. return 0
  6352. }
  6353.  
  6354. if {[info exists remove_lol_idle_check]} { killtimer $remove_lol_idle_check }
  6355. lol_idle_check
  6356.  
  6357. ### END OF SCRIPT
  6358.  
  6359. set nb_script [info script]
  6360. set nb_dir [file dirname $nb_script]
  6361. set nb_setscript $nb_dir/alltools.tcl
  6362. if {![file exists $nb_setscript]} {
  6363. die "*** LoL's TooLz requires now alltools.tcl. Please install it."
  6364. }
  6365.  
  6366. putlog "\r"
  6367. putlog "$lol(version), Copyright (C) 1998-2002 LL Productions.\r"
  6368. putlog "This software is free software under the terms of GNU GPL 2.\r"
  6369. putlog "Home: http://www.leonini.net/\r"
  6370. putlog "Type \002.help-lol\002 for commands and \002.gpl-lol\002 for license.\r"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement