Advertisement
kyroskoh

public2.tcl (Public Commands to DCC)

Mar 22nd, 2011
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.42 KB | None | 0 0
  1. # NOTICE: Do not copy and paste unless you know what you are doing. /me *grins* :}
  2. # Done by Kyros Koh (i.am@kyroskoh.com)
  3.  
  4. # 13:05:34 <Kyros> .join = join a channel
  5. # 13:05:40 <Kyros> .part = part a channel
  6. # 13:05:43 <Kyros> .chattr
  7. # 13:05:52 <Kyros> .adduser
  8. # eggdrop 1.6.19
  9.  
  10. bind pub m .join pub_join
  11. bind pub m .part pub_part
  12. bind pub m .chattr pub_chattr
  13. bind pub m .adduser pub_adduser
  14. bind pub m .save pub_save
  15. bind pub n .rehash pub_rehash
  16. bind pub n .restart pub_restart
  17. bind pub m .uptime pub_uptime
  18. bind pub m .info pub_info
  19. bind pub m .say pub_say
  20. bind pub m .msg pub_msg
  21. bind pub m .voice pub_voice
  22. bind pub m .devoice pub_devoice
  23. bind pub m .act pub_act
  24.  
  25. proc pub_join {n u h c a} {
  26. set chan [lindex $a 0]
  27. if {![string match #* $chan]} {
  28. puthelp "privmsg $c :$n: Channel must have a # in front."
  29. return 0
  30. }
  31. channel add $chan
  32. puthelp "NOTICE $n :0,1 Hold on, while i park in..."
  33. }
  34.  
  35. proc pub_part {n u h c a} {
  36. set chan [lindex $a 0]
  37. if {![validchan $chan]} {
  38. puthelp "NOTICE $n :0,1 That channel doesn't exist!"
  39. return 0
  40. }
  41. if {![isdynamic $chan]} {
  42. puthelp "NOTICE $n :0,1 That channel isn't dynamic!"
  43. return 0
  44. }
  45. channel remove $chan
  46. }
  47.  
  48. proc pub_chattr {n u h c a} {
  49. set handle [lindex $a 0]
  50. set flags [lindex $a 1]
  51. if {![validuser $handle]} {
  52. puthelp "NOTICE $n :0,1 That handle doesn't exist!"
  53. return 0
  54. }
  55. if {$flags == ""} {
  56. puthelp "NOTICE $n :0,1 Syntax: .chattr <handle> <+|-><flags>"
  57. return 0
  58. }
  59. chattr $handle $flags
  60. puthelp "NOTICE $n :0,1 It will be done..."
  61. }
  62.  
  63. proc pub_adduser {n u h c a} {
  64. set handle [lindex $a 0]
  65. set hostmask [lindex $a 1]
  66. if {[validuser $handle]} {
  67. puthelp "NOTICE $n :0,1 That handle already exists!"
  68. return 0
  69. }
  70. if {$hostmask == ""} {
  71. set host [getchanhost $handle]
  72. if {$host == ""} {
  73. puthelp "NOTICE $n :0,1 I can't get $handle's host."
  74. puthelp "NOTICE $n :0,1 Syntax: .adduser <handle> <hostmask (nick!user@host) wildcard acceptable>
  75. return 0
  76. }
  77. else {
  78. adduser $handle *!$host
  79. puthelp "NOTICE $n :0,1 It will be done..."
  80. }
  81. }
  82. else {
  83. adduser $handle $hostmask
  84. puthelp "NOTICE $n :0,1 It will be done..."
  85. }
  86. }
  87.  
  88. proc pub_save {n u h c a} {
  89. puthelp "NOTICE $n :0,1 It will be done..."
  90. save
  91. }
  92.  
  93. proc pub_rehash {n u h c a} {
  94. puthelp "NOTICE $n :0,1 It will be done..."
  95. rehash
  96. }
  97.  
  98. proc pub_restart {n u h c a} {
  99. puthelp "NOTICE $n :0,1 It will be done..."
  100. restart
  101. }
  102.  
  103. proc pub_uptime {n u h c a} {
  104. global uptime
  105. set uu [unixtime]
  106. set tt [incr uu -$uptime]
  107. puthelp "privmsg $c :$n: My uptime is [duration $tt]."
  108. }
  109.  
  110. proc pub_info {n u h c a} {
  111. if {$a == "none"} {
  112. setuser $h info ""
  113. puthelp "NOTICE $n :0,1 It will be done..."
  114. }
  115. if {$a != "none" && $a != ""} {
  116. setuser $h info $a
  117. puthelp "NOTICE $n :0,1 It will be done..."
  118. }
  119. if {$a == ""} {
  120. if {[getuser $h info] == ""} {
  121. puthelp "NOTICE $n :0,1 You don't have an info."
  122. return 0
  123. }
  124. puthelp "NOTICE $n :0,1 Your info is: [getuser $h info]"
  125. }
  126. }
  127.  
  128. proc pub_say {n u h c a} {
  129. putserv "privmsg $c :$a"
  130. }
  131.  
  132. proc pub_msg {n u h c a} {
  133. set target [lindex $a 0]
  134. set text [string trimleft $a "$target "]
  135. putserv "privmsg $target :$text"
  136. }
  137.  
  138. proc pub_voice {n u h c a} {
  139. pushmode $c +vvvvvv $a
  140. }
  141.  
  142. proc pub_devoice {n u h c a} {
  143. pushmode $c -vvvvvv $a
  144. }
  145.  
  146. proc pub_act {n u h c a} {
  147. putserv "privmsg $c :ACTION $a"
  148. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement