Advertisement
Guest User

Untitled

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