Advertisement
kyroskoh

NK0004.tcl (Public Commands Not Requiring Ops)

Mar 22nd, 2011
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.62 KB | None | 0 0
  1. ##### Script Name : Public Commands Not Requiring Ops
  2. ##### Script Version : NK0004.0.tcl
  3. ##### Edited & Bug Fixed By : Kyros Koh (i.am@kyroskoh.com)
  4.  
  5. ##### Pre-Loaded Settings #####
  6.  
  7. putlog "NK0004.tcl Loaded. Functions Enabled..."
  8. set die ""
  9.  
  10. ###################################### Edit Below #########################################
  11. ##### Bind Command (Edit Only The Flags Below. Format: global|channel) #####
  12. ##### Comment Out Commands That You Do Not Want To Use #####
  13. ##### You Can Change The Command Name #####
  14.  
  15. bind msg n|- die NK0004-msg:die
  16.  
  17. bind pub n|- !rehash NK0004-pub:!rehash
  18. bind pub n|- !restart pub:!restart
  19. bind pub n|- !uptime NK0004-pub:!uptime
  20. bind pub n|- !jump NK0004-pub:!jump
  21. bind pub n|- !server NK0004-pub:!server
  22.  
  23. bind pub n|- !part NK0004-pub:!part
  24. bind pub n|- !partall NK0004-pub:!partall
  25. bind pub n|- !channels NK0004-pub:!channels
  26. bind pub n|- !address NK0004-pub:!address
  27. bind pub n|- !modes NK0004-pub:!modes
  28.  
  29. bind pub n|- !die NK0004-pub:!die
  30. bind pub n|- !chattr NK0004-pub:!chattr
  31. bind pub n|- !adduser NK0004-pub:!adduser
  32. bind pub n|- !deluser NK0004-pub:!deluser
  33. bind pub n|- !addhost NK0004-pub:!addhost
  34.  
  35. bind pub n|- !delhost NK0004-pub:!delhost
  36. bind pub n|- !delallhosts NK0004-pub:!delallhosts
  37. bind pub n|- !hosts NK0004-pub:!hosts
  38. bind pub n|- !botattr NK0004-pub:!botattr
  39. bind pub n|- !addbot NK0004-pub:!addbot
  40.  
  41. bind pub n|- !delbot NK0004-pub:!delbot
  42. bind pub n|- !flags NK0004-pub:!flags
  43. bind pub n|- !join NK0004-pub:!join
  44. bind pub n|- !say NK0004-pub:!say
  45. bind pub n|- !action NK0004-pub:!action
  46.  
  47. bind pub n|- !notice NK0004-pub:!notice
  48. bind pub n|- !cycle NK0004-pub:!cycle
  49. bind pub n|- !save NK0004-pub:!save
  50. bind pub n|- !link NK0004-pub:!link
  51. bind pub n|- !unlink NK0004-pub:!unlink
  52.  
  53. bind pub n|- !bots NK0004-pub:!bots
  54. bind pub n|- !load NK0004-pub:!reload
  55. bind pub n|- !time NK0004-pub:!time
  56. bind pub n|- !away NK0004-pub:!away
  57. bind pub n|- !back NK0004-pub:!back
  58.  
  59. bind pub n|- !nick NK0004-pub:!nick
  60. bind pub n|- !msg NK0004-pub:!msg
  61.  
  62. ##### You Can Change The Command Name #####
  63. ##### Comment Out Commands That You Do Not Want To Use #####
  64. ##### Bind Command (Edit Only The Flags Above. Format: global|channel) #####
  65. ###################################### Edit Above #########################################
  66.  
  67. ##### Rehash Command #####
  68.  
  69.  
  70. proc NK0004-pub:!rehash { nickname userhost handle channel text } {
  71. if { [llength $text] != 0 } {
  72. putquick "NOTICE $nickname : Syntax !rehash"
  73. } else {
  74. rehash
  75. putquick "NOTICE $nickname : Rehashing In Progress..."
  76. }
  77. }
  78.  
  79. ##### Restart Command #####
  80.  
  81.  
  82. proc NK0004-pub:!restart { nickname userhost handle channel text } {
  83. if { [llength $text] != 0 } {
  84. putquick "NOTICE $nickname : Syntax : !restart"
  85. } else {
  86. putquick "NOTICE $nickname : Restarting In Progress..."
  87. restart
  88. }
  89. }
  90.  
  91. ##### Uptime Command #####
  92.  
  93.  
  94. proc NK0004-pub:!uptime { nickname userhost handle channel text } {
  95. global botnick uptime
  96. if { [llength $text] != 0 } {
  97. putquick "NOTICE $nickname : Syntax : !uptime"
  98. } else {
  99. putquick "NOTICE $nickname : Uptime For $botnick: [duration [expr [unixtime] - $uptime]]"
  100. }
  101. }
  102.  
  103. ##### Jump Server Command #####
  104.  
  105.  
  106. proc NK0004-pub:!jump { nickname userhost handle channel text } {
  107. if { [llength $text] > 3 } {
  108. putquick "NOTICE $nickname : Syntax : !jump \[server\] \[port\] \[password\]"
  109. } else {
  110. putquick "NOTICE $nickname : Jumping Servers..."
  111. jump [lindex $text 0] [lindex $text 1] [lindex $text 2]
  112. }
  113. }
  114.  
  115. ##### Show Server Command #####
  116.  
  117.  
  118. proc NK0004-pub:!server { nickname userhost handle channel text } {
  119. global botnick server
  120. if { [llength $text] != 0 } {
  121. putquick "NOTICE $nickname : Syntax : !server"
  122. } else {
  123. putquick "NOTICE $nickname : $botnick Is Currently Connected On $server"
  124. }
  125. }
  126.  
  127. ##### Part Channel Command #####
  128.  
  129.  
  130. proc NK0004-pub:!part { nickname userhost handle channel text } {
  131. global botnick
  132. if { [llength $text] > 1 } {
  133. putquick "NOTICE $nickname : Syntax : !part \[#channel\]"
  134. } else {
  135. if { [llength $text] == 0 } {
  136. putquick "NOTICE $nickname : Parting Channel And Removingn Records For $channel In Progress"
  137. channel remove $channel
  138. } else {
  139. if { [string match "#*" [lindex $text 0]] == 0 } {
  140. putquick "NOTICE $nickname : Please Enter A Valid Channel Name"
  141. } else {
  142. putquick "NOTICE $nickname : Parting Channel And Removing Records For [lindex $text 0] In Progress"
  143. channel remove [lindex $text 0]
  144. }
  145. }
  146. }
  147. }
  148.  
  149. ##### Part All Channels Command #####
  150.  
  151.  
  152. proc NK0004-pub:!partall { nickname userhost handle channel text } {
  153. if { [llength $text] != 0 } {
  154. putquick "NOTICE $nickname : Syntax !partall"
  155. } else {
  156. putquick "NOTICE $nickname : Parting All Channels In Progress"
  157. for { set i 0 } { $i < [llength [channels]] } { incr i } {
  158. channel remove [lindex [channels] $i]
  159. }
  160. }
  161. }
  162.  
  163. ##### List Channels Command #####
  164.  
  165.  
  166. proc NK0004-pub:!channels { nickname userhost handle channel text } {
  167. if { [llength $text] != 0 } {
  168. putquick "NOTICE $nickname : Syntax : !channels"
  169. } else {
  170. set chan ""
  171. set modes ""
  172. for { set channels 0 } { $channels < [llength [channels]] } { incr channels } {
  173. if { [botonchan [lindex [channels] $channels]] == 1 } {
  174. if { [botisop [lindex [channels] $channels]] == 1 } {
  175. set modes "@"
  176. }
  177. if { [botisvoice [lindex [channels] $channels]] == 1 } {
  178. set modes "${modes}+"
  179. }
  180. set chan "$chan ${modes}[lindex [channels] $channels]"
  181. set modes ""
  182. }
  183. }
  184. putquick "NOTICE $nickname : I Am On ([llength $chan]) Channel(s): $chan"
  185. }
  186. }
  187.  
  188. ##### Show Address Command #####
  189.  
  190.  
  191. proc NK0004-pub:!address { nickname userhost handle channel text } {
  192. global botnick
  193. if { [llength $text] != 0 } {
  194. putquick "NOTICE $nickname : Syntax : !address"
  195. } else {
  196. putquick "NOTICE $nickname : $botnick Is Under The Address ${botnick}![getchanhost $botnick]"
  197. }
  198. }
  199.  
  200. ##### Modes Of Channel Command #####
  201.  
  202.  
  203. proc NK0004-pub:!modes { nickname userhost handle channel text } {
  204. if { [llength $text] > 0 } {
  205. putquick "NOTICE $nickname : Syntax : !modes"
  206. } else {
  207. set total 0
  208. set ops 0
  209. set voice 0
  210. set reg 0
  211. for { set i 0 } { $i < [llength [chanlist $channel]] } { incr i } {
  212. if { [isop [lindex [chanlist $channel] $i] $channel] == 1 && [isvoice [lindex [chanlist $channel] $i] $channel] == 1 } {
  213. incr total
  214. incr ops
  215. incr voice
  216. }
  217. if { [isop [lindex [chanlist $channel] $i] $channel] == 1 && [isvoice [lindex [chanlist $channel] $i] $channel] == 0 } {
  218. incr total
  219. incr ops
  220. }
  221. if { [isop [lindex [chanlist $channel] $i] $channel] == 0 && [isvoice [lindex [chanlist $channel] $i] $channel] == 1 } {
  222. incr total
  223. incr voice
  224. }
  225. if { [isop [lindex [chanlist $channel] $i] $channel] == 0 && [isvoice [lindex [chanlist $channel] $i] $channel] == 0 } {
  226. incr total
  227. incr reg
  228. }
  229. }
  230. putquick "NOTICE $nickname : Modes For $channel : [getchanmode $channel]; Total: $total/$total; Ops: $ops/$total; Voice: $voice/$total; Reg: $reg/$total; Bans: [llength [chanbans $channel]]"
  231. }
  232. }
  233.  
  234. ##### Disconnect Command #####
  235.  
  236.  
  237. proc NK0004-pub:!die { nickname userhost handle channel text } {
  238. global die botnick
  239. if { [llength $text] != 0 } {
  240. putquick "NOTICE $nickname : Syntax : !die"
  241. } else {
  242. if { $die == "" } {
  243. set die [rand 99999]
  244. putquick "NOTICE $nickname : Are You Sure You Want To Disconnect $botnick? If Yes, Please Type /msg $botnick die <password> $die. If Not, Type !die Again"
  245. } elseif { $die != "" } {
  246. set die ""
  247. putquick "NOTICE $nickname : Disconnect Procedure Terminated"
  248. }
  249. }
  250. }
  251.  
  252.  
  253. proc NK0004-msg:die { nickname userhost handle text } {
  254. global die botnick
  255. if { [llength $text] == 0 } {
  256. if { $die == "" } {
  257. set die [rand 99999]
  258. putquick "NOTICE $nickname : Are You Sure You Want To Disconnect $botnick? If Yes, Please Type /msg $botnick die <password> $die. If Not, Type /msg $botnick die Again"
  259. } elseif { $die != "" } {
  260. set die ""
  261. putquick "NOTICE $nickname : Disconnect Procedure Terminated"
  262. }
  263. } elseif { [llength $text] == 2 } {
  264. if { [lindex $text 1] == $die && [passwdok $handle [lindex $text 0]] == 1 } {
  265. putquick "NOTICE $nickname : Disconnect Procedure Completed. Disconnecting Now..."
  266. die "Requested By Owner"
  267. } else {
  268. putquick "NOTICE $nickname : Incorrect Password. You Would Have To Repeat The Whole Process Again"
  269. set die ""
  270. }
  271. } else {
  272. putquick "NOTICE $nickname : Syntax : /msg $botnick die <password> <die>"
  273. }
  274. }
  275.  
  276. ##### Change Attributes Of User Command #####
  277.  
  278.  
  279. proc NK0004-pub:!chattr { nickname userhost handle channel text } {
  280. if { [llength $text] > 3 || [llength $text] < 1 } {
  281. putquick "NOTICE $nickname : Syntax : !chattr <handle> \[global attributes|channel attributes\] \[#channel\]"
  282. } else {
  283. if { [validuser [lindex $text 0]] == 0 } {
  284. putquick "NOTICE $nickname : [lindex $text 0] Is Not A Valid User"
  285. } else {
  286. if { [llength $text] == 1 } {
  287. if { [chattr [lindex $text 0]] == "-" } {
  288. putquick "NOTICE $nickname : No Global Attributes For [lindex $text 0]"
  289. } else {
  290. putquick "NOTICE $nickname : Global Attributes For [lindex $text 0] Are [chattr [lindex $text 0]]"
  291. }
  292. }
  293. if { [llength $text] == 2 } {
  294. if { [string match "#*" [lindex $text 1]] == 1 } {
  295. if { [string match "*|-" [chattr [lindex $text 0] [lindex $text 2]]] == 1 } {
  296. putquick "NOTICE $nickname : No [lindex $text 2] Attributes For [lindex $text 0]"
  297. } else {
  298. putquick "NOTICE $nickname : [lindex $text 1] Attributes For [lindex $text 0] Are [chattr [lindex $text 0] [lindex $text 1]]"
  299. }
  300. } else {
  301. chattr [lindex $text 0] [lindex $text 1]
  302. if { [chattr [lindex $text 0]] == "-" } {
  303. putquick "NOTICE $nickname : No Global Attributes For [lindex $text 0]"
  304. } else {
  305. putquick "NOTICE $nickname : Global Attributes For [lindex $text 0] Are : [chattr [lindex $text 0]]"
  306. }
  307. }
  308. }
  309. if { [llength $text] == 3 } {
  310. if { [string match "#*" [lindex $text 2]] == 0 } {
  311. putquick "NOTICE $nickname : Syntax : !chattr <handle> \[global attributes|channel attributes\] \[channel\]"
  312. } else {
  313. chattr [lindex $text 0] [lindex $text 1] [lindex $text 2]
  314. if { [string match "*|-" [chattr [lindex $text 0] [lindex $text 2]]] == 1 } {
  315. putquick "NOTICE $nickname : No [lindex $text 2] Attributes For [lindex $text 0]"
  316. } else {
  317. putquick "NOTICE $nickname : [lindex $text 2] Attributes For [lindex $text 0] Are : [chattr [lindex $text 0] [lindex $text 2]]"
  318. }
  319. }
  320. }
  321. }
  322. }
  323. }
  324.  
  325. ##### Add User Command #####
  326.  
  327.  
  328. proc NK0004-pub:!adduser { nickname userhost handle channel text } {
  329. if { [llength $text] == 0 || [llength $text] > 2 } {
  330. putquick "NOTICE $nickname : Syntax : !adduser <handle> \[userhost|AUTO\]"
  331. } else {
  332. if { [validuser [lindex $text 0]] == 1 } {
  333. putquick "NOTICE $nickname : User - [lindex $text 0] Already Exists"
  334. } else {
  335. if { [llength $text] == 1 } {
  336. adduser [lindex $text 0]
  337. putquick "NOTICE $nickname : Added [lindex $text 0] To Bot With No Userhost"
  338. }
  339. if { [llength $text] == 2 } {
  340. if { [string match -nocase "AUTO" [lindex $text 1]] == 1 } {
  341. if { [maskhost [getchanhost [lindex $text 0]]] == "*!*@" } {
  342. adduser [lindex $text 0]
  343. putquick "NOTICE $nickname : Added [lindex $text 0] To Bot With No Userhost"
  344. } else {
  345. adduser [lindex $text 0] [maskhost [getchanhost [lindex $text 0]]]
  346. putquick "NOTICE $nickname : Added [lindex $text 0] To Bot With Userhost : [maskhost [getchanhost [lindex $text 0]]]"
  347. }
  348. } else {
  349. if { [string match "*!*@*" [lindex $text 1]] == 0 } {
  350. adduser [lindex $text 0]
  351. putquick "NOTICE $nickname : Added [lindex $text 0] To Bot With No Userhost"
  352. } else {
  353. adduser [lindex $text 0] [lindex $text 1]
  354. putquick "NOTICE $nickname : Added [lindex $text 0] To Bot With Userhost : [lindex $text 1]"
  355. }
  356. }
  357. }
  358. }
  359. }
  360. }
  361.  
  362. ##### Delete User Command #####
  363.  
  364.  
  365. proc NK0004-pub:!deluser { nickname userhost handle channel text } {
  366. if { [llength $text] != 1 } {
  367. putquick "NOTICE $nickname : Syntax : !deluser <handle>"
  368. } else {
  369. if { [validuser [lindex $text 0]] == 0 } {
  370. putquick "NOTICE $nickname : User - [lindex $text 0] Does Not Exist"
  371. } else {
  372. deluser [lindex $text 0]
  373. putquick "NOTICE $nickname : Deleted [lindex $text 0] From Bot"
  374. }
  375. }
  376. }
  377.  
  378. ##### Add Host Command #####
  379.  
  380.  
  381. proc NK0004-pub:!addhost { nickname userhost handle channel text } {
  382. if { [llength $text] != 2 } {
  383. putquick "NOTICE $nickname : Syntax : !addhost <handle> <userhost>"
  384. } else {
  385. if { [validuser [lindex $text 0]] == 0 } {
  386. putquick "NOTICE $nickname : Invalid Handle - [lindex $text 0]"
  387. } else {
  388. if { [string match "*!*@*" [lindex $text 1]] == 0 } {
  389. putquick "NOTICE $nickname : Invalid Address Format"
  390. } else {
  391. setuser [lindex $text 0] hosts [lindex $text 1]
  392. putquick "NOTICE $nickname : Added Host - [lindex $text 1] For [lindex $text 0]"
  393. }
  394. }
  395. }
  396. }
  397.  
  398. ##### Delete Host Command #####
  399.  
  400.  
  401. proc NK0004-pub:!delhost { nickname userhost handle channel text } {
  402. if { [llength $text] != 2 } {
  403. putquick "NOTICE $nickname : Syntax : !delhost <handle> <userhost>"
  404. } else {
  405. if { [validuser [lindex $text 0]] == 0 } {
  406. putquick "NOTICE $nickname : Invalid Handle"
  407. } else {
  408. if { [delhost [lindex $text 0] [lindex $text 1]] == 1 } {
  409. putquick "NOTICE $nickname : Deleted Host - [lindex $text 1] From [lindex $text 0]"
  410. } else {
  411. putquick "NOTICE $nickname : Host Does Not Exist For [lindex $text 0]"
  412. }
  413. }
  414. }
  415. }
  416.  
  417. ##### Delete All Hosts Of User Command #####
  418.  
  419.  
  420. proc NK0004-pub:!delallhosts { nickname userhost handle channel text } {
  421. if { [llength $text] != 1 } {
  422. putquick "NOTICE $nickname : Syntax : !delallhosts <handle>"
  423. } else {
  424. if { [validuser [lindex $text 0]] == 0 } {
  425. putquick "NOTICE $nickname : Invalid Handle - [lindex $text 0]"
  426. } else {
  427. setuser [lindex $text 0] hosts
  428. putquick "NOTICE $nickname : Deleted All Hosts For [lindex $text 0]"
  429. }
  430. }
  431. }
  432.  
  433. ##### List Hosts Of User Command #####
  434.  
  435.  
  436. proc NK0004-pub:!hosts { nickname userhost handle channel text } {
  437. if { [llength $text] > 1 } {
  438. putquick "NOTICE $nickname : Syntax : !hosts \[handle\]"
  439. } else {
  440. if { [llength $text] == 1 } {
  441. if { [validuser [lindex $text 0]] == 0 } {
  442. putquick "NOTICE $nickname : Invalid Handle - [lindex $text 0]"
  443. } else {
  444. if { [llength [getuser [lindex $text 0] hosts]] == 0 } {
  445. putquick "NOTICE $nickname : No Hosts Set For [lindex $text 0]"
  446. } else {
  447. putquick "NOTICE $nickname : Hosts For [lindex $text 0] ([llength [getuser [lindex $text 0] hosts]]) : [getuser [lindex $text 0] hosts]"
  448. }
  449. }
  450. } else {
  451. putquick "NOTICE $nickname : Hosts For $handle (You) : ([llength [getuser $handle hosts]]) : [getuser $handle hosts]"
  452. }
  453. }
  454. }
  455.  
  456. ##### Change Bot Attributes Command #####
  457.  
  458.  
  459. proc NK0004-pub:!botattr { nickname userhost handle channel text } {
  460. if { [llength $text] > 2 || [llength $text] < 1 } {
  461. putquick "NOTICE $nickname : Syntax : !botattr <handle> \[attributes\]"
  462. } else {
  463. if { [validuser [lindex $text 0]] == 0 && [matchattr [lindex $text 0] b] == 1 } {
  464. putquick "NOTICE $nickname : [lindex $text 0] Is Not A Valid Bot"
  465. } else {
  466. if { [llength $text] == 1 } {
  467. if { [botattr [lindex $text 0]] == "-" } {
  468. putquick "NOTICE $nickname : No Bot Attributes For [lindex $text 0]"
  469. } else {
  470. putquick "NOTICE $nickname : Bot Attributes For [lindex $text 0] Are [botattr [lindex $text 0]]"
  471. }
  472. }
  473. if { [llength $text] == 2 } {
  474. botattr [lindex $text 0] [lindex $text 1]
  475. if { [botattr [lindex $text 0]] == "-" } {
  476. putquick "NOTICE $nickname : No Bot Attributes For [lindex $text 0]"
  477. } else {
  478. putquick "NOTICE $nickname : Bot Attributes For [lindex $text 0] Are : [botattr [lindex $text 0]]"
  479. }
  480. }
  481. }
  482. }
  483. }
  484.  
  485. ##### Add Bot Command #####
  486.  
  487.  
  488. proc NK0004-pub:!addbot { nickname userhost handle channel text } {
  489. if { [llength $text] != 2 } {
  490. putquick "NOTICE $nickname : Syntax : !addbot <handle> <address>\[:port\]"
  491. } else {
  492. if { [validuser [lindex $text 0]] == 1 } {
  493. putquick "NOTICE $nickname : Handle - [lindex $text 0] Already Exists"
  494. } else {
  495. addbot [lindex $text 0] [lindex $text 1]
  496. putquick "NOTICE $nickname : Added Bot ([lindex $text 0]) With Address - [lindex $text 1]"
  497. }
  498. }
  499. }
  500.  
  501. ##### Delete Bot Command #####
  502.  
  503.  
  504. proc NK0004-pub:!delbot { nickname userhost handle channel text } {
  505. if { [llength $text] != 1 } {
  506. putquick "NOTICE $nickname : Syntax : !delbot <handle>"
  507. } else {
  508. if { [validuser [lindex $text 0]] == 0 || [matchattr [lindex $text 0] b] == 0 } {
  509. putquick "NOTICE $nickname : [lindex $text 0] Is Not A Valid User Or Is Not A Bot"
  510. } else {
  511. deluser [lindex $text 0]
  512. putquick "NOTICE $nickname : Deleted Bot - [lindex $text 0] From Bot Records"
  513. }
  514. }
  515. }
  516.  
  517. ##### Flags Of User Command #####
  518.  
  519.  
  520. proc NK0004-pub:!flags { nickname userhost handle channel text } {
  521. if { [llength $text] > 1 } {
  522. putquick "NOTICE $nickname : Syntax : !flags \[handle\]"
  523. } else {
  524. if { [llength $text] == 1 } {
  525. if { [validuser [lindex $text 0]] == 0 } {
  526. putquick "NOTICE $nickname : [lindex $text 0] Is An Invalid Handle"
  527. } else {
  528. if { [chattr [lindex $text 0]] == "-" } {
  529. putquick "NOTICE $nickname : No Global Flags For [lindex $text 0]"
  530. } else {
  531. putquick "NOTICE $nickname : Global Flags For [lindex $text 0] : [chattr [lindex $text 0]]"
  532. }
  533. }
  534. } else {
  535. if { [chattr $handle] == "-" } {
  536. putquick "NOTICE $nickname : No Global Flags For $handle (You)"
  537. } else {
  538. putquick "NOTICE $nickname : Global Flags For $handle (You) : [chattr $handle]"
  539. }
  540. }
  541. }
  542. }
  543.  
  544. ##### Join Channel Command #####
  545.  
  546.  
  547. proc NK0004-pub:!join { nickname userhost handle channel text } {
  548. global botnick
  549. if { [llength $text] > 2 || [llength $text] == 0 } {
  550. putquick "NOTICE $nickname : Syntax : !join <#channel> \[key\]"
  551. } else {
  552. if { [string match -nocase "* [lindex $text 0] *" " [channels] "] == 1 && [botonchan [lindex $text 0]] == 1 } {
  553. putquick "NOTICE $nickname : Bot ($botnick) Is Already On [lindex $text 0]"
  554. } else {
  555. if { [string match "#*" [lindex $text 0]] == 0 } {
  556. putquick "NOTICE $nickname : Please Enter A Valid Channel Name"
  557. } else {
  558. putquick "NOTICE $nickname : Joining Channel - [lindex $text 0] In Progress"
  559. channel add [lindex $text 0]
  560. if { [llength $text] == 2 } {
  561. putquick "JOIN [lindex $text 0] [lindex $text 1]"
  562. }
  563. }
  564. }
  565. }
  566. }
  567.  
  568. ##### Say Command #####
  569.  
  570.  
  571. proc NK0004-pub:!say { nickname userhost handle channel text } {
  572. putquick "PRIVMSG $channel : $text"
  573. putquick "NOTICE $nickname : Saying To $channel : $text"
  574. }
  575.  
  576. ##### Action Command #####
  577.  
  578.  
  579. proc NK0004-pub:!action { nickname userhost handle channel text } {
  580. if { [llength $text] == 0 } {
  581. putquick "NOTICE $nickname : !action <text>"
  582. } else {
  583. putquick "PRIVMSG $channel :ACTION $text"
  584. putquick "NOTICE $nickname : Action To $channel : $text"
  585. }
  586. }
  587.  
  588. ##### Notice Command #####
  589.  
  590.  
  591. proc NK0004-pub:!notice { nickname userhost handle channel text } {
  592. putquick "NOTICE $channel : $text"
  593. putquick "NOTICE $nickname : Notice To $channel : $text"
  594. }
  595.  
  596. ##### Cycle Command #####
  597.  
  598.  
  599. proc NK0004-pub:!cycle { nickname userhost handle channel text } {
  600. global botnick
  601. if { [llength $text] > 1 } {
  602. putquick "NOTICE $nickname : Syntax : !cycle \[#channel\]"
  603. } else {
  604. if { [llength $text] == 0 } {
  605. putquick "NOTICE $nickname : Cycling $channel In Progress"
  606. putquick "PART $channel"
  607. putquick "JOIN $channel"
  608. } else {
  609. if { [string match "#*" [lindex $text 0]] == 0 } {
  610. putquick "NOTICE $nickname : Please Enter A Valid Channel Name"
  611. } else {
  612. if { [string match -nocase "* [lindex $text 0] *" " [channels] "] == 0 || [botonchan [lindex $text 0]] == 0 } {
  613. putquick "NOTICE $nickname : Bot ($botnick) Is Not On [lindex $text 0]"
  614. } else {
  615. putquick "NOTICE $nickname : Cycling [lindex $text 0] In Progress"
  616. putquick "PART [lindex $text 0]"
  617. putquick "JOIN [lindex $text 0]"
  618. }
  619. }
  620. }
  621. }
  622. }
  623.  
  624. ##### Save Userfile And Channel File Command #####
  625.  
  626.  
  627. proc NK0004-pub:!save { nickname userhost handle channel text } {
  628. if { [llength $text] != 0 } {
  629. putquick "NOTICE $nickname : Syntax : !save"
  630. } else {
  631. putquick "NOTICE $nickname : Saving Userfile And Channel File In Progress"
  632. save
  633. }
  634. }
  635.  
  636. ##### Link To Bot Command #####
  637.  
  638.  
  639. proc NK0004-pub:!link { nickname userhost handle channel text } {
  640. if { [llength $text] < 1 || [llength $text] > 2 } {
  641. putquick "NOTICE $nickname : Syntax : !link \[via-bot\] <bot>"
  642. } else {
  643. if { [llength $text] == 1 } {
  644. if { [link [lindex $text 0]] == 1 } {
  645. putquick "NOTICE $nickname : Attempting To Link To [lindex $text 0]"
  646. } else {
  647. putquick "NOTICE $nickname : Failed Attempt To Link To [lindex $text 0]"
  648. }
  649. } else {
  650. if { [link [lindex $text 0] [lindex $text 1]] == 1 } {
  651. putquick "NOTICE $nickname : Via-bot ([lindex $text 0]) Attempting To Link To [lindex $text 1]"
  652. } else {
  653. putquick "NOTICE $nickname : Failed Attempt By Via-bot ([lindex $text 0]) To Link To [lindex $text 1]"
  654. }
  655. }
  656. }
  657. }
  658.  
  659. ##### Unlink From Bot Command #####
  660.  
  661.  
  662. proc NK0004-pub:!unlink { nickname userhost handle channel text } {
  663. if { [llength $text] != 1 } {
  664. putquick "NOTICE $nickname : Syntax : !unlink <bot>"
  665. } else {
  666. if { [unlink [lindex $text 0]] == 1 } {
  667. putquick "NOTICE $nickname : Successful Unlink From [lindex $text 0]"
  668. } else {
  669. putquick "NOTICE $nickname : Unsuccessful Unlink From [lindex $text 0]"
  670. }
  671. }
  672. }
  673.  
  674. ##### List Linked Bots Command #####
  675.  
  676.  
  677. proc NK0004-pub:!bots { nickname userhost handle channel text } {
  678. global botnick
  679. if { [llength $text] != 0 } {
  680. putquick "NOTICE $nickname : Syntax : !bots"
  681. } else {
  682. if { [bots] == "" } {
  683. putquick "NOTICE $nickname : No Bots Linked To Me ($botnick) "
  684. } else {
  685. putquick "NOTICE $nickname : Bots Linked To Me ($botnick) ([llength [bots]]) : [bots]"
  686. }
  687. }
  688. }
  689.  
  690. ##### Reload Userfile And Channel Command #####
  691.  
  692.  
  693. proc NK0004-pub:!reload { nickname userhost handle channel text } {
  694. if { [llength $text] > 1 } {
  695. putquick "NOTICE $nickname : Syntax : !load \[USERFILE/CHANNELS\]"
  696. } else {
  697. if { [llength $text] == 0 } {
  698. putquick "NOTICE $nickname : Reloading Userfile And Channel File In Progress..."
  699. reload
  700. loadchannels
  701. } else {
  702. if { [string match -nocase "USERFILE" [lindex $text 0]] == 1 } {
  703. putquick "NOTICE $nickname : Reloading Userfile In Progress..."
  704. reload
  705. } elseif { [string match -nocase "CHANNELS" [lindex $text 0]] == 1 } {
  706. putquick "NOTICE $nickname : Reloading Channel File In Progress..."
  707. loadchannels
  708. } else {
  709. putquick "NOTICE $nickname : Syntax : !load \[USERFILE/CHANNELS\]"
  710. }
  711. }
  712. }
  713. }
  714.  
  715. ##### Show Time Command #####
  716.  
  717.  
  718. proc NK0004-pub:!time { nickname userhost handle channel text } {
  719. if { [llength $text] != 0 } {
  720. putquick "NOTICE $nickname : Syntax : !time"
  721. } else {
  722. putquick "NOTICE $nickname : Current Time Is : [ctime [unixtime]]"
  723. }
  724. }
  725.  
  726. ##### Away Command #####
  727.  
  728.  
  729. proc NK0004-pub:!away { nickname userhost handle channel text } {
  730. global botnick
  731. if { [llength $text] == 0 } {
  732. putquick "NOTICE $nickname : Syntax : !away <reason>"
  733. } else {
  734. putquick "NOTICE $nickname : I ($botnick) Am Being Marked As Away : $text"
  735. putquick "AWAY : $text"
  736. }
  737. }
  738.  
  739. ##### Back Command #####
  740.  
  741.  
  742. proc NK0004-pub:!back { nickname userhost handle channel text } {
  743. global botnick
  744. if { [llength $text] != 0 } {
  745. putquick "NOTICE $nickname : Syntax : !back"
  746. } else {
  747. putquick "NOTICE $nickname : I ($botnick) Am Not Longer Being Marked As Away"
  748. putquick "Away"
  749. }
  750. }
  751.  
  752. ##### Nick Change Command #####
  753.  
  754.  
  755. proc NK0004-pub:!nick { nickname userhost handle channel text } {
  756. if { [llength $text] != 1 } {
  757. putquick "NOTICE $nickname : Syntax : !nick <newnick>"
  758. } else {
  759. set nick "[lindex $text 0]"
  760. putquick "NOTICE $nickname : Attempting To Change Nickname To : [lindex $text 0]"
  761. }
  762. }
  763.  
  764.  
  765. ##### Message Target Command #####
  766.  
  767.  
  768. proc NK0004-pub:!msg { nickname userhost handle channel text } {
  769. if { [llength $text] == 0 } {
  770. putquick "NOTICE $nickname : Syntax : !msg <target> \[message\]"
  771. } else {
  772. putquick "PRIVMSG [lindex $text 0] : [lrange $text 1 end]"
  773. putquick "NOTICE $nickname : Messaging To [lindex $text 0] : [lrange $text 1 end]"
  774. }
  775. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement