Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
564
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 201.98 KB | None | 0 0
  1. ####################################################################
  2. ## EDITED by.indis ##
  3. ## Modified Monday, November 19, 2001 7:50:13 PM / EDIT TcL ##
  4. ## ------------------------------------------------------------ ##
  5. ## REQUIRES EGGDROP 1.3+ with toolkit.tcl and alltools.tcl ##
  6. ####################################################################
  7.  
  8. #--------------------------------------------------------------------------------------
  9. putlog "\002\[4damn4!\]\002 ••••••••••••••••••••••••••••••••••••••••••••••••"
  10. putlog "\002\[4damn4!\]\002 ••••• Initializing 6damn6! TcL •••••"
  11. #--------------------------------------------------------------------------------------
  12. # this tcl's version *for now*
  13. set vers "v.1.0"
  14. # Set your Command Character below
  15. set CC "`"
  16. # Set Your Bot's Time Zone here
  17. set timezone "WIB"
  18. # Set channel to NEVER part from! (this is your main channel)
  19. set nopart "#medan-city"
  20. # Adds the users nick in the topic when they set it via the bot. 1=yes 0=no
  21. set topicnick 1
  22. # Set Greet flag (must be capitalized)
  23. set greetflag G
  24. # How often to backup edit files. (in minutes)
  25. set min 120
  26. # Do you want public commands for flags o p x? 1=yes 0=no
  27. set pubcommands 1
  28. # Do you want public commands for flag m? 1=yes 0=no
  29. set mastercommands 1
  30. # Do you want public commands for flag n? 1=yes 0=no
  31. set ownercommands 1
  32. # Do you want additional dcc commands? 1=yes 0=no
  33. set moredcc 1
  34. # Do you want combot commands? 1=yes 0=no
  35. set combot 1
  36. # Do you want pez and ramen commands? 1=yes 0=no
  37. set funny_stuff 0
  38. # Do you want dumb beer and drug commands? (VERY FUNNY!) 1=yes 0=no
  39. set rrated_funny_stuff 1
  40. # This is where your bot path is set, dont change it if you dont know what your doing
  41. set path "[pwd]/"
  42. #--------------------------------------------------------------------------------------
  43. putlog "\002\[4damn4!\]\002 ••••• 6damn6! TcL •••••"
  44. putlog "\002\[4damn4!\]\002 ••••• ngedit konpig nunuw •••••"
  45. #--------------------------------------------------------------------------------------
  46.  
  47.  
  48. ########################################
  49. ## DON'T CHANGE BELOW THIS LINE!!!! ##
  50. ########################################
  51.  
  52. #--------------------------------------------------------------------------------------
  53. putlog "\002\[4damn4!\]\002 ••••• TcL Version 1.0 4Un4Detected 4Own4! •••••"
  54. putlog "\002\[4damn4!\]\002 ••••• 4Damn4! •••••"
  55. #--------------------------------------------------------------------------------------
  56. if {$numversion < 1030700} {
  57. putlog "*** Can't load [damn] tcl -- At least Eggdrop v1.3.7 required"
  58. return 0
  59. }
  60.  
  61. set thepath $path
  62. set newpath $path
  63. set greetfile "${nick}.greet"
  64. set emailfile "${nick}.email"
  65. set urlfile "${nick}.url"
  66. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set greetpath "$thepath/$greetfile"} else {set greetpath "$thepath$greetfile"}
  67. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set emailpath "$thepath/$emailfile"} else {set emailpath "$thepath$emailfile"}
  68. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set urlpath "$thepath/$urlfile"} else {set urlpath "$thepath$urlfile"}
  69.  
  70. foreach x [timers] {
  71. if {[lindex $x 1] == "bndc_autosave"} {
  72. killtimer [lindex $x 2]
  73. }
  74. }
  75.  
  76. #foreach u [utimers] {
  77. # if {[lindex $u 1] == "bndc_check"} {
  78. # killutimer [lindex $u 2]
  79. # }
  80. #}
  81.  
  82. bind join G|G * join_greet
  83. bind dcc p|p bndchelp dcc_bndchelp
  84. bind dcc p|p bndCHelp dcc_bndchelp
  85. bind pub p|p ${CC}bndchelp pub_bndchelp
  86. bind pub p|p ${CC}bndchelp pub_bndchelp
  87. bind pub p|p ${CC}about pub_about
  88. bind dcc p|p about dcc_about
  89. bind pub p|p ${CC}version pub_version
  90. bind dcc p|p version dcc_version
  91. bind msg p|p auth msg_auth
  92. bind msg p|p deauth msg_deauth
  93. bind sign p|p * sign_deauth
  94. bind part p|p * part_deauth
  95.  
  96. proc botname {} {global botname;return $botname}
  97.  
  98. if {$pubcommands==1} {
  99. bind pub p|p ${CC}echo pub_echo
  100. bind pub p|p ${CC}seen pub_seen
  101. bind pub p|p ${CC}who pub_who
  102. bind pub p|p ${CC}whois pub_whois
  103. bind pub p|p ${CC}wi pub_whois
  104. bind pub p|p ${CC}whom pub_whom
  105. bind pub o|o ${CC}match pub_match
  106. bind pub p|p ${CC}bots pub_bots
  107. bind pub p|p ${CC}bottree pub_bottree
  108. bind pub p|p ${CC}notes pub_notes
  109. bind pub m ${CC}+ban pub_+ban
  110. bind pub m ${CC}ban pub_ban
  111. bind pub m ${CC}kb pub_kb
  112. bind pub m ${CC}kickban pub_kickban
  113. bind pub m ${CC}-ban pub_-ban
  114. bind pub m ${CC}bans pub_bans
  115. bind pub m ${CC}resetbans pub_resetbans
  116. bind pub o|o ${CC}notice pub_notice
  117. bind pub o|o ${CC}op pub_op
  118. bind pub o|o ${CC}deop pub_deop
  119. bind pub o|o ${CC}topic pub_topic
  120. bind pub o|o ${CC}act pub_act
  121. bind pub o|o ${CC}say pub_say
  122. bind pub o|o ${CC}msg pub_msg
  123. bind pub n|n ${CC}tsunami pub_tsunami
  124. bind pub n|n ${CC}bndc pub_bndc
  125. bind pub o|o ${CC}motd pub_motd
  126. bind pub o|o ${CC}addlog pub_addlog
  127. bind pub o|o ${CC}invite pub_invite
  128. bind pub o|o ${CC}nick pub_nick
  129. bind pub p|p ${CC}note pub_note
  130. bind pub x|x ${CC}files pub_files
  131. bind pub p|p ${CC}newpass pub_newpass
  132. bind pub o|o ${CC}console pub_console
  133. bind pub p|p ${CC}quit pub_quit
  134. bind pub o|o ${CC}servers pub_servers
  135. bind pub p|p ${CC}info pub_info
  136. bind pub x|x ${CC}get pub_get
  137. bind pub p|p ${CC}botinfo pub_botinfo
  138. bind pub p|p ${CC}chat pub_chat
  139. bind pub p|p ${CC}channel pub_channel
  140. bind pub p|p ${CC}time pub_time
  141. bind pub o|o ${CC}kick pub_kick
  142. bind pub p|o ${CC}k pub_k
  143. bind pub p|p ${CC}channels pub_channels
  144. bind pub o|o ${CC}botinfo pub_botinfo
  145. bind pub o|o ${CC}trace pub_trace
  146. bind pub o|o ${CC}stick pub_stick
  147. bind pub o|o ${CC}unstick pub_unstick
  148. bind pub o|o ${CC}su pub_su
  149. bind pub p|p ${CC}page pub_page
  150. bind pub p|p ${CC}help pub_help
  151. bind pub p|p ${CC}comment pub_comment
  152. bind pub o|o ${CC}+t mode_+t
  153. bind pub o|o ${CC}+n mode_+n
  154. bind pub o|o ${CC}+s mode_+s
  155. bind pub o|o ${CC}+i mode_+i
  156. bind pub o|o ${CC}+p mode_+p
  157. bind pub o|o ${CC}+m mode_+m
  158. bind pub o|o ${CC}+k mode_+k
  159. bind pub o|o ${CC}+l mode_+l
  160. bind pub o|o ${CC}-v mode_-v
  161. bind pub o|o ${CC}-t mode_-t
  162. bind pub o|o ${CC}-s mode_-s
  163. bind pub o|o ${CC}-l mode_-l
  164. bind pub o|o ${CC}-k mode_-k
  165. bind pub o|o ${CC}-m mode_-m
  166. bind pub o|o ${CC}-i mode_-i
  167. bind pub o|o ${CC}-n mode_-n
  168. bind pub o|o ${CC}-p mode_-p
  169. bind pub p|p ${CC}email pub_email
  170. bind pub p|p ${CC}url pub_url
  171. bind pub p|p ${CC}greet pub_greet
  172. bind pub p|p ${CC}userinfo pub_userinfo
  173. bind pub p|p ${CC}ui pub_userinfo
  174. }
  175.  
  176. if {$mastercommands==1} {
  177. bind pub n ${CC}adduser pub_adduser
  178. bind pub n ${CC}+user pub_+user
  179. bind pub n ${CC}-user pub_-user
  180. bind pub n ${CC}deluser pub_deluser
  181. bind pub m ${CC}+bot pub_+bot
  182. bind pub m ${CC}-bot pub_-bot
  183. bind pub m ${CC}+host pub_+host
  184. bind pub m ${CC}-host pub_-host
  185. bind pub n ${CC}chattr pub_chattr
  186. bind pub m ${CC}save pub_save
  187. bind pub m ${CC}chpass pub_chpass
  188. bind pub m ${CC}chinfo pub_chinfo
  189. bind pub m ${CC}chnick pub_chnick
  190. bind pub m ${CC}chcomment pub_chcomment
  191. bind pub m ${CC}+ignore pub_+ignore
  192. bind pub m ${CC}-ignore pub_-ignore
  193. bind pub m ${CC}ignores pub_ignores
  194. bind pub m ${CC}reload pub_reload
  195. bind pub n ${CC}jump pub_jump
  196. bind pub n ${CC}rehash pub_rehash
  197. bind pub n ${CC}restart pub_restart
  198. bind dcc n join cmd_join
  199. bind pub n ${CC}join pub_join
  200. bind dcc n part cmd_part
  201. bind pub n ${CC}part pub_part
  202. bind dcc m global cmd_global
  203. bind pub m ${CC}chaddr pub_chaddr
  204. bind pub m ${CC}filestats pub_filestats
  205. bind pub m ${CC}fixcodes pub_fixcodes
  206. bind pub m ${CC}strip pub_strip
  207. bind pub m ${CC}link pub_link
  208. bind pub m ${CC}unlink pub_unlink
  209. bind pub m ${CC}chbotattr pub_chbotattr
  210. bind pub m ${CC}assoc pub_assoc
  211. bind pub m ${CC}status pub_status
  212. bind pub m ${CC}chaninfo pub_chaninfo
  213. bind pub n ${CC}boot pub_boot
  214. bind pub n ${CC}relay pub_relay
  215. bind pub n ${CC}set pub_set
  216. bind pub m ${CC}flush pub_flush
  217. bind pub m ${CC}banner pub_banner
  218. bind pub m ${CC}reset pub_reset
  219. bind pub n ${CC}binds pub_binds
  220. bind pub m ${CC}dump pub_dump
  221. bind pub m ${CC}debug pub_debug
  222. bind pub m ${CC}+chrec pub_+chrec
  223. bind pub m ${CC}-chrec pub_-chrec
  224. bind pub m ${CC}dccstat pub_dccstat
  225. bind pub m ${CC}botattr pub_botattr
  226. bind pub m ${CC}chemail pub_cchemail
  227. bind pub m ${CC}churl pub_churl
  228. bind pub m ${CC}chgreet pub_chgreet
  229. bind dcc m chemail dcc_chemail
  230. bind dcc m churl dcc_churl
  231. bind dcc m chgreet dcc_chgreet
  232. bind pub m ${CC}chemail pub_chemail
  233. bind pub m ${CC}churl pub_churl
  234. bind pub m ${CC}chgreet pub_chgreet
  235. }
  236.  
  237. if {$ownercommands==1} {
  238. bind dcc a botnick dcc_botnick
  239. bind pub a ${CC}botnick pub_botnick
  240. bind pub a ${CC}die pub_die
  241. bind pub a ${CC}chanset pub_chanset
  242. bind pub a ${CC}chansave pub_chansave
  243. bind pub a ${CC}chanload pub_chanload
  244. bind pub n ${CC}+chan pub_+chan
  245. bind pub n ${CC}-chan pub_-chan
  246. bind pub n ${CC}simul pub_simul
  247. bind pub n ${CC}modules pub_modules
  248. bind pub n ${CC}loadmodule pub_loadmodule
  249. bind pub n ${CC}unloadmodule pub_unloadmodule
  250. bind dcc a flsave dcc_flsave
  251. }
  252.  
  253. if {$moredcc==1} {
  254. bind dcc o|o userlist cmd_userlist
  255. bind dcc p|p channels cmd_channels
  256. bind dcc o|o flagnote cmd_flagnote
  257. bind dcc o|o say cmd_say
  258. bind dcc o|o act cmd_act
  259. bind dcc o|o addlog cmd_addlog
  260. bind dcc o|o op cmd_op
  261. bind dcc o|o deop cmd_deop
  262. bind dcc m aop cmd_aop
  263. bind dcc m raop cmd_raop
  264. bind dcc o|o match dcc_match
  265. bind filt p \001ACTION*\001 cmd_action
  266. bind dcc p|p email dcc_email
  267. bind dcc p|p url dcc_url
  268. bind dcc p|p greet dcc_greet
  269. bind dcc p|p userinfo dcc_userinfo
  270. bind dcc p|p ui dcc_userinfo
  271. bind dcc p|p wi dcc_wi
  272. }
  273.  
  274. if {$combot==1} {
  275. bind pub m ${CC}aop pub_aop
  276. bind pub m ${CC}raop pub_raop
  277. bind pub o|o ${CC}userlist pub_userlist
  278. bind pub o|o ${CC}me pub_me
  279. bind pub o|o up pub_up
  280. bind pub o|o ${CC}up pub_up
  281. bind pub o|o down pub_down
  282. bind pub o|o ${CC}down pub_down
  283. bind pub p|p ${CC}pong pub_pong
  284. bind pub p|p ${CC}ping pub_ping
  285. bind pub m ${CC}ban pub_ban
  286. bind pub p|p ${CC}access pub_access
  287. bind dcc p|p access dcc_access
  288. bind pub -|- rollcall pub_rollcall
  289. bind pub -|- ${CC}rollcall pub_rollcall
  290. bind pub m ${CC}massunban pub_massunban
  291. bind pub m ${CC}mub pub_massunban
  292. bind dcc m massunban dcc_massunban
  293. bind dcc m mub dcc_mub
  294. bind dcc m massdeop dcc_massdeop
  295. bind dcc m massop dcc_massop
  296. bind dcc m mdeop cmd_mdeop
  297. bind dcc m mop cmd_mop
  298. bind pub m ${CC}massdeop pub_massdeop
  299. bind pub m ${CC}massop pub_massop
  300. bind pub m ${CC}mop pub_massop
  301. bind pub m ${CC}mdeop pub_massdeop
  302. }
  303.  
  304.  
  305. if {$funny_stuff==1} {
  306. bind pub p|p ${CC}pez pub_pez
  307. bind pub p|p ${CC}ramen pub_ramen
  308. }
  309.  
  310. if {$rrated_funny_stuff==1} {
  311. bind pub p|p ${CC}beer pub_beer
  312. bind pub p|p ${CC}drug pub_drug
  313. }
  314.  
  315. ## modes via pubic cmd -- start
  316. proc mode_+v {nick uhost hand chan rest} {
  317. global CC botnick
  318. if {[matchattr $hand Q] == 0} {
  319. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  320. return 0
  321. }
  322. if {$rest == ""} {
  323. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}+v <nick>"
  324. return 0
  325. }
  326. if {[onchan $rest $chan] == 0} {
  327. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $rest is not on the channel."
  328. return 0
  329. }
  330. if {[isvoice $rest $chan] == 1} {
  331. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $rest is already +v"
  332. }
  333. if {[onchan $rest $chan] == 1} {
  334. pushmode $chan +v $rest
  335. }
  336. }
  337.  
  338. proc mode_-v {nick uhost hand chan rest} {
  339. global CC botnick
  340. if {[matchattr $hand Q] == 0} {
  341. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  342. return 0
  343. }
  344. if {$rest == ""} {
  345. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}-v <nick>"
  346. return 0
  347. }
  348. if {[onchan $rest $chan] == 0} {
  349. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $rest is not on the channel."
  350. return 0
  351. }
  352. if {[isvoice $rest $chan] == 1} {
  353. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $rest is already -v"
  354. }
  355. if {[onchan $rest $chan] == 1} {
  356. pushmode $chan -v $rest
  357. }
  358. }
  359.  
  360. proc mode_+t {nick uhost hand chan rest} {
  361. global CC botnick
  362. if {[matchattr $hand Q] == 0} {
  363. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  364. return 0
  365. }
  366. pushmode $chan +t
  367. }
  368.  
  369. proc mode_-t {nick uhost hand chan rest} {
  370. global CC botnick
  371. if {[matchattr $hand Q] == 0} {
  372. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  373. return 0
  374. }
  375. pushmode $chan -t
  376. }
  377.  
  378. proc mode_+s {nick uhost hand chan rest} {
  379. global CC botnick
  380. if {[matchattr $hand Q] == 0} {
  381. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  382. return 0
  383. }
  384. pushmode $chan +s-p
  385. }
  386.  
  387. proc mode_-s {nick uhost hand chan rest} {
  388. global CC botnick
  389. if {[matchattr $hand Q] == 0} {
  390. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  391. return 0
  392. }
  393. pushmode $chan -s
  394. }
  395.  
  396. proc mode_+p {nick uhost hand chan rest} {
  397. global CC botnick
  398. if {[matchattr $hand Q] == 0} {
  399. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  400. return 0
  401. }
  402. pushmode $chan +p-s
  403. }
  404.  
  405. proc mode_-p {nick uhost hand chan rest} {
  406. global CC botnick
  407. if {[matchattr $hand Q] == 0} {
  408. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  409. return 0
  410. }
  411. pushmode $chan -p
  412. }
  413.  
  414. proc mode_+n {nick uhost hand chan rest} {
  415. global CC botnick
  416. if {[matchattr $hand Q] == 0} {
  417. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  418. return 0
  419. }
  420. pushmode $chan +n
  421. }
  422.  
  423. proc mode_-n {nick uhost hand chan rest} {
  424. global CC botnick
  425. if {[matchattr $hand Q] == 0} {
  426. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  427. return 0
  428. }
  429. pushmode $chan -n
  430. }
  431.  
  432. proc mode_+i {nick uhost hand chan rest} {
  433. global CC botnick
  434. if {[matchattr $hand Q] == 0} {
  435. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  436. return 0
  437. }
  438. pushmode $chan +i
  439. }
  440.  
  441. proc mode_-i {nick uhost hand chan rest} {
  442. global CC botnick
  443. if {[matchattr $hand Q] == 0} {
  444. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  445. return 0
  446. }
  447. pushmode $chan -i
  448. }
  449.  
  450. proc mode_+m {nick uhost hand chan rest} {
  451. global CC botnick
  452. if {[matchattr $hand Q] == 0} {
  453. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  454. return 0
  455. }
  456. pushmode $chan +m
  457. }
  458.  
  459. proc mode_-m {nick uhost hand chan rest} {
  460. global CC botnick
  461. if {[matchattr $hand Q] == 0} {
  462. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  463. return 0
  464. }
  465. pushmode $chan -m
  466. }
  467.  
  468. proc mode_+l {nick uhost hand chan rest} {
  469. global CC botnick
  470. if {[matchattr $hand Q] == 0} {
  471. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  472. return 0
  473. }
  474. if {$rest == ""} {
  475. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}+l <limit>"
  476. return 0
  477. }
  478. pushmode $chan +l $rest
  479. }
  480.  
  481. proc mode_-l {nick uhost hand chan rest} {
  482. global CC botnick
  483. if {[matchattr $hand Q] == 0} {
  484. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  485. return 0
  486. }
  487. pushmode $chan -l $rest
  488. }
  489.  
  490. proc mode_+k {nick uhost hand chan rest} {
  491. global CC botnick
  492. if {[matchattr $hand Q] == 0} {
  493. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  494. return 0
  495. }
  496. if {$rest == ""} {
  497. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}+k <key>"
  498. return 0
  499. }
  500. pushmode $chan +k $rest
  501. }
  502.  
  503. proc mode_-k {nick uhost hand chan rest} {
  504. global CC botnick
  505. if {[matchattr $hand Q] == 0} {
  506. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  507. return 0
  508. }
  509. pushmode $chan -k $rest
  510. }
  511.  
  512. proc mode_+b {nick uhost hand chan rest} {
  513. global CC botnick
  514. if {[matchattr $hand Q] == 0} {
  515. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  516. return 0
  517. }
  518. if {$rest == ""} {
  519. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}+b <hostmask>"
  520. return 0
  521. }
  522. pushmode $chan +b $rest
  523. }
  524.  
  525. proc mode_-b {nick uhost hand chan rest} {
  526. global CC botnick
  527. if {[matchattr $hand Q] == 0} {
  528. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  529. return 0
  530. }
  531. if {$rest == ""} {
  532. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}-b <hostmask>"
  533. return 0
  534. }
  535. pushmode $chan -b $rest
  536. }
  537. ## modes via pubic cmd -- stop
  538. ## public cmd notice -- start
  539. proc pub_notice {nick uhost hand channel rest} {
  540. set person [lindex $rest 0]
  541. set rest [lrange $rest 1 end]
  542. if {$rest!=""} {
  543. puthelp "NOTICE $person :$rest"
  544. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! Notice $rest"
  545. return 0
  546. }
  547. if {$rest==""} {
  548. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: notice <nick> <msg>"
  549. }
  550. }
  551. ## public cmd notice -- stop
  552.  
  553.  
  554. ## public cmd echo -- start
  555. proc pub_echo {nick uhost hand chan rest} {
  556. global botnick version CC
  557. puthelp "NOTICE $nick :\002\[4damn4!\]\002 echo is only available via dcc chat."
  558. }
  559.  
  560. ## start of dcc/pub cmds for userinfo, greet, chgreet, chemail, email, churl, url
  561.  
  562. proc url_read {} {
  563. global url botnick nick thepath
  564. set urlfile "${nick}.url"
  565. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set urlpath "$thepath/$urlfile"} else {set urlpath "$thepath$urlfile"}
  566. if {![file exists $urlpath]} {
  567. set fd [open $urlpath w]
  568. puts $fd "### \[tNC\] Created on [unixtime]"
  569. close $fd
  570. putlog "\002\[4damn4!\]\002 Creating url file information."
  571. }
  572. if {[file exists $urlpath]} {
  573. set fd [open $urlpath r]
  574. while {![eof $fd]} {
  575. set urlinfo [gets $fd]
  576. if {[string trim $urlinfo " "] != ""} {
  577. set url([lindex $urlinfo 0]) [lrange $urlinfo 1 end]
  578. }
  579. }
  580. close $fd
  581. return "url_read"
  582. }
  583. }
  584.  
  585. proc greet_read {} {
  586. global greet nick thepath
  587. set greetfile "${nick}.greet"
  588. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set greetpath "$thepath/$greetfile"} else {set greetpath "$thepath$greetfile"}
  589. if {![file exists $greetpath]} {
  590. set fd [open $greetpath w]
  591. puts $fd "### \[tNC\] Created on [unixtime]"
  592. close $fd
  593. putlog "\002\[4damn4!\]\002 Creating greet file information"
  594. }
  595. if {[file exists $greetpath]} {
  596. set fd [open $greetpath r]
  597. while {![eof $fd]} {
  598. set greetinfo [gets $fd]
  599. if {[string trim [lindex $greetinfo 0] " "] != ""} {
  600. set greet([lindex $greetinfo 0]) [lrange $greetinfo 1 end]
  601. }
  602. }
  603. close $fd
  604. return "greet_read"
  605. }
  606. }
  607.  
  608. proc email_read {} {
  609. global email nick thepath
  610. set emailfile "${nick}.email"
  611. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set emailpath "$thepath/$emailfile"} else {set emailpath "$thepath$emailfile"}
  612. if {![file exists $emailpath]} {
  613. set fd [open $emailpath w]
  614. puts $fd "### \[4damn4!\] Created on [unixtime]"
  615. close $fd
  616. putlog "\002\[4damn4!\]\002 Creating email file information"
  617. }
  618. if {[file exists $emailpath]} {
  619. set fd [open $emailpath r]
  620. while {![eof $fd]} {
  621. set emailinfo [gets $fd]
  622. if {[string trim [lindex $emailinfo 0] " "] != ""} {
  623. set email([lindex $emailinfo 0]) [lrange $emailinfo 1 end]
  624. }
  625. }
  626. close $fd
  627. return "email_read"
  628. }
  629. }
  630.  
  631.  
  632.  
  633. if {(![info exists greet]) || ([array size greet] == 0)} {
  634. greet_read
  635. putlog "Loading \002\[4damn4!\]\002 Greet File..."
  636. }
  637. if {(![info exists url]) || ([array size url] == 0)} {
  638. url_read
  639. putlog "Loading \002\[4damn4!\]\002 URL File..."
  640. }
  641. if {(![info exists email]) || ([array size email] == 0)} {
  642. email_read
  643. putlog "Loading \002\[4damn4!\]\002 E-Mail File..."
  644. }
  645.  
  646.  
  647. timer $min bndc_autosave
  648. proc bndc_autosave {} {
  649. global min
  650. putlog "\002\[4damn4!\]\002 Automatically backing up greet information"
  651. greet_save
  652. putlog "\002\[4damn4!\]\002 Automatically backing up email information"
  653. email_save
  654. putlog "\002\[4damn4!\]\002 Automatically backing up url information"
  655. url_save
  656. timer $min bndc_autosave
  657. }
  658.  
  659. proc dcc_flsave {hand idx arg} {
  660. putcmdlog "#$hand# flsave"
  661. putlog "\002\[4damn4!\]\002 ${hand} requested backup of greet information"
  662. greet_save
  663. putlog "\002\[4damn4!\]\002 ${hand} requested backup of email information"
  664. email_save
  665. putlog "\002\[4damn4!\]\002 ${hand} requested backup of url information"
  666. url_save
  667. }
  668.  
  669. proc url_save {} {
  670. global url nick thepath
  671. set urlfile "${nick}.url"
  672. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set urlpath "$thepath/$urlfile"} else {set urlpath "$thepath$urlfile"}
  673. if {[file exists $urlpath]} {
  674. set fd [open $urlpath w]
  675. set start [array startsearch url]
  676. puts $fd "### $url(###)"
  677. while {[array anymore url $start]} {
  678. set item [array nextelement url $start]
  679. if {$item != "###"} {
  680. puts $fd "$item $url($item)"
  681. }
  682. }
  683. array donesearch url $start
  684. unset start
  685. close $fd
  686. putlog "\002\[4damn4!\]\002 saving url information complete."
  687. return "url_save"
  688. }
  689. }
  690.  
  691. proc greet_save {} {
  692. global greet botnick nick thepath
  693. set greetfile "${nick}.greet"
  694. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set greetpath "$thepath/$greetfile"} else {set greetpath "$thepath$greetfile"}
  695. if {[file exists $greetpath]} {
  696. set fd [open $greetpath w]
  697. set start [array startsearch greet]
  698. puts $fd "### $greet(###)"
  699. while {[array anymore greet $start]} {
  700. set item [array nextelement greet $start]
  701. if {$item != "###"} {
  702. puts $fd "$item $greet($item)"
  703. }
  704. }
  705. array donesearch greet $start
  706. close $fd
  707. putlog "\002\[4damn4!\]\002 saving greet information complete."
  708. }
  709. }
  710.  
  711. proc email_save {} {
  712. global email nick thepath
  713. set emailfile "${nick}.email"
  714. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set emailpath "$thepath/$emailfile"} else {set emailpath "$thepath$emailfile"}
  715. if {[file exists $emailpath]} {
  716. set fd [open $emailpath w]
  717. set start [array startsearch email]
  718. puts $fd "### $email(###)"
  719. while {[array anymore email $start]} {
  720. set item [array nextelement email $start]
  721. if {$item != "###"} {
  722. puts $fd "$item $email($item)"
  723. }
  724. }
  725. array donesearch email $start
  726. unset start
  727. close $fd
  728. putlog "\002\[4damn4!\]\002 saving email information complete."
  729. return "email_save"
  730. }
  731. }
  732.  
  733. catch {unbind dcc - restart *dcc:restart ;bind dcc m restart fl_orig_restart} 0
  734. proc fl_orig_restart {hand idx arg} {
  735. global greet url email thepath
  736. greet_save;email_save;url_save
  737. *dcc:restart $hand $idx $arg
  738. }
  739.  
  740. catch {unbind dcc - rehash *dcc:rehash ;bind dcc m rehash fl_orig_rehash} 0
  741. proc fl_orig_rehash {hand idx arg} {
  742. global greet url email thepath
  743. greet_save;email_save;url_save
  744. *dcc:rehash $hand $idx $arg
  745. }
  746.  
  747. catch {unbind dcc - die *dcc:die ;bind dcc n die fl_orig_die} 0
  748. proc fl_orig_die {hand idx arg} {
  749. greet_save;email_save;url_save
  750. *dcc:die $hand $idx $arg
  751. }
  752.  
  753. set thebot $nick
  754.  
  755. proc pub_greet {nick uhost hand chan rest} {
  756. global greet botnick CC thepath thebot
  757. set greetfile "${thebot}.greet"
  758. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set greetpath "$thepath/$greetfile"} else {set greetpath "$thepath$greetfile"}
  759. set greetinfo [lrange $rest 0 end]
  760. if {$greetinfo == ""} {
  761. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}greet <new greet>"
  762. return 0
  763. }
  764. if {[lindex $greetinfo 0] == "none"} {
  765. set greet([string tolower $hand]) ""
  766. putcmdlog "\002\[4damn4!\]\002 #${hand}# greet $greetinfo"
  767. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Your Greet msg has been removed."
  768. return 0
  769. }
  770. set greet([string tolower $hand]) "$greetinfo"
  771. putcmdlog "\002\[4damn4!\]\002 #${hand}# greet $greetinfo"
  772. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Setting for '\002greet\002' is now $greetinfo"
  773. }
  774.  
  775. proc dcc_greet {hand idx arg} {
  776. global greet botnick thebot CC thepath
  777. set greetfile "${thebot}.greet"
  778. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set greetpath "$thepath/$greetfile"} else {set greetpath "$thepath$greetfile"}
  779. set greetinfo [lrange $arg 0 end]
  780. if {$greetinfo == ""} {
  781. putdcc $idx "\002\[4damn4!\]\002 Usage: .greet <new greet>"
  782. return 0
  783. }
  784. if {[lindex $greetinfo 0] == "none"} {
  785. set greet([string tolower $hand]) ""
  786. putcmdlog "\002\[4damn4!\]\002 #${hand}# greet $greetinfo"
  787. putdcc $idx "\002\[4damn4!\]\002 Your Greet msg has been removed."
  788. return 0
  789. }
  790. set greet([string tolower $hand]) "$greetinfo"
  791. putcmdlog "\002\[4damn4!\]\002 #${hand}# greet $greetinfo"
  792. putdcc $idx "\002\[4damn4!\]\002 Setting for '\002greet\002' is now $greetinfo"
  793. }
  794.  
  795. proc pub_email {nick uhost hand chan rest} {
  796. global email botnick CC thebot thepath
  797. set emailfile "${thebot}.email"
  798. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set emailpath "$thepath/$emailfile"} else {set emailpath "$thepath$emailfile"}
  799. set emailinfo [lrange $rest 0 end]
  800. if {$emailinfo == ""} {
  801. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}email <new email>"
  802. return 0
  803. }
  804. if {[lindex $emailinfo 0] == "none"} {
  805. set email([string tolower $hand]) ""
  806. putcmdlog "\002\[4damn4!\]\002 #${hand}# email $emailinfo"
  807. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Your email msg has been removed."
  808. return 0
  809. }
  810. set email([string tolower $hand]) "$emailinfo"
  811. putcmdlog "\002\[4damn4!\]\002 #${hand}# email $emailinfo"
  812. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Setting for '\002email\002' is now $emailinfo"
  813. }
  814.  
  815. proc dcc_email {hand idx arg} {
  816. global email botnick thebot CC thepath
  817. set emailfile "${thebot}.email"
  818. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set emailpath "$thepath/$emailfile"} else {set emailpath "$thepath$emailfile"}
  819. set emailinfo [lrange $arg 0 end]
  820. if {$emailinfo == ""} {
  821. putdcc $idx "\002\[4damn4!\]\002 Usage: email <new email>"
  822. return 0
  823. }
  824. if {[lindex $emailinfo 0] == "none"} {
  825. set email([string tolower $hand]) ""
  826. putcmdlog "\002\[4damn4!\]\002 #${hand}# email $emailinfo"
  827. putdcc $idx "\002\[4damn4!\]\002 Your email msg has been removed."
  828. return 0
  829. }
  830. set email([string tolower $hand]) "$emailinfo"
  831. putcmdlog "\002\[4damn4!\]\002 #${hand}# email $emailinfo"
  832. putdcc $idx "\002\[4damn4!\]\002 Setting for '\002email\002' is now $emailinfo"
  833. }
  834.  
  835. proc pub_chemail {nick uhost hand chan rest} {
  836. global email botnick thebot CC thepath
  837. set emailfile "${thebot}.email"
  838. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set emailpath "$thepath/$emailfile"} else {set emailpath "$thepath$emailfile"}
  839. set user [string tolower [lindex $rest 0]]
  840. set emailinfo [lrange $rest 1 end]
  841. if {($emailinfo == "") || ($user == "")} {
  842. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}chemail <new email>"
  843. return 0
  844. }
  845. if {![validuser $user]} {
  846. puthelp "NOTICE $nick :\002\[4damn4!\]\002 no such user."
  847. return 0
  848. }
  849. if {[lindex $emailinfo 0] == "none"} {
  850. set email([string tolower $user]) ""
  851. putcmdlog "\002\[4damn4!\]\002 #${hand}# chemail $user $emailinfo"
  852. puthelp "NOTICE $nick :\002\[4damn4!\]\002 ${user}'s email msg has been removed."
  853. return 0
  854. }
  855. set email([string tolower $user]) "$emailinfo"
  856. putcmdlog "\002\[4damn4!\]\002 #${hand}# chemail $user $emailinfo"
  857. puthelp "NOTICE $nick :\002\[4damn4!\]\002 ${user}'s Setting for '\002email\002' is now $emailinfo"
  858. }
  859.  
  860. proc dcc_chemail {hand idx arg} {
  861. global email botnick thebot thepath
  862. set emailfile "${thebot}.email"
  863. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set emailpath "$thepath/$emailfile"} else {set emailpath "$thepath$emailfile"}
  864. set user [string tolower [lindex $arg 0]]
  865. set emailinfo [lrange $arg 1 end]
  866. if {($emailinfo == "") || ($user == "")} {
  867. putdcc $idx "\002\[4damn4!\]\002 Usage: ${CC}chemail <new email>"
  868. return 0
  869. }
  870. if {![validuser $user]} {
  871. putdcc $idx "\002\[4damn4!\]\002 no such user."
  872. return 0
  873. }
  874. if {[lindex $emailinfo 0] == "none"} {
  875. set email([string tolower $user]) ""
  876. putcmdlog "\002\[4damn4!\]\002 #${hand}# chemail $user $emailinfo"
  877. putdcc $idx "\002\[4damn4!\]\002 ${user}'s email msg has been removed."
  878. return 0
  879. }
  880. set email([string tolower $user]) "$emailinfo"
  881. putcmdlog "\002\[4damn4!\]\002 #${hand}# chemail $user $emailinfo"
  882. putdcc $idx "\002\[4damn4!\]\002 ${user}'s Setting for '\002email\002' is now $emailinfo"
  883. }
  884.  
  885. proc pub_chgreet {nick uhost hand chan rest} {
  886. global greet botnick thebot CC thepath
  887. set greetfile "${thebot}.greet"
  888. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set greetpath "$thepath/$greetfile"} else {set greetpath "$thepath$greetfile"}
  889. set user [string tolower [lindex $rest 0]]
  890. set greetinfo [lrange $rest 1 end]
  891. if {($greetinfo == "") || ($user == "")} {
  892. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}chgreet <new greet>"
  893. return 0
  894. }
  895. if {![validuser $user]} {
  896. puthelp "NOTICE $nick :\002\[4damn4!\]\002 no such user."
  897. return 0
  898. }
  899. if {[lindex $greetinfo 0] == "none"} {
  900. set greet([string tolower $user]) ""
  901. putcmdlog "\002\[4damn4!\]\002 #${hand}# chgreet $user $greetinfo"
  902. puthelp "NOTICE $nick :\002\[4damn4!\]\002 ${user}'s greet msg has been removed."
  903. return 0
  904. }
  905. set greet([string tolower $user]) "$greetinfo"
  906. putcmdlog "\002\[4damn4!\]\002 #${hand}# chgreet $user $greetinfo"
  907. puthelp "NOTICE $nick :\002\[4damn4!\]\002 ${user}'s Setting for '\002greet\002' is now $greetinfo"
  908. }
  909.  
  910. proc dcc_chgreet {hand idx arg} {
  911. global greet botnick thebot thepath
  912. set greetfile "${thebot}.greet"
  913. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set greetpath "$thepath/$greetfile"} else {set greetpath "$thepath$greetfile"}
  914. set user [string tolower [lindex $arg 0]]
  915. set greetinfo [lrange $arg 1 end]
  916. if {($greetinfo == "") || ($user == "")} {
  917. putdcc $idx "\002\[4damn4!\]\002 Usage: ${CC}chgreet <new greet>"
  918. return 0
  919. }
  920. if {![validuser $user]} {
  921. putdcc $idx "\002\[4damn4!\]\002 no such user."
  922. return 0
  923. }
  924. if {[lindex $greetinfo 0] == "none"} {
  925. set greet([string tolower $user]) ""
  926. putcmdlog "\002\[4damn4!\]\002 #${hand}# chgreet $user $greetinfo"
  927. putdcc $idx "\002\[4damn4!\]\002 ${user}'s greet msg has been removed."
  928. return 0
  929. }
  930. set greet([string tolower $user]) "$greetinfo"
  931. putcmdlog "\002\[4damn4!\]\002 #${hand}# chgreet $user $greetinfo"
  932. putdcc $idx "\002\[4damn4!\]\002 ${user}'s Setting for '\002greet\002' is now $greetinfo"
  933. }
  934.  
  935. proc pub_url {nick uhost hand chan rest} {
  936. global url botnick thebot CC thepath
  937. set urlfile "${thebot}.url"
  938. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set urlpath "$thepath/$urlfile"} else {set urlpath "$thepath$urlfile"}
  939. set urlinfo [lrange $rest 0 end]
  940. if {$urlinfo == ""} {
  941. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}url <new url>"
  942. return 0
  943. }
  944. if {[lindex $urlinfo 0] == "none"} {
  945. set url([string tolower $user]) ""
  946. putcmdlog "\002\[4damn4!\]\002 #${hand}# url $urlinfo"
  947. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Your url msg has been removed."
  948. return 0
  949. }
  950. set url([string tolower $hand]) "$urlinfo"
  951. putcmdlog "\002\[4damn4!\]\002 #${hand}# url $urlinfo"
  952. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Setting for '\002url\002' is now $urlinfo"
  953. }
  954.  
  955. proc dcc_url {hand idx arg} {
  956. global url botnick thebot thepath
  957. set urlfile "${thebot}.url"
  958. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set urlpath "$thepath/$urlfile"} else {set urlpath "$thepath$urlfile"}
  959. set urlinfo [lrange $arg 0 end]
  960. if {$urlinfo == ""} {
  961. putdcc $idx "\002\[4damn4!\]\002 Usage: .url <new url>"
  962. return 0
  963. }
  964. if {[lindex $urlinfo 0] == "none"} {
  965. set url([string tolower $hand]) ""
  966. putcmdlog "\002\[4damn4!\]\002 #${hand}# url $urlinfo"
  967. putdcc $idx "\002\[4damn4!\]\002 Your url msg has been removed."
  968. return 0
  969. }
  970. set url([string tolower $hand]) "$urlinfo"
  971. putcmdlog "\002\[4damn4!\]\002 #${hand}# url $urlinfo"
  972. putdcc $idx "\002\[4damn4!\]\002 Setting for '\002url\002' is now $urlinfo"
  973. }
  974.  
  975. proc pub_churl {nick uhost hand chan rest} {
  976. global url botnick thebot CC thepath
  977. set urlfile "${thebot}.url"
  978. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set urlpath "$thepath/$urlfile"} else {set urlpath "$thepath$urlfile"}
  979. set user [string tolower [lindex $rest 0]]
  980. set urlinfo [lrange $rest 1 end]
  981. if {($urlinfo == "") || ($user == "")} {
  982. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}churl <new url>"
  983. return 0
  984. }
  985. if {![validuser $user]} {
  986. puthelp "NOTICE $nick :\002\[4damn4!\]\002 no such user."
  987. return 0
  988. }
  989. if {[lindex $urlinfo 0] == "none"} {
  990. set url([string tolower $user]) ""
  991. putcmdlog "\002\[4damn4!\]\002 #${hand}# churl $user $urlinfo"
  992. puthelp "NOTICE $nick :\002\[4damn4!\]\002 ${user}'s url msg has been removed."
  993. return 0
  994. }
  995. set url([string tolower $user]) "$urlinfo"
  996. putcmdlog "\002\[4damn4!\]\002 #${hand}# churl $user $urlinfo"
  997. puthelp "NOTICE $nick :\002\[4damn4!\]\002 ${user}'s Setting for '\002url\002' is now $urlinfo"
  998. }
  999.  
  1000. proc dcc_churl {hand idx arg} {
  1001. global url botnick thebot thepath
  1002. set urlfile "${thebot}.url"
  1003. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set urlpath "$thepath/$urlfile"} else {set urlpath "$thepath$urlfile"}
  1004. set user [string tolower [lindex $arg 0]]
  1005. set urlinfo [lrange $arg 1 end]
  1006. if {($urlinfo == "") || ($user == "")} {
  1007. putdcc $idx "\002\[4damn4!\]\002 Usage: ${CC}churl <new url>"
  1008. return 0
  1009. }
  1010. if {![validuser $user]} {
  1011. putdcc $idx "\002\[4damn4!\]\002 no such user."
  1012. return 0
  1013. }
  1014. if {[lindex $urlinfo 0] == "none"} {
  1015. set url($user) ""
  1016. putcmdlog "\002\[4damn4!\]\002 #${hand}# churl $user $urlinfo"
  1017. putdcc $idx "\002\[4damn4!\]\002 ${user}'s url msg has been removed."
  1018. return 0
  1019. }
  1020. set url(${user}) "$urlinfo"
  1021. putcmdlog "\002\[4damn4!\]\002 #${hand}# churl $user $urlinfo"
  1022. putdcc $idx "\002\[4damn4!\]\002 ${user}'s Setting for '\002url\002' is now $urlinfo"
  1023. }
  1024.  
  1025. proc pub_ui {nick uhost hand chan rest} {
  1026. global greet url thebot email CC timezone botnick thepath
  1027. pub_userinfo $nick $uhost $hand $chan $rest
  1028. }
  1029.  
  1030. proc pub_userinfo {nick uhost hand chan rest} {
  1031. global greet url thebot email CC timezone botnick thepath
  1032. set greetfile "${thebot}.greet"
  1033. set emailfile "${thebot}.email"
  1034. set urlfile "${thebot}.url"
  1035. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set greetpath "$thepath/$greetfile"} else {set greetpath "$thepath$greetfile"}
  1036. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set emailpath "$thepath/$emailfile"} else {set emailpath "$thepath$emailfile"}
  1037. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set urlpath "$thepath/$urlfile"} else {set urlpath "$thepath$urlfile"}
  1038.  
  1039. set user [lindex $rest 0]
  1040. if {$user == ""} {set user $hand}
  1041. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Information about $user"
  1042. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Current Time : [ctime [unixtime]] $timezone"
  1043. if {[validuser $user] == 0} {
  1044. puthelp "NOTICE $nick :\002\[4damn4!\]\002 No such user."
  1045. return 0
  1046. }
  1047. if {[onchan $user $chan]} {
  1048. set last "Is currently online."
  1049. } else {
  1050. set last "[ctime [lindex [getuser $user LASTON] 0]]"
  1051. }
  1052. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Last Online : $last"
  1053. set emailyes 0;set urlyes 0;set greetyes 0
  1054. if {![info exists email([string tolower $user])]} {set emailyes 1}
  1055. if {![info exists url([string tolower $user])]} {set urlyes 1}
  1056. if {![info exists email([string tolower $user])]} {set greetyes 1}
  1057. if {!$emailyes} {
  1058. if {$email([string tolower $user]) != ""} {
  1059. puthelp "NOTICE $nick :\002\[4damn4!\]\002 E-Mail Address : $email([string tolower $user])"
  1060. }
  1061. }
  1062. if {!$urlyes} {
  1063. if {$url([string tolower $user]) != ""} {
  1064. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Web Address : $url([string tolower $user])"
  1065. }
  1066. }
  1067. if {!$greetyes} {
  1068. if {$greet([string tolower $user]) != ""} {
  1069. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Greet : $greet([string tolower $user])"
  1070. }
  1071. }
  1072. if {[getuser $user INFO] != ""} {
  1073. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Info : [getuser $user INFO]"
  1074. }
  1075. }
  1076.  
  1077. proc dcc_ui {hand idx arg} {
  1078. global greet url email thebot CC timezone botnick thepath
  1079. dccsimul $idx ".userinfo $arg"
  1080. }
  1081.  
  1082. proc dcc_userinfo {hand idx arg} {
  1083. global greet url email thebot CC timezone botnick thepath
  1084. set greetfile "${thebot}.greet"
  1085. set emailfile "${thebot}.email"
  1086. set urlfile "${thebot}.url"
  1087. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set greetpath "$thepath/$greetfile"} else {set greetpath "$thepath$greetfile"}
  1088. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set emailpath "$thepath/$emailfile"} else {set emailpath "$thepath$emailfile"}
  1089. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set urlpath "$thepath/$urlfile"} else {set urlpath "$thepath$urlfile"}
  1090. set user [lindex $arg 0]
  1091. if {$user == ""} {set user $hand}
  1092. putdcc $idx "\002\[4damn4!\]\002 Information about $user"
  1093. putdcc $idx "\002\[4damn4!\]\002 Current Time : [ctime [unixtime]] $timezone"
  1094. if {[validuser $user] == 0} {
  1095. putdcc $idx "\002\[4damn4!\]\002 No such user."
  1096. return 0
  1097. }
  1098. foreach x [channels] {
  1099. if {[onchan $user $x]} {
  1100. set last "Is currently online in ${x}."
  1101. } else {
  1102. set last "[ctime [lindex [getuser $user LASTON] 0]]"
  1103. }
  1104. }
  1105. putdcc $idx "\002\[4damn4!\]\002 Last Online : $last"
  1106. set emailyes 0;set urlyes 0;set greetyes 0
  1107. if {![info exists url([string tolower $user])]} {set urlyes 1}
  1108. if {![info exists email([string tolower $user])]} {set emailyes 1}
  1109. if {![info exists greet([string tolower $user])]} {set greetyes 1}
  1110. if {!$emailyes} {
  1111. if {$email([string tolower $user]) != ""} {
  1112. putdcc $idx "\002\[4damn4!\]\002 E-Mail Address : $email([string tolower $user])"
  1113. }
  1114. }
  1115. if {!$urlyes} {
  1116. if {$url([string tolower $user]) != ""} {
  1117. putdcc $idx "\002\[4damn4!\]\002 Web Address : $url([string tolower $user])"
  1118. }
  1119. }
  1120. if {!$greetyes} {
  1121. if {$greet([string tolower $user]) != ""} {
  1122. putdcc $idx "\002\[4damn4!\]\002 Greet : $greet([string tolower $user])"
  1123. }
  1124. }
  1125. if {[getuser $user INFO] != ""} {
  1126. putdcc $idx "\002\[4damn4!\]\002 Info : [getuser $user INFO]"
  1127. }
  1128. }
  1129.  
  1130. proc join_greet {nick uhost hand chan} {
  1131. global greet botnick thebot thepath
  1132. set greetfile "${thebot}.greet"
  1133. if {[string index $thepath [expr [string length $thepath]-1]] != "/"} {set greetpath "$thepath/$greetfile"} else {set greetpath "$thepath$greetfile"}
  1134. if {[string tolower $nick] != [string tolower $botnick]} {
  1135. if {![info exists greet([string tolower $hand])]} {return 0}
  1136. if {[info exists greet([string tolower $hand])]} {
  1137. if {$greet([string tolower $hand]) != ""} {
  1138. if {[string tolower $nick] != [string tolower $hand]} {
  1139. putserv "PRIVMSG $chan :\002\[\002${nick} \(${hand}\)\002]\002 $greet([string tolower $hand])"
  1140. } else {
  1141. putserv "PRIVMSG $chan :\002\[\002${nick}\002]\002 $greet([string tolower $hand])"
  1142. }
  1143. }
  1144. }
  1145. }
  1146. }
  1147.  
  1148.  
  1149. ## end of dcc/pub cmds for userinfo, greet, chgreet, chemail, email, churl, url
  1150.  
  1151. ## public cmd seen -- start
  1152. proc pub_seen {nick uhost hand chan rest} {
  1153. global botnick version CC
  1154. set handle [lindex $rest 0]
  1155. if {$rest == ""} {
  1156. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}seen <handle>"
  1157. return 0
  1158. }
  1159. if {[validuser $handle] == 0} {
  1160. puthelp "NOTICE $nick :\002\[4damn4!\]\002 No such user in my userlist."
  1161. return 0
  1162. }
  1163. if {[string tolower $handle] == [string tolower $nick]} {
  1164. puthelp "NOTICE $nick :\002\[4damn4!\]\002 You are here."
  1165. return 0
  1166. }
  1167. if {[onchan $handle $chan] == 1} {
  1168. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $handle is currently on $chan."
  1169. return 0
  1170. }
  1171. set lastseen [getuser $handle LASTON]
  1172. if {$lastseen == ""} {puthelp "NOTICE $nick :\002\[4damn4!\]\002 $handle was never here";return 0}
  1173. set lastseen [lindex $lastseen 0]
  1174. set totalyear [expr [unixtime] - $lastseen]
  1175. if {$totalyear < 60} {
  1176. return "$handle has left $chan less than a minute ago."
  1177. return 0
  1178. }
  1179. if {$totalyear >= 31536000} {
  1180. set yearsfull [expr $totalyear/31536000]
  1181. set years [expr int($yearsfull)]
  1182. set yearssub [expr 31536000*$years]
  1183. set totalday [expr $totalyear - $yearssub]
  1184. }
  1185. if {$totalyear < 31536000} {
  1186. set totalday $totalyear
  1187. set years 0
  1188. }
  1189. if {$totalday >= 86400} {
  1190. set daysfull [expr $totalday/86400]
  1191. set days [expr int($daysfull)]
  1192. set dayssub [expr 86400*$days]
  1193. set totalhour [expr $totalday - $dayssub]
  1194. }
  1195. if {$totalday < 86400} {
  1196. set totalhour $totalday
  1197. set days 0
  1198. }
  1199. if {$totalhour >= 3600} {
  1200. set hoursfull [expr $totalhour/3600]
  1201. set hours [expr int($hoursfull)]
  1202. set hourssub [expr 3600*$hours]
  1203. set totalmin [expr $totalhour - $hourssub]
  1204. }
  1205. if {$totalhour < 3600} {
  1206. set totalmin $totalhour
  1207. set hours 0
  1208. }
  1209. if {$totalmin >= 60} {
  1210. set minsfull [expr $totalmin/60]
  1211. set mins [expr int($minsfull)]
  1212. }
  1213. if {$totalmin < 60} {
  1214. set mins 0
  1215. }
  1216. if {$years < 1} {set yearstext ""} elseif {$years == 1} {set yearstext "$years year, "} {set yearstext "$years years, "}
  1217.  
  1218. if {$days < 1} {set daystext ""} elseif {$days == 1} {set daystext "$days day, "} {set daystext "$days days, "}
  1219.  
  1220. if {$hours < 1} {set hourstext ""} elseif {$hours == 1} {set hourstext "$hours hour, "} {set hourstext "$hours hours, "}
  1221.  
  1222. if {$mins < 1} {set minstext ""} elseif {$mins == 1} {set minstext "$mins minute"} {set minstext "$mins minutes"}
  1223.  
  1224. set output $yearstext$daystext$hourstext$minstext
  1225. set output [string trimright $output ", "]
  1226. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $nick, I last saw $handle $output ago"
  1227. }
  1228. ## pub cmd seen -- stop
  1229.  
  1230. ## msg cmd auth -- start
  1231. proc msg_auth {nick uhost hand rest} {
  1232. global botnick
  1233. set pw [lindex $rest 0]
  1234. if {$pw == ""} {
  1235. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: /msg $botnick auth <password>"
  1236. return 0
  1237. }
  1238. if {[matchattr $hand Q] == 1} {
  1239. puthelp "NOTICE $nick :\002\[4damn4!\]\002 You are already Authenticated."
  1240. return 0
  1241. }
  1242. set ch [passwdok $hand ""]
  1243. if {$ch == 1} {
  1244. puthelp "NOTICE $nick :\002\[4damn4!\]\002 No password set. Type /msg $botnick pass <password>"
  1245. return 0
  1246. }
  1247. if {[passwdok $hand $pw] == 1} {
  1248. chattr $hand +Q
  1249. putcmdlog "\002\[4damn4!\]\002 #$hand# auth ..."
  1250. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Authentication successful!"
  1251. }
  1252. if {[passwdok $hand $pw] == 0} {
  1253. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Authentication failed!"
  1254. }
  1255. }
  1256. ## msg cmd auth -- stop
  1257.  
  1258. ## msg cmd deauth -- start
  1259. proc msg_deauth {nick uhost hand rest} {
  1260. global botnick
  1261. if {$rest == ""} {
  1262. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: /msg $botnick deauth <password>"
  1263. return 0
  1264. }
  1265. if {[matchattr $hand Q] == 0} {
  1266. puthelp "NOTICE $nick :\002\[4damn4!\]\002 You never authenticated."
  1267. return 0
  1268. }
  1269. if {[passwdok $hand $rest] == 1} {
  1270. chattr $hand -Q
  1271. putcmdlog "\002\[4damn4!\]\002 #$hand# deauth ..."
  1272. puthelp "NOTICE $nick :\002\[4damn4!\]\002 DeAuthentication successful!"
  1273. }
  1274. if {[passwdok $hand $rest] == 0} {
  1275. puthelp "NOTICE $nick :\002\[4damn4!\]\002 DeAuthentication failed!"
  1276. }
  1277. }
  1278. ## msg cmd deauth -- stop
  1279.  
  1280. ## sign cmd deauth -- start
  1281. proc sign_deauth {nick uhost hand chan rest} {
  1282. if {[matchattr $hand Q] == 1} {
  1283. chattr $hand -Q
  1284. putlog "\002\[4damn4!\]\002 $nick has signed off, automatic deauthentication."
  1285. }
  1286. if {[matchattr $hand Q] == 0} {
  1287. return 0
  1288. }
  1289. }
  1290. ## sign cmd deauth -- stop
  1291.  
  1292. ## part cmd deauth -- start
  1293. proc part_deauth {nick uhost hand chan} {
  1294. if {[matchattr $hand Q] == 1} {
  1295. chattr $hand -Q
  1296. putlog "\002\[4damn4!\]\002 $nick has parted $chan, automatic deauthentication."
  1297. }
  1298. if {[matchattr $hand Q] == 0} {
  1299. return 0
  1300. }
  1301. }
  1302. ## part cmd deauth -- stop
  1303.  
  1304. ## public cmd about -- start
  1305. proc pub_about {nick uhost hand chan rest} {
  1306. global vers
  1307. putcmdlog "#$hand# about damn.tcl"
  1308. puthelp "NOTICE $nick :\002\[4damn4!\]\002 6damn6! TcL ${vers} By Undetectedlabs <mail@undetectedlabs.org>"
  1309. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Modified Monday, November 19, 2001 7:50:13 PM"
  1310. puthelp "NOTICE $nick :\002\[4damn4!\]\002 REQUIRES EGGDROP 1.3+ with toolkit.tcl and alltools.tcl"
  1311. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Copyright © 2001 - 4Damn4!"
  1312. }
  1313. ## public cmd about -- stop
  1314.  
  1315. ## dcc cmd about -- start
  1316. proc dcc_about {hand idx args} {
  1317. global vers
  1318. putcmdlog "#$hand# about damn.tcl"
  1319. putdcc $idx "\002\[4damn4!\]\002 6damn6! TcL ${vers} By DJ Noe2x <mail@dj-noe2x.com>"
  1320. putdcc $idx "\002\[4damn4!\]\002 Modified Monday, November 19, 2001 7:50:13 PM"
  1321. putdcc $idx "\002\[4damn4!\]\002 REQUIRES EGGDROP 1.3+ with toolkit.tcl and alltools.tcl"
  1322. putdcc $idx "\002\[4damn4!\]\002 Copyright © 2001 - 4Damn4!"
  1323. }
  1324. ## dcc cmd about - stop
  1325.  
  1326. ## public cmd version -- start
  1327. proc pub_version {nick uhost hand chan rest} {
  1328. putcmdlog "#$hand# version"
  1329. global vers
  1330. puthelp "NOTICE $nick :\002\[4damn4!\]\002 6damn6! TcL ${vers} By DJ Noe2x <mail@dj-noe2x.com>"
  1331. }
  1332. ## public cmd version -- stop
  1333.  
  1334. ## dcc cmd version -- start
  1335. proc dcc_version {hand idx args} {
  1336. global vers
  1337. putcmdlog "#$hand# version"
  1338. putdcc $idx "\002\[4damn4!\]\002 6damn6! TcL ${vers} By DJ Noe2x <mail@dj-noe2x.com>"
  1339. }
  1340. ## dcc cmd version -- stop
  1341.  
  1342. ## public cmd help -- start
  1343. proc pub_help {nick uhost hand chan rest} {
  1344. puthelp "NOTICE $nick :\002\[4damn4!\]\002 help is only available via dcc chat."
  1345. }
  1346. ## public cmd help -- stop
  1347.  
  1348. ## public cmd bndchelp -- start
  1349. proc pub_bndchelp {nick uhost hand chan rest} {
  1350. puthelp "NOTICE $nick :\002\[4damn4!\]\002 help is only available via dcc chat."
  1351. }
  1352. ## public cmd bndchelp -- stop
  1353.  
  1354. ## dcc cmd bndCHelp -- start
  1355. proc dcc_bndchelp {hand idx args} {
  1356. global botnick version vers
  1357. set tn "\002\[4damn4!\]\002"
  1358. set args [lindex $args 0]
  1359. global CC NC
  1360. if {$args == ""} {
  1361. putdcc $idx "$tn 6damn6! TcL ${vers} By DJ Noe2x <mail@dj-noe2x.com>"
  1362. putdcc $idx "$tn PUBLIC COMMANDS for $botnick, eggdrop v[lindex $version 0]"
  1363. putdcc $idx "$tn MY DCC CMD CHAR IS: \002'\002.\002'\002 MY PUBLIC CMD CHAR IS: \002'\002${CC}\002'\002"
  1364. putdcc $idx "$tn"
  1365. putdcc $idx "$tn \002\[\002\037For partyline users\037\002\]\002"
  1366. putdcc $idx "$tn ping access version time"
  1367. putdcc $idx "$tn pong rollcall about seen"
  1368. if {[matchattr $hand o] == 1} {
  1369. putdcc $idx "$tn \002\[\002\037For channel ops\037\002\]\002"
  1370. putdcc $idx "$tn who +ban say away(disabled) quit"
  1371. putdcc $idx "$tn whom -ban msg back(disabled) servers"
  1372. putdcc $idx "$tn whois ban act note channel"
  1373. putdcc $idx "$tn match bans me files kick"
  1374. putdcc $idx "$tn bots addlog newpass su k"
  1375. putdcc $idx "$tn bottree op invite console kickban"
  1376. putdcc $idx "$tn notes deop nick email kb"
  1377. putdcc $idx "$tn echo up stick unstick info"
  1378. putdcc $idx "$tn trace down filestats page strip"
  1379. putdcc $idx "$tn topic fixcodes userlist flagnote comment"
  1380. putdcc $idx "$tn chat botinfo motd modes info"
  1381. putdcc $idx "$tn wi ui"
  1382. }
  1383. if {[matchattr $hand m] == 1} {
  1384. putdcc $idx "$tn \002\[\002\037For masters\037\002\]\002"
  1385. putdcc $idx "$tn adduser +host chattr save reload"
  1386. putdcc $idx "$tn deluser -host status boot chaninfo"
  1387. putdcc $idx "$tn +bot botattr chnick chpass chinfo"
  1388. putdcc $idx "$tn -bot link unlink chaddr chcomment"
  1389. putdcc $idx "$tn +user set jump dump +ignores"
  1390. putdcc $idx "$tn -user flush dccstat debug -ignores"
  1391. putdcc $idx "$tn join aop +chrec reset ignores"
  1392. putdcc $idx "$tn part raop -chrec rehash restart"
  1393. putdcc $idx "$tn massop mop massunban boot banner"
  1394. putdcc $idx "$tn massdeop mdeop mub assoc relay"
  1395. putdcc $idx "$tn botattr"
  1396. }
  1397. if {[matchattr $hand n] == 1} {
  1398. putdcc $idx "$tn \002\[\002\037For owners\037\002\]\002"
  1399. putdcc $idx "$tn chanset chansave chanload simul"
  1400. putdcc $idx "$tn +chan -chan die botnick"
  1401. putdcc $idx "$tn modules loadmodule unloadmodule"
  1402. }
  1403. putdcc $idx "$tn All of these commands are available in the channel and in dcc chat."
  1404. return 0
  1405. }
  1406. if {[string tolower $args] == "kb"} {
  1407. putcmdlog "$tn #$hand# help kb"
  1408. putdcc $idx "$tn \#\#\# kb"
  1409. putdcc $idx "$tn kickbans a user off of the channel."
  1410. return 0
  1411. }
  1412. if {[string tolower $args] == "chcomment"} {
  1413. putcmdlog "$tn #$hand# help chcomment"
  1414. putdcc $idx "$tn \#\#\# chcomment"
  1415. putdcc $idx "$tn Allows masters/owners to set users comment line."
  1416. return 0
  1417. }
  1418. if {[string tolower $args] == "seen"} {
  1419. putcmdlog "$tn #$hand# help seen"
  1420. putdcc $idx "$tn \#\#\# seen"
  1421. putdcc $idx "$tn Gives the last time a user was on the channel."
  1422. return 0
  1423. }
  1424. if {[string tolower $args] == "time"} {
  1425. putcmdlog "$tn #$hand# help time"
  1426. putdcc $idx "$tn \#\#\# time"
  1427. putdcc $idx "$tn Gives the user the current time according to the bots location."
  1428. return 0
  1429. }
  1430. if {[string tolower $args] == "mdeop"} {
  1431. putcmdlog "$tn #$hand# help mdeop"
  1432. putdcc $idx "$tn \#\#\# mdeop"
  1433. putdcc $idx "$tn MassDeops all non-ops on the channel."
  1434. return 0
  1435. }
  1436. if {[string tolower $args] == "mop"} {
  1437. putcmdlog "$tn #$hand# help mop"
  1438. putdcc $idx "$tn \#\#\# mop"
  1439. putdcc $idx "$tn MassOps all non-ops on the channel."
  1440. return 0
  1441. }
  1442. if {[string tolower $args] == "massdeop"} {
  1443. putcmdlog "$tn #$hand# help massdeop"
  1444. putdcc $idx "$tn \#\#\# massdeop"
  1445. putdcc $idx "$tn MassDeops all non-ops on the channel."
  1446. return 0
  1447. }
  1448. if {[string tolower $args] == "massop"} {
  1449. putcmdlog "$tn #$hand# help massop"
  1450. putdcc $idx "$tn \#\#\# massop"
  1451. putdcc $idx "$tn MassOps all non-ops on the channel."
  1452. return 0
  1453. }
  1454. if {[string tolower $args] == "mub"} {
  1455. putcmdlog "$tn #$hand# help mub"
  1456. putdcc $idx "$tn \#\#\# mub"
  1457. putdcc $idx "$tn Removes all bans currently set on the channel."
  1458. return 0
  1459. }
  1460. if {[string tolower $args] == "massuban"} {
  1461. putcmdlog "$tn #$hand# help massuban"
  1462. putdcc $idx "$tn \#\#\# massunban"
  1463. putdcc $idx "$tn Removes all bans currently set on the channel."
  1464. return 0
  1465. }
  1466. if {[string tolower $args] == "about"} {
  1467. putcmdlog "$tn #$hand# help about"
  1468. putdcc $idx "$tn \#\#\# about"
  1469. putdcc $idx "$tn About damn.tcl"
  1470. return 0
  1471. }
  1472. if {[string tolower $args] == "version"} {
  1473. putcmdlog "$tn #$hand# help version"
  1474. putdcc $idx "$tn \#\#\# version"
  1475. putdcc $idx "$tn damn.tcl version"
  1476. return 0
  1477. }
  1478. if {[string tolower $args] == "back"} {
  1479. putcmdlog "$tn #$hand# help back"
  1480. putdcc $idx "$tn \#\#\# back"
  1481. putdcc $idx "$tn Back states that your bot is back after being away"
  1482. putdcc $idx "$tn (only available via PUBLIC CMD)"
  1483. return 0
  1484. }
  1485. if {[string tolower $args] == "down"} {
  1486. putcmdlog "$tn #$hand# help down"
  1487. putdcc $idx "$tn \#\#\# down"
  1488. putdcc $idx "$tn bot deops you on the channel."
  1489. putdcc $idx "$tn (only available via PUBLIC CMD)"
  1490. return 0
  1491. }
  1492. if {[string tolower $args] == "up"} {
  1493. putcmdlog "$tn #$hand# help up"
  1494. putdcc $idx "$tn \#\#\# up"
  1495. putdcc $idx "$tn bot ops on the channel."
  1496. putdcc $idx "$tn (only available via PUBLIC CMD)"
  1497. return 0
  1498. }
  1499. if {[string tolower $args] == "userlist"} {
  1500. putcmdlog "$tn #$hand# help userlist"
  1501. putdcc $idx "$tn \#\#\# userlist"
  1502. putdcc $idx "$tn \#\#\# userlist <flags>"
  1503. putdcc $idx "$tn Lists all users currently on the bot"
  1504. return 0
  1505. }
  1506. if {[string tolower $args] == "ping"} {
  1507. putcmdlog "$tn #$hand# help ping"
  1508. putdcc $idx "$tn \#\#\# ping"
  1509. putdcc $idx "$tn Shows bot response time."
  1510. putdcc $idx "$tn (only available via PUBLIC CMD)"
  1511. return 0
  1512. }
  1513. if {[string tolower $args] == "pong"} {
  1514. putdcc $idx "$tn \#\#\# pong"
  1515. putcmdlog "$tn #$hand# help pong"
  1516. putdcc $idx "$tn Shows bot response time"
  1517. putdcc $idx "$tn (only available via PUBLIC CMD)"
  1518. return 0
  1519. }
  1520. if {[string tolower $args] == "access"} {
  1521. putcmdlog "$tn #$hand# help access"
  1522. putdcc $idx "$tn \#\#\# acess"
  1523. putdcc $idx "$tn \#\#\# access <nick>"
  1524. putdcc $idx "$tn shows user flags currently enabled."
  1525. return 0
  1526. }
  1527. if {[string tolower $args] == "rollcall"} {
  1528. putcmdlog "$tn #$hand# help rollcall"
  1529. putdcc $idx "$tn \#\#\# rollcall"
  1530. putdcc $idx "$tn shows bots command char \& shows current bot version."
  1531. putdcc $idx "$tn (only available via PUBLIC CMD)"
  1532. return 0
  1533. }
  1534. if {[string tolower $args] == "aop"} {
  1535. putcmdlog "$tn #$hand# help aop"
  1536. putdcc $idx "$tn \#\#\# aop <nick>"
  1537. putdcc $idx "$tn aop Auto-op's a user when they enter a channel."
  1538. return 0
  1539. }
  1540. if {[string tolower $args] == "raop"} {
  1541. putcmdlog "$tn #$hand# help raop"
  1542. putdcc $idx "$tn \#\#\# raop <nick>"
  1543. putdcc $idx "$tn Removes user's auto-op privilege."
  1544. return 0
  1545. }
  1546. if {[string tolower $args] == "botnick"} {
  1547. putcmdlog "$tn #$hand# help botnick"
  1548. putdcc $idx "$tn \#\#\# botnick <new botnick>"
  1549. putdcc $idx "$tn changes the bots irc nick - \002\037NOT\037\002 botnet nick."
  1550. return 0
  1551. }
  1552. if {[string tolower $args] == "join"} {
  1553. putcmdlog "$tn #$hand# help join"
  1554. putdcc $idx "$tn \#\#\# join <#channel>"
  1555. putdcc $idx "$tn Forces the bot to join a channel"
  1556. return 0
  1557. }
  1558. if {[string tolower $args] == "part"} {
  1559. putcmdlog "$tn #$hand# help part"
  1560. putdcc $idx "$tn \#\#\# part <#channel>"
  1561. putdcc $idx "$tn Forces a bot to leave a channel."
  1562. return 0
  1563. }
  1564. if {[string tolower $args] == "modes"} {
  1565. putcmdlog "$tn #$hand# help modes"
  1566. putdcc $idx "$tn \#\#\# modes"
  1567. putdcc $idx "$tn Lets you auto set channel modes."
  1568. putdcc $idx "$tn Current modes are t,n,i,p,s,m,l,k,v"
  1569. putdcc $idx "$tn Example: ${CC}+v lamest, ${CC}+k private, +t"
  1570. return 0
  1571. }
  1572. if {[string tolower $args] == "flagnote"} {
  1573. putcmdlog "$tn #$hand# help flagnote"
  1574. putdcc $idx "$tn \#\#\# flagnote <flag>"
  1575. putdcc $idx "$tn flagnote Sends a message to all users with a certain flag"
  1576. return 0
  1577. }
  1578. if {$args != ""} {
  1579. dccsimul $idx ".help $args"
  1580. }
  1581. }
  1582. ## dcc cmd bndchelp -- stop
  1583.  
  1584. ## dcc cmd wi -- start
  1585. proc dcc_wi {hand idx arg} {
  1586. global botnick
  1587. if {$arg == ""} {
  1588. putdcc $idx "\002\[4damn4!\]\002 Usage: whois <handle>"
  1589. return 0
  1590. }
  1591. dccsimul $idx ".whois $arg"
  1592. }
  1593. ## dcc cmd wi -- stop
  1594.  
  1595.  
  1596. ## public cmd massunban -- start
  1597. proc pub_massunban {nick uhost hand chan rest} {
  1598. global botnick
  1599. if {[matchattr $hand Q] == 0} {
  1600. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  1601. return 0
  1602. }
  1603. putserv "MODE $chan +b"
  1604. }
  1605. ## public cmd massunban -- stop
  1606.  
  1607. ## dcc cmd mub -- start
  1608. proc dcc_mub {hand idx args} {
  1609. set channel [lindex $args 0]
  1610. if {[validchan $channel]} {
  1611. putserv "MODE $channel +b"
  1612. } else {
  1613. putdcc $idx "\002\[4damn4!\]\002 Usage: mub <#channel>"
  1614. }
  1615. }
  1616. ## dcc cmd mub -- stop
  1617.  
  1618. ## dcc cmd massunban -- start
  1619. proc dcc_massunban {hand idx args} {
  1620. set channel [lindex $args 0]
  1621. if {[validchan $channel]} {
  1622. putserv "MODE $channel +b"
  1623. } else {
  1624. putdcc $idx "\002\[4damn4!\]\002 Usage: massunban <#channel>"
  1625. }
  1626. }
  1627. ## dcc cmd massunban -- stop
  1628.  
  1629. ## public cmd dccstat -- start
  1630. proc pub_dccstat {nick uhost hand chan rest} {
  1631. set socksp " ";set usersp " ";set hostsp " "
  1632. puthelp "NOTICE $nick :\002\[4damn4!\]\002 SOCK NICK HOST TYPE"
  1633. puthelp "NOTICE $nick :\002\[4damn4!\]\002 ---- --------- ----------------- ----"
  1634. foreach info [dcclist] {
  1635. # set info [lsort -integer [lindex $info 0]] [lrange $info 1 end]
  1636. set sock [lindex $info 0]
  1637. set user [lindex $info 1]
  1638. set host [lindex $info 2]
  1639. set type [lindex $info 3]
  1640. if {[string length $sock] < 4} {
  1641. set socksize [expr [string length $socksp]-[string length $sock]]
  1642. set newsocksp [string range $socksp 0 [expr $socksize - 1]]
  1643. set sock "${sock}${newsocksp}"
  1644. }
  1645. if {[string length $user] < 9} {
  1646. set usersize [expr [string length $usersp]-[string length $user]]
  1647. set newusersp [string range $usersp 0 [expr $usersize - 1]]
  1648. set user "${user}${newusersp}"
  1649. }
  1650. if {[string length $user] > 9} {set user [string range $user 0 8}
  1651. if {[string length $host] < 17} {
  1652. set hostsize [expr [string length $hostsp]-[string length $host]]
  1653. set newhostsp [string range $hostsp 0 [expr $hostsize - 1]]
  1654. set host "${host}${newhostsp}"
  1655. }
  1656. if {[string length $host] > 17} {
  1657. set hostsize [expr [string length $host] -17]
  1658. set host [string range $host $hostsize end]
  1659. }
  1660. if {$type == "TELNET"} {set type "lstn"}
  1661. set type [string range [string tolower $type] 0 3]
  1662. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $sock $user $host $type"
  1663. putcmdlog "\002\[4damn4!\]\002 #$hand# dccstat"
  1664. }
  1665. }
  1666. ## public cmd dccstat -- stop
  1667.  
  1668. ## public cmd -chrec -- start
  1669. proc pub_-chrec {nick uhost hand chan rest} {
  1670. puthelp "NOTICE $nick :\002\[4damn4!\]\002 -chrec is only available via dcc chat."
  1671. }
  1672. ## public cmd -chrec -- stop
  1673.  
  1674. ## public cmd +chrec -- start
  1675. proc pub_+chrec {nick uhost hand chan rest} {
  1676. puthelp "NOTICE $nick :\002\[4damn4!\]\002 +chrec is only available via dcc chat."
  1677. }
  1678. ## public cmd +chrec -- stop
  1679.  
  1680. ## public cmd debug -- start
  1681. proc pub_debug {nick uhost hand chan rest} {
  1682. puthelp "NOTICE $nick :\002\[4damn4!\]\002 debug is only available via dcc chat."
  1683. }
  1684. ## public cmd debug -- stop
  1685.  
  1686. ## public cmd dump -- start
  1687. proc pub_dump {nick uhost hand chan rest} {
  1688. if {[matchattr $hand Q] == 0} {
  1689. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  1690. return 0
  1691. }
  1692. putserv "$rest"
  1693. puthelp "NOTICE $nick :Dumped Information to Server"
  1694. putcmdlog "#$hand# dump $rest"
  1695. }
  1696. ## public cmd dump -- stop
  1697.  
  1698. ## public cmd unloadmodule -- start
  1699. proc pub_unloadmodule {nick uhost hand chan rest} {
  1700. puthelp "NOTICE $nick :\002\[4damn4!\]\002 unloadmodule is only available via dcc chat."
  1701. }
  1702. ## public cmd unloadmodule -- stop
  1703.  
  1704. ## public cmd loadmodule -- start
  1705. proc pub_loadmodule {nick uhost hand chan rest} {
  1706. puthelp "NOTICE $nick :\002\[4damn4!\]\002 loadmodule is only available via dcc chat."
  1707. }
  1708. ## public cmd loadmodule -- stop
  1709.  
  1710. ## public cmd modules -- start
  1711. proc pub_modules {nick uhost hand chan rest} {
  1712. puthelp "NOTICE $nick :\002\[4damn4!\]\002 modules is only available via dcc chat."
  1713. }
  1714. ## public cmd modules -- stop
  1715.  
  1716. ## public cmd simul -- start
  1717. proc pub_simul {nick uhost hand chan rest} {
  1718. puthelp "NOTICE $nick :\002\[4damn4!\]\002 simul is only available via dcc chat."
  1719. }
  1720. ## public cmd simul -- stop
  1721.  
  1722. ## public cmd botattr -- start
  1723. proc pub_botattr {nick uhost hand channel rest} {
  1724. global CC botnick
  1725. if {[matchattr $hand Q] == 0} {
  1726. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  1727. return 0
  1728. }
  1729. set chan [lindex $rest 2]
  1730. set bot [lindex $rest 0]
  1731. set bflags [lindex $rest 1]
  1732. if {($bot == "") || ($bflags == "")} {
  1733. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}botattr <bot> <flags> \[channel\]"
  1734. return 0
  1735. }
  1736. if {[validuser $bot] == 0} {
  1737. puthelp "NOTICE $nick :\002\[4damn4!\]\002 No such bot!"
  1738. return 0
  1739. }
  1740. if {[matchattr $bot b] == 0} {
  1741. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $bot is not a bot"
  1742. return 0
  1743. }
  1744. if {$chan != ""} {
  1745. if {[validchan $chan]} {
  1746. putcmdlog "\002\[4damn4!\]\002 #$hand# botattr $bot $bflags $chan"
  1747. if {[string trim $bflags abcdefghijklmnopqrstuvwdamnABCDEFGHIJKLMNOPQRSTUVWdamn+-] == "|"} {
  1748. botattr $bot $bflags $chan
  1749. } else {
  1750. botattr $bot |$bflags $chan
  1751. }
  1752. set chanflags [chattr $bot | $chan]
  1753. set chanflags [string trimleft "abcdefghijklmnopqrstuvwdamnABCDEFGHIJKLMNOPQRSTUVWdamn+-"]
  1754. set chanflags [string trim $chanflags "|"]
  1755. set globalflags [chattr $ownern]
  1756. puthelp "NOTICE $nick :\002\[4damn4!\]\002 botattr $bot \002\[\002${bflags}\002\]\002 $chan"
  1757. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Global Flags for $bot are \002\[\002${globalflags}\002\]\002"
  1758. if {$chanflags != "-"} {
  1759. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Channel \002\"\002${chan}\002\"\002 Flags for $bot are \002\[\002${chanflags}\002\]\002"
  1760. } else {
  1761. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $bot does not have any channel specific flags."
  1762. }
  1763. } else {
  1764. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $chan is not a valid channel"
  1765. }
  1766. } else {
  1767. putcmdlog "\002\[4damn4!\]\002 #$hand# botattr $bot $bflags"
  1768. botattr $bot $bflags
  1769. set bflags [getuser $bot BOTFL]
  1770. puthelp "NOTICE $nick :\002\[4damn4!\]\002 botattr $bot \002\[\002${bflags}\002\]\002"
  1771. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Global Flags for $bot are now \002\[\002${bflags}\002\]\002"
  1772. }
  1773. }
  1774. ## public cmd -chan -- stop
  1775. proc pub_-chan {nick uhost hand chan rest} {
  1776. global CC botnick
  1777. if {[matchattr $hand Q] == 0} {
  1778. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  1779. return 0
  1780. }
  1781. set channel [lindex $rest 0]
  1782. if {$channel == ""} {
  1783. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}+chan <#channel>"
  1784. return 0
  1785. }
  1786. if {[string first # $channel]!=0} {
  1787. set channel "#$channel"
  1788. }
  1789. if {[validchan $channel]} {
  1790. putcmdlog "\002\[4damn4!\]\002 #$hand# -chan $channel"
  1791. channel remove $channel
  1792. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Channel $channel removed from the bot."
  1793. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This includes any channel specific bans you set."
  1794. } else {
  1795. puthelp "NOTICE $nick :\002\[4damn4!\]\002 That channel doesnt exist!"
  1796. }
  1797. }
  1798. ## public cmd -chan -- stop
  1799.  
  1800. ## public cmd +chan -- start
  1801. proc pub_+chan {nick uhost hand chan rest} {
  1802. global CC botnick
  1803. if {[matchattr $hand Q] == 0} {
  1804. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  1805. return 0
  1806. }
  1807. set channel [lindex $rest 0]
  1808. set options [lindex $rest 1]
  1809. if {$channel == ""} {
  1810. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}+chan <#channel> \[option-list\]"
  1811. return 0
  1812. }
  1813. if {[validchan $channel]} {
  1814. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Your already in $channel"
  1815. } else {
  1816. if {[string first # $channel]!=0} {
  1817. set channel "#$channel"
  1818. }
  1819. putcmdlog "\002\[4damn4!\]\002 #$hand# +chan $channel $options"
  1820. channel add $channel $options
  1821. }
  1822. }
  1823. ## public cmd +chan -- stop
  1824.  
  1825. ## public cmd binds -- start
  1826. proc pub_binds {nick uhost hand chan rest} {
  1827. puthelp "NOTICE $nick :\002\[4damn4!\]\002 binds is only available via dcc chat."
  1828. }
  1829. ## public cmd binds -- stop
  1830.  
  1831. ## public cmd reset -- start
  1832. proc pub_reset {nick uhost hand chan rest} {
  1833. puthelp "NOTICE $nick :\002\[4damn4!\]\002 reset is only available via dcc chat."
  1834. }
  1835. ## public cmd reset -- stop
  1836.  
  1837. ## public cmd banner -- start
  1838. proc pub_banner {nick uhost hand chan rest} {
  1839. puthelp "NOTICE $nick :\002\[4damn4!\]\002 banner is only available via dcc chat."
  1840. }
  1841. ## public cmd banner -- stop
  1842.  
  1843. ## public cmd resetbans -- start
  1844. proc pub_resetbans {nick uhost hand channel rest} {
  1845. global CC botnick
  1846. set chan $rest
  1847. if {$chan != ""} {
  1848. if {[validchan $chan]} {
  1849. foreach ban [banlist $chan] {
  1850. pushmode $chan +b [lindex $ban 0]
  1851. }
  1852. putserv "MODE $chan +b"
  1853. putcmdlog "\002\[4damn4!\]\002 #$hand# (${chan}) resetbans"
  1854. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Resetting bans on $chan..."
  1855. return 0
  1856. } else {
  1857. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $chan is an invalid channel."
  1858. return 0
  1859. }
  1860. }
  1861. if {$chan == ""} {
  1862. foreach ban [banlist] {
  1863. foreach i [channels] {
  1864. pushmode $i +b [lindex $ban 0]
  1865. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Resetting bans on $i"
  1866. }
  1867. }
  1868. foreach x [channels] {
  1869. putserv "MODE $x +b"
  1870. }
  1871. putcmdlog "\002\[4damn4!\]\002 #$hand# resetbans"
  1872. }
  1873. }
  1874. ## public cmd resetbans -- stop
  1875.  
  1876. ## public cmd flush -- start
  1877. proc pub_flush {nick uhost hand chan rest} {
  1878. puthelp "NOTICE $nick :\002\[4damn4!\]\002 flush is only available via dcc chat."
  1879. }
  1880. ## public cmd flush -- stop
  1881.  
  1882. ## public cmd set -- start
  1883. proc pub_set {nick uhost hand chan rest} {
  1884. puthelp "NOTICE $nick :\002\[4damn4!\]\002 set is only available via dcc chat."
  1885. }
  1886. ## public cmd set -- stop
  1887.  
  1888. ## public cmd chanload -- start
  1889. proc pub_chanload {nick uhost hand chan rest} {
  1890. global botnick
  1891. if {[matchattr $hand Q] == 0} {
  1892. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  1893. return 0
  1894. }
  1895. putcmdlog "\002\[4damn4!\]\002 #$hand# chanload"
  1896. loadchannels
  1897. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Reloading all dynamic channel settings."
  1898. }
  1899. ## public cmd chanload -- stop
  1900.  
  1901. ## public cmd chansave -- start
  1902. proc pub_chansave {nick uhost hand chan rest} {
  1903. global botnick
  1904. if {[matchattr $hand Q] == 0} {
  1905. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  1906. return 0
  1907. }
  1908. putcmdlog "\002\[4damn4!\]\002 #$hand# chansave"
  1909. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Saving all dynamic channel settings."
  1910. savechannels
  1911. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Writing channel file ..."
  1912. }
  1913. ## public cmd chansave -- stop
  1914.  
  1915. ## public cmd chanset -- start
  1916. proc pub_chanset {nick uhost hand chan rest} {
  1917. global CC botnick
  1918. if {[matchattr $hand Q] == 0} {
  1919. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  1920. return 0
  1921. }
  1922. set channel [lindex $rest 0]
  1923. set options [lindex $rest 1]
  1924. if {($channel == "") || ($options == "")} {
  1925. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}chanset #<channel> <option...>"
  1926. return 0
  1927. }
  1928. if {[validchan $channel]} {
  1929. putcmdlog "\002\[4damn4!\]\002 #$hand# chanset $channel $options"
  1930. channel set $channel $options
  1931. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Successfully set modes \{ $options \} on $channel"
  1932. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Changes to $channel are not permanent."
  1933. } else {
  1934. puthelp "NOTICE $nick :\002\[4damn4!\]\002 No such channel."
  1935. }
  1936. }
  1937. ## public cmd chanset -- stop
  1938.  
  1939. ## pubic cmd restart -- start
  1940. proc pub_restart {nick uhost hand chan rest} {
  1941. global botnick
  1942. if {[matchattr $hand Q] == 0} {
  1943. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  1944. return 0
  1945. }
  1946. utimer 1 restart
  1947. putcmdlog "#${hand}# restart"
  1948. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Writing user file... Writing channel file ... Restarting ..."
  1949. }
  1950. ## public cmd restart -- stop
  1951.  
  1952. ## pubic cmd rehash -- start
  1953. proc pub_rehash {nick uhost hand chan rest} {
  1954. if {[matchattr $hand Q] == 0} {
  1955. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  1956. return 0
  1957. }
  1958. utimer 1 rehash
  1959. putcmdlog "#${hand}# rehash"
  1960. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Writing user & channel file... Rehashing.. Userfile loaded, unpacking..."
  1961. }
  1962. ## public cmd rehash -- stop
  1963.  
  1964. ## public cmd relay -- start
  1965. proc pub_relay {nick uhost hand chan rest} {
  1966. puthelp "NOTICE $nick :\002\[4damn4!\]\002 relay is only available via dcc chat."
  1967. }
  1968. ## public cmd relay -- stop
  1969.  
  1970. ## public cmd chaninfo -- start
  1971. proc pub_chaninfo {nick uhost hand chan rest} {
  1972. global CC
  1973. if {$rest == ""} {
  1974. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}chaninfo <#channel>"
  1975. return 0
  1976. }
  1977. if {[validchan $rest]} {
  1978. set em [lindex [channel info $rest] 0]
  1979. putcmdlog "\002\[4damn4!\]\002 #$hand# chaninfo $rest"
  1980. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Settings for static channel $rest"
  1981. set em [lindex [channel info $rest] 0]
  1982. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Protect modes (chanmode): $em"
  1983. if {[lindex [channel info $rest] 1] == "0"} {
  1984. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Idle Kick after (idle-kick): DONT!"
  1985. } else {
  1986. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Idle Kick after (idle-kick): [lindex [channel info $rest] 1] min"
  1987. }
  1988. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Other modes:"
  1989. puthelp "NOTICE $nick :\002\[4damn4!\]\002 [lindex [channel info $rest] 12] [lindex [channel info $rest] 13] [lindex [channel info $rest] 14] [lindex [channel info $rest] 15]"
  1990. puthelp "NOTICE $nick :\002\[4damn4!\]\002 [lindex [channel info $rest] 16] [lindex [channel info $rest] 17] [lindex [channel info $rest] 18] [lindex [channel info $rest] 19]"
  1991. puthelp "NOTICE $nick :\002\[4damn4!\]\002 [lindex [channel info $rest] 20] [lindex [channel info $rest] 21] [lindex [channel info $rest] 22] [lindex [channel info $rest] 23]"
  1992. puthelp "NOTICE $nick :\002\[4damn4!\]\002 [lindex [channel info $rest] 24] [lindex [channel info $rest] 25] [lindex [channel info $rest] 26]"
  1993. set ichan [lindex [channel info $rest] 7]
  1994. set ictcp [lindex [channel info $rest] 8]
  1995. set ijoin [lindex [channel info $rest] 9]
  1996. set ikick [lindex [channel info $rest] 10]
  1997. set ideop [lindex [channel info $rest] 11]
  1998. puthelp "NOTICE $nick :\002\[4damn4!\]\002 flood settings: chan: $ichan ctcp: $ictcp join: $ijoin kick: $ikick deop: $ideop"
  1999. } else {
  2000. puthelp "NOTICE $nick :\002\[4damn4!\]\002 No such channel defined."
  2001. }
  2002. }
  2003. ## public cmd chaninfo -- stop
  2004.  
  2005. ## public cmd status -- start
  2006. proc pub_status {nick uhost hand chan rest} {
  2007. global botnick CC server max-file-users max-filesize admin chanmode version uptime timezone files-path incoming-path
  2008. putcmdlog "\002\[4damn4!\]\002 #$hand# status"
  2009. set vers [lindex $version 0]
  2010. set users [countusers]
  2011. regsub -all " " [channels] ", " chans
  2012. puthelp "NOTICE $nick :\002\[4damn4!\]\002 I am $botnick, running eggdrop v${vers}: $users users"
  2013. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Running on [exec uname -sr]"
  2014. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Server $server"
  2015. set totalyear [expr [unixtime] - $uptime]
  2016. if {$totalyear >= 31536000} {
  2017. set yearsfull [expr $totalyear/31536000]
  2018. set years [expr int($yearsfull)]
  2019. set yearssub [expr 31536000*$years]
  2020. set totalday [expr $totalyear - $yearssub]
  2021. }
  2022. if {$totalyear < 31536000} {
  2023. set totalday $totalyear
  2024. set years 0
  2025. }
  2026. if {$totalday >= 86400} {
  2027. set daysfull [expr $totalday/86400]
  2028. set days [expr int($daysfull)]
  2029. set dayssub [expr 86400*$days]
  2030. set totalhour [expr $totalday - $dayssub]
  2031. }
  2032. if {$totalday < 86400} {
  2033. set totalhour $totalday
  2034. set days 0
  2035. }
  2036. if {$totalhour >= 3600} {
  2037. set hoursfull [expr $totalhour/3600]
  2038. set hours [expr int($hoursfull)]
  2039. set hourssub [expr 3600*$hours]
  2040. set totalmin [expr $totalhour - $hourssub]
  2041. }
  2042. if {$totalhour < 3600} {
  2043. set totalmin $totalhour
  2044. set hours 0
  2045. }
  2046. if {$totalmin >= 60} {
  2047. set minsfull [expr $totalmin/60]
  2048. set mins [expr int($minsfull)]
  2049. }
  2050. if {$totalmin < 60} {
  2051. set mins 0
  2052. }
  2053. if {$years < 1} {set yearstext ""} elseif {$years == 1} {set yearstext "$years year, "} {set yearstext "$years years, "}
  2054.  
  2055. if {$days < 1} {set daystext ""} elseif {$days == 1} {set daystext "$days day, "} {set daystext "$days days, "}
  2056.  
  2057. if {$hours < 1} {set hourstext ""} elseif {$hours == 1} {set hourstext "$hours hour, "} {set hourstext "$hours hours, "}
  2058.  
  2059. if {$mins < 1} {set minstext ""} elseif {$mins == 1} {set minstext "$mins minute"} {set minstext "$mins minutes"}
  2060.  
  2061. if {[string length $mins] == 1} {set mins "0${mins}"}
  2062. if {[string length $hours] == 1} {set hours "0${hours}"}
  2063. set output "${yearstext}${daystext}${hours}:${mins}"
  2064. set output [string trimright $output ", "]
  2065. set cpu [lindex [exec ps ux [exec cat pid.${botnick}]] 13]
  2066. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Online for $output (background) CPU $cpu"
  2067. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Admin: $admin"
  2068. puthelp "NOTICE $nick :\002\[4damn4!\]\002 DCC file path: ${files-path}"
  2069. puthelp "NOTICE $nick :\002\[4damn4!\]\002 incoming: ${incoming-path}"
  2070. puthelp "NOTICE $nick :\002\[4damn4!\]\002 max users is ${max-file-users}"
  2071. puthelp "NOTICE $nick :\002\[4damn4!\]\002 DCC max file size: ${max-filesize}k"
  2072. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Channels: $chans"
  2073. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Server $server"
  2074. foreach x [channels] {
  2075. set ch [llength [chanlist $x]]
  2076. set em [lindex [channel info $x] 0]
  2077. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $x : $ch members, enforcing \"${em}\""
  2078. }
  2079. }
  2080. ## public cmd status -- stop
  2081.  
  2082. ## public cmd boot -- start
  2083. proc pub_boot {nick uhost hand chan rest} {
  2084. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Access denied, people should know who is booting them."
  2085. }
  2086. ## public cmd boot -- stop
  2087.  
  2088. ## public cmd assoc -- start
  2089. proc pub_assoc {nick uhost hand chan rest} {
  2090. puthelp "NOTICE $nick :\002\[4damn4!\]\002 assoc is only available via dcc chat."
  2091. }
  2092. ## public cmd assoc -- stop
  2093.  
  2094. ## public cmd chbotattr -- start
  2095. proc pub_chbotattr {nick uhost hand chan rest} {
  2096. puthelp "NOTICE $nick :\002\[4damn4!\]\002 See botattr command."
  2097. }
  2098. ## public cmd chbotattr -- stop
  2099.  
  2100. ## public cmd unlink -- start
  2101. proc pub_unlink {nick uhost hand chan rest} {
  2102. global CC botnick
  2103. if {[matchattr $hand Q] == 0} {
  2104. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  2105. return 0
  2106. }
  2107. if {$rest == ""} {
  2108. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}unlink <bot>"
  2109. return 0
  2110. }
  2111. if {([validuser $rest] == 0) || ([matchattr $rest b] == 0)} {
  2112. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $rest is not in my userlist as a bot."
  2113. return 0
  2114. }
  2115. if {[lsearch -exact [string tolower [bots]] [string tolower $rest]] == -1} {
  2116. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $rest is not linked on the botnet."
  2117. return 0
  2118. }
  2119. if {[lsearch -exact [string tolower [bots]] [string tolower $rest]] > -1} {
  2120. putcmdlog "\002\[4damn4!\]\002 #$hand# unlink $rest"
  2121. unlink $rest
  2122. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Breaking link with $rest"
  2123. }
  2124. }
  2125. ## public cmd unlink -- stop
  2126.  
  2127. ## public cmd link -- start
  2128. proc pub_link {nick uhost hand chan rest} {
  2129. global CC botnick
  2130. if {[matchattr $hand Q] == 0} {
  2131. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  2132. return 0
  2133. }
  2134. if {$rest == ""} {
  2135. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}link <bot>"
  2136. return 0
  2137. }
  2138. if {([validuser $rest] == 0) || ([matchattr $rest b] == 0)} {
  2139. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $rest is not in my userlist as a bot."
  2140. return 0
  2141. }
  2142. if {[lsearch -exact [string tolower [bots]] [string tolower $rest]] > -1} {
  2143. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $rest is already linked on the botnet."
  2144. return 0
  2145. }
  2146. if {[lsearch -exact [string tolower [bots]] [string tolower $rest]] == -1} {
  2147. putcmdlog "\002\[4damn4!\]\002 #$hand# link $rest"
  2148. link $rest
  2149. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Linking to $rest at [getaddr $rest]"
  2150. }
  2151. }
  2152. ## public cmd link -- end
  2153.  
  2154. ## public cmd su -- start
  2155. proc pub_su {nick uhost hand chan rest} {
  2156. puthelp "NOTICE $nick :\002\[4damn4!\]\002 su is only available via dcc chat."
  2157. }
  2158. ## public cmd strip -- start
  2159. proc pub_strip {nick uhost hand chan rest} {
  2160. puthelp "NOTICE $nick :\002\[4damn4!\]\002 strip is only available via dcc chat."
  2161. }
  2162. ## public cmd strip -- stop
  2163.  
  2164. ## public cmd page -- start
  2165. proc pub_page {nick uhost hand chan rest} {
  2166. puthelp "NOTICE $nick :\002\[4damn4!\]\002 page is only available via dcc chat."
  2167. }
  2168. ## public cmd page -- stop
  2169.  
  2170. ## public cmd filestats -- start
  2171. proc pub_filestats {nick uhost hand chan rest} {
  2172. global CC
  2173. if {$rest == ""} {
  2174. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}filestats <handle>"
  2175. return 0
  2176. }
  2177. if {[validuser $rest] == 0} {
  2178. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $rest is not in my userlist."
  2179. return 0
  2180. }
  2181. if {[validuser $rest] == 1} {
  2182. set uploads [getuploads $rest]
  2183. set nul [lindex [getuploads $rest] 0]
  2184. set tul [lindex [getuploads $rest] 1]
  2185. set ndl [lindex [getdnloads $rest] 0]
  2186. set tdl [lindex [getdnloads $rest] 1]
  2187. putcmdlog "\002\[4damn4!\]\002 #$hand# filestats $rest"
  2188. if {$tul >9} {set main " "} else {set main " "}
  2189. if {$tul >99} {set main " "} else {set main " "}
  2190. if {$tdl >9} {set main " "} else {set main " "}
  2191. if {$tdl >99} {set main " "} else {set main " "}
  2192. if {$nul >9} {set s " "} else {set s " "}
  2193. if {$nul >99} {set s " "} else {set s " "}
  2194. if {$nul >999} {set s " "} else {set s " "}
  2195. if {$nul >9999} {set s " "} else {set s " "}
  2196. if {$ndl >9} {set s " "} else {set s " "}
  2197. if {$ndl >99} {set s " "} else {set s " "}
  2198. if {$ndl >999} {set s " "} else {set s " "}
  2199. if {$ndl >9999} {set s " "} else {set s " "}
  2200. puthelp "NOTICE $nick :\002\[4damn4!\]\002 \037${rest}'s filestats\037"
  2201. puthelp "NOTICE $nick :\002\[4damn4!\]\002 uploads:${main}${nul} /${s}${tul}k"
  2202. puthelp "NOTICE $nick :\002\[4damn4!\]\002 downloads:${main}${ndl} /${s}${tdl}k"
  2203. }
  2204. }
  2205. ## public cmd filestats -- stop
  2206.  
  2207. ## public cmd unstick -- start
  2208. proc pub_unstick {nick uhost hand chan rest} {
  2209. puthelp "NOTICE $nick :\002\[4damn4!\]\002 unstick is only available via dcc chat."
  2210. }
  2211. ## public cmd unstick -- stop
  2212.  
  2213. ## public cmd stick -- start
  2214. proc pub_stick {nick uhost hand chan rest} {
  2215. puthelp "NOTICE $nick :\002\[4damn4!\]\002 stick is only available via dcc chat."
  2216. }
  2217. ## public cmd stick -- stop
  2218.  
  2219. ## public cmd fixcodes -- start
  2220. proc pub_fixcodes {nick uhost hand chan rest} {
  2221. puthelp "NOTICE $nick :\002\[4damn4!\]\002 fixcodes is only available via dcc chat."
  2222. }
  2223. ## public cmd fixcodes -- stop
  2224.  
  2225. ## public cmd trace -- start
  2226. proc pub_trace {nick uhost hand chan rest} {
  2227. puthelp "NOTICE $nick :\002\[4damn4!\]\002 trace is only available via dcc chat."
  2228. }
  2229. ## public cmd trace -- stop
  2230.  
  2231. ## public cmd botinfo -- start
  2232. proc pub_botinfo {nick uhost hand chan rest} {
  2233. puthelp "NOTICE $nick :\002\[4damn4!\]\002 botinfo is only available via dcc chat."
  2234. }
  2235. ## public cmd botinfo -- stop
  2236.  
  2237. ## public cmd chaddr -- start
  2238. proc pub_chaddr {nick uhost hand chan rest} {
  2239. global CC botnick
  2240. if {[matchattr $hand Q] == 0} {
  2241. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate. /msg $botnick auth <password>"
  2242. return 0
  2243. }
  2244. set botname [lindex $rest 0]
  2245. set changes [lindex $rest 1]
  2246. if {($botname == "") || ($changes == "")} {
  2247. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}chaddr <bot> <address:port#\[relay-port#\]>"
  2248. return 0
  2249. }
  2250. set porttest [string trim $changes "abcdefghijklmnopqrstuvwxyx."]
  2251. set porttest [string trim $porttest ":"]
  2252. if {$porttest == ""} {
  2253. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}chaddr <bot> <address:port#\[relay-port#\]>"
  2254. return 0
  2255. }
  2256. if {[validuser $botname] == 0} {
  2257. puthelp "NOTICE $nick :\002\[4damn4!\]\002 There is no such bot in the userlist."
  2258. return 0
  2259. }
  2260. if {[matchattr $botname b] == 0} {
  2261. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $rest is not a bot."
  2262. return 0
  2263. }
  2264. botattr $botname $changes
  2265. set oldaddy [getuser $botname BOTADDR]
  2266. set oldaddy [lindex $oldaddy 0]:[lindex $oldaddy 1]/[lindex $oldaddy 2]
  2267. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Changed ${botname}'s Address from \002\[\002${oldaddy}\002\]\002 to \002\[\002$changes\002\]\002"
  2268. }
  2269. ## public cmd chaddr -- stop
  2270.  
  2271. ## public cmd rollcall -- start
  2272.  
  2273. proc pub_rollcall {nick uhost hand chan rest} {
  2274. global CC botnick version
  2275. set botvers [lindex $version 0]
  2276. set cmdchar $CC
  2277. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! rollcall"
  2278. puthelp "NOTICE $nick :\002\[4damn4!\]\002 I am ${botnick}, running eggdrop v${botvers}"
  2279. puthelp "NOTICE $nick :\002\[4damn4!\]\002 My Command Charactor is \002\[\002${CC}\002\]\002"
  2280. }
  2281. ## public cmd rollcall -- stop
  2282.  
  2283. ## dcc cmd access -- start
  2284. proc dcc_access {hand idx rest} {
  2285. global CC
  2286. set who [lindex $rest 0]
  2287. set chan [lindex $rest 1]
  2288. if {$who == ""} {
  2289. putdcc $idx "\002\[4damn4!\]\002 Usage: .access <nick | me>"
  2290. return 0
  2291. }
  2292. if {$who == "me"} {
  2293. if {$chan != ""} {
  2294. if {[validchan $chan]} {
  2295. set swho $hand
  2296. set cflags [chattr $swho | $chan]
  2297. set nflags [string trimleft $cflags "abcdefghijklmnopqrstuvwdamnABCDEFGHIJKLMNOPQRSTUVWdamn"]
  2298. set cfflags [string trim $nflags "|"]
  2299. putlog "\002\[4damn4!\]\002 !$hand! access $swho $chan"
  2300. if {$cfflags == "-"} {
  2301. putdcc $idx "\002\[4damn4!\]\002 You do not have any channel specific flags on ${chan}."
  2302. return 0
  2303. } else {
  2304. putdcc $idx "\002\[4damn4!\]\002 Your access is \002\[\002${cfflags}\002\]\002 on ${chan}."
  2305. return 0
  2306. }
  2307. } else {
  2308. putdcc $idx "\002\[4damn4!\]\002 $chan is not a valid channel."
  2309. return 0
  2310. }
  2311. }
  2312. if {$chan == ""} {
  2313. set mwho $hand
  2314. set mflags [chattr $mwho]
  2315. putlog "\002\[4damn4!\]\002 !$hand! access $mwho"
  2316. putdcc $idx "\002\[4damn4!\]\002 Your access is \002\[\002${mflags}\002\]\002"
  2317. return 0
  2318. }
  2319. }
  2320. if {[validuser $who] == 1} {
  2321. if {$chan != ""} {
  2322. if {[validchan $chan]} {
  2323. set cflags [chattr $who | $chan]
  2324. set nflags [string trimleft $cflags "abcdefghijklmnopqrstuvwdamnABCDEFGHIJKLMNOPQRSTUVWdamn"]
  2325. set cfflags [string trim $nflags "|"]
  2326. putlog "\002\[4damn4!\]\002 !$hand! access $who $chan"
  2327. if {$cfflags == "-"} {
  2328. putdcc $idx "\002\[4damn4!\]\002 You do not have any channel specific flags on ${chan}."
  2329. return 0
  2330. } else {
  2331. putdcc $idx "\002\[4damn4!\]\002 ${who}'s access is \002\[\002${cfflags}\002\]\002 on ${chan}."
  2332. return 0
  2333. }
  2334. } else {
  2335. putdcc $idx "\002\[4damn4!\]\002 $chan is not a valid channel."
  2336. return 0
  2337. }
  2338. }
  2339. if {$chan == ""} {
  2340. set flags [chattr $who]
  2341. putlog "\002\[4damn4!\]\002 !$hand! access $who"
  2342. putdcc $idx "\002\[4damn4!\]\002 ${who}'s access is \002\[\002${flags}\002\]\002"
  2343. return 0
  2344. }
  2345. }
  2346. if {[validuser $who] == 0} {
  2347. putdcc $idx "\002\[4damn4!\]\002 No such user!"
  2348. return 0
  2349. }
  2350. }
  2351. ## dcc cmd access -- stop
  2352.  
  2353. ## public cmd access -- start
  2354. proc pub_access {nick uhost hand chan rest} {
  2355. global CC
  2356. set who [lindex $rest 0]
  2357. set chan [lindex $rest 1]
  2358. if {$who == ""} {
  2359. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}access <nick | me>"
  2360. return 0
  2361. }
  2362. if {$who == "me"} {
  2363. if {$chan != ""} {
  2364. if {[validchan $chan]} {
  2365. set swho $hand
  2366. set cflags [chattr $swho | $chan]
  2367. set nflags [string trimleft $cflags "abcdefghijklmnopqrstuvwdamnABCDEFGHIJKLMNOPQRSTUVWdamn"]
  2368. set cfflags [string trim $nflags "|"]
  2369. putlog "\002\[4damn4!\]\002 !$hand! access $swho $chan"
  2370. if {$cfflags == "-"} {
  2371. puthelp "NOTICE $nick :\002\[4damn4!\]\002 You do not have any channel specific flags on ${chan}."
  2372. return 0
  2373. } else {
  2374. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Your access is \002\[\002${cfflags}\002\]\002 on ${chan}."
  2375. return 0
  2376. }
  2377. } else {
  2378. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $chan is not a valid channel."
  2379. return 0
  2380. }
  2381. }
  2382. if {$chan == ""} {
  2383. set mwho $hand
  2384. set mflags [chattr $mwho]
  2385. putlog "\002\[4damn4!\]\002 !$hand! access $mwho"
  2386. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Your access is \002\[\002${mflags}\002\]\002"
  2387. return 0
  2388. }
  2389. }
  2390. if {[validuser $who] == 1} {
  2391. if {$chan != ""} {
  2392. if {[validchan $chan]} {
  2393. set cflags [chattr $who | $chan]
  2394. set nflags [string trimleft $cflags "abcdefghijklmnopqrstuvwdamnABCDEFGHIJKLMNOPQRSTUVWdamn"]
  2395. set cfflags [string trim $nflags "|"]
  2396. putlog "\002\[4damn4!\]\002 !$hand! access $who $chan"
  2397. if {$cfflags == "-"} {
  2398. puthelp "NOTICE $nick :\002\[4damn4!\]\002 ${who} does not have any channel specific flags on ${chan}."
  2399. return 0
  2400. } else {
  2401. puthelp "NOTICE $nick :\002\[4damn4!\]\002 ${who}'s access is \002\[\002${cfflags}\002\]\002 on ${chan}."
  2402. return 0
  2403. }
  2404. } else {
  2405. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $chan is not a valid channel."
  2406. return 0
  2407. }
  2408. }
  2409. if {$chan == ""} {
  2410. set flags [chattr $who]
  2411. putlog "\002\[4damn4!\]\002 !$hand! access $who"
  2412. puthelp "NOTICE $nick :\002\[4damn4!\]\002 ${who}'s access is \002\[\002${flags}\002\]\002"
  2413. return 0
  2414. }
  2415. }
  2416. if {[validuser $who] == 0} {
  2417. puthelp "NOTICE $nick :\002\[4damn4!\]\002 No such user!"
  2418. return 0
  2419. }
  2420. }
  2421. ## public cmd access -- stop
  2422.  
  2423. ## public cmd botnick -- start
  2424. proc pub_botnick {nick uhost hand chan rest} {
  2425. global CC botnick
  2426. if {[matchattr $hand Q] == 0} {
  2427. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  2428. return 0
  2429. }
  2430. set bot [lindex $rest 0]
  2431. if {$bot==""} {
  2432. puthelp "NOTICE $nick :\002\[4damn4!\]\002 ${CC}botnick <new botnick>."
  2433. return 0
  2434. }
  2435. putcmdlog "\002\[4damn4!\]\002 #$hand# botnick $bot"
  2436. putserv "NICK $bot"
  2437. }
  2438. ## public cmd botnick -- stop
  2439.  
  2440. ## dcc cmd botnick -- start
  2441. proc dcc_botnick {hand idx rest} {
  2442. set bot [lindex $rest 0]
  2443. if {$bot==""} {
  2444. puthelp "NOTICE $nick :\002\[4damn4!\]\002 .botnick <new botnick>."
  2445. return 0
  2446. }
  2447. putcmdlog "\002\[4damn4!\]\002 #$hand# botnick $bot"
  2448. putserv "NICK $bot"
  2449. }
  2450. ## dcc cmd botnick -- stop
  2451.  
  2452. ## public cmd jump -- start
  2453. proc pub_jump {nick uhost hand chan rest} {
  2454. global CC botnick
  2455. if {[matchattr $hand Q] == 0} {
  2456. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  2457. return 0
  2458. }
  2459. set server [lindex $rest 0]
  2460. if {$server == ""} {
  2461. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: jump <server> \[port\] \[password\]"
  2462. return 0
  2463. }
  2464. set port [lindex $rest 1]
  2465. if {$port == ""} {set port "6667"}
  2466. set password [lindex $rest 2]
  2467. putcmdlog "\002\[4damn4!\]\002 #$hand# jump $server $port $password"
  2468. jump $server $port $password
  2469. }
  2470. ## public cmd jump -- stop
  2471.  
  2472. ## public cmd die -- start
  2473. proc pub_die {nick uhost hand channel rest} {
  2474. global botnick
  2475. if {[matchattr $hand Q] == 0} {
  2476. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  2477. return 0
  2478. }
  2479. set idx [hand2idx $nick]
  2480. if {$rest == ""} {set rest "$nick, damn RuLz!"}
  2481. save
  2482.  
  2483. putcmdlog "\002\[4damn4!\]\002 #$hand# quit $rest"
  2484. if {$rest == ""} {set rest "$nick, damn RuLz!"}
  2485. foreach x [userlist] {
  2486. chattr $x -Q
  2487. }
  2488. putserv "QUIT :${rest}"
  2489. utimer 2 {die}
  2490. }
  2491. ## public cmd die -- stop
  2492.  
  2493. ## public cmd ban -- start
  2494. proc pub_ban {nick uhost hand channel rest} {
  2495. global botnick CC ban-time
  2496. if {[matchattr $hand Q] == 0} {
  2497. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  2498. return 0
  2499. }
  2500. if {[botisop $channel]==1} {
  2501. if {$rest == ""} {
  2502. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}ban <nick> \[reason\]"
  2503. return 0
  2504. }
  2505. if {$rest!=""} {
  2506. set handle [lindex $rest 0]
  2507. set reason [lrange $rest 1 end]
  2508. append userhost $handle "!*" [getchanhost $handle $channel]
  2509. set hostmask [maskhost $userhost]
  2510. if {![onchan $handle $channel]} {
  2511. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $handle is not on the channel."
  2512. return 0
  2513. }
  2514. if {[onchansplit $handle $channel]} {
  2515. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $handle is currently net-split."
  2516. return 0
  2517. }
  2518. if {[string tolower $handle] == [string tolower $botnick]} {
  2519. putserv "KICK $channel $nick :Mad-4\[ 4Yuck 4Fou \]-Kick"
  2520. return 0
  2521. }
  2522. if {$reason == ""} {
  2523. set reason "$nick, damn RuLz!"
  2524. }
  2525. set options [lindex $reason 0]
  2526. if {[string index $options 0] == "-"} {
  2527. set options [string range $options 1 end]
  2528. }
  2529. switch -exact $options {
  2530. perm {
  2531. set reason [lrange $reason 1 end]
  2532. newchanban $channel $hostmask $nick "$reason" 0
  2533. if {$reason == ""} {set reason "$nick, damn RuLz!"}
  2534. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! ban $channel $hostmask $options $reason"
  2535. return 0
  2536. }
  2537. min {
  2538. if {[val [lindex $reason 1]] == ""} {
  2539. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Error, invalid time period"
  2540. return 0
  2541. }
  2542. set time [lindex $reason 1]
  2543. set reason [lrange $reason 2 end]
  2544. newchanban $channel $hostmask $nick "$reason" $time
  2545. if {$reason == ""} {set reason "$nick, damn RuLz!"}
  2546. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! ban $channel $hostmask $options $reason"
  2547. return 0
  2548. }
  2549. hours {
  2550. if {[val [lindex $reason 1]] == ""} {
  2551. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Error, invalid time period"
  2552. return 0
  2553. }
  2554. set time [expr [lindex $reason 1]*60]
  2555. set reason [lrange $reason 2 end]
  2556. newchanban $channel $hostmask $nick "$reason" $time
  2557. if {$reason == ""} {set reason "$nick, damn RuLz!"}
  2558. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! ban $channel $hostmask $options $reason"
  2559. return 0
  2560. }
  2561. days {
  2562. if {[val [lindex $reason 1]] == ""} {
  2563. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Error, invalid time period"
  2564. return 0
  2565. }
  2566. set time [expr [expr [lindex $reason 1]*60]*24]
  2567. set reason [lrange $reason 2 end]
  2568. newchanban $channel $hostmask $nick "$reason" $time
  2569. if {$reason == ""} {set reason "$nick, damn RuLz!"}
  2570. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! ban $channel $hostmask $options $reason"
  2571. return 0
  2572. }
  2573. weeks {
  2574. if {[val [lindex $reason 1]] == ""} {
  2575. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Error, invalid time period"
  2576. return 0
  2577. }
  2578. set time [expr [expr [expr [lindex $reason 1]*60]*24]*7]
  2579. set reason [lrange $reason 2 end]
  2580. newchanban $channel $hostmask $nick "$reason" $time
  2581. if {$reason == ""} {set reason "$nick, damn RuLz!"}
  2582. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! ban $channel $hostmask $options $reason"
  2583. return 0
  2584. }
  2585. }
  2586. set reason [lrange $reason 1 end]
  2587. newchanban $channel $hostmask $nick "$reason" $ban-time
  2588. if {$reason == ""} {set reason "$nick, damn RuLz!"}
  2589. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! ban $channel $hostmask $options $reason"
  2590. return 0
  2591. }
  2592. }
  2593. if {[isop $botnick $channel]!=1} {
  2594. puthelp "NOTICE $nick :\002\[4damn4!\]\002 I am not oped"
  2595. }
  2596. }
  2597. ## public cmd ban -- stop
  2598.  
  2599. ## public cmd reload -- start
  2600. proc pub_reload {nick uhost hand chan rest} {
  2601. global CC botnick
  2602. if {[matchattr $hand Q] == 0} {
  2603. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  2604. return 0
  2605. }
  2606. reload
  2607. putcmdlog "\002\[4damn4!\]\002 #$hand# reload"
  2608. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Reloading user file..."
  2609. }
  2610. ## public cmd restart -- stop
  2611.  
  2612. ## public cmd ignores -- start
  2613. proc pub_ignores {nick uhost hand chan rest} {
  2614. global CC botnick
  2615. set iglist ""
  2616. foreach x [ignorelist] {
  2617. set iglister [lindex $x 0]
  2618. set iglist "$iglist $iglister"
  2619. }
  2620. if {[ignorelist]==""} {
  2621. putserv "NOTICE $nick :No ignores."
  2622. return 0
  2623. }
  2624. regsub -all " " $iglist ", " iglist
  2625. set iglist [string range $iglist 1 end]
  2626. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Currently ignoring:$iglist"
  2627. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! ignores"
  2628. return 0
  2629. }
  2630. ## public cmd ignores -- stop
  2631.  
  2632. ## public cmd -ignore -- start
  2633. proc pub_-ignore {nick uhost hand chan rest} {
  2634. global CC botnick
  2635. if {[matchattr $hand Q] == 0} {
  2636. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  2637. return 0
  2638. }
  2639. set hostmask [lindex $rest 0]
  2640. if {$hostmask == ""} {
  2641. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}-ignore <hostmask>"
  2642. return 0
  2643. }
  2644. if {[isignore $hostmask] == 0} {
  2645. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $hostmask is not on my ignore list."
  2646. return 0
  2647. }
  2648. if {[isignore $hostmask] == 1} {
  2649. putcmdlog "\002\[4damn4!\]\002 #$hand# -ignore $hostmask"
  2650. killignore $hostmask
  2651. puthelp "NOTICE $nick :\002\[4damn4!\]\002 No longer ignoring \002\[\002${hostmask}\002\]\002"
  2652. save
  2653. }
  2654. }
  2655. ## public cmd -ignore -- stop
  2656.  
  2657. ## public cmd +ignore -- start
  2658. proc pub_+ignore {nick uhost hand chan rest} {
  2659. global CC botnick
  2660. if {[matchattr $hand Q] == 0} {
  2661. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  2662. return 0
  2663. }
  2664. set hostmask [lindex $rest 0]
  2665. set comment [lindex $rest 1]
  2666. if {$hostmask == ""} {
  2667. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}+ignore <hostmask> \[comment\]"
  2668. return 0
  2669. }
  2670. if {[isignore $hostmask] == 1} {
  2671. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $hostmask is alreay set on ignore."
  2672. return 0
  2673. }
  2674. if {[isignore $hostmask] == 0} {
  2675. putcmdlog "\002\[4damn4!\]\002 #$hand# +ignore $hostmask"
  2676. newignore $hostmask $nick $comment 0
  2677. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Now ignoring \002\[\002${hostmask}\002\]\002"
  2678. save
  2679. }
  2680. }
  2681. ## public cmd +ignore -- stop
  2682.  
  2683. ## public cmd comment -- start
  2684. proc pub_comment {nick uhost hand chan rest} {
  2685. global CC botnick
  2686. if {[matchattr $hand Q] == 0} {
  2687. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  2688. return 0
  2689. }
  2690. set comment [lrange $rest 0 end]
  2691. if {($comment == "")} {
  2692. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}comment <new comment>"
  2693. return 0
  2694. }
  2695. putcmdlog "\002\[4damn4!\]\002 #$hand# comment $comment"
  2696. setuser $hand comment $comment
  2697. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Added comment \002\[\002${comment}\002\]\002"
  2698. }
  2699. ## public cmd comment -- stop
  2700.  
  2701. ## public cmd chnick -- start
  2702. proc pub_chnick {nick uhost hand chan rest} {
  2703. global CC owner botnick
  2704. if {[matchattr $hand Q] == 0} {
  2705. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  2706. return 0
  2707. }
  2708. set old [lindex $rest 0]
  2709. set new [lindex $rest 1]
  2710. if {($old == "") || ($new == "")} {
  2711. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}chnick <old nick> <new nick>"
  2712. return 0
  2713. }
  2714. if {[validuser $old]==0} {
  2715. puthelp "NOTICE $nick :\002\[4damn4!\]\002 No such user."
  2716. return 0
  2717. }
  2718. if {([matchattr $old n] == 1)} {
  2719. puthelp "NOTICE $nick :\002\[4damn4!\]\002 cannot change the bot owner's nick"
  2720. return 0
  2721. }
  2722. if {[validuser $old]==1} {
  2723. putcmdlog "\002\[4damn4!\]\002 #$hand# chnick $old $new"
  2724. chnick $old $new
  2725. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Changed partyline nick from \002\[\002${old}\002\]\002 to \002\[\002${new}\002\]\002"
  2726. }
  2727. }
  2728. ## public cmd chnick -- stop
  2729.  
  2730. ## public cmd chinfo -- start
  2731. proc pub_chinfo {nick uhost hand chan rest} {
  2732. global CC botnick
  2733. if {[matchattr $hand Q] == 0} {
  2734. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  2735. return 0
  2736. }
  2737. set who [lindex $rest 0]
  2738. set info [lrange $rest 1 end]
  2739. if {($who == "") || ($info == "")} {
  2740. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}chinfo <nick> <info>"
  2741. return 0
  2742. }
  2743. if {[validuser $who]==0} {
  2744. puthelp "NOTICE $nick :\002\[4damn4!\]\002 No such user."
  2745. return 0
  2746. }
  2747. if {[validuser $who]==1} {
  2748. putcmdlog "\002\[4damn4!\]\002 #$hand# chinfo $who $info"
  2749. setuser $who info $info
  2750. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Added info \002\[\002${info}\002\]\002 to $who."
  2751. }
  2752. }
  2753. ## public cmd chinfo -- stop
  2754.  
  2755. ## public cmd chcomment -- start
  2756. proc pub_chcomment {nick uhost hand chan rest} {
  2757. global CC botnick
  2758. if {[matchattr $hand Q] == 0} {
  2759. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botn$
  2760. return 0
  2761. }
  2762. set who [lindex $rest 0]
  2763. set comment [lrange $rest 1 end]
  2764. if {($who == "") || ($comment == "")} {
  2765. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}chcomment <nick> <new comment>"
  2766. return 0
  2767. }
  2768. if {[validuser $who]==0} {
  2769. puthelp "NOTICE $nick :\002\[4damn4!\]\002 No such user."
  2770. return 0
  2771. }
  2772. if {[validuser $who]==1} {
  2773. putcmdlog "\002\[4damn4!\]\002 #$hand# chcomment $who $comment"
  2774. setuser $who comment $comment
  2775. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Added info \002\[\002${comment}\002\]\002 to $who."
  2776. }
  2777. }
  2778. ## public cmd chcomment -- stop
  2779.  
  2780. ## public cmd chemail -- start
  2781. proc pub_chemail {nick uhost hand chan rest} {
  2782. global CC botnick
  2783. # puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command is only available via dcc chat"
  2784. # return 0
  2785. if {[matchattr $hand Q] == 0} {
  2786. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  2787. return 0
  2788. }
  2789. set who [lindex $rest 0]
  2790. set email [lindex $rest 1]
  2791. if {($who == "") || ($email == "")} {
  2792. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}chemail <nick> <email>"
  2793. return 0
  2794. }
  2795. if {[validuser $who]==0} {
  2796. puthelp "NOTICE $nick :\002\[4damn4!\]\002 No such user."
  2797. return 0
  2798. }
  2799. if {[validuser $who]==1} {
  2800. putcmdlog "\002\[4damn4!\]\002 #$hand# chemail $who $email"
  2801. setuser $who email $email
  2802. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Added email address \002\[\002${email}\002\]\002 to $who."
  2803. }
  2804. }
  2805. ## public cmd chemail -- stop
  2806.  
  2807. ## public cmd chpass -- start
  2808. proc pub_chpass {nick chan uhost hand rest} {
  2809. global CC
  2810. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Can only be changed via dcc chat."
  2811. }
  2812. ## public cmd chpass -- stop
  2813.  
  2814. ## public cmd me -- start
  2815. proc pub_me {nick uhost hand channel rest} {
  2816. global CC
  2817. if {$rest == ""} {
  2818. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage ${CC}me <msg>"
  2819. return 0
  2820. }
  2821. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! me $rest"
  2822. putserv "PRIVMSG $channel :\001ACTION $rest\001"
  2823. }
  2824. ## public cmd me -- stop
  2825.  
  2826. ## public cmd save -- start
  2827. proc pub_save {nick uhost hand channel rest} {
  2828. global CC botnick
  2829. if {[matchattr $hand Q] == 0} {
  2830. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  2831. return 0
  2832. }
  2833. putcmdlog "\002\[4damn4!\]\002 #$hand# save"
  2834. save
  2835. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Writing channel & user file ..."
  2836. }
  2837. ## public cmd save -- stop
  2838.  
  2839. ## public cmd chattr -- start
  2840. proc pub_chattr {nick uhost hand channel rest} {
  2841. global ownern flagss lowerflag nflagl CC botnick
  2842. if {[matchattr $hand Q] == 0} {
  2843. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  2844. return 0
  2845. }
  2846. set ownern [lindex $rest 0]
  2847. set flagss [lindex $rest 1]
  2848. set chan [lindex $rest 2]
  2849. if {$ownern==""} {
  2850. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}chattr <nick> <flags>"
  2851. return 0
  2852. }
  2853. if {[validuser $ownern]==0} {
  2854. puthelp "NOTICE $nick :\002\[4damn4!\]\002 No such user!"
  2855. return 0
  2856. }
  2857. if {$flagss==""} {
  2858. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}chattr <nick> <flags>"
  2859. return 0
  2860. }
  2861. if {([matchattr $ownern n] == 1) && ([matchattr $nick n] == 0)} {
  2862. puthelp "NOTICE $nick :\002\[4damn4!\]\002 You do not have access to change ${ownern}'s flags."
  2863. }
  2864. if {[matchattr $nick n] == 1} {
  2865. if {$chan != ""} {
  2866. if {[validchan $chan]} {
  2867. putcmdlog "\002\[4damn4!\]\002 #$hand# chattr $ownern $flagss $chan"
  2868. if {[string trim $flagss abcdefghijklmnopqrstuvwdamnABCDEFGHIJKLMNOPQRSTUVWdamn+-] == "|"} {
  2869. chattr $ownern $flagss $chan
  2870. } else {
  2871. chattr $ownern |$flagss $chan
  2872. }
  2873. set chanflags [chattr $ownern | $chan]
  2874. set chanflags [string trimleft $chanflags "abcdefghijklmnopqrstuvwdamnABCDEFGHIJKLMNOPQRSTUVWdamn"]
  2875. set chanflags [string trim $chanflags "|"]
  2876. set globalflags [chattr $ownern]
  2877. puthelp "NOTICE $nick :\002\[4damn4!\]\002 chattr $ownern \002\[\002${flagss}\002\]\002 $chan"
  2878. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Global Flags for $ownern are \002\[\002${globalflags}\002\]\002"
  2879. if {$chanflags != "-"} {
  2880. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Channel \002\"\002${chan}\002\"\002 Flags for $ownern are \002\[\002${chanflags}\002\]\002"
  2881. } else {
  2882. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $ownern does not have any channel specific flags on ${chan}."
  2883. }
  2884. } else {
  2885. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $chan is not a valid channel"
  2886. }
  2887. } else {
  2888. putcmdlog "\002\[4damn4!\]\002 #$hand# chattr $ownern $flagss $chan"
  2889. chattr $ownern $flagss
  2890. set flags [chattr $ownern]
  2891. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Chattr $ownern \002\[\002${flagss}\002\]\002"
  2892. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Global Flags for $ownern are now \002\[\002${flags}\002\]\002"
  2893. }
  2894. if {[matchattr $ownern a] == 1} {
  2895. pushmode $channel +o $ownern
  2896. }
  2897. if {([matchattr $ownern a] == 0) && ([matchattr $ownern o] == 0)} {
  2898. pushmode $channel -o $ownern
  2899. }
  2900. save
  2901. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Writing user file ..."
  2902. }
  2903. ##stop them from adding/removing +n if their not a owner.
  2904. if {[matchattr $nick n] == 0} {
  2905. set lowerflag [string tolower $flagss]
  2906. set nflagl [string trim $flagss abcdefghijklmopqrstuvwdamnABCDEFGHIJKLMNOPQRSTUVWdamn+-]
  2907. if {$nflagl != ""} {
  2908. puthelp "NOTICE $nick :\002\[4damn4!\]\002 You do not have access to add or remove the flag \002'\002n\002'\002 from that user."
  2909. return 0
  2910. }
  2911. }
  2912. ##stops other users from giving others +m.
  2913. if {([matchattr $nick n] == 0) && ([matchattr $nick m] == 1) && ([matchattr $ownern m] == 1)} {
  2914. set lowerflag [string tolower $flagss]
  2915. set nflagl [string trim $flagss abcdefghijklnopqrstuvwdamnABCDEFGHIJKLMNOPQRSTUVWdamn+-]
  2916. if {$nflagl != ""} {
  2917. puthelp "NOTICE $nick :\002\[4damn4!\]\002 You do not have access to add or remove the flag \002'\002m\002'\002 from $ownern."
  2918. return 0
  2919. }
  2920. }
  2921. if {([matchattr $nick n] == 0) && ([matchattr $ownern n] == 0)} {
  2922. if {$chan != ""} {
  2923. if {[validchan $chan]} {
  2924. putcmdlog "\002\[4damn4!\]\002 #$hand# chattr $ownern $flagss"
  2925. if {[string trim $flagss abcdefghijklmnopqrstuvwdamnABCDEFGHIJKLMNOPQRSTUVWdamn+-] == "|"} {
  2926. chattr $ownern $flagss $chan
  2927. } else {
  2928. chattr $ownern |$flagss $chan
  2929. }
  2930. set chanflags [chattr $ownern | $chan]
  2931. set chanflags [string trimleft $chanflags "abcdefghijklmnopqrstuvwdamnABCDEFGHIJKLMNOPQRSTUVWdamn"]
  2932. set chanflags [string trim $chanflags "|"]
  2933. set globalflags [chattr $ownern]
  2934. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Chattr $ownern \002\[\002${flagss}\002\]\002 $chan"
  2935. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Global Flags for $ownern are \002\[\002${globalflags}\002\]\002"
  2936. if {$chanflags != "-"} {
  2937. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Channel \002\"\002${chan}\002\"\002 Flags for $ownern are \002\[\002${chanflags}\002\]\002"
  2938. } else {
  2939. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $ownern does not have any channel specific flags on ${chan}."
  2940. }
  2941. } else {
  2942. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $chan is not a valid channel"
  2943. return 0
  2944. }
  2945. } else {
  2946. putcmdlog "\002\[4damn4!\]\002 #$hand# chattr $ownern $flagss"
  2947. chattr $ownern $flagss
  2948. set flags [chattr $ownern]
  2949. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Chattr $ownern \002\[\002${flagss}\002\]\002"
  2950. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Global Flags for $ownern are now \002\[\002${flags}\002\]\002"
  2951. }
  2952. if {[matchattr $ownern a] == 1} {
  2953. pushmode $channel +o $ownern
  2954. }
  2955. save
  2956. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Writing user file ..."
  2957. }
  2958. }
  2959. ## public cmd chattr -- stop
  2960.  
  2961. ## public cmd -host -- start
  2962. proc pub_-host {nick uhost hand chan rest} {
  2963. global CC botnick
  2964. if {[matchattr $hand Q] == 0} {
  2965. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  2966. return 0
  2967. }
  2968. set who [lindex $rest 0]
  2969. set hostname [lindex $rest 1]
  2970. set completed 0
  2971. if {($who == "") || ($hostname == "")} {
  2972. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}-host <nick> <hostmask>"
  2973. return 0
  2974. }
  2975. if {[validuser $who]==0} {
  2976. puthelp "NOTICE $nick :\002\[4damn4!\]\002 No such user."
  2977. return 0
  2978. }
  2979. if {([matchattr $nick n] == 0) && ([matchattr $who n] == 1)} {
  2980. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Can't remove hostmasks from the bot owner."
  2981. return 0
  2982. }
  2983. if {[matchattr $nick m] == 0} {
  2984. if {[string tolower $hand] != [string tolower $who]} {
  2985. puthelp "NOTICE $nick :\002\[4damn4!\]\002 You need '+m' to change other users hostmasks"
  2986. return 0
  2987. }
  2988. }
  2989. foreach * [getuser $who HOSTS] {
  2990. if {${hostname} == ${*}} {
  2991. putcmdlog "\002\[4damn4!\]\002 #$hand# -host $who $hostname"
  2992. delhost $who $hostname
  2993. save
  2994. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Removed \002\[\002${hostname}\002\]\002 from $who."
  2995. ### Make it do the -host thing here, and any message that goes along with it
  2996. set completed 1
  2997. }
  2998. }
  2999. if {$completed == 0} {
  3000. puthelp "NOTICE $nick :\002\[4damn4!\]\002 No such hostmask!"
  3001. }
  3002. }
  3003. ## public cmd -host -- stop
  3004.  
  3005. ## public cmd +host -- start
  3006. set thehosts {
  3007. *@* * *!*@* *!* *!@* !*@* *!*@*.* *!@*.* !*@*.* *@*.*
  3008. *!*@*.com *!*@*com *!*@*.net *!*@*net *!*@*.org *!*@*org
  3009. *!*@*gov *!*@*.ca *!*@*ca *!*@*.uk *!*@*uk *!*@*.mil
  3010. *!*@*.fr *!*@*fr *!*@*.au *!*@*au *!*@*.nl *!*@*nl *!*@*edu
  3011. *!*@*se *!*@*.se *!*@*.nz *!*@*nz *!*@*.eg *!*@*eg *!*@*dk
  3012. *!*@*.il *!*@*il *!*@*.no *!*@*no *!*@*br *!*@*.br *!*@*.gi
  3013. *!*@*.gov *!*@*.dk *!*@*.edu *!*@*gi *!*@*mil *!*@*.to *!@*.to
  3014. *!*@*to *@*.to *@*to
  3015.  
  3016. }
  3017.  
  3018. proc pub_+host {nick uhost hand chan rest} {
  3019. global CC thehosts botnick
  3020. if {[matchattr $hand Q] == 0} {
  3021. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  3022. return 0
  3023. }
  3024. set who [lindex $rest 0]
  3025. set hostname [lindex $rest 1]
  3026. if {($who == "") || ($hostname == "")} {
  3027. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}+host <nick> <new hostmask>"
  3028. return 0
  3029. }
  3030. if {[validuser $who] == 0} {
  3031. puthelp "NOTICE $nick :\002\[4damn4!\]\002 No such user!"
  3032. return 0
  3033. }
  3034. set badhost 0
  3035. foreach * [getuser $who HOSTS] {
  3036. if {${hostname} == ${*}} {
  3037. puthelp "NOTICE $nick :\002\[4damn4!\]\002 That hostmask is already there."
  3038. return 0
  3039. }
  3040. }
  3041. if {($who == "") && ($hostname == "")} {
  3042. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}+host <nick> <new hostmask>"
  3043. return 0
  3044. }
  3045. if {([lsearch -exact $thehosts $hostname] > "-1") || ([string match *@* $hostname] == 0)} {
  3046. if {[string index $hostname 0] != "*"} {
  3047. set hostname "*!*@*${hostname}"
  3048. } else {
  3049. set hostname "*!*@${hostname}"
  3050. }
  3051. }
  3052. if {([string match *@* $hostname] == 1) && ([string match *!* $hostname] == 0)} {
  3053. if {[string index $hostname 0] == "*"} {
  3054. set hostname "*!${hostname}"
  3055. } else {
  3056. set hostname "*!*${hostname}"
  3057. }
  3058. }
  3059. puthelp "NOTICE kindred :$hostname"
  3060. if {[validuser $who]==0} {
  3061. puthelp "NOTICE $nick :\002\[4damn4!\]\002 No such user."
  3062. return 0
  3063. }
  3064. if {([matchattr $nick n] == 0) && ([matchattr $who n] == 1)} {
  3065. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Can't add hostmasks to the bot owner."
  3066. return 0
  3067. }
  3068. foreach * $thehosts {
  3069. if {${hostname} == ${*}} {
  3070. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Invalid hostmask!"
  3071. set badhost 1
  3072. }
  3073. }
  3074. if {$badhost != 1} {
  3075. if {[matchattr $nick m] == 0} {
  3076. if {[string tolower $hand] != [string tolower $who]} {
  3077. puthelp "NOTICE $nick :\002\[4damn4!\]\002 You need '+m' to change other users hostmasks"
  3078. return 0
  3079. }
  3080. }
  3081. putcmdlog "\002\[4damn4!\]\002 #$hand# +host $who $hostname"
  3082. setuser $who HOSTS $hostname
  3083. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Added \002\[\002${hostname}\002\]\002 to $who."
  3084. if {[matchattr $who a] == 1} {
  3085. pushmode $chan +o $who
  3086. }
  3087. save
  3088. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Writing user file ..."
  3089. }
  3090. }
  3091. ## public cmd +host -- stop
  3092.  
  3093. ## public cmd -bot -- start
  3094. proc pub_-bot {nick uhost hand chan rest} {
  3095. global CC botnick
  3096. if {[matchattr $hand Q] == 0} {
  3097. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  3098. return 0
  3099. }
  3100. set bot [lindex $rest 0]
  3101. if {$bot==""} {
  3102. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}-bot <handle>"
  3103. return 0
  3104. }
  3105. if {[validuser $bot] == 0} {
  3106. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $bot is not on my userlist."
  3107. return 0
  3108. }
  3109. if {[matchattr $bot b] == 0} {
  3110. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $bot is not a bot on the userlist."
  3111. return 0
  3112. }
  3113. if {[matchattr $bot b] == 1} {
  3114. putcmdlog "\002\[4damn4!\]\002 #$hand# -bot $bot"
  3115. deluser $bot
  3116. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $bot has been deleted from the userlist."
  3117. save
  3118. }
  3119. }
  3120. ## public cmd -bot -- stop
  3121.  
  3122. ## public cmd +bot -- start
  3123. proc pub_+bot {nick uhost hand channel rest} {
  3124. global CC botnick
  3125. if {[matchattr $hand Q] == 0} {
  3126. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  3127. return 0
  3128. }
  3129. set bot [lindex $rest 0]
  3130. set address [lindex $rest 1]
  3131. set hostmask [lindex $rest 2]
  3132. if {[validuser $bot]==1} {
  3133. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $bot is already in my userlist."
  3134. return 0
  3135. }
  3136. if {($bot=="") || ($address=="")} {
  3137. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}+bot <botname> <address:botport#\[userport#\]> \[hostmask\]"
  3138. return 0
  3139. }
  3140. set porttest [string trim $address "abcdefghijklmnopqrstuvwxyx."]
  3141. set porttest [string trim $porttest ":"]
  3142. if {$porttest == ""} {
  3143. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}+bot <botname> <address:botport#\[userport#\]> \[hostmask\]"
  3144. return 0
  3145. }
  3146. if {[validuser $bot]==0} {
  3147. putcmdlog "\002\[4damn4!\]\002 #$hand# +bot $bot $address $hostmask"
  3148. addbot $bot $address
  3149. if {$hostmask != ""} {
  3150. setuser $bot HOSTS $hostmask
  3151. }
  3152. save
  3153. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $bot \002\[\002${address}\002\]\002 has been add to userlist as a bot."
  3154. return 0
  3155. }
  3156. }
  3157. ## public cmd +bot -- stop
  3158.  
  3159. ## public cmd deluser -- start
  3160. proc pub_deluser {nick uhost hand channel rest} {
  3161. global CC botnick
  3162. if {[matchattr $hand Q] == 0} {
  3163. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  3164. return 0
  3165. }
  3166. if {$rest == ""} {
  3167. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}deluser <handle>"
  3168. return 0
  3169. } else {
  3170. pub_-user $nick $uhost $hand $channel $rest} {
  3171. }
  3172. }
  3173. ## public cmd deluser -- stop
  3174.  
  3175. ## public cmd -user -- start
  3176. proc pub_-user {nick uhost hand channel rest} {
  3177. global CC botnick
  3178. if {[matchattr $hand Q] == 0} {
  3179. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  3180. return 0
  3181. }
  3182. set who [lindex $rest 0]
  3183. if {$who == ""} {
  3184. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}-user <nick>"
  3185. } else {
  3186. if {[validuser $who] == 0} {
  3187. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $who is not on my userlist."
  3188. } else {
  3189. if {[matchattr $who n] == 1} {
  3190. puthelp "NOTICE $nick :\002\[4damn4!\]\002 You cannot delete a bot owner."
  3191. } else {
  3192. if {([matchattr $who m] == 1) && ([matchattr $nick n] == 0)} {
  3193. puthelp "NOTICE $nick :\002\[4damn4!\]\002 You don't have access to delete $who."
  3194. } else {
  3195. putcmdlog "\002\[4damn4!\]\002 #$hand# -user $who"
  3196. deluser $who
  3197. save
  3198. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $who has been deleted."
  3199. }
  3200. }
  3201. }
  3202. }
  3203. }
  3204. ## public cmd -user -- stop
  3205.  
  3206. ## public cmd +user -- start
  3207. proc pub_+user {nick uhost hand channel rest} {
  3208. global CC botnick thehosts
  3209. if {[matchattr $hand Q] == 0} {
  3210. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  3211. return 0
  3212. }
  3213. set who [lindex $rest 0]
  3214. set hostmask [lindex $rest 1]
  3215. if {([lsearch -exact $thehosts $hostmask] > "-1") || ([string match *@* $hostmask] == 0)} {
  3216. if {[string index $hostmask 0] != "*"} {
  3217. set hostmask "*!*@*${hostmask}"
  3218. } else {
  3219. set hostmask "*!*@${hostmask}"
  3220. }
  3221. }
  3222. if {([string match *@* $hostmask] == 1) && ([string match *!* $hostmask] == 0)} {
  3223. if {[string index $hostmask 0] == "*"} {
  3224. set hostmask "*!${hostmask}"
  3225. } else {
  3226. set hostmask "*!*${hostmask}"
  3227. }
  3228. }
  3229. if {$hostmask == ""} {
  3230. if {[onchan $who $channel] == 1} {
  3231. regsub -all " " [split [maskhost [getchanhost mark- #wonkegg]] !] "!*" hostmask
  3232. }
  3233. }
  3234. if {[validuser $who]==1} {
  3235. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $who is already in my userlist."
  3236. return 0
  3237. }
  3238. if {($who=="") || ($hostmask=="")} {
  3239. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}+user <nick> <hostmask>"
  3240. return 0
  3241. }
  3242. set who [lindex $rest 0]
  3243. set flags [lindex $rest 2]
  3244. if {[validuser $who]==0} {
  3245. putcmdlog "\002\[4damn4!\]\002 #$hand# +user $who $hostmask"
  3246. adduser $who $hostmask
  3247. save
  3248. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $who has been added to userlist with hostmask \002\[\002$hostmask\002\]\002."
  3249. if {$flags != ""} {
  3250. chattr $who $flags $channel
  3251. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Added $flags to $who"
  3252. }
  3253. return 0
  3254. }
  3255. }
  3256. ## public cmd +user -- stop
  3257.  
  3258. ## public cmd adduser -- start
  3259. proc pub_adduser {nick uhost hand channel rest} {
  3260. global CC botnick
  3261. if {[matchattr $hand Q] == 0} {
  3262. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  3263. return 0
  3264. }
  3265. if {[lindex $rest 0] == ""} {
  3266. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}adduser <nick> \[optional flags\]"
  3267. return 0
  3268. }
  3269. if {[validuser [lindex $rest 0]]} {
  3270. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $rest is already in my userlist."
  3271. return 0
  3272. }
  3273. if {[onchan [lindex $rest 0] $channel]==1} {
  3274. set who [lindex $rest 0]
  3275. set oflags [lindex $rest 1]
  3276. set host [maskhost [getchanhost [lindex $rest 0] $channel]]
  3277. putcmdlog "\002\[4damn4!\]\002 #$hand# adduser $who $oflags"
  3278. adduser $who $host
  3279. if {$oflags != ""} {
  3280. if {[lindex $rest 2] != ""} {
  3281. chattr $who |${oflags} [lindex $rest 2]
  3282. set flags [chattr $who]
  3283. set newhost [getuser $who HOSTS]
  3284. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $who \002\[\002$newhost\002\]\002 has been added to the userlist."
  3285. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Global Flags for $who are \002\[\002${flags}\002\]\002"
  3286. set chanflags [chattr [lindex $rest 0] | [lindex $rest 2]]
  3287. set chanflags [string trimleft $chanflags "abcdefghijklmnopqrstuvwKoRnABCDEFGHIJKLMNOPQRSTUVWdamn"]
  3288. set chanflags [string trim $chanflags |]
  3289. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Channel \002\"\002[lindex $rest 2]\002\"\002 Flags for $who are \002\[\002${chanflags}\002\]\002"
  3290. save
  3291. return 0
  3292. } else {
  3293. chattr $who $oflags
  3294. set flags [chattr $who]
  3295. set newhost [getuser $who HOSTS]
  3296. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $who \002\[\002$newhost\002\]\002 has been added to the userlist."
  3297. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Global Flags for $who are \002\[\002${flags}\002\]\002"
  3298. save
  3299. return 0
  3300. }
  3301. } else {
  3302. set flags [chattr $who]
  3303. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $who \002\[\002$host\002\]\002 has been added to the userlist."
  3304. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Global Flags for $who are \002\[\002${flags}\002\]\002"
  3305. save
  3306. return 0
  3307. }
  3308. }
  3309. if {[onchan [lindex $rest 0] $channel]==0} {
  3310. puthelp "NOTICE $nick :\002\[4damn4!\]\002 That user is not on $channel."
  3311. }
  3312. }
  3313. ## public cmd adduser -- stop
  3314.  
  3315. ## dcc cmd action -- start
  3316. proc cmd_action {idx text} {
  3317. set text [string trim $text \001]
  3318. set text [lrange $text 1 end]
  3319. dccsimul $idx ".me $text"
  3320. return 1
  3321. }
  3322. ## dcc cmd action -- stop
  3323.  
  3324. ## public cmd part -- start
  3325. proc pub_part {nick uhost hand chan rest} {
  3326. set rest [lindex $rest 0]
  3327. global nopart botnick
  3328. if {[matchattr $hand Q] == 0} {
  3329. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  3330. return 0
  3331. }
  3332. if {[string first # $rest]!=0} {
  3333. set rest "#$rest"
  3334. }
  3335. if {$rest==""} {
  3336. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: part <#channel>"
  3337. return 0
  3338. } else {
  3339. foreach x [channels] {
  3340. if {[string tolower $x]==[string tolower $rest]} {
  3341. if {[string tolower $rest]==[string tolower $nopart]} {
  3342. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Sorry I can not part $nopart \[PROTECTED\]"
  3343. return 0
  3344. }
  3345. channel remove $rest
  3346. puthelp "NOTICE $nick :\002\[4damn4!\]\002 I have left $x"
  3347. putcmdlog "\002\[4damn4!\]\002 #$hand# part $x"
  3348. return 0
  3349. }
  3350. }
  3351. }
  3352. puthelp "NOTICE $nick :\002\[4damn4!\]\002 I wasn't in $rest"
  3353. }
  3354. ## public cmd part -- stop
  3355.  
  3356. ## public cmd join -- start
  3357. proc pub_join {nick uhost hand chan rest} {
  3358. global CC botnick
  3359. if {[matchattr $hand Q] == 0} {
  3360. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  3361. return 0
  3362. }
  3363. set chan [lindex $rest 0]
  3364. if {[string first # $chan]!=0} {
  3365. set chan "#$chan"
  3366. }
  3367. if {$chan=="#"} {
  3368. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}join <#channel>"
  3369. } else {
  3370. foreach x [channels] {
  3371. if {[string tolower $x]==[string tolower $chan]} {
  3372. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Your already in $x"
  3373. return 0
  3374. }
  3375. }
  3376. if {[lindex $rest 1] == ""} {
  3377. puthelp "NOTICE $nick :\002\[4damn4!\]\002 I have joined $chan"
  3378. } else {
  3379. puthelp "NOTICE $nick :\002\[4damn4!\]\002 I have joined $chan (key: [lindex $rest 1])"
  3380. }
  3381. channel add $chan
  3382. if {$rest!=""} {
  3383. putserv "JOIN $chan :[lindex $rest 1]"
  3384. putcmdlog "\002\[4damn4!\]\002 #$hand# join $chan (key: [lindex $rest 1])"
  3385. }
  3386. }
  3387. }
  3388. ## public cmd join -- stop
  3389.  
  3390. ## dcc cmd join -- start
  3391. proc cmd_join {hand idx rest} {
  3392. set chan [lindex $rest 0]
  3393. if {[string first # $chan]!=0} {
  3394. set chan "#$chan"
  3395. }
  3396. if {$chan=="#"} {
  3397. putdcc $idx "\002\[4damn4!\]\002 Usage: join <#channel> \[key\]"
  3398. } else {
  3399. foreach x [channels] {
  3400. if {[string tolower $x]==[string tolower $chan]} {
  3401. putdcc $idx "\002\[4damn4!\]\002 Your already in $x"
  3402. return 0
  3403. }
  3404. }
  3405. if {[lindex $rest 1] == ""} {
  3406. putdcc $idx "\002\[4damn4!\]\002 I have joined $chan"
  3407. } else {
  3408. putdcc $idx "\002\[4damn4!\]\002 I have joined $chan (key: [lindex $rest 1])"
  3409. }
  3410. channel add $chan
  3411. if {$rest!=""} {
  3412. putserv "JOIN $chan :[lindex $rest 1]"
  3413. putcmdlog "\002\[4damn4!\]\002 #$hand# join $chan (key: [lindex $rest 1])"
  3414. }
  3415. }
  3416. }
  3417. ## dcc cmd join -- stop
  3418.  
  3419. ## dcc cmd part -- start
  3420. proc cmd_part {hand idx rest} {
  3421. set rest [lindex $rest 0]
  3422. global nopart
  3423. if {[string first # $rest]!=0} {
  3424. set rest "#$rest"
  3425. }
  3426. if {$rest==""} {
  3427. putdcc $idx "\002\[4damn4!\]\002 Usage: part <#channel>"
  3428. return 0
  3429. } else {
  3430. foreach x [channels] {
  3431. if {[string tolower $x]==[string tolower $rest]} {
  3432. if {[string tolower $rest]==[string tolower $nopart]} {
  3433. putdcc $idx "\002\[4damn4!\]\002 Sorry I can not part $nopart \[PROTECTED\]"
  3434. return 0
  3435. }
  3436. channel remove $rest
  3437. putdcc $idx "\002\[4damn4!\]\002 I have left $x"
  3438. putcmdlog "\002\[4damn4!\]\002 #$hand# part $x"
  3439. return 0
  3440. }
  3441. }
  3442. }
  3443. putdcc $idx "\002\[4damn4!\]\002 I wasn't in $rest"
  3444. }
  3445. ## dcc cmd part -- stop
  3446.  
  3447. ## public cmd channels -- start
  3448. proc pub_channels {nick hand uhost chan rest} {
  3449. regsub -all " " [channels] ", " chans
  3450. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Channels: $chans"
  3451. }
  3452. ## public cmd channels -- stop
  3453.  
  3454. ## dcc cmd say -- start
  3455. proc cmd_say {hand idx rest} {
  3456. if {$rest==""} {
  3457. putdcc $idx "\002\[4damn4!\]\002 Usage: say <msg>"
  3458. }
  3459. if {$rest!=""} {
  3460. set chan2send [lindex [console $idx] 0]
  3461. puthelp "PRIVMSG $chan2send :$rest"
  3462. putcmdlog "\002\[4damn4!\]\002 #$hand# say $rest"
  3463. }
  3464. }
  3465. ## dcc cmd say -- stop
  3466.  
  3467. ## dcc cmd act -- start
  3468. proc cmd_act {hand idx rest} {
  3469. if {$rest==""} {
  3470. putdcc $idx "\002\[4damn4!\]\002 Usage: act <msg>"
  3471. }
  3472. if {$rest!=""} {
  3473. set chan2send [lindex [console $idx] 0]
  3474. putserv "PRIVMSG $chan2send :\001ACTION $rest\001"
  3475. putcmdlog "\002\[4damn4!\]\002 #$hand# act $rest"
  3476. }
  3477. }
  3478. ## dcc cmd act -- stop
  3479.  
  3480. ## dcc cmd addlog -- start
  3481. proc cmd_addlog {hand idx rest} {
  3482. if {$rest==""} {
  3483. putdcc $idx "\002\[4damn4!\]\002 Usage: addlog <log>"
  3484. } else {
  3485. putcmdlog "\002\[4damn4!\]\002 $hand: $rest"
  3486. }
  3487. }
  3488. ## dcc cmd addlog -- stop
  3489.  
  3490. ## dcc cmd invite -- start
  3491. proc cmd_invite {hand idx rest} {
  3492. set rest [lindex $rest 0]
  3493. set activechan [lindex [console $idx] 0]
  3494. if {$rest==""} {
  3495. putdcc $idx "\002\[4damn4!\]\002 Usage: invite <nick>"
  3496. return 0
  3497. } else {
  3498. if {[onchan $rest $activechan]==1} {
  3499. putdcc $idx "\002\[4damn4!\]\002 $rest is on $activechan already!"
  3500. return 0
  3501. } else {
  3502. putserv "INVITE $rest :$activechan"
  3503. putdcc $idx "\002\[4damn4!\]\002 Invitation sent to $rest"
  3504. putcmdlog "\002\[4damn4!\]\002 #$hand# invite $rest"
  3505. }
  3506. }
  3507. }
  3508. ## public cmd invite -- stop
  3509.  
  3510. ## cmd aop join -- start
  3511. proc aop_join {nick hand uhost channel} {
  3512. global botnick
  3513. if {[botisop $channel]==1} {
  3514. foreach x $channel {
  3515. if {[string tolower $channel]==[string tolower $x]} {
  3516. pushmode $channel +o $nick
  3517. }
  3518. }
  3519. }
  3520. if {[botisop $channel]!=1} {
  3521. if {$botnick!=$nick} {
  3522. puthelp "NOTICE $nick :\002\[4damn4!\]\002 I would have auto oped you... but I am not oped"
  3523. }
  3524. }
  3525. }
  3526. ## cmd aop join -- stop
  3527.  
  3528. ## dcc cmd raop -- start
  3529. proc cmd_raop {hand idx rest} {
  3530. set who [lindex $rest 0]
  3531. set chan [lindex $rest 1]
  3532. if {$who != ""} {
  3533. if {[validuser $who] == 1} {
  3534. if {$chan != ""} {
  3535. if {[validchan $chan]} {
  3536. if {[matchattr $who |a $chan] == 1} {
  3537. chattr $who |-a $chan
  3538. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $who is no longer auto oped on $chan"
  3539. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! raop $who $chan"
  3540. return 0
  3541. } else {
  3542. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $who wasn't auto oped on $chan"
  3543. return 0
  3544. }
  3545. } else {
  3546. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $chan is not a valid channel"
  3547. return 0
  3548. }
  3549. } else {
  3550. if {[matchattr $who a] == 1} {
  3551. chattr $who -a
  3552. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $who is no longer a global auto oped"
  3553. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! raop $who $chan"
  3554. return 0
  3555. } else {
  3556. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $who wasn't auto oped"
  3557. return 0
  3558. }
  3559. }
  3560. }
  3561. if {[validuser $who] == 0} {
  3562. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $who is not a valid user"
  3563. }
  3564. }
  3565. if {$who == ""} {
  3566. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: raop <nick>"
  3567. }
  3568. }
  3569. ## dcc cmd raop -- stop
  3570.  
  3571. ## public cmd raop -- start
  3572. proc pub_raop {nick uhost hand channel rest} {
  3573. global botnick
  3574. if {[matchattr $hand Q] == 0} {
  3575. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  3576. return 0
  3577. }
  3578. set who [lindex $rest 0]
  3579. set chan [lindex $rest 1]
  3580. if {$who != ""} {
  3581. if {[validuser $who] == 1} {
  3582. if {$chan != ""} {
  3583. if {[validchan $chan]} {
  3584. if {[matchattr $who |a $chan] == 1} {
  3585. chattr $who |-a $chan
  3586. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $who is no longer auto oped on $chan"
  3587. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! raop $who $chan"
  3588. return 0
  3589. } else {
  3590. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $who wasn't auto oped on $chan"
  3591. return 0
  3592. }
  3593. } else {
  3594. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $chan is not a valid channel"
  3595. return 0
  3596. }
  3597. } else {
  3598. if {[matchattr $who a] == 1} {
  3599. chattr $who -a
  3600. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $who is no longer a global auto oped"
  3601. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! raop $who $chan"
  3602. return 0
  3603. } else {
  3604. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $who wasn't auto oped"
  3605. return 0
  3606. }
  3607. }
  3608. }
  3609. if {[validuser $who] == 0} {
  3610. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $who is not a valid user"
  3611. }
  3612. }
  3613. if {$who == ""} {
  3614. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: raop <nick>"
  3615. }
  3616. }
  3617. ## public cmd raop -- start
  3618.  
  3619. ## public cmd aop -- start
  3620. proc pub_aop {nick uhost hand channel rest} {
  3621. global botnick CC
  3622. if {[matchattr $hand Q] == 0} {
  3623. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  3624. return 0
  3625. }
  3626. set who [lindex $rest 0]
  3627. set chan [lindex $rest 1]
  3628. if {$who != ""} {
  3629. if {[validuser $who] == 1} {
  3630. if {$chan != ""} {
  3631. if {[validchan $chan]} {
  3632. if {[matchattr $who |a $chan] == 0} {
  3633. chattr $who |a $chan
  3634. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $who is now auto oped on $chan"
  3635. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! aop $who $chan"
  3636. return 0
  3637. } else {
  3638. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $who is already auto oped on $chan"
  3639. return 0
  3640. }
  3641. } else {
  3642. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $chan is not a valid channel"
  3643. return 0
  3644. }
  3645. } else {
  3646. if {[matchattr $who a] == 0} {
  3647. chattr $who +a
  3648. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $who is now global auto oped."
  3649. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! aop $who"
  3650. return 0
  3651. } else {
  3652. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $who is already auto oped"
  3653. return 0
  3654. }
  3655. }
  3656. }
  3657. if {[validuser $who] == 0} {
  3658. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $who is not a valid user"
  3659. }
  3660. }
  3661. if {$who == ""} {
  3662. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}aop <nick>"
  3663. }
  3664. }
  3665. ## public cmd aop -- stop
  3666.  
  3667. ## dcc cmd aop -- start
  3668. proc cmd_aop {hand idx rest} {
  3669. set who [lindex $rest 0]
  3670. set chan [lindex $rest 1]
  3671. if {$who != ""} {
  3672. if {[validuser $who] == 1} {
  3673. if {$chan != ""} {
  3674. if {[validchan $chan]} {
  3675. if {[matchattr $who |a $chan] == 0} {
  3676. chattr $who |a $chan
  3677. putdcc $idx "\002\[4damn4!\]\002 $who is now auto oped on $chan"
  3678. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! aop $who $chan"
  3679. return 0
  3680. } else {
  3681. putdcc $idx "\002\[4damn4!\]\002 $who is already auto oped on $chan"
  3682. return 0
  3683. }
  3684. } else {
  3685. putdcc $idx "\002\[4damn4!\]\002 $chan is not a valid channel"
  3686. return 0
  3687. }
  3688. } else {
  3689. if {[matchattr $who a] == 0} {
  3690. chattr $who +a
  3691. putdcc $idx "\002\[4damn4!\]\002 $who is now global auto oped."
  3692. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! aop $who"
  3693. return 0
  3694. } else {
  3695. putdcc $idx "\002\[4damn4!\]\002 $who is already auto oped"
  3696. return 0
  3697. }
  3698. }
  3699. }
  3700. if {[validuser $who] == 0} {
  3701. putdcc $idx "\002\[4damn4!\]\002 $who is not a valid user"
  3702. }
  3703. }
  3704. if {$who == ""} {
  3705. putdcc $idx "\002\[4damn4!\]\002 Usage: aop <nick>"
  3706. }
  3707. }
  3708. ## dcc cmd aop -- stop
  3709.  
  3710. ## public cmd channel -- start
  3711. proc pub_channel {nick uhost hand channel rest} {
  3712. global botnick
  3713. set rest [lindex $rest 0]
  3714. set chanlisting ""
  3715. foreach x [chanlist $channel] {
  3716. set dathand [nick2hand $x $channel]
  3717. if {$dathand=="*"} {set dathand "?"}
  3718. set chanlisting "$chanlisting $x\[$dathand\]"
  3719. }
  3720. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Channel:$chanlisting"
  3721. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! channel"
  3722. }
  3723. ## public cmd channel -- stop
  3724.  
  3725. ## public cmd who -- start
  3726. proc pub_who {nick uhost hand channel rest} {
  3727. global botnick
  3728. set peoplelist ""
  3729. set botlist ""
  3730. set e " "
  3731. foreach x [dcclist] {
  3732. set people [lindex $x 1]
  3733. set type [lindex $x 3]
  3734. set bot [lindex $x 1]
  3735. if {$type == "CHAT"} {
  3736. string trim $people " "
  3737. set peoplelist "$peoplelist $people"
  3738. set peoplenum $e\[[llength $peoplelist]\]
  3739. }
  3740. if {$type == "BOT"} {
  3741. string trim $bot " "
  3742. set botlist "$botlist $bot"
  3743. set botnum $e\[[llength $bot]\]
  3744. }
  3745. }
  3746. if {[string trim ${peoplelist} " "]==""} {
  3747. set peoplelist " No one is on $botnick"
  3748. set peoplenum ""
  3749. }
  3750. if {[string trim ${botlist} ""]==""} {
  3751. set botlist " No bots are linked to $botnick"
  3752. set botnum ""
  3753. }
  3754. regsub -all " " $peoplelist ", " peoplelist
  3755. regsub -all " " $botlist ", " botlist
  3756.  
  3757. set peoplelist [string range $peoplelist 1 end]
  3758. set botlist [string range $botlist 1 end]
  3759. puthelp "NOTICE $nick :\002\[4damn4!\]\002 People$peoplenum:$peoplelist"
  3760. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Bots$botnum:$botlist"
  3761. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! who"
  3762. return 0
  3763. }
  3764. ## public cmd who -- stop
  3765.  
  3766. proc pub_wi {nick uhost hand channel rest} {
  3767. global botnick max-notes
  3768. pub_whois $nick $uhost $hand $channel $rest
  3769. }
  3770.  
  3771. proc pub_whois {nick uhost hand channel rest} {
  3772. global botnick max-notes
  3773. set fl "\002\[4damn4!\]\002"
  3774. if {[validuser $rest] == 0} {
  3775. putserv "NOTICE $nick :\002\[4damn4!\]\002 No such user!"
  3776. return 0
  3777. }
  3778. set user [lindex $rest 0]
  3779. set ch [passwdok "$rest" ""]
  3780. if {!$ch} {set pass "yes"} else {set pass "no "}
  3781. set notes [notes $user]
  3782. set flags [chattr $user]
  3783. while {[string length $flags] < 15} {
  3784. append flags " "
  3785. }
  3786. while {[string length $user] < 9} {
  3787. append user " "
  3788. }
  3789. if {[string length $notes] == "1"} {set notes " ${notes}"}
  3790. if {[string length $notes] == "2"} {set notes " ${notes}"}
  3791. #set flags [chattr $user]
  3792. #set userlen [string length $user]
  3793. #set bl1 " "
  3794. #if {$userlen < 9} {
  3795. # set dt1 [expr 8-$userlen]
  3796. # set add [string range $bl1 0 $dt1]
  3797. # append user $add
  3798. #}
  3799. #if {$userlen > 9} {set user [string range $userlen 0 8]}
  3800. #set flagslen [string length $flags]
  3801. #set bl2 " "
  3802. #if {$flagslen < 15} {
  3803. # set dt2 [expr 14-$flagslen]
  3804. # set add [string range $bl2 0 $dt2]
  3805. # append flags $add
  3806. #}
  3807. set lastseen [ctime [lindex [getuser [string trim $user] LASTON] 0]]
  3808. set day "[lindex $lastseen 0]."
  3809. set month "[lindex $lastseen 1], [lindex $lastseen 2]"
  3810. set time [lindex $lastseen 3]
  3811. set year "[string range [lindex $lastseen 4] 2 3]"
  3812. set last "$time on $month"
  3813.  
  3814.  
  3815. #if {$flagslen > 15} {set flags [string range $flagslen 0 14]}
  3816. puthelp "NOTICE $nick :$fl HANDLE PASS NOTES FLAGS LAST"
  3817. puthelp "NOTICE $nick :$fl $user $pass $notes $flags $last"
  3818. set user [string trim $user]
  3819. if {![matchattr $user b]} {
  3820. foreach i [channels] {
  3821. set tchan [string length $i]
  3822.  
  3823. set bl3 " "
  3824. if {$tchan < 18} {
  3825. set dt3 [expr 17-$tchan]
  3826. set add2 [string range $bl3 0 $dt3]
  3827. append chans $i$add2
  3828. }
  3829. set cflags [chattr $user | $i]
  3830. set nflags [string trimleft $cflags "abcdefghijklmnopqrstuvwdamnABCDEFGHIJKLMNOPQRSTUVWdamn"]
  3831.  
  3832. set cfflags [string trim $nflags "|"]
  3833. set cf [string length $cfflags]
  3834. set flagslen2 [string length $cf]
  3835. set bl26 " "
  3836. if {$flagslen2 < 14} {
  3837. set dt26 [expr 13-$flagslen2]
  3838. set add4 [string range $bl26 0 $dt26]
  3839. append flags12 $add4
  3840. }
  3841. if {$flagslen2 > 14} {set flags12 [string range $flagslen2 0 13]}
  3842. set lastseen2 [ctime [lindex [getuser $user LASTON $i] 0]]
  3843. set day2 "[lindex $lastseen2 0]."
  3844. set month2 "[lindex $lastseen2 1], [lindex $lastseen2 2]"
  3845. set time2 [lindex $lastseen2 3]
  3846. set year2 "`[string range [lindex $lastseen2 4] 2 3]"
  3847. set last2 "$time on $month2"
  3848. puthelp "NOTICE $nick :$fl $chans $cfflags $flags12 $last2"
  3849. }
  3850. }
  3851. if {[getuser $user HOSTS] != ""} {
  3852. set hosts [getuser $user hosts]
  3853. puthelp "NOTICE $nick :$fl HOSTS: $hosts"
  3854. }
  3855. if {[getuser $user BOTFL] != ""} {
  3856. puthelp "NOTICE $nick :$fl BOT FLAGS: [getuser $user BOTFL]"
  3857. }
  3858. if {[getuser $user BOTADDR] != ""} {
  3859. set botinfo [getuser $user BOTADDR]
  3860. puthelp "NOTICE $nick :$fl ADDRESS: [lindex $botinfo 0]"
  3861. puthelp "NOTICE $nick :$fl telnet: [lindex $botinfo 1], relay: [lindex $botinfo 2]"
  3862. }
  3863. }
  3864. ## public cmd whois -- stop
  3865.  
  3866. ## public cmd whom -- start
  3867. proc pub_whom {nick uhost hand channel rest} {
  3868. set peoplelist ""
  3869. foreach x [whom 0] {
  3870. set people [lindex $x 0]
  3871. string trim $people " "
  3872. set peoplelist "$peoplelist ${people}@[lindex [string trim $x ""] 1]"
  3873. }
  3874. regsub -all " " $peoplelist ", " peoplelist
  3875. set peoplelist [string range $peoplelist 1 end]
  3876. if {[string trim ${peoplelist} " "]==""} {
  3877. set peoplelist " No one is on the partyline"
  3878. }
  3879. puthelp "NOTICE $nick :\002\[4damn4!\]\002 People:$peoplelist"
  3880. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! whom"
  3881. return 0
  3882. }
  3883. ## public cmd whom -- stop
  3884.  
  3885. ## public cmd match -- start
  3886. proc pub_match {nick uhost hand chan rest} {
  3887. global CC
  3888. if {$rest==""} {
  3889. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}match <flags>"
  3890. return 0
  3891. }
  3892. set rest [string trim $rest +]
  3893. if {[string length $rest] > 1} {
  3894. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Invalid option."
  3895. return 0
  3896. }
  3897. if {$rest!=""} {
  3898. set rest "+[lindex $rest 0]"
  3899. if {[userlist $rest]!=""} {
  3900. regsub -all " " [userlist $rest] ", " users
  3901. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Match \[$rest\]: $users"
  3902. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! match $rest"
  3903. return 0
  3904. }
  3905. if {[userlist $rest]==""} {
  3906. puthelp "NOTICE $nick :\002\[4damn4!\]\002 No users with flags \[$rest\]"
  3907. return 0
  3908. }
  3909. }
  3910. }
  3911. ## public cmd match -- stop
  3912.  
  3913. ## dcc cmd match -- start
  3914. proc dcc_match {hand idx args} {
  3915. set flags [lindex $args 0]
  3916. set flags [string trim $flags +]
  3917. if {$flags==""} {
  3918. putdcc $idx "\002\[4damn4!\]\002 Usage: match <flags>"
  3919. return 0
  3920. }
  3921. if {[string length $flags] > 1} {
  3922. putdcc $idx "\002\[4damn4!\]\002 Invalid Option."
  3923. return 0
  3924. }
  3925. if {$flags!=""} {
  3926. if {[userlist $flags]!=""} {
  3927. regsub -all " " [userlist $flags] ", " users
  3928. putdcc $idx "\002\[4damn4!\]\002 Match \[$flags\]: $users"
  3929. putlog "\002\[4damn4!\]\002 #$hand# match $flags"
  3930. return 0
  3931. }
  3932. if {[userlist $flags]==""} {
  3933. putdcc $idx "\002\[4damn4!\]\002 No users with flags \[$flags\]"
  3934. return 0
  3935. }
  3936. }
  3937. }
  3938. ## dcc cmd match -- stop
  3939.  
  3940. ## public cmd bots -- start
  3941. proc pub_bots {nick uhost hand chan rest} {
  3942. if {[bots]==""} {
  3943. puthelp "NOTICE $nick :\002\[4damn4!\]\002 No bots connected"
  3944. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! bots"
  3945. return 0
  3946. }
  3947. if {[bots]!=""} {
  3948. regsub -all " " [bots] ", " bots
  3949. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Bots: $bots"
  3950. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! bots"
  3951. return 0
  3952. }
  3953. }
  3954. ## public cmd bots -- stop
  3955.  
  3956. ## public cmd bottree -- start
  3957. proc pub_bottree {nick uhost hand chan rest} {
  3958. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Bottree is only available via dcc chat, try Bots"
  3959. }
  3960. ## public cmd bottree - stop
  3961.  
  3962. ## public cmd notes -- start
  3963. proc pub_notes {nick uhost hand chan rest} {
  3964. puthelp "NOTICE $nick :\002\[4damn4!\]\002 notes is only available via dcc chat"
  3965. }
  3966. ## public cmd notes -- stop
  3967.  
  3968. proc val {string} {
  3969. set arg [string trim $string /ABCDEFGHIJKLMNOPQRSTUVWdamnabcdefghijklmnopqrstuvwdamn]
  3970. set arg2 [string trim $arg #!%()@-_+=\[\]|,.?<>{}]
  3971. return $arg2
  3972. }
  3973.  
  3974. ## public cmd +ban -- start
  3975. proc pub_+ban {nick uhost hand channel rest} {
  3976. global botnick CC ban-time
  3977. if {[matchattr $hand Q] == 0} {
  3978. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  3979. return 0
  3980. }
  3981. if {[botisop $channel]==1} {
  3982. if {$rest == ""} {
  3983. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}+ban <hostmask> \[reason\]"
  3984. return 0
  3985. }
  3986. if {$rest!=""} {
  3987. set host [lindex $rest 0]
  3988. set reason [lrange $rest 1 end]
  3989. if {[string tolower $host] == [string tolower $botnick]} {
  3990. putserv "KICK $channel $nick :Mad-4\[ 4Yuck 4Fou \]-Kick"
  3991. return 0
  3992. }
  3993. if {$reason == ""} {
  3994. set reason "\002..::Ban enforcing - bnd4C::..\002"
  3995. }
  3996. set options [lindex $reason 0]
  3997. if {[string index $options 0] == "-"} {
  3998. set options [string range $options 1 end]
  3999. }
  4000. switch -exact $options {
  4001. perm {
  4002. set reason [lrange $reason 1 end]
  4003. newban $host $nick "$reason" 0
  4004. if {$reason == ""} {set reason "$nick, damn RuLz!"}
  4005. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! +ban $reason"
  4006. return 0
  4007. }
  4008. min {
  4009. if {[val [lindex $reason 1]] == ""} {
  4010. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Error, invalid time period"
  4011. return 0
  4012. }
  4013. set time [lindex $reason 1]
  4014. set reason [lrange $reason 2 end]
  4015. newban $host $nick "$reason" $time
  4016. if {$reason == ""} {set reason "$nick, damn RuLz!"}
  4017. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! +ban $reason"
  4018. return 0
  4019. }
  4020. hours {
  4021. if {[val [lindex $reason 1]] == ""} {
  4022. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Error, invalid time period"
  4023. return 0
  4024. }
  4025. set time [expr [lindex $reason 1]*60]
  4026. set reason [lrange $reason 2 end]
  4027. newban $host $nick "$reason" $time
  4028. if {$reason == ""} {set reason "$nick, damn RuLz!"}
  4029. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! +ban $reason"
  4030. return 0
  4031. }
  4032. days {
  4033. if {[val [lindex $reason 1]] == ""} {
  4034. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Error, invalid time period"
  4035. return 0
  4036. }
  4037. set time [expr [expr [lindex $reason 1]*60]*24]
  4038. set reason [lrange $reason 2 end]
  4039. newban $host $nick "$reason" $time
  4040. if {$reason == ""} {set reason "$nick, damn RuLz!"}
  4041. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! +ban $reason"
  4042. return 0
  4043. }
  4044. weeks {
  4045. if {[val [lindex $reason 1]] == ""} {
  4046. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Error, invalid time period"
  4047. return 0
  4048. }
  4049. set time [expr [expr [expr [lindex $reason 1]*60]*24]*7]
  4050. set reason [lrange $reason 2 end]
  4051. newban $host $nick "$reason" $time
  4052. if {$reason == ""} {set reason "$nick, damn RuLz!"}
  4053. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! +ban $reason"
  4054. return 0
  4055. }
  4056. }
  4057. set reason [lrange $reason 1 end]
  4058. newban $host $nick "$reason" $ban-time
  4059. if {$reason == ""} {set reason "$nick, damn RuLz!"}
  4060. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! +ban $reason"
  4061. return 0
  4062. }
  4063. }
  4064. if {[botisop $channel]!=1} {
  4065. puthelp "NOTICE $nick :\002\[4damn4!\]\002 I am not oped"
  4066. }
  4067. }
  4068. ## public cmd +ban -- stop
  4069.  
  4070. ## public cmd -ban -- start
  4071. proc pub_-ban {nick uhost hand channel rest} {
  4072. set rest [lindex $rest 0]
  4073. global botnick botnick
  4074. if {[matchattr $hand Q] == 0} {
  4075. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  4076. return 0
  4077. }
  4078. if {[botisop $channel]==1} {
  4079. if {$rest==""} {
  4080. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: -ban <ban #>"
  4081. }
  4082. if {$rest!=""} {
  4083. set mbantester [catch {expr $rest-1}]
  4084. if {$mbantester==1} {
  4085. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: -ban <ban #>"
  4086. return 0
  4087. }
  4088. if {[lindex [banlist $channel] [expr ${rest}-1]]==""} {
  4089. puthelp "NOTICE $nick :\002\[4damn4!\]\002 No such channel ban. It may be a global ban"
  4090. return 0
  4091. }
  4092. if {[lindex [banlist $channel] [expr ${rest}-1]]!=""} {
  4093. set restban [lindex [lindex [banlist $channel] 0] [expr ${rest}-1]]
  4094. killchanban $channel $rest
  4095. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Ban $restban was removed"
  4096. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! -ban $rest"
  4097. return 0
  4098. }
  4099. }
  4100. }
  4101. if {[isop $botnick $channel]!=1} {
  4102. puthelp "NOTICE $nick :\002\[4damn4!\]\002 I am not oped"
  4103. }
  4104. }
  4105. ## public cmd -ban -- stop
  4106.  
  4107. ## public cmd bans -- start
  4108. proc pub_bans {nick uhost hand chan rest} {
  4109. global CC ban-time
  4110. set rest [lindex $rest 0]
  4111. set rest [string toupper $rest]
  4112. if {$rest!="CHANNEL"} {
  4113. if {$rest!="GLOBAL"} {
  4114. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: bans <global | channel>"
  4115. }
  4116. }
  4117. set banlistchan ""
  4118. if {$rest=="CHANNEL"} {
  4119. foreach x [banlist $chan] {
  4120. set banlister [lindex $x 0]
  4121. set banlistchan "$banlistchan $banlister"
  4122. }
  4123. if {[banlist $chan]==""} {
  4124. set banlistchan " No channel bans in $chan"
  4125. }
  4126. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Channel Bans:$banlistchan"
  4127. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! bans channel"
  4128. return 0
  4129. }
  4130. set banlist ""
  4131. if {$rest=="GLOBAL"} {
  4132. foreach x [banlist] {
  4133. set banlisting [lindex $x 0]
  4134. set banlist "$banlist $banlisting"
  4135. }
  4136. if {$banlist==""} {
  4137. set banlist " No global bans"
  4138. }
  4139. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Global Bans:$banlist"
  4140. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! bans global"
  4141. return 0
  4142. }
  4143. }
  4144. ## public cmd bans -- stop
  4145.  
  4146. ## dcc cmd op -- start
  4147. proc cmd_op {hand idx rest} {
  4148. set rest [lindex $rest 0]
  4149. set channel [lindex [console $idx] 0]
  4150. global botnick
  4151. if {[botisop $channel]==1} {
  4152. if {$rest==""} {
  4153. putdcc $idx "\002\[4damn4!\]\002 Usage: op <nick>"
  4154. }
  4155. if {[onchan $rest $channel]=="1"} {
  4156. if {[isop $rest $channel]=="1"} {
  4157. putdcc $idx "\002\[4damn4!\]\002 $rest is already oped"
  4158. }
  4159. }
  4160. if {$rest!=""} {
  4161. if {[onchan $rest $channel]=="0"} {
  4162. putdcc $idx "\002\[4damn4!\]\002 $rest isn't on the channel"
  4163. }
  4164. }
  4165. if {[onchan $rest $channel]=="1"} {
  4166. if {[isop $rest $channel]=="0"} {
  4167. pushmode $channel +o $rest
  4168. putlog "\002\[4damn4!\]\002 #$hand# op $rest"
  4169. }
  4170. }
  4171. }
  4172. if {[botisop $channel]!=1} {
  4173. putdcc $idx "\002\[4damn4!\]\002 I am not oped, sorry."
  4174. }
  4175. }
  4176. ## dcc cmd op -- stop
  4177.  
  4178. ## public cmd op -- start
  4179. proc pub_op {nick uhost hand channel rest} {
  4180. set rest [lindex $rest 0]
  4181. global botnick
  4182. if {[matchattr $hand Q] == 0} {
  4183. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  4184. return 0
  4185. }
  4186. if {[botisop $channel]==1} {
  4187. if {$rest==""} {
  4188. if {![botisop $channel]} {
  4189. putserv "NOTICE $nick :Sorry, Im not op'd."
  4190. return 0
  4191. }
  4192. if {[isop $nick $channel]} {
  4193. putserv "NOTICE $nick :You are already op'd."
  4194. return 0
  4195. }
  4196. putcmdlog "#$hand# op $nick"
  4197. pushmode $channel +o $nick
  4198. return 0
  4199. }
  4200. if {[onchan $rest $channel]==1} {
  4201. if {[isop $rest $channel]==1} {
  4202. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $rest is already oped."
  4203. }
  4204. }
  4205. if {$rest!=""} {
  4206. if {[onchan $rest $channel]==0} {
  4207. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $rest isn't on the channel."
  4208. }
  4209. }
  4210. if {[onchan $rest $channel]==1} {
  4211. if {[isop $rest $channel]==0} {
  4212. pushmode $channel +o $rest
  4213. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! op $rest"
  4214. }
  4215. }
  4216. }
  4217. if {[botisop $channel]!=1} {
  4218. puthelp "NOTICE $nick :\002\[4damn4!\]\002 I am not oped, sorry."
  4219. }
  4220. }
  4221. ## public cmd op -- stop
  4222.  
  4223. ## dcc cmd deop -- start
  4224. proc cmd_deop {hand idx rest} {
  4225. global botnick
  4226. set rest [lindex $rest 0]
  4227. set channel [lindex [console $idx] 0]
  4228. if {[botisop $channel]==1} {
  4229. if {$rest==""} {
  4230. putdcc $idx "\002\[4damn4!\]\002 Usage: deop <nick>"
  4231. }
  4232. if {$rest!=""} {
  4233. if {[onchan $rest $channel]=="0"} {
  4234. putdcc $idx "\002\[4damn4!\]\002 $rest isn't on the channel"
  4235. }
  4236. }
  4237. if {[onchan $rest $channel]=="1"} {
  4238. if {[isop $rest $channel]=="0"} {
  4239. putdcc $idx "\002\[4damn4!\]\002 $rest is already deoped"
  4240. }
  4241. }
  4242. if {[string tolower $botnick] == [string tolower $rest]} {
  4243. putdcc $idx "\002\[4damn4!\]\002 I don't deop myself..."
  4244. }
  4245. if {[isop $rest $channel]=="1"} {
  4246. if {[onchan $rest $channel]=="1"} {
  4247. if {$botnick!=$rest} {
  4248. pushmode $channel -o $rest
  4249. putlog "\002\[4damn4!\]\002 #$hand# deop $rest"
  4250. }
  4251. }
  4252. }
  4253. }
  4254. if {[botisop $channel]!=1} {
  4255. putdcc $idx "\002\[4damn4!\]\002 I am not oped"
  4256. }
  4257. }
  4258. ## dcc cmd deop -- stop
  4259.  
  4260. ## public cmd deop -- start
  4261. proc pub_deop {nick uhost hand channel rest} {
  4262. global botnick
  4263. if {[matchattr $hand Q] == 0} {
  4264. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  4265. return 0
  4266. }
  4267. set rest [lindex $rest 0]
  4268. if {[botisop $channel]==1} {
  4269. if {$rest==""} {
  4270. if {![botisop $channel]} {
  4271. putserv "NOTICE $nick :Sorry, Im not op'd."
  4272. return 0
  4273. }
  4274. if {![isop $nick $channel]} {
  4275. putserv "NOTICE $nick :You are already deop'd."
  4276. return 0
  4277. }
  4278. putcmdlog "#$hand# deop $nick"
  4279. pushmode $channel -o $nick
  4280. return 0
  4281. }
  4282. if {$rest!=""} {
  4283. if {[onchan $rest $channel] == 0} {
  4284. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $rest isn't on the channel."
  4285. return 0
  4286. }
  4287. }
  4288. if {[onchan $rest $channel]=="1"} {
  4289. if {[isop $rest $channel]=="0"} {
  4290. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $rest is already deoped."
  4291. return 0
  4292. }
  4293. }
  4294. if {[string tolower $botnick] == [string tolower $rest]} {
  4295. putserv "KICK $channel $nick :Mad-4\[ 4Yuck 4Fou \]-Kick"
  4296. return 0
  4297. }
  4298. if {[isop $rest $channel]=="1"} {
  4299. if {[onchan $rest $channel]=="1"} {
  4300. if {[string tolower $botnick] != [string tolower $rest]} {
  4301. pushmode $channel -o $rest
  4302. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! deop $rest"
  4303. }
  4304. }
  4305. }
  4306. }
  4307. if {[botisop $channel]!=1} {
  4308. puthelp "NOTICE $nick :\002\[4damn4!\]\002 I am not oped, sorry."
  4309. }
  4310. }
  4311. ## public cmd deop -- stop
  4312.  
  4313. ## public cmd topic -- start
  4314. proc pub_topic {nick uhost hand channel rest} {
  4315. global botnick topicnick
  4316. if {[matchattr $hand Q] == 0} {
  4317. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  4318. return 0
  4319. }
  4320. if {$rest!=""} {
  4321. if {[botisop $channel]==1} {
  4322. if {$topicnick == 0} {
  4323. putserv "TOPIC $channel :$rest"
  4324. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! topic $rest"
  4325. } else {
  4326. putserv "TOPIC $channel :$rest (${hand})"
  4327. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! topic $rest"
  4328. }
  4329. }
  4330. if {[botisop $channel]!=1} {
  4331. puthelp "NOTICE $nick :\002\[4damn4!\]\002 I am not oped" }
  4332. }
  4333. if {$rest==""} {
  4334. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: topic <topic>"
  4335. }
  4336. }
  4337. ## public cmd topic -- stop
  4338.  
  4339. ## public cmd act -- start
  4340. proc pub_act {nick uhost hand channel rest} {
  4341. if {$rest!=""} {
  4342. putserv "PRIVMSG $channel :\001ACTION $rest\001"
  4343. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! act $rest"
  4344. return 0
  4345. }
  4346. if {$rest==""} {
  4347. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: act <msg>"
  4348. }
  4349. }
  4350. ## public cmd act -- stop
  4351.  
  4352. ## public cmd say -- start
  4353. proc pub_say {nick uhost hand channel rest} {
  4354. if {$rest!=""} {
  4355. puthelp "PRIVMSG $channel :$rest"
  4356. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! say $rest"
  4357. return 0
  4358. }
  4359. if {$rest==""} {
  4360. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: say <msg>"
  4361. }
  4362. }
  4363. ## public cmd say -- stop
  4364.  
  4365. ## public cmd msg -- start
  4366. proc pub_msg {nick uhost hand channel rest} {
  4367. set person [lindex $rest 0]
  4368. set rest [lrange $rest 1 end]
  4369. if {$rest!=""} {
  4370. puthelp "PRIVMSG $person :$rest"
  4371. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! msg $rest"
  4372. return 0
  4373. }
  4374. if {$rest==""} {
  4375. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: msg <nick> <msg>"
  4376. }
  4377. }
  4378. ## public cmd msg -- stop
  4379. #########################
  4380. ## public cmd tsunami -- start
  4381. proc pub_tsunami {nick uhost hand channel rest} {
  4382. set person [lindex $rest 0]
  4383. set rest [lrange $rest 1 end]
  4384. if {$rest!=""} {
  4385. puthelp "PRIVMSG $person :$rest ,|@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%|"
  4386. puthelp "NOTICE $person :$rest ,|@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%|"
  4387. puthelp "PRIVMSG $person :$rest ,|@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%|"
  4388. puthelp "NOTICE $person :$rest ,|@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%|"
  4389. puthelp "PRIVMSG $person :$rest ,|@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%|"
  4390. puthelp "NOTICE $person :$rest ,|@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%||@#$%|"
  4391. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! tsunami $person"
  4392. return 0
  4393. }
  4394. if {$rest==""} {
  4395. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: tsunami <nick> <*add your insult to injury is better :)*>"
  4396. }
  4397. }
  4398. ## public cmd msg -- stop
  4399. #########################
  4400. ## public cmd bndc -- start
  4401. proc pub_bndc {nick uhost hand channel rest} {
  4402. set person [lindex $rest 0]
  4403. set rest [lrange $rest 1 end]
  4404. if {$rest!=""} {
  4405. puthelp "PRIVMSG $person :$rest ,1,4bnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóD"
  4406. puthelp "NOTICE $person :$rest ,1,4bnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóD"
  4407. puthelp "PRIVMSG $person :$rest ,1,8bnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóD"
  4408. puthelp "NOTICE $person :$rest ,1,8bnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóD"
  4409. puthelp "PRIVMSG $person :$rest ,1,3bnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóD"
  4410. puthelp "NOTICE $person :$rest ,1,3bnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóDbnd©f£öóD"
  4411. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! bndc $person"
  4412. return 0
  4413. }
  4414. if {$rest==""} {
  4415. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: bndc <nick> <*add your insult to injury is better :)*>"
  4416. }
  4417. }
  4418. ## public cmd msg -- stop
  4419. ##########################
  4420. ## public cmd motd -- start
  4421. proc pub_motd {nick uhost hand channel rest} {
  4422. global newpath botnick version vers admin network
  4423. set mfile "${newpath}alt.motd"
  4424. if {![file exists $mfile]} {
  4425. set new [open $mfile w]
  4426. putserv "NOTICE $nick :I am $botnick, running v[lindex $version 0] with tNC.tcl v${vers}"
  4427. puts $new "I am $botnick, running v[lindex $version 0] with tNC.tcl v${vers}"
  4428. putserv "NOTICE $nick :Admin: $admin"
  4429. puts $new "Admin: $admin"
  4430. regsub -all " " [channels] ", " chans
  4431. putserv "NOTICE $nick :Located: $chans on $network"
  4432. puts $new "Located: $chans on $network"
  4433. close $new
  4434. } else {
  4435. set info [fileinfo $mfile]
  4436. set info [lrange $info 0 2]
  4437. foreach x $info {
  4438. putserv "NOTICE $nick :$x"
  4439. }
  4440. }
  4441. }
  4442. ## public cmd motd -- stop
  4443.  
  4444. ## public cmd addlog -- start
  4445. proc pub_addlog {nick uhost hand chan rest} {
  4446. global botnick
  4447. if {[matchattr $hand Q] == 0} {
  4448. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  4449. return 0
  4450. }
  4451. if {$rest==""} {
  4452. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: addlog <msg>"
  4453. }
  4454. if {$rest!=""} {
  4455. putlog "\002\[4damn4!\]\002 $hand: $rest"
  4456. }
  4457. }
  4458. ## public cmd addlog -- stop
  4459.  
  4460. ## public cmd invite -- start
  4461. proc pub_invite {nick uhost hand chan rest} {
  4462. global botnick
  4463. if {[matchattr $hand Q] == 0} {
  4464. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  4465. return 0
  4466. }
  4467. set rest [lindex $rest 0]
  4468. if {$rest==""} {
  4469. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: invite <nick>"
  4470. }
  4471. if {$rest!=""} {
  4472. if {[onchan $rest $chan]==0} {
  4473. putserv "INVITE $rest :$chan"
  4474. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Invitation to $chan has been sent to $rest"
  4475. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! invite $rest"
  4476. return 0
  4477. }
  4478. if {[onchan $rest $chan]==1} {
  4479. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $rest is already on the channel"
  4480. }
  4481. }
  4482. }
  4483. ## public cmd invite -- stop
  4484.  
  4485. ## public cmd nick -- start
  4486. proc pub_nick {nick uhost hand chan rest} {
  4487. global botnick
  4488. if {[matchattr $hand Q] == 0} {
  4489. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  4490. return 0
  4491. }
  4492. set rest [lindex $rest 0]
  4493. if {$rest==""} {
  4494. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: nick <new nick on bot>"
  4495. }
  4496. if {$rest!=""} {
  4497. chnick $hand $rest
  4498. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Your partyline handle is now [nick2hand $nick $chan]"
  4499. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! nick $rest"
  4500. return 0
  4501. }
  4502. }
  4503. ## public cmd nick -- stop
  4504.  
  4505. ## Away stuff ##
  4506. set idle.v "\002\[4damn4!\]\002-aNtiIdLe tEcHz"
  4507. set idle.1 10
  4508. #make a private msg to someone, or your home channel
  4509. set idle.w "$botnick"
  4510. set idle.m "\002\[4damn4!\]\002 rules :) ..:: loaded with $vers ::.."
  4511. if {![info exists idle.l]} {
  4512. global idle.w idle.m idle.1
  4513. set idle.l 0
  4514. timer ${idle.1} {idle.a}
  4515. putlog "${idle.v} loaded"
  4516. }
  4517.  
  4518. proc idle.a {} {
  4519. global idle.w idle.m idle.1
  4520. putserv "PRIVMSG ${idle.w} ${idle.m}"
  4521. putserv "PRIVMSG [lindex ${idle.w} 0] :\001PING [unixtime]\001"
  4522. timer ${idle.1} {idle.a}
  4523. }
  4524.  
  4525. set awaym {
  4526. " Citrus Flavored Beverage "
  4527. }
  4528.  
  4529. timer 5 idleaway
  4530. proc idleaway {} {
  4531. global awaym
  4532. set awaymsg [lindex $awaym [rand [llength $awaym]]]
  4533. putserv "AWAY :$awaymsg"
  4534. timer [expr [rand 30] + 2] idleaway2
  4535. }
  4536. proc idleaway2 {} {
  4537. global awaym
  4538. putserv "BACK"
  4539. set awaymsg [lindex $awaym [rand [llength $awaym]]]
  4540. putserv "AWAY :$awaymsg"
  4541. timer [expr [rand 45] + 2] idleaway3
  4542. }
  4543. proc idleaway3 {} {
  4544. global awaym
  4545. putserv "BACK"
  4546. set awaymsg [lindex $awaym [rand [llength $awaym]]]
  4547. putserv "AWAY :$awaymsg"
  4548. timer [expr [rand 15] + 2] idleaway
  4549. }
  4550. #
  4551.  
  4552. ## public cmd chat -- start
  4553. proc pub_chat {nick uhost hand chan rest} {
  4554. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Chat is only available via dcc chat"
  4555. }
  4556. ## public cmd chat -- stop
  4557.  
  4558. ## public cmd note -- start
  4559. proc pub_note {nick uhost hand chan rest} {
  4560. global botnick
  4561. if {[matchattr $hand Q] == 0} {
  4562. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  4563. return 0
  4564. }
  4565. set reciever [lindex $rest 0]
  4566. set rest [lrange $rest 1 end]
  4567. if {$rest==""} {
  4568. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: note <hand> <note>"
  4569. }
  4570. if {$rest!=""} {
  4571. set notetest [sendnote $hand $reciever $rest]
  4572. if {$notetest==1} {
  4573. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Note to $reciever was recieved"
  4574. }
  4575. if {$notetest==2} {
  4576. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Note to $reciever was stored \[local\]"
  4577. }
  4578. if {$notetest==3} {
  4579. puthelp "NOTICE $nick :\002\[4damn4!\]\002 ${reciever}'s mailbox was full"
  4580. }
  4581. if {$notetest==4} {
  4582. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Tcl binding intercepted the note"
  4583. }
  4584. if {$notetest==5} {
  4585. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $reciever was away, note stored"
  4586. }
  4587. if {$notetest==0} {
  4588. puthelp "NOTICE $nick :Send to $reciever failed"
  4589. return 0
  4590. }
  4591. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! note $reciever *masked*"
  4592. }
  4593. }
  4594. ## public cmd chat -- stop
  4595.  
  4596. ## public cmd files -- start
  4597. proc pub_files {nick uhost hand chan rest} {
  4598. global botnick
  4599. global sizeoffile
  4600. set wowfiles [getfiles /]
  4601. set wowdirs [getdirs /]
  4602. if {$wowfiles!=""} {
  4603. set z 0
  4604. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $botnick is offering \002[llength $wowfiles] packs\002, type \002.get \[X\]\002 to recieve a file"
  4605. foreach x $wowfiles {
  4606. set z [expr $z+1]
  4607. set sizeoffile [string trim [exec du dcc/$x] dcc/$x]
  4608. if {[expr $sizeoffile/1024]!=0} {
  4609. set sizeofthefile \[[expr $sizeoffile/1024]MB\]
  4610. while {[string length $sizeofthefile]<7} {
  4611. set sizeofthefile " $sizeofthefile"
  4612. }
  4613. }
  4614. if {[expr $sizeoffile/1024]==0} {
  4615. set sizeofthefile \[${sizeoffile}k\]
  4616. while {[string length $sizeofthefile]<8} {
  4617. set sizeofthefile " $sizeofthefile"
  4618. }
  4619. }
  4620. set wowfiles "\002${sizeofthefile}\002 $x"
  4621. if {$z<10} {
  4622. set z " $z"
  4623. }
  4624. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $z\002)\002 $wowfiles"
  4625. }
  4626. }
  4627. if {$wowfiles==""} {set wowfiles "No files available"}
  4628. if {$wowdirs==""} {set wowdirs "No directories available"}
  4629. if {$wowfiles=="No files available"} {
  4630. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Files: $wowfiles"
  4631. }
  4632. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Directories: $wowdirs"
  4633. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Many more commands available via dcc chat"
  4634. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! files"
  4635. return 0
  4636. }
  4637. ## public cmd files -- stop
  4638.  
  4639. ## public cmd newpass -- start
  4640. proc pub_newpass {nick uhost hand chan rest} {
  4641. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Newpass: For some reason, I think not"
  4642. }
  4643. ## public cmd newpass -- stop
  4644.  
  4645. ## public cmd console -- start
  4646. proc pub_console {nick uhost hand chan rest} {
  4647. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Console is only available via dcc chat"
  4648. }
  4649. ## public cmd console -- stop
  4650.  
  4651. ## public cmd servers -- start
  4652. proc pub_servers {nick uhost hand chan rest} {
  4653. global server
  4654. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Server: Current Server is $server"
  4655. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! servers"
  4656. return 0
  4657. }
  4658. ## public cmd servers -- stop
  4659.  
  4660. ## publuc cmd quit -- strt
  4661. proc pub_quit {nick uhost hand channel rest} {
  4662. puthelp "NOTICE $nick :\002\[4damn4!\]\002 quit is only available via dcc chat."
  4663. }
  4664. ## public cmd quit -- stop
  4665.  
  4666. ## public cmd k -- start
  4667. proc pub_k {nick uhost hand channel rest} {
  4668. global CC botnick
  4669. if {[matchattr $hand Q] == 0} {
  4670. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  4671. return 0
  4672. }
  4673. if {$rest==""} {
  4674. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}k <nick> \[reason\]"
  4675. }
  4676. if {$rest!=""} {
  4677. pub_kick $nick $uhost $hand $channel $rest
  4678. }
  4679. }
  4680. ## public cmd k -- stop
  4681.  
  4682. ## public cmd kick -- start
  4683. proc pub_kick {nick uhost hand channel rest} {
  4684. global botnick
  4685. if {[matchattr $hand Q] == 0} {
  4686. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  4687. return 0
  4688. }
  4689. if {[botisop $channel]==1} {
  4690. if {$rest == ""} {
  4691. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: kick <nick> \[reason\]"
  4692. return 0
  4693. }
  4694. set handle [lindex $rest 0]
  4695. set reason [lrange $rest 1 end]
  4696. if {![onchan $handle $channel]} {
  4697. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $handle is not on the channel!"
  4698. return 0
  4699. }
  4700. if {[onchansplit $handle $channel]} {
  4701. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $handle is currently net-split."
  4702. return 0
  4703. }
  4704. if {$reason == ""} {
  4705. set reason "$nick, damn RuLz!"
  4706. }
  4707. if {[string tolower $handle] == [string tolower $botnick]} {
  4708. putserv "KICK $channel $nick :Mad-4\[ 4Yuck 4Fou \]-Kick"
  4709. return 0
  4710. } else {
  4711. if {[matchattr $handle n] == 1} {
  4712. putserv "KICK $channel $nick :Mad-4\[ 4Yuck 4Fou \]-Kick"
  4713. return 0
  4714. } else {
  4715. putserv "KICK $channel $handle :4DamN\[ $reason 4\]4!!!!"
  4716. if {$reason == ""} {set reason "$nick, damn RuLz!"}
  4717. putcmdlog "\002\[4damn4!\]\002 #$hand# kick $handle $reason"
  4718. return 0
  4719. }
  4720. }
  4721. }
  4722. if {[botisop $channel]==0} {
  4723. puthelp "NOTICE $nick :\002\[4damn4!\]\002 I am not oped"
  4724. }
  4725. }
  4726. ## dcc cmd kick -- stop
  4727.  
  4728. ## public cmd mdeop -- start
  4729. proc cmd_mdeop {hand idx arg} {
  4730. global botnick
  4731. set args [lindex $arg 0]
  4732. if {$args == ""} {
  4733. putdcc $idx "\002\[4damn4!\]\002 Usage: mdeop <#channel>"
  4734. }
  4735. if {$args != ""} {
  4736. dcc_massdeop $hand $idx $arg
  4737. }
  4738. }
  4739. ## public cmd mdeop -- stop
  4740.  
  4741. ## public cmd mop -- start
  4742. proc cmd_mop {hand idx arg} {
  4743. global botnick
  4744. if {[matchattr $hand Q] == 0} {
  4745. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  4746. return 0
  4747. }
  4748. set args [lindex $arg 0]
  4749. if {$args == ""} {
  4750. putdcc $idx "\002\[4damn4!\]\002 Usage: mop <#channel>"
  4751. }
  4752. if {$args != ""} {
  4753. dcc_massop $hand $idx $arg
  4754. }
  4755. }
  4756. ## public cmd mop -- stop
  4757.  
  4758. ## public cmd massdeop -- start
  4759. proc pub_massdeop {nick uhost hand chan rest} {
  4760. global botnick
  4761. if {[matchattr $hand Q] == 0} {
  4762. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  4763. return 0
  4764. }
  4765. set deopnicks ""
  4766. set mass 1
  4767. if {$mass==1} {
  4768. set deopnicks ""
  4769. set massdeop 0
  4770. set members [chanlist $chan]
  4771. foreach x $members {
  4772. if {([isop $x $chan] == 1) && ([onchansplit $x $chan] == 0) && ($x != $botnick) && ($x != $hand)} {
  4773. if {$massdeop < 6} {
  4774. append deopnicks " $x"
  4775. set massdeop [expr $massdeop + 1]
  4776. }
  4777. if {$massdeop == 6} {
  4778. set massdeop 0
  4779. putserv "MODE $chan -oooooo $deopnicks"
  4780. set deopnicks ""
  4781. append deopnicks " $x"
  4782. set massdeop 1
  4783. }
  4784. }
  4785. }
  4786. putserv "MODE $chan -oooooo $deopnicks"
  4787. putlog "\002\[4damn4!\]\002 #$hand# massdeop"
  4788. }
  4789. }
  4790. ## public cmd massdeop -- stop
  4791.  
  4792. ## public cmd massop -- start
  4793. proc pub_massop {nick uhost hand chan rest} {
  4794. global botnick
  4795. if {[matchattr $hand Q] == 0} {
  4796. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  4797. return 0
  4798. }
  4799. set deopnicks ""
  4800. set mass 1
  4801. if {$mass == 1} {
  4802. set opnicks ""
  4803. set massops 0
  4804. set members [chanlist $chan]
  4805. foreach x $members {
  4806. if {([isop $x $chan] == 0) && ([onchansplit $x $chan] == 0) && ($x != $botnick)} {
  4807. if {$massops < 6} {
  4808. append opnicks " $x"
  4809. set massops [expr $massops + 1]
  4810. }
  4811. if {$massops == 6} {
  4812. set massops 0
  4813. pushmode $chan +oooooo $opnicks
  4814. set opnicks ""
  4815. append opnicks " $x"
  4816. set massops 1
  4817. }
  4818. }
  4819. }
  4820. pushmode $chan +oooooo $opnicks
  4821. putlog "\002\[4damn4!\]\002 #$hand# massop"
  4822. }
  4823. }
  4824. ## public cmd massop -- stop
  4825.  
  4826. ## dcc cmd massdeop -- start
  4827. proc dcc_massdeop {hand idx arg} {
  4828. global botnick
  4829. set deopnicks ""
  4830. set mass 1
  4831. set chan [lindex $arg 0]
  4832. if {$chan == ""} {
  4833. putdcc $idx "\002\[\FL\]\002 Usage: massdeop <#channel>"
  4834. return 1
  4835. }
  4836. if {$mass==1} {
  4837. set deopnicks ""
  4838. set massdeop 0
  4839. set members [chanlist $chan]
  4840. foreach x $members {
  4841. if {([isop $x $chan] == 1) && ([onchansplit $x $chan] == 0) && ($x != $botnick) && ($x != $hand)} {
  4842. if {$massdeop < 6} {
  4843. append deopnicks " $x"
  4844. set massdeop [expr $massdeop + 1]
  4845. }
  4846. if {$massdeop == 6} {
  4847. set massdeop 0
  4848. putserv "MODE $chan -oooooo $deopnicks"
  4849. set deopnicks ""
  4850. append deopnicks " $x"
  4851. set massdeop 1
  4852. }
  4853. }
  4854. }
  4855. putserv "MODE $chan -oooooo $deopnicks"
  4856. putlog "\002\[4damn4!\]\002 #$hand# massdeop"
  4857. }
  4858. }
  4859. ## dcc cmd massdeop -- stop
  4860.  
  4861. ## dcc cmd massop -- start
  4862. proc dcc_massop {hand idx arg} {
  4863. global botnick
  4864. set deopnicks ""
  4865. set mass 1
  4866. set chan [lindex $arg 0]
  4867. if {$chan == ""} {
  4868. putdcc $idx "\002\[\FL\]\002 Usage: massop <#channel>"
  4869. return 1
  4870. }
  4871. if {$mass == 1} {
  4872. set opnicks ""
  4873. set massops 0
  4874. set members [chanlist $chan]
  4875. foreach x $members {
  4876. if {([isop $x $chan] == 0) && ([onchansplit $x $chan] == 0) && ($x != $botnick)} {
  4877. if {$massops < 6} {
  4878. append opnicks " $x"
  4879. set massops [expr $massops + 1]
  4880. }
  4881. if {$massops == 6} {
  4882. set massops 0
  4883. pushmode $chan +oooooo $opnicks
  4884. set opnicks ""
  4885. append opnicks " $x"
  4886. set massops 1
  4887. }
  4888. }
  4889. }
  4890. pushmode $chan +oooooo $opnicks
  4891. putlog "\002\[4damn4!\]\002 #$hand# massop"
  4892. }
  4893. }
  4894. ## dcc cmd massop -- stop
  4895.  
  4896. ## public cmd kickban -- start
  4897. proc pub_kickban {nick uhost hand channel rest} {
  4898. global botnick CC ban-time
  4899. if {[matchattr $hand Q] == 0} {
  4900. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  4901. return 0
  4902. }
  4903. if {[botisop $channel]==1} {
  4904. if {$rest == ""} {
  4905. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}kickban <nick> \[reason\]"
  4906. return 0
  4907. }
  4908. if {$rest!=""} {
  4909. set handle [lindex $rest 0]
  4910. set reason [lrange $rest 1 end]
  4911. append userhost $handle "!*" [getchanhost $handle $channel]
  4912. set hostmask [maskhost $userhost]
  4913. if {![onchan $handle $channel]} {
  4914. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $handle is not on the channel."
  4915. return 0
  4916. }
  4917. if {[onchansplit $handle $channel]} {
  4918. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $handle is currently net-split."
  4919. return 0
  4920. }
  4921. if {[string tolower $handle] == [string tolower $botnick]} {
  4922. putserv "KICK $channel $nick :Mad-4\[ 4Yuck 4Fou \]-Kick"
  4923. return 0
  4924. }
  4925. if {$reason == ""} {
  4926. set reason "$nick, damn RuLz!"
  4927. }
  4928. set options [lindex $reason 0]
  4929. if {[string index $options 0] == "-"} {
  4930. set options [string range $options 1 end]
  4931. }
  4932. switch -exact $options {
  4933. perm {
  4934. set reason [lrange $reason 1 end]
  4935. newchanban $channel $hostmask $nick "$reason" 0
  4936. if {$reason == ""} {set reason "$nick, damn RuLz!"}
  4937. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! kicban $channel $hostmask $options $reason"
  4938. putserv "KICK $channel $handle :4DamN\[ $reason 4\]4!!!!"
  4939. return 0
  4940. }
  4941. min {
  4942. if {[val [lindex $reason 1]] == ""} {
  4943. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Error, invalid time period"
  4944. return 0
  4945. }
  4946. set time [lindex $reason 1]
  4947. set reason [lrange $reason 2 end]
  4948. newchanban $channel $hostmask $nick "$reason" $time
  4949. if {$reason == ""} {set reason "$nick, damn RuLz!"}
  4950. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! kicban $channel $hostmask $options $reason"
  4951. putserv "KICK $channel $handle :4DamN\[ $reason 4\]4!!!!"
  4952. return 0
  4953. }
  4954. hours {
  4955. if {[val [lindex $reason 1]] == ""} {
  4956. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Error, invalid time period"
  4957. return 0
  4958. }
  4959. set time [expr [lindex $reason 1]*60]
  4960. set reason [lrange $reason 2 end]
  4961. newchanban $channel $hostmask $nick "$reason" $time
  4962. if {$reason == ""} {set reason "$nick, damn RuLz!"}
  4963. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! kicban $channel $hostmask $options $reason"
  4964. putserv "KICK $channel $handle :4DamN\[ $reason 4\]4!!!!"
  4965. return 0
  4966. }
  4967. days {
  4968. if {[val [lindex $reason 1]] == ""} {
  4969. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Error, invalid time period"
  4970. return 0
  4971. }
  4972. set time [expr [expr [lindex $reason 1]*60]*24]
  4973. set reason [lrange $reason 2 end]
  4974. newchanban $channel $hostmask $nick "$reason" $time
  4975. if {$reason == ""} {set reason "$nick, damn RuLz!"}
  4976. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! kicban $channel $hostmask $options $reason"
  4977. putserv "KICK $channel $handle :4DamN\[ $reason 4\]4!!!!"
  4978. return 0
  4979. }
  4980. weeks {
  4981. if {[val [lindex $reason 1]] == ""} {
  4982. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Error, invalid time period"
  4983. return 0
  4984. }
  4985. set time [expr [expr [expr [lindex $reason 1]*60]*24]*7]
  4986. set reason [lrange $reason 2 end]
  4987. newchanban $channel $hostmask $nick "$reason" $time
  4988. if {$reason == ""} {set reason "$nick, damn RuLz!"}
  4989. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! kicban $channel $hostmask $options $reason"
  4990. putserv "KICK $channel $handle :4DamN\[ $reason 4\]4!!!!"
  4991. return 0
  4992. }
  4993. }
  4994. set reason [lrange $reason 1 end]
  4995. newchanban $channel $hostmask $nick "$reason" $ban-time
  4996. if {$reason == ""} {set reason "$nick, damn RuLz!"}
  4997. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! kicban $channel $hostmask $options $reason"
  4998. putserv "KICK $channel $handle :4DamN\[ $reason 4\]4!!!!"
  4999. return 0
  5000. }
  5001. }
  5002. if {[isop $botnick $channel]!=1} {
  5003. puthelp "NOTICE $nick :\002\[4damn4!\]\002 I am not oped"
  5004. }
  5005. }
  5006. ## public cmd kickban -- stop
  5007.  
  5008. ## public cmd kb -- start
  5009. proc pub_kb {nick uhost hand channel rest} {
  5010. global botnick CC
  5011. if {[matchattr $hand Q] == 0} {
  5012. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  5013. return 0
  5014. }
  5015. if {[botisop $channel]==1} {
  5016. if {$rest == ""} {
  5017. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: ${CC}kb <nick> \[reason\]"
  5018. return 0
  5019. }
  5020. if {$rest!=""} {
  5021. set handle [lindex $rest 0]
  5022. set reason [lrange $rest 1 end]
  5023. append userhost $handle "!*" [getchanhost $handle $channel]
  5024. set hostmask [maskhost $userhost]
  5025. if {![onchan $handle $channel]} {
  5026. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $handle is not on the channel."
  5027. return 0
  5028. }
  5029. if {[onchansplit $handle $channel]} {
  5030. puthelp "NOTICE $nick :\002\[4damn4!\]\002 $handle is currently net-split."
  5031. return 0
  5032. }
  5033. if {[string tolower $handle] == [string tolower $botnick]} {
  5034. putserv "KICK $channel $nick :4DamN\[ Don't Do That !!! 4\]4!!!!"
  5035. return 0
  5036. }
  5037. if {$reason == ""} {
  5038. set reason "$nick, damn RuLz!"
  5039. }
  5040. set options [lindex $reason 0]
  5041. if {[string index $options 0] == "-"} {
  5042. set options [string range $options 1 end]
  5043. }
  5044. switch -exact $options {
  5045. perm {
  5046. set reason [lrange $reason 1 end]
  5047. newchanban $channel $hostmask $nick "$reason" 0
  5048. if {$reason == ""} {set reason "$nick, damn RuLz!"}
  5049. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! kicban $channel $hostmask $options $reason"
  5050. putserv "KICK $channel $handle :4DamN\[ $reason 4\]4!!!!"
  5051. return 0
  5052. }
  5053. min {
  5054. if {[val [lindex $reason 1]] == ""} {
  5055. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Error, invalid time period"
  5056. return 0
  5057. }
  5058. set time [lindex $reason 1]
  5059. set reason [lrange $reason 2 end]
  5060. newchanban $channel $hostmask $nick "$reason" $time
  5061. if {$reason == ""} {set reason "$nick, damn RuLz!"}
  5062. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! kicban $channel $hostmask $options $reason"
  5063. putserv "KICK $channel $handle :4DamN\[ $reason 4\]4!!!!"
  5064. return 0
  5065. }
  5066. hours {
  5067. if {[val [lindex $reason 1]] == ""} {
  5068. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Error, invalid time period"
  5069. return 0
  5070. }
  5071. set time [expr [lindex $reason 1]*60]
  5072. set reason [lrange $reason 2 end]
  5073. newchanban $channel $hostmask $nick "$reason" $time
  5074. if {$reason == ""} {set reason "$nick, damn RuLz!"}
  5075. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! kicban $channel $hostmask $options $reason"
  5076. putserv "KICK $channel $handle :4DamN\[ $reason 4\]4!!!!"
  5077. return 0
  5078. }
  5079. days {
  5080. if {[val [lindex $reason 1]] == ""} {
  5081. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Error, invalid time period"
  5082. return 0
  5083. }
  5084. set time [expr [expr [lindex $reason 1]*60]*24]
  5085. set reason [lrange $reason 2 end]
  5086. newchanban $channel $hostmask $nick "$reason" $time
  5087. if {$reason == ""} {set reason "$nick, damn RuLz!"}
  5088. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! kicban $channel $hostmask $options $reason"
  5089. putserv "KICK $channel $handle :4DamN\[ $reason 4\]4!!!!"
  5090. return 0
  5091. }
  5092. weeks {
  5093. if {[val [lindex $reason 1]] == ""} {
  5094. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Error, invalid time period"
  5095. return 0
  5096. }
  5097. set time [expr [expr [expr [lindex $reason 1]*60]*24]*7]
  5098. set reason [lrange $reason 2 end]
  5099. newchanban $channel $hostmask $nick "$reason" $time
  5100. if {$reason == ""} {set reason "$nick, damn RuLz!"}
  5101. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! kicban $channel $hostmask $options $reason"
  5102. putserv "KICK $channel $handle :4DamN\[ $reason 4\]4!!!!"
  5103. return 0
  5104. }
  5105. }
  5106. set reason [lrange $reason 1 end]
  5107. newchanban $channel $hostmask $nick "$reason" 0
  5108. if {$reason == ""} {set reason "$nick, damn RuLz!"}
  5109. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! kicban $channel $hostmask $options $reason"
  5110. putserv "KICK $channel $handle :4DamN\[ $reason 4\]4!!!!"
  5111. return 0
  5112. }
  5113. }
  5114. if {[isop $botnick $channel]!=1} {
  5115. puthelp "NOTICE $nick :\002\[4damn4!\]\002 I am not oped"
  5116. }
  5117. }
  5118. ## public cmd ban -- stop
  5119.  
  5120. ## public cmd info -- start
  5121. proc pub_info {nick uhost hand chan rest} {
  5122. global botnick
  5123. # puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command is only available via dcc chat"
  5124. # return 0
  5125. if {[matchattr $hand Q] == 0} {
  5126. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  5127. return 0
  5128. }
  5129. if {$rest==""} {
  5130. set wowthatinfo [getuser $hand INFO]
  5131. if {$wowthatinfo==""} {set wowthatinfo "No info is set"}
  5132. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Info: $wowthatinfo"
  5133. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! info"
  5134. return 0
  5135. }
  5136. if {$rest!=""} {
  5137. if {[string toupper $rest]=="NONE"} {
  5138. setuser $hand info ""
  5139. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Your info has been cleared"
  5140. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! info none"
  5141. return 0
  5142. }
  5143. if {[string toupper $rest]!="NONE"} {
  5144. setuser $hand info $rest
  5145. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Your info is now $rest"
  5146. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! info $rest"
  5147. return 0
  5148. }
  5149. }
  5150. }
  5151. ## public cmd info -- stop
  5152.  
  5153. ## public cmd get -- start
  5154. proc pub_get {nick uhost hand chan rest} {
  5155. global botnick
  5156. if {[matchattr $hand Q] == 0} {
  5157. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  5158. return 0
  5159. }
  5160. set rest [lindex $rest 0]
  5161. if {$rest==""} {
  5162. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: get <file #>"
  5163. }
  5164. if {$rest!=""} {
  5165. set f 0
  5166. if {[catch {set numberoffile [expr $rest-1]}]==1} {
  5167. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: get <file #>"
  5168. return 0
  5169. }
  5170. foreach x [getfiles /] {
  5171. if {$x==[lrange [getfiles /] $numberoffile $numberoffile]} {
  5172. set f 1
  5173. }
  5174. }
  5175. if {$f==1} {
  5176. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Sending you [lrange [getfiles /] $numberoffile $numberoffile]"
  5177. dccsend dcc/[lrange [getfiles /] $numberoffile $numberoffile] $nick
  5178. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! get $rest"
  5179. return 0
  5180. }
  5181. if {$f!="1"} {
  5182. puhelp "NOTICE $nick :\002\[4damn4!\]\002 Incorrect file number"
  5183. }
  5184. }
  5185. }
  5186. ## public cmd get -- stop
  5187.  
  5188. ## dcc cmd userlist -- start
  5189. proc cmd_userlist {hand idx args} {
  5190. set args [lindex $args 0]
  5191. set f [lindex $args 0]
  5192. if {[userlist $f] ==""} {
  5193. putdcc $idx "\002\[4damn4!\]\002 No users with flag(s) $f."
  5194. putcmdlog "\002\[4damn4!\]\002 #$hand# userlist $f"
  5195. return 0
  5196. }
  5197. if {[userlist $f] !=""} {
  5198. regsub -all " " [userlist $f] ", " userlist
  5199. putdcc $idx "\002\[4damn4!\]\002 Userlist: $userlist"
  5200. putcmdlog "\002\[4damn4!\]\002 #$hand# userlist $f"
  5201. return 0
  5202. }
  5203. }
  5204. ## dcc cmd userlist -- stop
  5205.  
  5206. ## public cmd userlist -- start
  5207. proc pub_userlist {nick uhost hand chan rest} {
  5208. set rest [lindex $rest 0]
  5209. set f [lindex $rest 0]
  5210. if {[userlist $f] ==""} {
  5211. puthelp "NOTICE $nick :\002\[4damn4!\]\002 No users with flag(s) \[$f\]"
  5212. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! userlist $f"
  5213. }
  5214. if {[userlist $f] !=""} {
  5215. set tester $f
  5216. if {$tester!=""} {set tester " \[$tester\]"}
  5217. regsub -all " " [userlist $f] ", " userlist
  5218. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Userlist$tester: $userlist"
  5219. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! userlist $f"
  5220. }
  5221. }
  5222. ## public cmd userlist -- stop
  5223.  
  5224. ## dcc cmd ramen -- start
  5225. proc cmd_ramen {hand idx args} {
  5226. global botnick
  5227. set cmd [string tolower [lindex $args 0]]
  5228. putdcc $idx "* $botnick makes you some good ass ramen noodles"
  5229. putdcc $idx "Enjoy!"
  5230. putcmdlog "\002\[4damn4!\]\002 #$hand# ramen"
  5231. return 0
  5232. }
  5233. ## dcc cmd ramen -- stop
  5234.  
  5235. ## public cmd pez -- start
  5236. proc pub_pez {nick uhost hand chan rest} {
  5237. global botnick
  5238. set cmd [string tolower [lindex $rest 0]]
  5239. puthelp "PRIVMSG $chan :\001ACTION rips open a pack of pez for $nick\001"
  5240. puthelp "PRIVMSG $chan :ENJOY!"
  5241. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! pez"
  5242. return 0
  5243. }
  5244. ## public cmd ramen -- start
  5245. proc pub_ramen {nick uhost hand chan rest} {
  5246. global botnick
  5247. set cmd [string tolower [lindex $rest 0]]
  5248. puthelp "PRIVMSG $chan :\001ACTION makes $nick some good ass ramen noodles.\001"
  5249. puthelp "PRIVMSG $chan :ENJOY!"
  5250. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! ramen"
  5251. return 0
  5252. }
  5253. ## public cmd ramen -- stop
  5254.  
  5255. ## public cmd ping -- start
  5256. proc pub_ping {nick uhost hand chan rest} {
  5257. global botnick
  5258. set cmd [string tolower [lindex $rest 0]]
  5259. puthelp "PRIVMSG $chan :${nick}, \002PONG\002"
  5260. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! ping"
  5261. }
  5262. ## public cmd ping -- stop
  5263.  
  5264. ## public cmd pong -- start
  5265. proc pub_pong {nick uhost hand chan rest} {
  5266. global botnick
  5267. set cmd [string tolower [lindex $rest 0]]
  5268. puthelp "PRIVMSG $chan :${nick}, \002PING\002"
  5269. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! pong"
  5270. }
  5271. ## public cmd pong -- stop
  5272.  
  5273. ## dcc cmd channels -- start
  5274. proc cmd_channels {hand idx args} {
  5275. putdcc $idx "\002\[4damn4!\]\002 Channels: [channels]"
  5276. putcmdlog "\002\[4damn4!\]\002 #$hand# channels"
  5277. }
  5278. ## dcc cmd channels --- stop
  5279.  
  5280. ## public cmd beer -- start
  5281. proc pub_beer {nick uhost hand chan rest} {
  5282. global botnick
  5283. set rest [string tolower [lindex $rest 0]]
  5284. if {$rest==""} {
  5285. puthelp "PRIVMSG $chan :\001ACTION hands $nick a frothy beer.\001"
  5286. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! beer"
  5287. return 0
  5288. }
  5289. switch $rest {
  5290. sixpack { putserv "PRIVMSG $chan :Here's some sixpacks, it's on me... =]"
  5291. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! beer $rest"
  5292. return 0 }
  5293. keg { putserv "PRIVMSG $chan :Hey...lets go in the woods and have a kegger!"
  5294. putserv "PRIVMSG $chan :hurry up and give me one =]"
  5295. putserv "PRIVMSG $chan :Damn...I can't walk....tink I am done..."
  5296. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! beer $rest"
  5297. return 0 }
  5298. mug { putserv "PRIVMSG $chan :Here's your mug of beer.... <g>"
  5299. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! beer $rest"
  5300. return 0 }
  5301. can { putserv "PRIVMSG $chan :\001ACTION calls Fido\001"
  5302. putserv "PRIVMSG $chan :Fido...get me a beer...thx"
  5303. putserv "PRIVMSG $chan :\001ACTION hands $nick a can of beer\001"
  5304. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! beer $rest"
  5305. return 0 }
  5306. tap { putserv "PRIVMSG $chan :\001ACTION puts his head under the tap\001"
  5307. putserv "PRIVMSG $chan :\001ACTION opens his mouth\001"
  5308. putserv "PRIVMSG $chan :\001ACTION gets plastered\001"
  5309. putserv "PRIVMSG $chan :Sorry....all gone =P"
  5310. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! beer $rest"
  5311. return 0 }
  5312. time { putserv "PRIVMSG $chan :Guess what time it is guys?"
  5313. if {[isop $botnick $chan]==1} {
  5314. putserv "TOPIC $chan :\002It's Beer Time!!"}
  5315. if {[isop $botnick $chan]!=1} {
  5316. putserv "PRIVMSG $chan :\002It's Beer Time!!"}
  5317. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! beer $rest"
  5318. return 0 }
  5319. help { putserv "NOTICE $nick :\002\[4damn4!\]\002 Beer Help"
  5320. putserv "NOTICE $nick :\002\[4damn4!\]\002 Usage: beer <command>"
  5321. putserv "NOTICE $nick :\002\[4damn4!\]\002 Usable Beer Types Are:"
  5322. putserv "NOTICE $nick :\002\[4damn4!\]\002 Sixpack, Keg, Mug, Can, Tap, Time"
  5323. putserv "NOTICE $nick :\002\[4damn4!\]\002 End Of Help -"
  5324. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! beer $rest"
  5325. return 0 }
  5326. return 0
  5327. }
  5328. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: beer <help | command>'"
  5329. }
  5330. ## public cmd beer -- stop
  5331.  
  5332. ## public cmd drug -- start
  5333. proc pub_drug {nick uhost hand chan rest} {
  5334. global botnick
  5335. set rest [string tolower [lindex $rest 0]]
  5336. if {$rest == ""} {
  5337. puthelp "PRIVMSG $chan :\001ACTION hands $nick a phat joint.\001"
  5338. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! drug"
  5339. return 0
  5340. }
  5341. switch $rest {
  5342. weed { putserv "PRIVMSG $chan :Here's some weed, now pack a bong =]"
  5343. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! drug $rest"
  5344. return 0 }
  5345. bud { putserv "PRIVMSG $chan :Beer or Weed?"
  5346. putserv "PRIVMSG $chan :...ummm...here's some of both..."
  5347. putserv "PRIVMSG $chan :Have a good time $nick <g>"
  5348. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! drug $rest"
  5349. return 0 }
  5350. shrooms { putserv "PRIVMSG $chan :Here's your shrooms, hope their good..."
  5351. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! drug $rest"
  5352. return 0 }
  5353. acid { putserv "PRIVMSG $chan :\001ACTION grabs some sheets\001"
  5354. putserv "PRIVMSG $chan :\001ACTION quickly eats one\001"
  5355. putserv "PRIVMSG $chan :HeRe'S YOUr shEEt $nick =]"
  5356. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! drug $rest"
  5357. return 0 }
  5358. time { putserv "PRIVMSG $chan :Guess what time it is guys?"
  5359. if {[isop $botnick $chan]==1} {
  5360. putserv "TOPIC $chan :\002It's Time for Drugs!!" }
  5361. if {[isop $botnick $chan]!=1} {
  5362. putserv "PRIVMSG $chan :\002It's Time for Drugs!!" }
  5363. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! drug $rest"
  5364. return 0 }
  5365. help { putserv "NOTICE $nick :\002\[4damn4!\]\002 Drug Help"
  5366. putserv "NOTICE $nick :\002\[4damn4!\]\002 Usage: drug <cmd>"
  5367. putserv "NOTICE $nick :\002\[4damn4!\]\002 Usable Drug Types Are:"
  5368. putserv "NOTICE $nick :\002\[4damn4!\]\002 Weed, Bud, Shrooms, Acid, Opium, "
  5369. putserv "NOTICE $nick :\002\[4damn4!\]\002 Extasy, Time"
  5370. putserv "NOTICE $nick :\002\[4damn4!\]\002 End Of Help -"
  5371. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! drug $rest"
  5372. return 0 }
  5373. opium { putserv "PRIVMSG $chan :Yummmy....$nick has good taste"
  5374. putserv "PRIVMSG $chan :\001ACTION packs a bowl for $nick\001"
  5375. putserv "PRIVMSG $chan :Here is OUR bowl of opium =P"
  5376. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! drug $rest"
  5377. return 0 }
  5378. extasy { putserv "PRIVMSG $chan :Wow....I love this shit..."
  5379. putserv "PRIVMSG $chan :\001ACTION gets two pills\001"
  5380. putserv "PRIVMSG $chan :\001ACTION gives $nick a pill"
  5381. putserv "PRIVMSG $chan :\001ACTION eats a pill"
  5382. putserv "PRIVMSG $chan :hey $nick where are the women?"
  5383. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! drug $rest"
  5384. return 0 }
  5385. return 0
  5386. }
  5387. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Usage: drug <help | command>"
  5388. }
  5389. ## public cmd drug -- stop
  5390.  
  5391. ## dcc cmd global -- start
  5392. proc cmd_global {hand idx args} {
  5393. set gsay [lindex $args 0]
  5394. global botnick
  5395. if {$gsay!=""} {
  5396. dccbroadcast "\002GLOBAL <${hand}@${botnick}>\002 : $gsay"
  5397. putcmdlog "\002\[4damn4!\]\002 #$hand# global $gsay"
  5398. }
  5399. if {$gsay==""} {
  5400. putdcc $idx "\002\[4damn4!\]\002 Usage: global <msg>"
  5401. }
  5402. }
  5403. ## dcc global -- stop
  5404.  
  5405. ## dcc cmd flagnote -- start
  5406. set oldflags "c d f j k m n o p x t h a v q"
  5407. set botflags "a b h l r s p"
  5408.  
  5409. proc cmd_flagnote {hand idx arg} {
  5410. global oldflags botflags
  5411. set whichflag [lindex $arg 0]
  5412. set message [lrange $arg 1 end]
  5413. if {$whichflag == "" || $message == ""} {
  5414. putdcc $idx "\002\[4damn4!\]\002 Usage: flagnote <flag> <msg>"
  5415. return 0
  5416. }
  5417. if {[string index $whichflag 0] == "+"} {
  5418. set whichflag [string index $whichflag 1]
  5419. }
  5420. set normwhichflag [string tolower $whichflag]
  5421. set boldwhichflag \[\002+$normwhichflag\002\]
  5422. if {([lsearch -exact $botflags $normwhichflag] > 0)} {
  5423. putdcc $idx "\002\[4damn4!\]\002 The flag $boldwhichflag is for bots only"
  5424. putdcc $idx "\002\[4damn4!\]\002 Choose from the following: $oldflags $newflags"
  5425. return 0
  5426. }
  5427. if {([lsearch -exact $oldflags $normwhichflag] < 0) && ([lsearch -exact $botflags $normwhichflag] < 0)} {
  5428. putdcc $idx "\002\[4damn4!\]\002 The flag $boldwhichflag is not a defined flag"
  5429. putdcc $idx "\002\[4damn4!\]\002 Choose from the following: $oldflags"
  5430. return 0
  5431. }
  5432. putlog "\002\[4damn4!\]\002 #$hand# flagnote [string tolower \[+$whichflag\]] ..."
  5433. putdcc $idx "\002\[4damn4!\]\002 Sending FlagNote to all $boldwhichflag users"
  5434. foreach user [userlist $normwhichflag] {
  5435. if {(![matchattr $user b])} {
  5436. sendnote $hand $user "$whichflag $message"
  5437. }
  5438. }
  5439. }
  5440. ## dcc cmd flagnote -- stop
  5441.  
  5442. ## public cmd time -- start
  5443. proc pub_time {nick uhost hand chan rest} {
  5444. global timezone
  5445. set fronttime [string range [time] 0 1]
  5446. set backtime [string range [time] 2 4]
  5447. if {$fronttime == "00"} {
  5448. puthelp "NOTICE $nick :\002\[4damn4!\]\002 The current time is 12$backtime AM $timezone"
  5449. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! time"
  5450. return 0
  5451. }
  5452. if {$fronttime < 12} {
  5453. puthelp "NOTICE $nick :\002\[4damn4!\]\002 The current time is $fronttime$backtime AM $timezone"
  5454. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! time"
  5455. return 0
  5456. }
  5457. if {$fronttime >= 12} {
  5458. putserv "NOTICE $nick :\002\[4damn4!\]\002 The current time is [expr $fronttime-12]$backtime PM $timezone"
  5459. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! time"
  5460. return 0
  5461. }
  5462. }
  5463. ## public cmd time -- stop
  5464.  
  5465. ## public cmd down -- start
  5466. proc pub_down {nick uhost hand channel rest} {
  5467. global botnick
  5468. if {[matchattr $hand Q] == 0} {
  5469. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  5470. return 0
  5471. }
  5472. if {[botisop $channel] != 1} {
  5473. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Im not oped, sorry."
  5474. return 0
  5475. }
  5476. if {[isop $nick $channel] == 1} {
  5477. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! down"
  5478. pushmode $channel -o $nick
  5479. } else {
  5480. puthelp "NOTICE $nick :\002\[4damn4!\]\002 You are already deoped."
  5481. return 0
  5482. }
  5483. }
  5484. ## public cmd down -- stop
  5485.  
  5486. ## public cmd up -- start
  5487. proc pub_up {nick uhost hand channel rest} {
  5488. global botnick
  5489. if {[matchattr $hand Q] == 0} {
  5490. puthelp "NOTICE $nick :\002\[4damn4!\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
  5491. return 0
  5492. }
  5493. if {[botisop $channel] != 1} {
  5494. puthelp "NOTICE $nick :\002\[4damn4!\]\002 Im not oped, sorry."
  5495. return 0
  5496. }
  5497. if {[isop $nick $channel] == 0} {
  5498. putlog "\002\[4damn4!\]\002 <<$nick>> !$hand! up"
  5499. pushmode $channel +o $nick
  5500. } else {
  5501. puthelp "NOTICE $nick :\002\[4damn4!\]\002 You are already oped."
  5502. return 0
  5503. }
  5504. }
  5505. ## public cmd up -- stop
  5506. putlog "\002\[4damn4!\]\002 ••••• 6damn6! TcL Loaded •••••"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement