Posted to tcl by cyruz at Thu Dec 14 16:19:46 GMT 2023view raw

  1. #Eggdrop Toolz v2.01 for Eggdrop v1.3.4 & up by tzun
  2. #All of the commands are explained at the beginning of each function.
  3. #Information on them can also be found if you type !help in a public chat.
  4. #To get more info on a specific command, type !help <command>.
  5.  
  6. putlog "Loading Toolz (C) 1998 by tzun..."
  7. putlog "Type !help in a public chat for more info."
  8.  
  9. ##### COMMANDS USED BY THIS SCRIPT #####
  10. proc say {who what} {
  11. puthelp "PRIVMSG $who :$what"
  12. }
  13. proc notice {who what} {
  14. puthelp "NOTICE $who :$what"
  15. }
  16. proc cleanarg {arg} {
  17. set temp ""
  18. for {set i 0} {$i < [string length $arg]} {incr i} {
  19. set char [string index $arg $i]
  20. if {($char != "\12") && ($char != "\15")} {
  21. append temp $char
  22. }
  23. }
  24. set temp [string trimright $temp "\}"]
  25. set temp [string trimleft $temp "\{"]
  26. return $temp
  27. }
  28.  
  29. ##### AUTH SECTION #####
  30. # The auth is a protection script so that ip spoofers won't be able to
  31. # use the commands, and take over channels. once you singoff, the auth
  32. # will expire.
  33. # Owners will be able to disable a user from using commands. This will
  34. # not allow them to auth themselves.
  35.  
  36. # The binds:
  37. bind pub n !disable pub:disable
  38. bind pub n !enable pub:enable
  39. bind msg - auth auth:auth
  40. bind sign - * auth:signcheck
  41. bind msg - deauth auth:deauth
  42.  
  43. # This is the command for owners to disable a user.
  44. # Usage: !disable <hand>
  45. proc pub:disable {nick host hand chan arg} {
  46. if {[llength $arg] < 1} {
  47. notice $nick "Usage: !disable <handle>"
  48. return 0
  49. }
  50. set who [lindex $arg 0]
  51. if {![validuser $who]} {
  52. notice $nick "$who is not a valid user."
  53. return 0
  54. }
  55. setuser $who XTRA AUTH "DEAD"
  56. notice $nick "Disabled $who"
  57. putcmdlog "<<$nick>> !$hand! disable $who"
  58. }
  59.  
  60. proc pub:enable {nick host hand chan arg} {
  61. if {[llength $arg] < 1} {
  62. notice $nick "Usage: !disable <handle>"
  63. return 0
  64. }
  65. set who [lindex $arg 0]
  66. if {![validuser $who]} {
  67. notice $nick "$who is not a valid user."
  68. return 0
  69. }
  70. setuser $who XTRA AUTH 0
  71. notice $nick "Enabled $who"
  72. putcmdlog "<<$nick>> !$hand! enable $who"
  73. }
  74.  
  75. # Usage: /msg $botnick auth <password>
  76. proc auth:auth {nick uhost hand arg} {
  77. global botnick
  78. set found 0
  79. foreach n [channels] {
  80. if {[onchan $nick $n]} {
  81. set found 1
  82. }
  83. }
  84. if {$found == 0} {return 0}
  85. if {[llength $arg] <1} {
  86. notice $nick "Usage: /msg $botnick auth <pass>"
  87. return 0
  88. }
  89. set pass [lindex $arg 0]
  90. if {$hand == "*"} {
  91. say $nick "You are not permitted to use my commands."
  92. return 0
  93. }
  94. if {[getuser $hand XTRA AUTH] == "DEAD"} {
  95. say $nick "Sorry, but you have been disabled from using my commands."
  96. return 0
  97. }
  98. if {[passwdok $hand $pass]} {
  99. setuser $hand XTRA "AUTH" "1"
  100. putcmdlog "<<$nick>> ($uhost) !$hand! AUTH ..."
  101. notice $nick "Password accepted."
  102. return 0
  103. } else {
  104. notice $nick "Password denied."
  105. }
  106. }
  107.  
  108. proc auth:signcheck {nick uhost hand chan reason} {
  109. if {$hand == "*"} {return 0}
  110. if {[getuser $hand XTRA AUTH] == "DEAD"} {
  111. return 0
  112. }
  113. setuser $hand XTRA "AUTH" "0"
  114. putlog "Auth for $hand expired."
  115. }
  116.  
  117. proc auth:check {hand} {
  118. set auth [getuser $hand XTRA "AUTH"]
  119. if {($auth == "") || ($auth == "0") || ($auth == "DEAD")} {
  120. return 0
  121. } else { return 1}
  122. }
  123.  
  124. proc auth:deauth {nick uhost hand arg} {
  125. if {[getuser $hand XTRA AUTH] == "DEAD"} {
  126. say $nick "Sorry, but you have been disabled from using my commands."
  127. return 0
  128. }
  129. if {$hand != "*"} {
  130. setuser $hand XTRA "AUTH" "0"
  131. putcmdlog "<<$nick>> ($uhost) !$hand! DEAUTH"
  132. notice $nick "Authentication has been removed."
  133. }
  134. }
  135.  
  136. ##### BINDS #############################
  137. bind pub p !bots pub:bots
  138. bind pub m|m !channels pub:channels
  139. bind pub o|o !ignore pub:ignore
  140. bind pub o|o !unignore pub:unignore
  141. bind pub n !chanset pub:chanset
  142. bind pub m|m !status pub:status
  143. bind pub m|m !flags pub:flags
  144. bind pub o|o !ignorelist pub:ignorelist
  145. bind pub o|o !banlist pub:banlist
  146. bind pub m !save pub:save
  147. bind pub m !reload pub:reload
  148. bind pub n !rehash pub:rehash
  149. bind pub n !restart pub:restart
  150. bind pub n !backup pub:backup
  151. bind pub n !forcebans pub:forcebans
  152. bind pub m !jump pub:jump
  153. bind pub - !time pub:time
  154. bind pub n !die pub:die
  155. bind pub o !act pub:act
  156. bind pub o !say pub:say
  157. bind pub - !mode pub:mode
  158. bind pub - !kick pub:kick
  159. bind pub - !ban pub:ban
  160. bind pub - !unban pub:unban
  161. bind pub - !voice pub:voice
  162. bind pub - !devoice pub:devoice
  163. bind pub n !link pub:link
  164. bind pub n !unlink pub:unlink
  165. bind pub p !ping pub:ping
  166. bind ctcr - PING pub:pingr
  167. bind pub - !op pub:op
  168. bind pub - !deop pub:deop
  169. bind pub o|o !opme pub:opme
  170. bind pub n !adduser pub:adduser
  171. bind pub n !broadcast pub:broadcast
  172. bind pub n !join pub:join
  173. bind pub n !part pub:part
  174. bind pub - !help pub:help
  175. bind pub - help pub:helpa
  176. bind pub n !chattr pub:chattr
  177. bind pub n !deluser pub:deluser
  178. bind pub n !addbot pub:addbot
  179. bind pub n !rmbot pub:rmbot
  180. bind pub n !addhost pub:addhost
  181. bind pub n !rmhost pub:rmhost
  182.  
  183. ##### BADWORD SECTION #####
  184. # Comment out the next lines if you would like to disable badword.
  185. # If you want to add one, just type this:
  186. # bind pubm - "*<your bad word>*" badword:kick
  187. # BE SURE TO KEEP THE STARS (*)
  188. # Script will not kick owners or masters of the bot.
  189. # If you would like to use this part, uncomment the following lines
  190. #bind pubm - "*fuck*" badword:kick
  191. #bind pubm - "*shit*" badword:kick
  192. #bind pubm - " ass*" badword:kick
  193. #bind pubm - "*cunt*" badword:kick
  194. #bind pubm - "*whore*" badword:kick
  195. #bind pubm - "*slut*" badword:kick
  196. #########################################
  197.  
  198. ##### GLOBALS #####
  199. set pub_pingchan ""
  200.  
  201. ##### PROCS #####
  202.  
  203. # Tells someone the time and date
  204. # Usage: !time
  205. proc pub:time {nick host hand chan arg} {
  206. notice $nick "[ctime [unixtime]]"
  207. }
  208.  
  209. # Tells the bot to stop running
  210. # Usage: !die [reason]
  211. proc pub:die {nick host hand chan arg} {
  212. if {(![auth:check $hand]) && (![isop $nick $chan])} {return 0}
  213. notice $nick "Sutting down... later!"
  214. putcmdlog "<<$nick>> !$hand! die $arg"
  215. die $arg
  216. }
  217.  
  218. # Jumps to a new server
  219. # Usage: !jump <server>[:port]
  220. proc pub:jump {nick host hand chan arg} {
  221. if {(![auth:check $hand]) && (![isop $nick $chan])} {return 0}
  222. notice $nick "Jumping to $arg..."
  223. jump $arg
  224. putlog "<<$nick>> !$hand! jump $arg"
  225. }
  226.  
  227. # Resets all bans to what they should be on the bot's banlist
  228. # Usage: !forcebans
  229. proc pub:forcebans {nick host hand chan arg} {
  230. if {(![auth:check $hand]) && (![isop $nick $chan])} {return 0}
  231. notice $nick "Resetting all bans to match my banlist..."
  232. resetbans $chan
  233. putcmdlog "<<$nick>> !$hand! forcebans"
  234. }
  235.  
  236. # Rehashes the bot
  237. # Usage: !rehash
  238. proc pub:rehash {nick host hand chan arg} {
  239. if {(![auth:check $hand]) && (![isop $nick $chan])} {return 0}
  240. notice $nick "Rehashing..."
  241. rehash
  242. putcmdlog "<<$nick>> !$hand! rehash"
  243. }
  244.  
  245. # Reloads the userfile
  246. # Usage: !reload
  247. proc pub:reload {nick host hand chan arg} {
  248. if {(![auth:check $hand]) && (![isop $nick $chan])} {return 0}
  249. notice $nick "Reloading..."
  250. reload
  251. putcmdlog "<<$nick>> !$hand! reload"
  252. }
  253.  
  254. # Restarts the bot
  255. # Usage: !restart
  256. proc pub:restart {nick host hand chan arg} {
  257. if {(![auth:check $hand]) && (![isop $nick $chan])} {return 0}
  258. notice $nick "restart..."
  259. restart
  260. putcmdlog "<<$nick>> !$hand! restart"
  261. }
  262.  
  263.  
  264. # Saves the userfile and channel file
  265. # Usage: !save
  266. proc pub:save {nick host hand chan arg} {
  267. if {(![auth:check $hand]) && (![isop $nick $chan])} {return 0}
  268. notice $nick "Saving channel file and user file..."
  269. save
  270. putcmdlog "<<$nick>> !$hand! save"
  271. }
  272.  
  273. # Makes a backup of the userfile
  274. # Usage: !backup
  275. proc pub:backup {nick host hand chan arg} {
  276. if {(![auth:check $hand]) && (![isop $nick $chan])} {return 0}
  277. notice $nick "Backing up the userfile..."
  278. backup
  279. putcmdlog "<<$nick>> !$hand! backup"
  280. }
  281.  
  282.  
  283. # Prints out a ban list
  284. # Usage: !banlist
  285. proc pub:banlist {nick host hand chan arg} {
  286. notice $nick "\002Global bans:\002"
  287. if {[banlist] == ""} {
  288. notice $nick "none"
  289. } else {
  290. foreach ig [banlist] {
  291. set what [lindex $ig 0]
  292. set by [lindex $ig 1]
  293. set comment [lindex $ig 4]
  294. notice $nick "$what - made by $by - $comment"
  295. }}
  296. notice $nick "\002Bans for $chan:\002"
  297. if {[banlist $chan] == ""} {
  298. notice $nick "none"
  299. } else {
  300. foreach b [banlist $chan] {
  301. set what [lindex $b 0]
  302. set by [lindex $b 5]
  303. set comment [lindex $b 1]
  304. notice $nick "$what - made by $by - $comment"
  305. }}
  306. }
  307.  
  308. # Prints out an ignore list
  309. # Usage: !ignorelist
  310. proc pub:ignorelist {nick host hand chan arg} {
  311. if {[ignorelist] == ""} {
  312. notice $nick "I don't have any ignores."
  313. return 0
  314. }
  315. notice $nick "Ignore list:"
  316. foreach ig [ignorelist] {
  317. set what [lindex $ig 0]
  318. set by [lindex $ig 4]
  319. set comment [lindex $ig 1]
  320. notice $nick "$what - made by $by - $comment"
  321. }
  322. }
  323.  
  324. # Gives the global bot flags for a person
  325. # Usage: !flags <handle>
  326. proc pub:flags {nick host hand chan arg} {
  327. if {[llength $arg]<1} {
  328. notice $nick "Usage: !flags <handle>"
  329. return 0
  330. }
  331. set who [lindex $arg 0]
  332. if {![validuser $who]} {
  333. notice $nick "I don't know who $who is."
  334. return 0
  335. }
  336. set flags [chattr $who]
  337. notice $nick "Global flags for $who: $flags"
  338. putcmdlog "<<$nick>> !$hand! flags $who"
  339. }
  340.  
  341. # Gives a bunch of statistics
  342. # Usage: !status
  343. proc pub:status {nick host hand chan arg} {
  344. global server botname version
  345. notice $nick "\002Bot statistics:\002"
  346. notice $nick "User records: [countusers]"
  347. notice $nick "My channels: [channels]"
  348. notice $nick "Linked bots: [bots]"
  349. notice $nick "My date: [date]"
  350. notice $nick "My time: [time]"
  351. notice $nick "My operating system: [unames]"
  352. notice $nick "Server: $server"
  353. notice $nick "My host: $botname"
  354. notice $nick "Eggdrop version: [lindex $version 0]"
  355. putcmdlog "<<$nick>> !$hand! status"
  356. }
  357.  
  358. # Changes the channel settings for a channel
  359. # Usage: !chanset <chan> <what> [args]
  360. proc pub:chanset {nick host hand chan arg} {
  361. if {(![auth:check $hand]) && (![isop $nick $chan])} {return 0}
  362. if {[llength $arg] < 2} {
  363. notice $nick "Usage: !chanset <#channel> <mode> \[args\]"
  364. return 0
  365. }
  366. set thechan [lindex $arg 0]
  367. set mode [lindex $arg 1]
  368. set a [lrange $arg 2 end]
  369. if {![validchan $thechan]} {
  370. notice $nick "I don't monitor that channel."
  371. return 0
  372. }
  373. channel set $thechan $mode $a
  374. putcmdlog "<<$nick>> !$hand! chanset $thechan $mode $a"
  375. }
  376.  
  377. # Lists the bots on the botnet
  378. # Usage: !bots
  379. proc pub:bots {nick host hand chan arg} {
  380. set bots [bots]
  381. notice $nick "Bots: $bots"
  382. putcmdlog "<<$nick>> !$hand! bots"
  383. }
  384.  
  385. # Lists the channels the bot is on
  386. # Usage: !channels
  387. proc pub:channels {nick host hand chan arg} {
  388. set chans [chanlist]
  389. notice $nick "Channels: $chans"
  390. putcmdlog "<<$nick>> !$hand! channels"
  391. }
  392.  
  393. # Makes a new ignore
  394. # Usage: !ignore <who/host> <life> <reason>
  395. proc pub:ignore {nick uhost hand chan args} {
  396. if {(![auth:check $hand]) && (![isop $nick $chan])} {return 0}
  397. set args [split [cleanarg $args]]
  398. if {[llength $args] < 3} {
  399. notice $nick "Usage: !ignore <nick/host> <time> <reason>"
  400. return 0
  401. }
  402. set who [lindex $args 0]
  403. set time [expr [lindex $args 1]]
  404. set reason [lrange $args 2 end]
  405. if {$hand == "*"} {return 0}
  406. if {([isop $hand $chan]) || ([matchattr $hand "|o" $chan]) || ([matchattr $hand "o"])} {
  407. if {![onchan $who $chan]} {
  408. set theban $who
  409. } else {
  410. set host [getchanhost $who $chan]
  411. set host [maskhost $host]
  412. set shost [split $host "!"]
  413. set theban "*!*[lindex $shost 1]"
  414. }
  415. newignore $theban $nick $reason $time
  416. putcmdlog "<<$nick>> !$hand! ignore $args"
  417. } else {
  418. notice $nick "You can't do that!"
  419. }
  420. }
  421.  
  422. # Kills an ignore
  423. # Usage: !unignore <ignore mask>
  424. proc pub:unignore {nick uhost hand chan args} {
  425. if {(![auth:check $hand]) && (![isop $nick $chan])} {return 0}
  426. set args [split [cleanarg $args]]
  427. if {[llength $args]<1} {
  428. notice $nick "Usage: !unignore <host>"
  429. return 0
  430. }
  431. set theban [lindex $args 0]
  432. if {$hand == "*"} {return 0}
  433. if {([isop $hand $chan]) || ([matchattr $hand "|o" $chan]) || ([matchattr $hand "o"])} {
  434. killignore $theban
  435. putcmdlog "<<$nick>> !$hand! unignore $chan $theban"
  436. } else {
  437. notice $nick "You can't do that!"
  438. }
  439. }
  440.  
  441.  
  442. # Says something on any channel
  443. # Usage: !say <chan> <what>
  444. proc pub:say {nick host hand chan arg} {
  445. global botnick
  446. if {![auth:check $hand]} {return 0}
  447. if {[llength $arg] < 2} {
  448. notice $nick "Usage: !say <chan> <what>"
  449. return 0
  450. }
  451. set thechan [lindex $arg 0]
  452. set what [lrange $arg 1 end]
  453. if {![onchan $botnick $thechan]} {
  454. notice $nick "I'm not on that channel."
  455. return 0
  456. }
  457. puthelp "PRIVMSG $chan :$what"
  458. notice $nick "Said to $thechan: $what"
  459. putcmdlog "<<$nick>> !$hand! ($thechan) !say $what"
  460. }
  461.  
  462. # Puts an action (/me) on a channel
  463. # Usage: !act <chan> <what>
  464. proc pub:act {nick host hand chan arg} {
  465. global botnick
  466. if {![auth:check $hand]} {return 0}
  467. if {[llength $arg] < 2} {
  468. notice $nick "Usage: !act <chan> <what>"
  469. return 0
  470. }
  471. set thechan [lindex $arg 0]
  472. set what [lrange $arg 1 end]
  473. if {![onchan $botnick $thechan]} {
  474. notice $nick "I'm not on that channel."
  475. return 0
  476. }
  477. puthelp "PRIVMSG $chan :\001ACTION $what\001"
  478. notice $nick "Act to $thechan: $what"
  479. putcmdlog "<<$nick>> !$hand! ($thechan) !act $what"
  480. }
  481.  
  482. # Changes a mode on the channel
  483. # Usage: !mode <mode change>
  484. # Ex: !mode +m, !mode +k booger
  485. proc pub:mode {nick uhost hand chan args} {
  486. if {(![auth:check $hand]) && (![isop $nick $chan])} {return 0}
  487. set args [cleanarg $args]
  488. if {[llength $args]<1} {
  489. notice $nick "Usage: !mode <mode change>"
  490. return 0
  491. }
  492. if {$hand == "*"} {return 0}
  493. if {([isop $hand $chan]) || ([matchattr $hand "|o" $chan]) || ([matchattr $hand "o"])} {
  494. putserv "MODE $chan $args"
  495. putcmdlog "<<$nick>> !$hand! mode $args"
  496. } else {
  497. notice $nick "You can't do that!"
  498. }
  499.  
  500. }
  501.  
  502. # Kicks someone off the channel
  503. # Usage: !kick <nick> <reason>
  504. # Ex: !kick Joe You suck!
  505. proc pub:kick {nick uhost hand chan args} {
  506. if {(![auth:check $hand]) && (![isop $nick $chan])} {return 0}
  507. set args [split [cleanarg $args]]
  508. if {[llength $args] < 2} {
  509. notice $nick "Usage: !kick <nick> <reason>"
  510. return 0
  511. }
  512. if {$hand == "*"} {return 0}
  513. if {([isop $hand $chan]) || ([matchattr $hand "|o" $chan]) || ([matchattr $hand "o"])} {
  514. set who [lindex $args 0]
  515. set reason [lrange $args 1 end]
  516. putserv "KICK $chan $who :$reason"
  517. putcmdlog "<<$nick>> !$hand! kick $args"
  518. } else {
  519. notice $nick "You can't do that!"
  520. }
  521. }
  522.  
  523. # Bans a nick/host off the channel
  524. # Usage: !ban <nick/host> <time> <reason>
  525. # nick/host :If you put a nick in, it will mask the host, but if you
  526. # put a host in, it will ban the host.
  527. # time: The time the ban will last (in minutes). 0 for permanent.
  528. proc pub:ban {nick uhost hand chan args} {
  529. if {(![auth:check $hand]) && (![isop $nick $chan])} {return 0}
  530. set args [split [cleanarg $args]]
  531. if {[llength $args] < 3} {
  532. notice $nick "Usage: !ban <nick/host> <time> <reason>"
  533. return 0
  534. }
  535. set who [lindex $args 0]
  536. set time [expr [lindex $args 1]]
  537. set reason [lrange $args 2 end]
  538. if {$hand == "*"} {return 0}
  539. if {([isop $hand $chan]) || ([matchattr $hand "|o" $chan]) || ([matchattr $hand "o"])} {
  540. if {![onchan $who $chan]} {
  541. set theban $who
  542. } else {
  543. set host [getchanhost $who $chan]
  544. set host [maskhost $host]
  545. set shost [split $host "!"]
  546. set theban "*!*[lindex $shost 1]"
  547. }
  548. newchanban $chan $theban $nick $reason $time
  549. putcmdlog "<<$nick>> !$hand! ban $args"
  550. } else {
  551. notice $nick "You can't do that!"
  552. }
  553. }
  554.  
  555. # Unbans a host from the channel
  556. # Usage: !unban <host>
  557. proc pub:unban {nick uhost hand chan args} {
  558. if {(![auth:check $hand]) && (![isop $nick $chan])} {return 0}
  559. set args [split [cleanarg $args]]
  560. if {[llength $args]<1} {
  561. notice $nick "Usage: !unban <host>"
  562. return 0
  563. }
  564. set theban [lindex $args 0]
  565. if {$hand == "*"} {return 0}
  566. if {([isop $hand $chan]) || ([matchattr $hand "|o" $chan]) || ([matchattr $hand "o"])} {
  567. killchanban $chan $theban
  568. putcmdlog "<<$nick>> !$hand! unban $chan $theban"
  569. } else {
  570. notice $nick "You can't do that!"
  571. }
  572. }
  573.  
  574. # Adds a user
  575. # Usage: !adduser <nick> [host]
  576. # If you leave out 'host', it will take the 'nick', and mask a host.
  577. proc pub:adduser {nick uhost hand chan args} {
  578. if {![auth:check $hand]} {return 0}
  579. set args [split [cleanarg $args]]
  580. global botnick admin
  581. if {[llength $args]<1} {
  582. notice $nick "Usage: !adduser <nick> \[host\]"
  583. return 0
  584. }
  585. if {$nick == $botnick} {return 0}
  586. if {[getting-users]} {
  587. notice $nick "Sorry, there is currently a userfile transfer going on. Try back in a couple of seconds."
  588. return 0
  589. }
  590. set who [lindex $args 0]
  591. if {[llength $args]==2} {
  592. set host [lindex args 1]
  593. } else {
  594. if {![onchan $who $chan]} {
  595. say $chan "$nick: $who is not on this channel."
  596. return 0
  597. }
  598. set host [maskhost [getchanhost $who $chan]]
  599. }
  600. set err [adduser $who $host]
  601. if {$err == 0} {
  602. say $chan "That nick already exists."
  603. return 0
  604. }
  605. putcmdlog "<<$nick>> !$hand! adduser $who $host"
  606.  
  607. if {![onchan $who $chan]} {return 0}
  608. notice $who "Your account has been added with the hostmask $host."
  609. notice $who "Type /msg $botnick PASS <yourpass> to set your password."
  610. notice $who "After you have set your password, type /dcc chat $botnick to start a dcc chat session."
  611. notice $who "If you have any problems, please contact $admin"
  612. }
  613.  
  614. # Gives someone voice in the channel
  615. # Usage: !voice <nick>
  616. proc pub:voice {nick uhost hand chan args} {
  617. if {(![auth:check $hand]) && (![isop $nick $chan])} {return 0}
  618. set args [split [cleanarg $args]]
  619. if {[llength $args]<1} {
  620. notice $nick "Usage: !voice <nick>"
  621. return 0
  622. }
  623. set who [lindex $args 0]
  624. if {$hand == "*"} {return 0}
  625. if {([isop $hand $chan]) || ([matchattr $hand "|o" $chan]) || ([matchattr $hand "o"])} {
  626. putserv "MODE $chan +v $who"
  627. } else {
  628. notice $nick "You can't do that!"
  629. }
  630. putcmdlog "<<$nick>> !$hand! voice $chan $who"
  631. }
  632.  
  633. # Takes away voice from someone in the channel
  634. # Usage: !devoice <nick>
  635. proc pub:devoice {nick uhost hand chan args} {
  636. if {(![auth:check $hand]) && (![isop $nick $chan])} {return 0}
  637. set args [split [cleanarg $args]]
  638. if {[llength $args]<1} {
  639. notice $nick "Usage: !devoice $nick"
  640. return 0
  641. }
  642. set who [lindex $args 0]
  643. if {$hand == "*"} {return 0}
  644. if {([isop $hand $chan]) || ([matchattr $hand "|o" $chan]) || ([matchattr $hand "o"])} {
  645. putserv "MODE $chan -v $who"
  646. } else {
  647. notice $nick "You can't do that!"
  648. }
  649. putcmdlog "<<$nick>> !$hand! devoice $chan $who"
  650. }
  651.  
  652. # Trys to link to another bot
  653. # Usage: !link <bot>
  654. proc pub:link {nick uhost hand chan args} {
  655. if {![auth:check $hand]} {return 0}
  656. set args [split [cleanarg $args]]
  657. if {[llength $args]<1} {
  658. notice $nick "Usage: !link <bot>"
  659. return 0
  660. }
  661. if {[getting-users]} {
  662. notice $nick "Sorry, there is currently a userfile transfer going on. Try back in a couple of seconds."
  663. return 0
  664. }
  665. set who [lindex $args 0]
  666. say $chan "$nick: Trying to link to $who..."
  667. set err [link $who]
  668. if {$err == 0} {
  669. say $chan "$nick: An error occured."
  670. }
  671. }
  672.  
  673. # Unlink from a bot
  674. # Usage: !unlink <bot>
  675. proc pub:unlink {nick uhost hand chan args} {
  676. if {![auth:check $hand]} {return 0}
  677. set args [split [cleanarg $args]]
  678. if {[llength $args]<1} {
  679. notice $nick "Usage: !unlink <bot>"
  680. return 0
  681. }
  682. if {[getting-users]} {
  683. notice $nick "Sorry, there is currently a userfile transfer going on. Try back in a couple of seconds."
  684. return 0
  685. }
  686. set who [lindex $args 0]
  687. say $chan "$nick: Trying to unlink from $who..."
  688. set err [link $who]
  689. if {$err == 0} {say $chan "AAAH! An error occured!"}
  690. if {$err == 1} {say $chan "And... SUCCESS!"}
  691. }
  692.  
  693. # Pings a person from the bot
  694. # Usage: !ping <nick>
  695. proc pub:ping {nick uhost hand chan args} {
  696. if {![auth:check $hand]} {return 0}
  697. set args [split [cleanarg $args]]
  698. if {[llength $args]<1} {
  699. set who $nick
  700. } else {
  701. set who [lindex $args 0]
  702. }
  703. global pub_pingchan
  704. set time [unixtime]
  705. say $who "\001PING $time\001"
  706. set pub_pingchan $chan
  707. putcmdlog "<<$nick>> !$hand! PING $who : $time"
  708. }
  709.  
  710. # This is the ping reply function.
  711. proc pub:pingr {nick uhost hand dest keyword args} {
  712. global pub_pingchan
  713. set temp [unixtime]
  714. set time [expr $temp - $args]
  715. putlog "PING reply from $nick: $time seconds"
  716. say $pub_pingchan "PING reply from $nick: $time seconds"
  717. }
  718.  
  719. # Op someone in the channel
  720. # Usage: !op <nick>
  721. proc pub:op {nick uhost hand chan args} {
  722. if {(![auth:check $hand]) && (![isop $nick $chan])} {return 0}
  723. set args [split [cleanarg $args]]
  724. if {[llength $args] == 0 && ([matchattr $hand n] || [matchattr $hand "|n" $chan] || [matchattr $hand o $chan] || [matchattr $hand "|o" $chan])} {
  725. putserv "MODE $chan +o $nick"
  726. }
  727. if {[llength $args]<1} {
  728. notice $nick "Usage: !op <nick>"
  729. return 0
  730. }
  731. set who [lindex $args 0]
  732. if {$hand == "*"} {return 0}
  733. if {([isop $hand $chan]) || ([matchattr $hand "|o" $chan]) || ([matchattr $hand "o"])} {
  734. putserv "MODE $chan +o $who"
  735. putcmdlog "<<$nick>> !$hand! op $chan $who"
  736. } else {
  737. notice $nick "You can't do that!"
  738. }
  739. }
  740.  
  741. # Deop someone in the channel
  742. # Usage: !deop <nick>
  743. proc pub:deop {nick uhost hand chan args} {
  744. if {(![auth:check $hand]) && (![isop $nick $chan])} {return 0}
  745. set args [split [cleanarg $args]]
  746. if {[llength $args]<1} {
  747. notice $nick "Usage: !deop <nick>"
  748. return 0
  749. }
  750. set who [lindex $args 0]
  751. if {$hand == "*"} {return 0}
  752. if {([isop $hand $chan]) || ([matchattr $hand "|o" $chan]) || ([matchattr $hand "o"])} {
  753. putserv "MODE $chan -o $who"
  754. putcmdlog "<<$nick>> !$hand! deop $chan $who"
  755. } else {
  756. notice $nick "You can't do that!"
  757. }
  758. }
  759.  
  760. # Ops you if you have op status on the bot
  761. # Usage: !opme
  762. proc pub:opme {nick uhost hand chan args} {
  763. if {![auth:check $hand]} {return 0}
  764. putserv "MODE $chan +o $nick"
  765. }
  766.  
  767. # Broadcasts a message to every channel the bot is on
  768. # Usage: !broadcast <message>
  769. # Ex: !broadcast The bot is coming down now!
  770. proc pub:broadcast {nick uhost hand chan args} {
  771. if {![auth:check $hand]} {return 0}
  772. set msg [cleanarg $args]
  773. foreach n [channels] {
  774. say $n $msg
  775. }
  776. }
  777.  
  778. # Makes the bot join a channel
  779. # Usage: !join <#channel>
  780. proc pub:join {nick uhost hand chan args} {
  781. if {![auth:check $hand]} {return 0}
  782. set args [cleanarg $args]
  783. if {[llength $args]<1} {
  784. notice $nick "Usage: !join <#channel>"
  785. return 0
  786. }
  787. channel add $args {+greet -bitch -autoop -bitch -stopnethack}
  788. }
  789.  
  790. # Makes the bot part a channel
  791. proc pub:part {nick uhost hand chan args} {
  792. if {![auth:check $hand]} {return 0}
  793. set args [cleanarg $args]
  794. if {[llength $args]<1} {
  795. notice $nick "Usage: !part <#channel>"
  796. return 0
  797. }
  798. channel remove $args
  799. }
  800.  
  801. # Changes the attr of a user
  802. # Usage: !chattr <nick> <options> [channel]
  803. proc pub:chattr {nick uhost hand chan args} {
  804. if {![auth:check $hand]} {return 0}
  805. set args [split [cleanarg $args]]
  806. if {[llength $args]<2} {
  807. notice $nick "Usage: !chattr <handle> <options> \[channel\]"
  808. return 0
  809. }
  810. if {[getting-users]} {
  811. notice $nick "Sorry, there is currently a userfile transfer going on. Try back in a couple of seconds."
  812. return 0
  813. }
  814. set who [lindex $args 0]
  815. set modes [lindex $args 1]
  816. set channel ""
  817. if {[llength $args]==3} {
  818. set channel [lindex $args 2]
  819. set temp "|"
  820. append temp $modes
  821. set modes $temp
  822. }
  823. if {$channel != ""} {
  824. set rt [chattr $who $modes $channel]
  825. } else {
  826. set rt [chattr $who $modes]
  827. }
  828. putcmdlog "<<$nick>> !$hand! chattr $args"
  829. if {$channel != ""} {
  830. set rt [lindex [split $rt "|"] 1]
  831. say $chan "Modes for $who on $channel are now $rt"
  832. } else {
  833. say $chan "Global modes for $who are now $rt"
  834. }
  835. }
  836.  
  837. # Deletes a user record
  838. # Usage: !deluser <handle>
  839. proc pub:deluser {nick uhost hand chan args} {
  840. if {![auth:check $hand]} {return 0}
  841. set args [split [cleanarg $args]]
  842. if {[llength $args]<1} {
  843. notice $nick "Usage: !deluser <handle>"
  844. return 0
  845. }
  846. if {[getting-users]} {
  847. notice $nick "Sorry, there is currently a userfile transfer going on. Try back in a couple of seconds."
  848. return 0
  849. }
  850. set who [lindex $args 0]
  851. set err [deluser $who]
  852. if {$err == 0} {
  853. say $chan "Attempt to remove $who failed."
  854. return 0
  855. }
  856. putcmdlog "<<$nick>> !$hand! deluser $who"
  857. }
  858.  
  859. # Adds a bot
  860. # Usage: !addbot <handle> <address:port>
  861. proc pub:addbot {nick uhost hand chan args} {
  862. if {![auth:check $hand]} {return 0}
  863. set args [split [cleanarg $args]]
  864. if {[llength $args]<2} {
  865. notice $nick "Usage: !addbot <handle> <address:port>"
  866. return 0
  867. }
  868. if {[llength [split [lindex $args 1] ":"]]!=2} {
  869. notice $nick "Usage: !addbot <handle> <address:port>"
  870. return 0
  871. }
  872. if {[getting-users]} {
  873. notice $nick "Sorry, there is currently a userfile transfer going on. Try back in a couple of seconds."
  874. return 0
  875. }
  876. set addr [lindex $args 1]
  877. set who [lindex $args 0]
  878. addbot $who $addr
  879. putcmdlog "<<$nick>> !$hand! addbot $who $addr"
  880. }
  881.  
  882. # Removes a bot
  883. # Usage: !rmbot <handle>
  884. proc pub:rmbot {nick uhost hand chan args} {
  885. if {![auth:check $hand]} {return 0}
  886. set args [split [cleanarg $args]]
  887. if {[llength $args]<1} {
  888. notice $nick "Usage: !rmbot <handle>"
  889. return 0
  890. }
  891. if {[getting-users]} {
  892. notice $nick "Sorry, there is currently a userfile transfer going on. Try back in a couple of seconds."
  893. return 0
  894. }
  895. set who [lindex $args 0]
  896. deluser $who
  897. putcmdlog "<<$nick>> !$hand! rmbot $who"
  898. }
  899.  
  900. # Adds hostmask for user
  901. # Usage: !addhost <handle> <host>
  902. proc pub:addhost {nick uhost hand chan args} {
  903. if {![auth:check $hand]} {return 0}
  904. set args [split [cleanarg $args]]
  905. if {[llength $args]<2} {
  906. notice $nick "Usage: !addhost <handle> <host>"
  907. return 0
  908. }
  909. if {[getting-users]} {
  910. notice $nick "Sorry, there is currently a userfile transfer going on. Try back in a couple of seconds."
  911. return 0
  912. }
  913. set who [lindex $args 0]
  914. set host [lindex $args 1]
  915. setuser $who HOSTS $host
  916. putcmdlog "<<$nick>> !$hand! addhost $who $host"
  917. }
  918.  
  919. # Removes host from user
  920. # Usage: !rmhost <handle> <host>
  921. proc pub:rmhost {nick uhost hand chan args} {
  922. if {![auth:check $hand]} {return 0}
  923. set args [split [cleanarg $args]]
  924. if {[llength $args]<2} {
  925. notice $nick "Usage: !rmhost <handle> <host>"
  926. return 0;
  927. }
  928. if {[getting-users]} {
  929. notice $nick "Sorry, there is currently a userfile transfer going on. Try back in a couple of seconds."
  930. return 0
  931. }
  932. set who [lindex $args 0]
  933. set host [lindex $args 1]
  934. delhost $who $host
  935. putcmdlog "<<$nick>> !$hand! rmhost $who $host"
  936. }
  937.  
  938. ##### HELP SECTION (QUITE LONG) #####
  939. proc pub:help {nick uhost hand chan args} {
  940. global botnick
  941. set args [split [cleanarg $args]]
  942. if {[llength $args]<1} {
  943. notice $nick "------\002Toolz Help: \002-------------------------------------------"
  944. notice $nick "!op <nick> - ops \002nick\002"
  945. notice $nick "!deop <nick> - deops \002nick\002"
  946. notice $nick "!ban <nick/host> <time> <reason> - bans a \002nick/host\002"
  947. notice $nick "!unban <host> - unbans \002host\002 from channel"
  948. notice $nick "!voice <nick> - gives \002nick\002 voice"
  949. notice $nick "!devoice <nick> - takes away \002nick\002's voice"
  950. notice $nick "!opme - ops you if you have access"
  951. notice $nick "!addbot <handle> <address:port> - adds a bot"
  952. notice $nick "!rmbot <handle> - removes a bot"
  953. notice $nick "!link <bot> - attempts to link to \002bot\002"
  954. notice $nick "!unlink <bot> - attempts to unlink from \002bot\002"
  955. notice $nick "!ping \[nick\] - pings \002nick\002, or you"
  956. notice $nick "!mode <mode change> - changes a mode setting on the channel"
  957. notice $nick "!adduser <handle/nick> \[host\] - adds a user"
  958. notice $nick "!deluser <handle> - removes \002handle\002 from user list"
  959. notice $nick "!chattr <handle> <options> \[channel\] - changes attributes for user"
  960. notice $nick "!part <#channel> - makes the bot leave the channel"
  961. notice $nick "!join <#channel> - makes the bot join a channel"
  962. notice $nick "!addhost <handle> <host> - adds a host to a user"
  963. notice $nick "!rmhost <handle> <host> - removes a host from a user"
  964. notice $nick "!disable <handle> - disables a handle from these commands"
  965. notice $nick "!enable <handle> - enables a disabled user"
  966. notice $nick "!act <chan> <what> - posts an action on chan"
  967. notice $nick "!say <chan> <what> - says something to chan"
  968. notice $nick "!bots - lists the bots linked on the botnet"
  969. notice $nick "!channels - lists the channels the bot is on"
  970. notice $nick "!ignore <nick/host> <time> <reason> - adds a new ignore"
  971. notice $nick "!unignore <host> - removes an ignore"
  972. notice $nick "!time - gives you the date and time"
  973. notice $nick "!die \[reason\] - shuts down the bot for \[reason\]"
  974. notice $nick "!jump <server>\[:port\] - makes the bot jump to a server"
  975. notice $nick "!forcebans - makes all bans match bans on bot"
  976. notice $nick "!rehash - rehashes the bot"
  977. notice $nick "!reload - reloads the userfile"
  978. notice $nick "!restart - restarts the bot"
  979. notice $nick "!save - saves the userfile and channel file"
  980. notice $nick "!backup - backs up the userfile"
  981. notice $nick "!banlist - gives you a banlist for global & channel bans"
  982. notice $nick "!ignorelist - gives you a list of ignores"
  983. notice $nick "!flags <handle> - gives you handle's global flags"
  984. notice $nick "!status - gives you some statistics"
  985. notice $nick "!chanset <chan> <mode> \[args\] - changes a channel setting"
  986. notice $nick "!help <command> - gives a detailed explaination of \002command\002"
  987. notice $nick "---------------------------------------------------------"
  988. notice $nick "------- type \002 !help <command>\002 to get more info ----------"
  989. notice $nick "\002NOTE: Before using any of there commands, you must\002"
  990. notice $nick "\002authenticate yourself with the bot by typeing:\002"
  991. notice $nick "\002/msg $botnick auth <your password>\002"
  992. #end
  993. } else {
  994. #start another long section
  995. switch [lindex $args 0] {
  996. "time" {
  997. notice $nick "\002-----time-----\002"
  998. notice $nick "Usage: !time"
  999. notice $nick "Flags Needed: none"
  1000. notice $nick " Tells you the current date and time."
  1001. }
  1002. "bots" {
  1003. notice $nick "\002-----bots-----\002"
  1004. notice $nick "Usage: !bots"
  1005. notice $nick "Flags Needed: party line (+p)"
  1006. notice $nick " Tells you the bots on the botnet."
  1007. }
  1008. "channels" {
  1009. notice $nick "\002-----channels-----\002"
  1010. notice $nick "Usage: !channels"
  1011. notice $nick "Flags Needed: channel or bot master"
  1012. notice $nick " Tells you the channels the bot is on."
  1013. }
  1014. "ignore" {
  1015. notice $nick "\002-----ignore-----\002"
  1016. notice $nick "Usage: !ignore <nick/host> <time> <reason>"
  1017. notice $nick "Flags Needed: global op"
  1018. notice $nick " Creates a new ignore. If nick is on the channel,"
  1019. notice $nick " it will get a hostmask from him, otherwise, it will"
  1020. notice $nick " get it from the one you specify."
  1021. }
  1022. "unignore" {
  1023. notice $nick "\002-----unignore-----\002"
  1024. notice $nick "Usage: !unignore <host>"
  1025. notice $nick "Flags Needed: global op"
  1026. notice $nick " Removes the ignore matching host."
  1027. }
  1028. "chanset" {
  1029. notice $nick "\002-----chanset-----\002"
  1030. notice $nick "Usage: !chanset <chan> <mode> \[args\]"
  1031. notice $nick "Flags Needed: bot owner"
  1032. notice $nick " Works just like the .chanset dcc command."
  1033. }
  1034. "status" {
  1035. notice $nick "\002-----status-----\002"
  1036. notice $nick "Usage: !status"
  1037. notice $nick "Flags Needed: channel or bot master"
  1038. notice $nick " Gives you some statistics about the bot."
  1039. }
  1040. "channels" {
  1041. notice $nick "\002-----flags-----\002"
  1042. notice $nick "Usage: !flags <handle>"
  1043. notice $nick "Flags Needed: channel or bot master"
  1044. notice $nick " Gives you the global flags of handle."
  1045. }
  1046. "ignorelist" {
  1047. notice $nick "\002-----ignorelist-----\002"
  1048. notice $nick "Usage: !ignorelist"
  1049. notice $nick "Flags Needed: channel or bot op"
  1050. notice $nick " Gives you a list of active ignores."
  1051. }
  1052. "banlist" {
  1053. notice $nick "\002-----banlist-----\002"
  1054. notice $nick "Usage: !banlist"
  1055. notice $nick "Flags Needed: channel or bot op"
  1056. notice $nick " Gives you a list of bans."
  1057. }
  1058. "save" {
  1059. notice $nick "\002-----save-----\002"
  1060. notice $nick "Usage: !save"
  1061. notice $nick "Flags Needed: bot master"
  1062. notice $nick " Saves the userfile and channel file to disk."
  1063. }
  1064. "reload" {
  1065. notice $nick "\002-----reload-----\002"
  1066. notice $nick "Usage: !reload"
  1067. notice $nick "Flags Needed: bot master"
  1068. notice $nick " Reloads the userfile from disk."
  1069. }
  1070. "rehash" {
  1071. notice $nick "\002-----rehash-----\002"
  1072. notice $nick "Usage: !rehash"
  1073. notice $nick "Flags Needed: bot owner"
  1074. notice $nick " Rehashes the bot."
  1075. }
  1076. "restart" {
  1077. notice $nick "\002-----restart-----\002"
  1078. notice $nick "Usage: !restart"
  1079. notice $nick "Flags Needed: bot owner"
  1080. notice $nick " Restarts the bot."
  1081. }
  1082. "backup" {
  1083. notice $nick "\002-----backup-----\002"
  1084. notice $nick "Usage: !backup"
  1085. notice $nick "Flags Needed: bot owner"
  1086. notice $nick " Backs up the user file."
  1087. }
  1088. "forcebans" {
  1089. notice $nick "\002-----forcebans-----\002"
  1090. notice $nick "Usage: !forcebans"
  1091. notice $nick "Flags Needed: bot owner"
  1092. notice $nick " Makes the bans on the channel match all bans in the bot's"
  1093. notice $nick " ban list."
  1094. }
  1095. "jump" {
  1096. notice $nick "\002-----jump-----\002"
  1097. notice $nick "Usage: !jump <server>\[:port\]"
  1098. notice $nick "Flags Needed: bot master"
  1099. notice $nick " Jumps to server on optional port."
  1100. }
  1101. "die" {
  1102. notice $nick "\002-----die-----\002"
  1103. notice $nick "Usage: !die \[reason\]"
  1104. notice $nick "Flags Needed: bot owner"
  1105. notice $nick " Shuts down the bot for optional reason."
  1106. }
  1107. "help" {
  1108. notice $nick "Dumbo."
  1109. }
  1110. "say" {
  1111. notice $nick "\002-----say-----\002"
  1112. notice $nick "Usage: !say <chan> <what>"
  1113. notice $nick "Flags Needed: global op on bot"
  1114. notice $nick " Will say \002what\002 to \002chan\002."
  1115. }
  1116. "act" {
  1117. notice $nick "\002-----act-----\002"
  1118. notice $nick "Usage: !act <chan> <what>"
  1119. notice $nick "Flags Needed: global op on bot"
  1120. notice $nick " Will post an action of \002what\002 to \002chan\002."
  1121. }
  1122. "op" {
  1123. notice $nick "\002-----op-----\002"
  1124. notice $nick "Usage: !op <nick>"
  1125. notice $nick "Flags Needed: op on channel, or op on bot"
  1126. notice $nick " Ops \002nick\002 on the current channel."
  1127. }
  1128. "disable" {
  1129. notice $nick "\002-----disable-----\002"
  1130. notice $nick "Usage: !disable <handle>"
  1131. notice $nick "Flags Needed: owner on bot"
  1132. notice $nick " Disables \002handle\002 from using all ! commands."
  1133. }
  1134. "enable" {
  1135. notice $nick "\002-----enable-----\002"
  1136. notice $nick "Usage: !enable <handle>"
  1137. notice $nick "Flags Needed: owner on bot"
  1138. notice $nick " Enables \002handle\002 to use all ! commands."
  1139. notice $nick " NOTE: Only needed if user has been \002!disable\002'ed."
  1140. }
  1141. "deop" {
  1142. notice $nick "\002-----deop-----\002"
  1143. notice $nick "Usage: !deop <nick>"
  1144. notice $nick "Flags Needed: op on channel, or op on bot"
  1145. notice $nick " Deops \002nick\002 on the current channel."
  1146. }
  1147. "ban" {
  1148. notice $nick "\002-----ban-----\002"
  1149. notice $nick "Usage: !ban <nick/host> <time> <reason>"
  1150. notice $nick "Flags Needed: op on channel, or op on bot"
  1151. notice $nick " If \002nick\002 is on the channel, it will get a"
  1152. notice $nick " hostmask and ban that. If not, it will take the"
  1153. notice $nick " host and ban that instead. \002time\002 is the amount"
  1154. notice $nick " of time in minutes that the ban will last. Putting 0"
  1155. notice $nick " in this field means a permanent ban. \002reason\002 is"
  1156. notice $nick " the reason why you banned the nick (can be anything)."
  1157. }
  1158. "unban" {
  1159. notice $nick "\002-----unban-----\002"
  1160. notice $nick "Usage: !unban <host>"
  1161. notice $nick "Flags Needed: op on channel, or op on bot"
  1162. notice $nick " Unbans \002host\002 from the channel. It can contain"
  1163. notice $nick " wildcards. Ex: !unban *!*Candy*@*.aol.com"
  1164. }
  1165. "voice" {
  1166. notice $nick "\002-----voice-----\002"
  1167. notice $nick "Usage: !voice <nick>"
  1168. notice $nick "Flags Needed: op on channel, or op on bot"
  1169. notice $nick " Gives voice to \002nick\002 on current channel."
  1170. }
  1171. "devoice" {
  1172. notice $nick "\002-----devoice-----\002"
  1173. notice $nick "Usage: !devoice <nick>"
  1174. notice $nick "Flags Needed: op on channel, or op on bot"
  1175. notice $nick " Takes away op from \002nick\002."
  1176. }
  1177. "opme" {
  1178. notice $nick "\002-----opme-----\002"
  1179. notice $nick "Usage: !opme"
  1180. notice $nick "Flags Needed: op on bot"
  1181. notice $nick " Gives you op on the channel"
  1182. }
  1183. "link" {
  1184. notice $nick "\002-----link-----\002"
  1185. notice $nick "Usage: !link <bot>"
  1186. notice $nick "Flags Needed: bot owner"
  1187. notice $nick " Attempts to link to \002bot\002."
  1188. }
  1189. "unlink" {
  1190. notice $nick "\002-----unlink-----\002"
  1191. notice $nick "Usage: !unlink <bot>"
  1192. notice $nick "Flags Needed: bot owner"
  1193. notice $nick " Attempts to unlink from \002bot\002."
  1194. }
  1195. "ping" {
  1196. notice $nick "\002-----ping-----\002"
  1197. notice $nick "Usage: !ping \[nick\]"
  1198. notice $nick "Flags Needed: partyline access"
  1199. notice $nick " Pings \002nick\002 and prints the time on the channel."
  1200. notice $nick " If no nick is given, it will ping you."
  1201. }
  1202. "mode" {
  1203. notice $nick "\002-----mode-----\002"
  1204. notice $nick "Usage: !mode <mode change>"
  1205. notice $nick "Flags Needed: op on channel, or op on bot"
  1206. notice $nick " Changes a mode on the channel specified by \002mode change\002."
  1207. notice $nick " Ex: !mode +m"
  1208. }
  1209. "adduser" {
  1210. notice $nick "\002-----adduser-----\002"
  1211. notice $nick "Usage: !adduser <nick> \[host\]"
  1212. notice $nick "Flags Needed: bot owner"
  1213. notice $nick " Adds a user to the userlist with \002nick\002 as their"
  1214. notice $nick " handle. If they are on the channel, and no \002host\002"
  1215. notice $nick " is specified, it will get a hostmask from the channel."
  1216. notice $nick " Otherwise, it will use the host you specify."
  1217. }
  1218. "part" {
  1219. notice $nick "\002-----part-----\002"
  1220. notice $nick "Usage: !part <#channel>"
  1221. notice $nick "Flags Needed: bot owner"
  1222. notice $nick " Makes the bot part a channel."
  1223. }
  1224. "join" {
  1225. notice $nick "\002-----join-----\002"
  1226. notice $nick "Usage: !join <#channel>"
  1227. notice $nick "Flags Needed: bot owner"
  1228. notice $nick " Makes the bot leave the channel."
  1229. }
  1230. "chattr" {
  1231. notice $nick "\002-----chattr-----\002"
  1232. notice $nick "Usage: !chattr <handle> <options> \[channel\]"
  1233. notice $nick "Flags Needed: bot owner"
  1234. notice $nick " Changes the flags (\002options\002) of a user (\002handle\002)."
  1235. notice $nick " If \002channel\002 is specified, it will change the channel flags for"
  1236. notice $nick " the user."
  1237. }
  1238. "deluser" {
  1239. notice $nick "\002-----deluser-----\002"
  1240. notice $nick "Usage: !deluser <handle>"
  1241. notice $nick "Flags Needed: bot owner"
  1242. notice $nick " Completely removes a user record from the bot."
  1243. }
  1244. "addbot" {
  1245. notice $nick "\002-----addbot-----\002"
  1246. notice $nick "Usage: !addbot <handle> <address:port>"
  1247. notice $nick "Flags Needed: bot owner"
  1248. notice $nick " Adds a bot to the user file. You should know how to use"
  1249. notice $nick " this if you are an owner of the bot."
  1250. }
  1251. "rmbot" {
  1252. notice $nick "\002-----rmbot-----\002"
  1253. notice $nick "Usage: !rmbot <handle>"
  1254. notice $nick "Flags Needed: bot owner"
  1255. notice $nick " Removes a bot user record from the bot."
  1256. }
  1257. "addhost" {
  1258. notice $nick "\002-----addhost-----\002"
  1259. notice $nick "Usage: !addhost <handle> <host>"
  1260. notice $nick "Flags Needed: bot owner"
  1261. notice $nick " Adds \002host\002 to user record for \002handle\002."
  1262. }
  1263. "rmhost" {
  1264. notice $nick "\002-----rmhost-----\002"
  1265. notice $nick "Usage: !rmhost <handle> <host>"
  1266. notice $nick "Flags Needed: bot owner"
  1267. notice $nick " Removes host from \002handle\002."
  1268. }
  1269. "sex" {
  1270. notice $nick "Go talk to a shrink."
  1271. }
  1272. "me" {
  1273. notice $nick "I can do that!"
  1274. notice $nick "Just type \002!help\002 for commands."
  1275. }
  1276. "him" {
  1277. notice $nick "Sorry, I can't help him."
  1278. }
  1279. }
  1280. }
  1281. }
  1282.  
  1283. proc pub:helpa {nick uhost hand chan args} {
  1284. pub:help $nick $uhost $hand $chan $args
  1285. }
  1286.  
  1287. ##### BADWORD #####
  1288. proc badword:kick {nick uhost hand chan text} {
  1289. if {$hand != "*"} {
  1290. if {([matchattr $hand "n"]) || ([matchattr $hand "m"]) || ([matchattr $hand "|m" $chan]) || ([matchattr $hand "|n" $chan]) || ([matchattr $hand "f"]) || ([matchattr $hand "|f" $chan])} {
  1291. return 0
  1292. }
  1293. }
  1294. putserv "KICK $chan $nick :Shame on you! Using those words in public!"
  1295. }
  1296.  
  1297. ##### REMIND USERS #####
  1298. proc toolz:remind_users {} {
  1299. global botnick
  1300. foreach n [userlist] {
  1301. if {[passwdok $n ""]} {
  1302. say $n "Your password on me has not been set yet. Please set it by typing /msg $botnick PASS <password>. This message is relayed every 30 minutes."
  1303. putlog "Reminded $n to set his/her password."
  1304. }
  1305. }
  1306. timer 30 toolz:remind_users
  1307. }
  1308.  
  1309. set found 0
  1310. foreach n [timers] {
  1311. if {[lindex $n 1] == "toolz:remind_users"} {
  1312. set found 1
  1313. }
  1314. }
  1315. if {$found == 0} {
  1316. timer 5 toolz:remind_users
  1317. }
  1318. unset found
  1319.