Advertisement
Guest User

Untitled

a guest
Jul 25th, 2015
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 46.46 KB | None | 0 0
  1. # chanrelay.tcl 3.9
  2. #
  3. # A way to link your channels
  4. #
  5. # Author: CrazyCat <crazycat@c-p-f.org>
  6. # http://www.eggdrop.fr
  7. # irc.zeolia.net #eggdrop
  8.  
  9. ## DESCRIPTION ##
  10. #
  11. # This TCL is a complete relay script wich works with botnet.
  12. # All you have to do is to include this tcl in all the eggdrop who
  13. # are concerned by it.
  14. #
  15. # You can use it as a spy or a full duplex communication tool.
  16. #
  17. # It don't mind if the eggdrops are on the same server or not,
  18. # it just mind about the channels and the handle of each eggdrop.
  19.  
  20. ## CHANGELOG ##
  21. #
  22. # 3.9
  23. # Added exclusion list to ignore some users
  24. # Added a way to restrict relay to an internal user list
  25. #
  26. # 3.81
  27. # Action mades by server are no more using nick "*"
  28. # Added a protection on oper actions:
  29. # the action must come from the oper bot
  30. # Correction of the quit transmission: when the bot leaves,
  31. # it now detect and transmit
  32. # Added botnet status broadcast
  33. # Changed the unload system (thanks to MenzAgitat)
  34. #
  35. # 3.8
  36. # Correction : the config file can now use username for naming,
  37. # allowing to have relaying eggdrops in the same place with
  38. # different settings
  39. #
  40. # 3.7
  41. # Addition of @commandes (public) restricted to operators:
  42. # @topic <network|all> a new topic :
  43. # Changes topic on specified network (or all)
  44. # All modes must be separated with a comma
  45. # @kick <network|all> user [reason] :
  46. # Kicks user on specified network (or all)
  47. # @ban <network|all> user [reason]:
  48. # Ban-kick user on specified network (or all)
  49. # Default reason and banmask are in the conf section
  50. #
  51. # 3.6-3
  52. # Correction of trans mode on/off
  53. #
  54. # 3.6-2
  55. # Correction of the logging of actions (/me)
  56. # Nick was replaced with ACTION
  57. # Correction of empty chan list (!who)
  58. #
  59. # 3.6-1
  60. # Correction of the !who command
  61. # It's now possible to have the list from a specific server
  62. #
  63. # 3.6
  64. # Correction of modes catching / transmitting
  65. #
  66. # 3.5 (Beta)
  67. # Integration of Message Delivery Service (MDS)
  68. # by MenzAgitat
  69. #
  70. # 3.4
  71. # Settings modified by msg commands are now saved
  72. # Correction of small bugs
  73. # Best verification of settings sent
  74. # Acknowledgement and error messages added
  75. #
  76. # 3.3-1
  77. # Correction for /msg eggdrop trans <action> [on|off]
  78. #
  79. # 3.3
  80. # Added lines introducing beginning and ending of userlist
  81. #
  82. # 3.2
  83. # Added gray user highlight
  84. #
  85. # 3.1
  86. # Added check for linked bot
  87. # Corrected parse of some messages
  88. # Corrected pub commands
  89. #
  90. # 3.0
  91. # Complete modification of configuration
  92. # Use of namespace
  93. # No more broadcast, the relay is done with putbot
  94.  
  95. ## TODO ##
  96. #
  97. # Enhance configuration
  98. # Allow save of configuration
  99. # Multi-languages
  100.  
  101. ## CONFIGURATION ##
  102. #
  103. # For each eggdrop in the relay, you have to
  104. # indicate his botnet nick, the chan and the network.
  105. #
  106. # Syntax:
  107. # set regg(USERNAME) {
  108. # "chan" "#CHANNEL"
  109. # "network" "NETWORK"
  110. #}
  111. # with:
  112. # USERNAME : The username sets in eggdrop.conf (case-sensitive)
  113. # optionaly, you can override default values:
  114. # * highlight (0/1/2/3): is speaker highlighted ? (no/bold/undelined/gray)
  115. # * snet (y/n): is speaker'network shown ?
  116. # * transmit (y/n): does eggdrop transmit his channel activity ?
  117. # * receive (y/n): does eggdrop diffuse other channels activity ?
  118. # * oper (y/n): does the eggdrop accept @ commands (topic, kick, ban) ?
  119. #
  120. # userlist(beg) is the sentence announcing the start of !who
  121. # userlist(end) is the sentence announcing the end of !who
  122.  
  123. namespace eval crelay {
  124.  
  125. variable regg
  126. variable default
  127. variable userlist
  128. set regg(Spy) {
  129. "chan" "#Unix"
  130. "network" "CyberIRCD"
  131. "highlight" 0
  132. "log" "n"
  133. "oper" "y"
  134. "transmit" "n"
  135. }
  136.  
  137. set regg(RichKids) {
  138. "chan" "#Unix"
  139. "network" "chknet"
  140. "highlight" 3
  141. "oper" "n"
  142. "receive" "n"
  143. }
  144.  
  145. set regg(CC_Egg) {
  146. "chan" "#eggdrop.fr"
  147. "network" "Undernet"
  148. }
  149.  
  150. set default {
  151. "highlight" 1
  152. "snet" "n"
  153. "transmit" "y"
  154. "receive" "y"
  155. "log" "n"
  156. "oper" "n"
  157. }
  158.  
  159. # Fill this list with the nick of the users
  160. # who WON'T BE relayed, as services bot
  161. variable users_excluded {\[Guru\] Pan}
  162.  
  163. # Fill this list with the nick of the users
  164. # wich will be THE ONLY ONES to be relayed
  165. variable users_only {}
  166. # transmission configuration
  167. set trans_pub "y"; # transmit the pub
  168. set trans_act "y"; # transmit the actions (/me)
  169. set trans_nick "y"; # transmit the nick changement
  170. set trans_join "y"; # transmit the join
  171. set trans_part "y"; # transmit the part
  172. set trans_quit "y"; # transmit the quit
  173. set trans_topic "y"; # transmit the topic changements
  174. set trans_kick "y"; # transmit the kicks
  175. set trans_mode "y"; #transmit the mode changements
  176. set trans_who "y"; # transmit the who list
  177.  
  178. # reception configuration
  179. set recv_pub "y"; # recept the pub
  180. set recv_act "y"; # recept the actions (/me)
  181. set recv_nick "y"; # recept the nick changement
  182. set recv_join "y"; # recept the join
  183. set recv_part "y"; # recept the part
  184. set recv_quit "y"; # recept the quit
  185. set recv_topic "y"; # recept the topic changements
  186. set recv_kick "y"; # recept the kicks
  187. set recv_mode "y"; # recept the mode changements
  188. set recv_who "y"; # recept the who list
  189.  
  190. set userlist(beg) "Beginning of userlist"
  191. set userlist(end) "End of userlist"
  192.  
  193. # Set the banmask to use in banning the IPs
  194. # Default banmask is set to 1
  195. # 1 - *!*@some.domain.com
  196. # 2 - *!*@*.domain.com
  197. # 3 - *!*ident@some.domain.com
  198. # 4 - *!*ident@*.domain.com
  199. # 5 - *!*ident*@some.domain.com
  200. # 6 - *nick*!*@*.domain.com
  201. # 7 - *nick*!*@some.domain.com
  202. # 8 - nick!ident@some.domain.com
  203. # 9 - nick!ident@*.host.com
  204. set bantype 1
  205. # The default (ban)kick reason.
  206. # %n will be replaced with the kicker name
  207. set breason "You have been kicked by %n"
  208. # Path and name of the config file
  209. # %b will be replaced with the botnick
  210. variable config "databases/%b.chanrelay.db"
  211.  
  212. variable author "CrazyCat"
  213. variable version "3.9"
  214.  
  215. }
  216.  
  217. ####################################
  218. # DO NOT EDIT ANYTHING BELOW #
  219. ####################################
  220. proc ::crelay::init {args} {
  221.  
  222. variable me
  223.  
  224. array set me $::crelay::default
  225. array set me $::crelay::regg($::username)
  226.  
  227. if { [file exists $::crelay::config] } {
  228. [namespace current]::preload
  229. }
  230.  
  231. if { $me(transmit) == "y" } {
  232. bind msg o|o "trans" [namespace current]::set:trans
  233. if { $::crelay::trans_pub == "y" } { bind pubm - * [namespace current]::trans:pub }
  234. if { $::crelay::trans_act == "y" } { bind ctcp - "ACTION" [namespace current]::trans:act }
  235. if { $::crelay::trans_nick == "y" } { bind nick - * [namespace current]::trans:nick }
  236. if { $::crelay::trans_join == "y" } { bind join - * [namespace current]::trans:join }
  237. if { $::crelay::trans_part == "y" } { bind part - * [namespace current]::trans:part }
  238. if { $::crelay::trans_quit == "y" } {
  239. bind sign - * [namespace current]::trans:quit
  240. bind evnt - disconnect-server [namespace current]::trans:selfquit
  241. }
  242. if { $::crelay::trans_topic == "y" } { bind topc - * [namespace current]::trans:topic }
  243. if { $::crelay::trans_kick == "y" } { bind kick - * [namespace current]::trans:kick }
  244. if { $::crelay::trans_mode == "y" } { bind raw - "MODE" [namespace current]::trans:mode }
  245. if { $::crelay::trans_who == "y" } { bind pub - "!who" [namespace current]::trans:who }
  246. if { $me(oper) == "y" } {
  247. bind pub -|o "@topic" [namespace current]::trans:otopic
  248. bind pub -|o "@mode" [namespace current]::trans:omode
  249. bind pub -|o "@kick" [namespace current]::trans:okick
  250. bind pub -|o "@ban" [namespace current]::trans:oban
  251. }
  252. }
  253.  
  254. if { $me(receive) =="y" } {
  255. bind msg o|o "recv" ::crelay::set:recv
  256. if { $::crelay::recv_pub == "y" } { bind bot - ">pub" [namespace current]::recv:pub }
  257. if { $::crelay::recv_act == "y" } { bind bot - ">act" [namespace current]::recv:act }
  258. if { $::crelay::recv_nick == "y" } { bind bot - ">nick" [namespace current]::recv:nick }
  259. if { $::crelay::recv_join == "y" } { bind bot - ">join" [namespace current]::recv:join }
  260. if { $::crelay::recv_part == "y" } { bind bot - ">part" [namespace current]::recv:part }
  261. if { $::crelay::recv_quit == "y" } { bind bot - ">quit" [namespace current]::recv:quit }
  262. if { $::crelay::recv_topic == "y" } { bind bot - ">topic" [namespace current]::recv:topic }
  263. if { $::crelay::recv_kick == "y" } { bind bot - ">kick" [namespace current]::recv:kick }
  264. if { $::crelay::recv_mode == "y" } { bind bot - ">mode" [namespace current]::recv:mode }
  265. if { $::crelay::recv_who == "y" } {
  266. bind bot - ">who" [namespace current]::recv:who
  267. bind bot - ">wholist" [namespace current]::recv:wholist
  268. }
  269. bind bot - ">otopic" [namespace current]::recv:otopic
  270. bind bot - ">omode" [namespace current]::recv:omode
  271. bind bot - ">okick" [namespace current]::recv:okick
  272. bind bot - ">oban" [namespace current]::recv:oban
  273. bind disc - * [namespace current]::recv:disc
  274. bind link - * [namespace current]::recv:link
  275. }
  276.  
  277. [namespace current]::set:hl $me(highlight);
  278.  
  279. if { $me(log) == "y"} {
  280. logfile sjpk $me(chan) "logs/[string range $me(chan) 1 end].log"
  281. }
  282. bind msg -|o "rc.status" [namespace current]::help:status
  283. bind msg - "rc.help" [namespace current]::help:cmds
  284. bind msg -|o "rc.light" [namespace current]::set:light
  285. bind msg -|o "rc.net" [namespace current]::set:snet
  286. bind bot - ">notop" [namespace current]::recv:error
  287.  
  288. variable eggdrops
  289. variable chans
  290. variable networks
  291. foreach bot [array names [namespace current]::regg] {
  292. array set tmp $::crelay::regg($bot)
  293. lappend eggdrops $bot
  294. lappend chans $tmp(chan)
  295. lappend networks $tmp(network)
  296. }
  297. [namespace current]::save
  298. bind evnt -|- prerehash [namespace current]::deinit
  299.  
  300. package forget ChanRelay
  301. package provide ChanRelay $::crelay::version
  302.  
  303. }
  304.  
  305. # Reads settings from a file
  306. proc ::crelay::preload {args} {
  307. regsub -all %b $::crelay::config $::username fname
  308. if { [file exists $fname] } {
  309. set fp [open $fname r]
  310. set settings [read -nonewline $fp]
  311. close $fp
  312. foreach line [split $settings "\n"] {
  313. set lset [split $line "|"]
  314. switch [lindex $lset 0] {
  315. transmit { set [namespace current]::me(transmit) [lindex $lset 1] }
  316. receive { set [namespace current]::me(receive) [lindex $lset 1] }
  317. snet { set [namespace current]::me(snet) [lindex $lset 1] }
  318. highlight { set [namespace current]::me(highligt) [lindex $lset 1] }
  319. default {
  320. set [namespace current]::[lindex $lset 0] [lindex $lset 1]
  321. }
  322. }
  323. }
  324. } else {
  325. [namespace current]::save
  326. }
  327. }
  328. # Save all settings in a file
  329. proc ::crelay::save {args} {
  330. regsub -all %b $::crelay::config $::username fname
  331. set fp [open $fname w]
  332. puts $fp "transmit|$::crelay::me(transmit)"
  333. puts $fp "receive|$::crelay::me(transmit)"
  334. puts $fp "snet|$::crelay::me(transmit)"
  335. puts $fp "highlight|$::crelay::me(transmit)"
  336. puts $fp "trans_pub|$::crelay::trans_pub"
  337. puts $fp "trans_act|$::crelay::trans_act"
  338. puts $fp "trans_nick|$::crelay::trans_nick"
  339. puts $fp "trans_join|$::crelay::trans_join"
  340. puts $fp "trans_part|$::crelay::trans_part"
  341. puts $fp "trans_quit|$::crelay::trans_quit"
  342. puts $fp "trans_topic|$::crelay::trans_topic"
  343. puts $fp "trans_kick|$::crelay::trans_kick"
  344. puts $fp "trans_mode|$::crelay::trans_mode"
  345. puts $fp "trans_who|$::crelay::trans_who"
  346. puts $fp "recv_pub|$::crelay::recv_pub"
  347. puts $fp "recv_act|$::crelay::recv_act"
  348. puts $fp "recv_nick|$::crelay::recv_nick"
  349. puts $fp "recv_join|$::crelay::recv_join"
  350. puts $fp "recv_part|$::crelay::recv_part"
  351. puts $fp "recv_quit|$::crelay::recv_quit"
  352. puts $fp "recv_topic|$::crelay::recv_topic"
  353. puts $fp "recv_kick|$::crelay::recv_kick"
  354. puts $fp "recv_mode|$::crelay::recv_mode"
  355. puts $fp "recv_who|$::crelay::recv_who"
  356. close $fp
  357. }
  358.  
  359. proc ::crelay::deinit {args} {
  360. putlog "Starting unloading CHANRELAY $::crelay::version"
  361. [namespace current]::save
  362. putlog "Settings are saved in $::crelay::config"
  363. foreach binding [lsearch -inline -all -regexp [binds *[set ns [::tcl::string::range [namespace current] 2 end]]*] " \{?(::)?$ns"] {
  364. unbind [lindex $binding 0] [lindex $binding 1] [lindex $binding 2] [lindex $binding 4]
  365. }
  366. }
  367. putlog "CHANRELAY $::crelay::version unloaded"
  368. package forget ChanRelay
  369. namespace delete [namespace current]
  370.  
  371. }
  372.  
  373. namespace eval crelay {
  374. variable hlnick
  375. variable snet
  376.  
  377. # Setting of hlnick
  378. proc set:light { nick uhost handle arg } {
  379. # message binding
  380. switch $arg {
  381. "bo" { [namespace current]::set:hl 1; }
  382. "un" { [namespace current]::set:hl 2; }
  383. "gr" { [namespace current]::set:hl 3; }
  384. "off" { [namespace current]::set:hl 0; }
  385. default { puthelp "NOTICE $nick :you must chose \002(bo)\002ld , \037(un)\037derline, \00314(gr)\003ay or (off)" }
  386. }
  387. [namespace current]::save
  388. return 0;
  389. }
  390.  
  391. proc set:hl { arg } {
  392. # global hlnick setting function
  393. switch $arg {
  394. 1 { set [namespace current]::hlnick "\002"; }
  395. 2 { set [namespace current]::hlnick "\037"; }
  396. 3 { set [namespace current]::hlnick "\00314"; }
  397. default { set [namespace current]::hlnick ""; }
  398. }
  399. }
  400.  
  401. # Setting of show network
  402. proc set:snet {nick host handle arg } {
  403. if { $arg == "yes" } {
  404. set [namespace current]::snet "y"
  405. puthelp "NOTICE $nick :Network is now showed"
  406. } elseif { $arg == "no" } {
  407. set [namespace current]::snet "n"
  408. puthelp "NOTICE $nick :Network is now hidden"
  409. } else {
  410. puthelp "NOTICE $nick :you must chose yes or no"
  411. return 0
  412. }
  413. [namespace current]::save
  414. }
  415.  
  416. # proc setting of transmission by msg
  417. proc set:trans { nick host handle arg } {
  418. if { $::crelay::me(transmit) == "y" } {
  419. if { $arg == "" } {
  420. putquick "NOTICE $nick :you'd better try /msg $::botnick trans help"
  421. }
  422. if { [lindex [split $arg] 0] == "help" } {
  423. putquick "NOTICE $nick :usage is /msg $::botnick trans <value> on|off"
  424. putquick "NOTICE $nick :with <value> = pub, act, nick, join, part, quit, topic, kick, mode, who"
  425. return 0
  426. } else {
  427. switch [lindex [split $arg] 0] {
  428. "pub" { set type pubm }
  429. "act" { set type ctcp }
  430. "nick" { set type nick }
  431. "join" { set type join }
  432. "part" { set type part }
  433. "quit" { set type sign }
  434. "topic" { set type topc }
  435. "kick" { set type kick }
  436. "mode" { set type mode }
  437. "who" { set type who }
  438. default {
  439. putquick "NOTICE $nick :Bad mode. Try /msg $::botnick trans help"
  440. return 0
  441. }
  442. }
  443. set proc_change "[namespace current]::trans:[lindex [split $arg] 0]"
  444. set mod_change "[namespace current]::trans_[lindex [split $arg] 0]"
  445. if { [lindex [split $arg] 1] eq "on" } {
  446. if { $type eq "mode" } {
  447. bind raw - "MODE" [namespace current]::trans:mode
  448. } else {
  449. bind $type - * $proc_change
  450. }
  451. if { $type eq "sign"} {
  452. bind evnt - disconnect-server [namespace current]::trans:selfquit
  453. }
  454. set ${mod_change} "y"
  455. putserv "NOTICE $nick :Transmission of [lindex [split $arg] 0] enabled"
  456. } elseif { [lindex [split $arg] 1] eq "off" } {
  457. if { $type eq "mode" } {
  458. unbind raw - "MODE" [namespace current]::trans:mode
  459. } else {
  460. unbind $type - * $proc_change
  461. }
  462. if { $type eq "sign"} {
  463. unbind evnt - disconnect-server [namespace current]::trans:selfquit
  464. }
  465. set ${mod_change} "n"
  466. putserv "NOTICE $nick :Transmission of [lindex [split $arg] 0] disabled"
  467. } else {
  468. putquick "NOTICE $nick :[lindex [split $arg] 1] is not a correct value, choose \002on\002 or \002off\002"
  469. }
  470. }
  471. } else {
  472. putquick "NOTICE $nick :transmission is not activated, you can't change anything"
  473. }
  474. [namespace current]::save
  475. }
  476.  
  477. # proc setting of reception by msg
  478. proc set:recv { nick host handle arg } {
  479. if { $::crelay::me(receive) == "y" } {
  480. if { $arg == "" } {
  481. putquick "NOTICE $nick :you'd better try /msg $::botnick recv help"
  482. }
  483. if { [lindex [split $arg] 0] == "help" } {
  484. putquick "NOTICE $nick :usage is /msg $::botnick recv <value> on|off"
  485. putquick "NOTICE $nick :with <value> = pub, act, nick, join, part, quit, topic, kick, mode, who"
  486. return 0
  487. } else {
  488. switch [lindex [split $arg] 0] {
  489. "pub" -
  490. "act" -
  491. "nick" -
  492. "join" -
  493. "part" -
  494. "quit" -
  495. "topic" -
  496. "kick" -
  497. "mode" -
  498. "who" { set type [lindex [split $arg] 0] }
  499. default {
  500. putquick "NOTICE $nick :Bad mode. Try /msg $::botnick recv help"
  501. return 0
  502. }
  503. }
  504. set change ">$type"
  505. set proc_change "[namespace current]::recv:$type"
  506. set mod_change "[namespace current]::recv_$type"
  507. if { [lindex [split $arg] 1] eq "on" } {
  508. bind bot - $change $proc_change
  509. set ${mod_change} "y"
  510. putserv "NOTICE $nick :Reception of $type enabled"
  511. } elseif { [lindex [split $arg] 1] == "off" } {
  512. unbind bot - $change $proc_change
  513. set ${mod_change} "n"
  514. putserv "NOTICE $nick :Reception of $type disabled"
  515. } else {
  516. putquick "NOTICE $nick :[lindex [split $arg] 1] is not a correct value, choose \002on\002 or \002off\002"
  517. }
  518. }
  519. } else {
  520. putquick "NOTICE $nick :reception is not activated, you can't change anything"
  521. }
  522. [namespace current]::save
  523. }
  524.  
  525. # Generates an user@network name
  526. # based on nick and from bot
  527. proc make:user { nick frm_bot } {
  528. if {[string length $::crelay::hlnick] > 0 } {
  529. set ehlnick [string index $::crelay::hlnick 0]
  530. } else {
  531. set ehlnick ""
  532. }
  533. array set him $::crelay::regg($frm_bot)
  534. if {$nick == "*"} {
  535. set speaker [concat "$::crelay::hlnick$him(network)$ehlnick"]
  536. } else {
  537. if { $::crelay::me(snet) == "y" } {
  538. set speaker [concat "$::crelay::hlnick\($nick@$him(network)\)$ehlnick"]
  539. } else {
  540. set speaker $::crelay::hlnick$nick$ehlnick
  541. }
  542. }
  543. return $speaker
  544. }
  545.  
  546. # Logs virtual channel activity
  547. proc cr:log { lev chan line } {
  548. if { $::crelay::me(log) == "y" } {
  549. putloglev $lev "$chan" "$line"
  550. }
  551. return 0
  552. }
  553.  
  554. # Global transmit procedure
  555. proc trans:bot { usercmd chan usernick text } {
  556. if {[llength $::crelay::users_only]>0 && [lsearch -nocase $::crelay::users_only $usernick]==-1} {
  557. return 0
  558. }
  559. if {[llength $::crelay::users_excluded]>0 && [lsearch -nocase $::crelay::users_excluded $usernick]!=-1} {
  560. return 0
  561. }
  562. set transmsg [concat $usercmd $usernick $text]
  563. set ::crelay::eob 0
  564. if {$chan == $::crelay::me(chan)} {
  565. foreach bot [array names [namespace current]::regg] {
  566. if {$bot != $::botnick && [islinked $bot]} {
  567. putbot $bot $transmsg
  568. if {$usercmd == ">who" } { incr [namespace current]::eob }
  569. }
  570. }
  571. } else {
  572. return 0
  573. }
  574. }
  575.  
  576. # proc transmission of pub (trans_pub = y)
  577. proc trans:pub {nick uhost hand chan text} {
  578. if { [string tolower [lindex [split $text] 0]] == "!who" } { return 0; }
  579. if { [string tolower [lindex [split $text] 0]] == "@topic" } { return 0; }
  580. if { [string tolower [lindex [split $text] 0]] == "@mode" } { return 0; }
  581. if { [string tolower [lindex [split $text] 0]] == "@ban" } { return 0; }
  582. if { [string tolower [lindex [split $text] 0]] == "@kick" } { return 0; }
  583. [namespace current]::trans:bot ">pub" $chan $nick [join [split $text]]
  584. }
  585.  
  586. # proc transmission of action (trans_act = y)
  587. proc trans:act {nick uhost hand chan key text} {
  588. set arg [concat $key $text]
  589. [namespace current]::trans:bot ">act" $chan $nick $arg
  590. }
  591.  
  592. # proc transmission of nick changement
  593. proc trans:nick {nick uhost hand chan newnick} {
  594. [namespace current]::trans:bot ">nick" $chan $nick $newnick
  595. }
  596.  
  597. # proc transmission of join
  598. proc trans:join {nick uhost hand chan} {
  599. [namespace current]::trans:bot ">join" $chan $chan $nick
  600. }
  601.  
  602. # proc transmission of part
  603. proc trans:part {nick uhost hand chan text} {
  604. set arg [concat $chan $text]
  605. [namespace current]::trans:bot ">part" $chan $nick $arg
  606. }
  607.  
  608. # proc transmission of quit
  609. proc trans:quit {nick host hand chan text} {
  610. [namespace current]::trans:bot ">quit" $chan $nick $text
  611. }
  612. # Proc to get our self quit
  613. proc trans:selfquit {type} {
  614. [namespace current]::trans:bot "" ""
  615. }
  616.  
  617. # proc transmission of topic changement
  618. proc trans:topic {nick uhost hand chan topic} {
  619. set arg [concat $chan $topic]
  620. [namespace current]::trans:bot ">topic" $chan $nick $arg
  621. }
  622.  
  623. # proc transmission of kick
  624. proc trans:kick {nick uhost hand chan victim reason} {
  625. set arg [concat $victim $chan $reason]
  626. [namespace current]::trans:bot ">kick" $chan $nick $arg
  627. }
  628.  
  629. # proc transmission of mode changement
  630. proc trans:mode {from keyw text} {
  631. set nick [lindex [split $from !] 0]
  632. set chan [lindex [split $text] 0]
  633.  
  634. set text [concat $nick $text]
  635. [namespace current]::trans:bot ">mode" $chan $nick $text
  636. }
  637.  
  638. # proc transmission of "who command"
  639. proc trans:who {nick uhost handle chan args} {
  640. if { [join [lindex [split $args] 0]] != "" } {
  641. set netindex [lsearch -nocase $::crelay::networks [lindex [split $args] 0]]
  642. if { $netindex == -1 } {
  643. putserv "PRIVMSG $nick :$args est un réseau inconnu";
  644. return 0
  645. } else {
  646. set [namespace current]::eol 0
  647. set [namespace current]::bol 0
  648. set [namespace current]::eob 1
  649. putbot [lindex $::crelay::eggdrops $netindex] ">who $nick"
  650. }
  651. } else {
  652. set [namespace current]::eol 0
  653. set [namespace current]::bol 0
  654. [namespace current]::trans:bot ">who" $chan $nick ""
  655. }
  656. }
  657.  
  658. # Error reception
  659. proc recv:error {frm_bot command arg} {
  660. # putlog "$command - $arg"
  661. return 0
  662. }
  663.  
  664. # proc reception of pub
  665. proc recv:pub {frm_bot command arg} {
  666. if {[set him [lsearch $::crelay::eggdrops $frm_bot]] >= 0} {
  667. set argl [split $arg]
  668. set speaker [[namespace current]::make:user [lindex $argl 0] $frm_bot]
  669. putquick "PRIVMSG $::crelay::me(chan) :$speaker [join [lrange $argl 1 end]]"
  670. [namespace current]::cr:log p "$::crelay::me(chan)" "<[lindex $argl 0]> [join [lrange $argl 1 end]]"
  671. }
  672. return 0
  673. }
  674.  
  675. # proc reception of action
  676. proc recv:act {frm_bot command arg} {
  677. if {[set him [lsearch $::crelay::eggdrops $frm_bot]] >= 0} {
  678. set argl [split $arg]
  679. set speaker [[namespace current]::make:user [lindex $argl 0] $frm_bot]
  680. putquick "PRIVMSG $::crelay::me(chan) :* $speaker [join [lrange $argl 2 end]]"
  681. [namespace current]::cr:log p "$::crelay::me(chan)" "Action: [lindex $argl 0] [join [lrange $argl 2 end]]"
  682. }
  683. return 0
  684. }
  685. # proc reception of nick changement
  686. proc recv:nick {frm_bot command arg} {
  687. if {[set him [lsearch $::crelay::eggdrops $frm_bot]] >= 0} {
  688. set argl [split $arg]
  689. set speaker [[namespace current]::make:user [lindex $argl 0] $frm_bot]
  690. putquick "PRIVMSG $::crelay::me(chan) :*** $speaker is now known as [join [lrange $argl 1 end]]"
  691. [namespace current]::cr:log j "$::crelay::me(chan)" "Nick change: [lindex $argl 0] -> [join [lrange $argl 1 end]]"
  692. }
  693. return 0
  694. }
  695.  
  696. # proc reception of join
  697. proc recv:join {frm_bot command arg} {
  698. if {[set him [lsearch $::crelay::eggdrops $frm_bot]] >= 0} {
  699. set argl [split $arg]
  700. set speaker [[namespace current]::make:user [lindex $argl 1] $frm_bot]
  701. putquick "PRIVMSG $::crelay::me(chan) :"
  702. [namespace current]::cr:log j "$::crelay::me(chan)" "[lindex $argl 1] joined $::crelay::me(chan)."
  703. }
  704. return 0
  705. }
  706.  
  707. # proc reception of part
  708. proc recv:part {frm_bot command arg} {
  709. if {[set him [lsearch $::crelay::eggdrops $frm_bot]] >= 0} {
  710. set argl [split $arg]
  711. set speaker [[namespace current]::make:user [lindex $argl 0] $frm_bot]
  712. putquick "PRIVMSG $::crelay::me(chan) :<-- $speaker has left channel [lindex $argl 1] ([join [lrange $argl 2 end]])"
  713. [namespace current]::cr:log j "$::crelay::me(chan)" "[lindex $argl 0] left $::crelay::me(chan) ([join [lrange $argl 2 end]])"
  714. }
  715. return 0
  716. }
  717. # proc reception of quit
  718. proc recv:quit {frm_bot command arg} {
  719. if {[set him [lsearch $::crelay::eggdrops $frm_bot]] >= 0} {
  720. set argl [split $arg]
  721. set speaker [[namespace current]::make:user [lindex $argl 0] $frm_bot]
  722. putquick "PRIVMSG $::crelay::me(chan) :-//- $speaker has quit ([join [lrange $argl 1 end]])"
  723. [namespace current]::cr:log j "$::crelay::me(chan)" "[lindex $argl 0] left irc: [join [lrange $argl 1 end]]"
  724. }
  725. return 0
  726. }
  727.  
  728. # proc reception of topic changement
  729. proc recv:topic {frm_bot command arg} {
  730. if {[set him [lsearch $::crelay::eggdrops $frm_bot]] >= 0} {
  731. set argl [split $arg]
  732. set speaker [[namespace current]::make:user [lindex $argl 0] $frm_bot]
  733. putquick "PRIVMSG $::crelay::me(chan) :*** $speaker changes topic of [lindex $argl 1] to '[join [lrange $argl 2 end]]'"
  734. }
  735. return 0
  736. }
  737.  
  738. # proc reception of kick
  739. proc recv:kick {frm_bot command arg} {
  740. if {[set him [lsearch $::crelay::eggdrops $frm_bot]] >= 0} {
  741. set argl [split $arg]
  742. set speaker [[namespace current]::make:user [lindex $argl 1] $frm_bot]
  743. putquick "PRIVMSG $::crelay::me(chan) :*** $speaker has been kicked from [lindex $argl 2] by [lindex $argl 0]: [join [lrange $argl 3 end]]"
  744. }
  745. return 0
  746. }
  747.  
  748. # proc reception of mode changement
  749. proc recv:mode {frm_bot command arg} {
  750. if {[set him [lsearch $::crelay::eggdrops $frm_bot]] >= 0} {
  751. set argl [split $arg]
  752. set speaker [[namespace current]::make:user [lindex $argl 1] $frm_bot]
  753. putquick "PRIVMSG $::crelay::me(chan) :*** $speaker set mode [join [lrange $argl 2 end]]"
  754. }
  755. return 0
  756. }
  757.  
  758. # reception of !who command
  759. proc recv:who {frm_bot command arg} {
  760. set nick $arg
  761. set ulist ""
  762. set cusr 0
  763. if {![botonchan $::crelay::me(chan)]} {
  764. putbot $frm_bot ">wholist $::crelay::me(chan) $nick eol"
  765. return 0
  766. }
  767. foreach user [chanlist $::crelay::me(chan)] {
  768. if { $user == $::botnick } { continue; }
  769. if { [isop $user $::crelay::me(chan)] == 1 } {
  770. set st "@"
  771. } elseif { [ishalfop $user $::crelay::me(chan)] == 1 } {
  772. set st "%"
  773. } elseif { [isvoice $user $::crelay::me(chan)] == 1 } {
  774. set st "%"
  775. } else {
  776. set st ""
  777. }
  778. incr cusr 1
  779. append ulist " $st$user"
  780. if { $cusr == 5 } {
  781. putbot $frm_bot ">wholist $::crelay::me(chan) $nick $ulist"
  782. set ulist ""
  783. set cusr 0
  784. }
  785. }
  786. if { $ulist != "" } {
  787. putbot $frm_bot ">wholist $::crelay::me(chan) $nick $ulist"
  788. }
  789. putbot $frm_bot ">wholist $::crelay::me(chan) $nick eol"
  790. }
  791.  
  792. # Proc reception of a who list
  793. proc recv:wholist {frm_bot command arg} {
  794. set nick [join [lindex [split $arg] 1]]
  795. set speaker [[namespace current]::make:user $frm_bot $frm_bot]
  796. if {$::crelay::bol == 0} {
  797. incr [namespace current]::bol
  798. putserv "NOTICE $nick :*** $::crelay::userlist(beg)"
  799. }
  800. if { [join [lrange [split $arg] 2 end]] == "eol"} {
  801. incr [namespace current]::eol
  802. if {$::crelay::eol == $::crelay::eob} {
  803. putserv "NOTICE $nick :*** $::crelay::userlist(end)"
  804. }
  805. } else {
  806. putserv "NOTICE $nick :$speaker [join [lrange [split $arg] 2 end]]"
  807. }
  808. }
  809.  
  810. ######################################
  811. # Operators commands
  812. #
  813. proc trans:otopic {nick uhost handle chan text} {
  814. set netindex [[namespace current]::checkDest [join [lindex [split $text] 0]]]
  815. if { $netindex == -1 } {
  816. putserv "NOTICE $nick :Syntaxe is @topic <network|all> the new topic"
  817. return 0
  818. }
  819. set topic [join [lrange [split $text] 1 end]]
  820. if { $netindex < 99 } {
  821. putbot [lindex $::crelay::eggdrops $netindex] ">otopic $nick $topic"
  822. } else {
  823. [namespace current]::trans:bot ">otopic" $chan $nick $topic
  824. putserv "TOPIC $::crelay::me(chan) :$topic"
  825. }
  826. return 0
  827. }
  828.  
  829. proc recv:otopic {frm_bot command arg} {
  830. set nick [join [lindex [split $arg] 0]]
  831. if { $::crelay::reg($frm_bot)(oper) != "y" } { return 0; }
  832. if { ![[namespace current]::hasRights $::crelay::me(chan)] } {
  833. putbot $frm_bot ">notop $::crelay::me(chan) $nick"
  834. return 0
  835. }
  836. putserv "TOPIC $::crelay::me(chan) :[join [lrange [split $arg] 1 end]]"
  837. return 0
  838. }
  839.  
  840. proc trans:omode {nick uhost handle chan text} {
  841. set netindex [[namespace current]::checkDest [join [lindex [split $text] 0]]]
  842. if { $netindex == -1 } {
  843. putserv "NOTICE $nick :Syntaxe is @mode <network|all> <+/-mode> [arg][,<+/-mode> [arg]...]"
  844. return 0
  845. }
  846. set mode [join [lrange [split $text] 1 end]]
  847. if { $netindex < 99 } {
  848. putbot [lindex $::crelay::eggdrops $netindex] ">omode $nick $mode"
  849. } else {
  850. [namespace current]::trans:bot ">omode" $chan $nick $mode
  851. foreach m [split $mode ","] { pushmode $::crelay::me(chan) $m }
  852. flushmode $::crelay::me(chan)
  853. }
  854. return 0
  855. }
  856.  
  857. proc recv:omode {frm_bot command arg} {
  858. set nick [join [lindex [split $arg] 0]]
  859. if { $::crelay::reg($frm_bot)(oper) != "y" } { return 0; }
  860. if { ![[namespace current]::hasRights $::crelay::me(chan)] } {
  861. putbot $frm_bot ">notop $::crelay::me(chan) $nick"
  862. return 0
  863. }
  864. foreach mode [split [join [lrange [split $arg] 1 end]] ","] {
  865. catch { pushmode $::crelay::me(chan) $mode }
  866. }
  867. flushmode $::crelay::me(chan)
  868. return 0
  869. }
  870.  
  871. proc trans:okick {nick uhost handle chan text} {
  872. set netindex [[namespace current]::checkDest [join [lindex [split $text] 0]]]
  873. set vict [join [lindex [split $text] 1]]
  874. set reason [join [lrange [split $text] 2 end]]
  875. if { $vict eq "" || $netindex == -1 } {
  876. putserv "NOTICE $nick :Syntaxe is @kick <operpass> <network|all> nick \[reason of kickin\]"
  877. return 0
  878. }
  879. if { $netindex < 99 } {
  880. putbot [lindex $::crelay::eggdrops $netindex] ">okick $chan $nick $vict $reason"
  881. } else {
  882. [namespace current]::trans:bot ">okick" $chan $nick [concat $vict $reason]
  883. }
  884. return 0
  885. }
  886.  
  887. proc recv:okick {frm_bot command arg} {
  888. set nick [join [lindex [split $arg] 1]]
  889. if { $::crelay::reg($frm_bot)(oper) != "y" } { return 0; }
  890. if { ![[namespace current]::hasRights $::crelay::me(chan)] } {
  891. putbot $frm_bot ">notop $::crelay::me(chan) $nick"
  892. return 0
  893. }
  894. set vict [join [lindex [split $arg] 2]]
  895. if {![onchan $vict $::crelay::me(chan)]} {
  896. putbot $frm_bot ">notop $::crelay::me(chan) $nick"
  897. }
  898. set reason [join [lrange [split $arg] 2 end]]
  899. if { $reason eq "" } { regsub -all %n $::crelay::breason $nick reason }
  900. putkick $::crelay::me(chan) $vict $reason
  901. return 0
  902. }
  903.  
  904. proc trans:oban {nick uhost handle chan text} {
  905. set netindex [[namespace current]::checkDest [join [lindex [split $text] 0]]]
  906. set vict [join [lindex [split $text] 1]]
  907. set reason [join [lrange [split $text] 2 end]]
  908. if { $vict eq "" || $netindex == -1 } {
  909. putserv "NOTICE $nick :Syntaxe is @ban <operpass> <network|all> nick \[reason of banning\]"
  910. return 0
  911. }
  912. if { $netindex < 99 } {
  913. putbot [lindex $::crelay::eggdrops $netindex] ">oban $chan $nick $vict $reason"
  914. } else {
  915. [namespace current]::trans:bot ">oban" $chan $nick [concat $vict $reason]
  916. }
  917. return 0
  918. }
  919.  
  920. proc recv:oban {frm_bot command arg} {
  921. set nick [join [lindex [split $arg] 1]]
  922. if { $::crelay::reg($frm_bot)(oper) != "y" } { return 0; }
  923. if { ![[namespace current]::hasRights $::crelay::me(chan)] } {
  924. putbot $frm_bot ">notop $::crelay::me(chan) $nick"
  925. return 0
  926. }
  927. set vict [join [lindex [split $arg] 2]]
  928. if {![onchan $vict $::crelay::me(chan)]} {
  929. putbot $frm_bot ">notop $::crelay::me(chan) $nick"
  930. }
  931. set reason [join [lrange [split $arg] 3 end]]
  932. if { $reason eq "" } { regsub -all %n $::crelay::breason $nick reason }
  933. set bmask [[namespace current]::mask [getchanhost $vict $::crelay::me(chan)] $vict]
  934. pushmode $::crelay::me(chan) +b $bmask
  935. putkick $::crelay::me(chan) $vict $reason
  936. flushmode $::crelay::me(chan)
  937. return 0
  938. }
  939.  
  940. # Special : botnet lost
  941. proc recv:disc {frm_bot} {
  942. if {$frm_bot == $::username} {
  943. putquick "PRIVMSG $::crelay::me(chan) :I'd left the relay"
  944. } elseif {[set him [lsearch $::crelay::eggdrops $frm_bot]] >= 0} {
  945. set speaker [[namespace current]::make:user "*" $frm_bot]
  946. putquick "PRIVMSG $::crelay::me(chan) :"
  947. }
  948. return 0
  949. }
  950.  
  951. # Special : botnet recover
  952. proc recv:link {frm_bot via} {
  953. if {$frm_bot == $::username} {
  954. putquick "PRIVMSG $::crelay::me(chan) :I'm back in the relay"
  955. } elseif {[set him [lsearch $::crelay::eggdrops $frm_bot]] >= 0} {
  956. set speaker [[namespace current]::make:user "*" $frm_bot]
  957. putquick "PRIVMSG $::crelay::me(chan) :"
  958. }
  959. return 0
  960. }
  961.  
  962. ######################################
  963. # Private messaging
  964. #
  965.  
  966. bind msg - "say" [namespace current]::prv:say_send
  967. proc prv:say_send {nick uhost handle text} {
  968. if {[lsearch [package names] "MDS"] >= 0 } {
  969. [namespace current]::priv_sendmsg $nick $uhost $handle $text
  970. return 0
  971. }
  972. set dest [join [lindex [split $text] 0]]
  973. set msg [join [lrange [split $text] 1 end]]
  974. set vict [join [lindex [split $dest @] 0]]
  975. set net [join [lindex [split $dest @] 1]]
  976. if { $vict == "" || $net == "" } {
  977. putserv "PRIVMSG $nick :Use \002say user@network your message to \037user\037\002";
  978. return 0
  979. }
  980. set him [lsearch -nocase $::crelay::networks $net]
  981. if { $him == -1 } {
  982. putserv "PRIVMSG $nick :I don't know any network called $net.";
  983. putserv "PRIVMSG $nick :Available networks: [join [split $::crelay::networks]]"
  984. return 0
  985. }
  986. if { [string length $msg] == 0 } {
  987. putserv "PRIVMSG $nick :Did you forget your message to $vict@$net ?";
  988. return 0
  989. }
  990. putbot [lindex $::crelay::eggdrops $him] ">pvmsg $vict $nick@$::crelay::me(network) $msg"
  991. }
  992.  
  993. bind bot - ">pvmsg" [namespace current]::prv:say_get
  994. proc prv:say_get {frm_bot command arg} {
  995. set dest [join [lindex [split $arg] 0]]
  996. set from [join [lindex [split $arg] 1]]
  997. set msg [join [lrange [split $arg] 2 end]]
  998. if { [onchan $dest $::crelay::me(chan)] == 1 } {
  999. putserv "PRIVMSG $dest :$from: $msg"
  1000. }
  1001. }
  1002.  
  1003. # Addition of MDS interception
  1004. proc priv_sendmsg {nick host hand text} {
  1005. [namespace current]::pub_sendmsg $nick $host $hand $::crelay::me(chan) $text
  1006. }
  1007.  
  1008. proc pub_sendmsg {nick host hand chan arg} {
  1009. set dest [join [lindex [split $arg] 0]]
  1010. set vict [join [lindex [split $dest @] 0]]
  1011. set net [join [lindex [split $dest @] 1]]
  1012. set msg [join [lrange [split $arg] 1 end]]
  1013. if { $vict == "" } {
  1014. putserv "PRIVMSG $nick :Use \002$MDS::pub_msg_cmd user[@network] your message to \037user\037\002";
  1015. putserv "PRIVMSG $nick :If network is not filled, all networks will receive it";
  1016. return 0
  1017. }
  1018. if { [string length $msg] == 0 } {
  1019. putserv "PRIVMSG $nick :Did you forget your message to $vict@$net ?";
  1020. return 0
  1021. }
  1022. if { ($net eq "") || ([lsearch -nocase $::crelay::networks $net] == -1)} {
  1023. putallbots ">mds $vict $nick@$::crelay::me(network) $msg"
  1024. send_msg_to dest $vict "crelay" $msg
  1025. } else {
  1026. set him [lsearch -nocase $::crelay::networks $net]
  1027. if {[lindex $::crelay::eggdrops $him] eq $::username} {
  1028. send_msg_to dest $vict "crelay" $msg
  1029. } else {
  1030. putbot [lindex $::crelay::eggdrops $him] ">mds $vict $nick@$::crelay::me(network) $msg"
  1031. }
  1032. }
  1033. return 0
  1034. }
  1035.  
  1036. proc recv:mds {frm_bot command arg} {
  1037. set dest [join [lindex [split $arg] 0]]
  1038. set from [join [lindex [split $arg] 1]]
  1039. set msg [join [lrange [split $arg] 2 end]]
  1040. if { [onchan $dest $::crelay::me(chan)] == 1 } {
  1041. putserv "PRIVMSG $dest :$from: $msg"
  1042. } else {
  1043. send_msg_to dest "crelay" $msg
  1044. }
  1045. }
  1046.  
  1047. ######################################
  1048. # Small tools
  1049. #
  1050. proc checkDest { network } {
  1051. set netindex [lsearch -nocase $::crelay::networks $network]
  1052. if { $network ne "all" && $netindex == -1 } { return -1 }
  1053. if { $network eq "all" } { return 99 }
  1054. return $netindex
  1055. }
  1056.  
  1057. proc hasRights { chan } {
  1058. if { ![botisop $chan] && ![botishalfop $chan] } {
  1059. return 0
  1060. }
  1061. return 1
  1062. }
  1063.  
  1064. proc mask {uhost nick} {
  1065. switch -- $::crelay::bantype {
  1066. 1 { set mask "*!*@[lindex [split $uhost @] 1]" }
  1067. 2 { set mask "*!*@[lindex [split [maskhost $uhost] "@"] 1]" }
  1068. 3 { set mask "*!*$uhost" }
  1069. 4 { set mask "*!*[lindex [split [maskhost $uhost] "!"] 1]" }
  1070. 5 { set mask "*!*[lindex [split $uhost "@"] 0]*@[lindex [split $uhost "@"] 1]" }
  1071. 6 { set mask "*$nick*!*@[lindex [split [maskhost $uhost] "@"] 1]" }
  1072. 7 { set mask "*$nick*!*@[lindex [split $uhost "@"] 1]" }
  1073. 8 { set mask "$nick![lindex [split $uhost "@"] 0]@[lindex [split $uhost @] 1]" }
  1074. 9 { set mask "$nick![lindex [split $uhost "@"] 0]@[lindex [split [maskhost $uhost] "@"] 1]" }
  1075. default { set mask "*!*@[lindex [split $uhost @] 1]" }
  1076. }
  1077. return $mask
  1078. }
  1079.  
  1080. ######################################
  1081. # proc for helping
  1082. #
  1083. # proc status
  1084. proc help:status { nick host handle arg } {
  1085. puthelp "PRIVMSG $nick :Chanrelay status for $::crelay::me(chan)@$crelay::me(network)"
  1086. puthelp "PRIVMSG $nick :\002 Global status\002"
  1087. puthelp "PRIVMSG $nick :\037type\037 -- | trans -|- recept |"
  1088. puthelp "PRIVMSG $nick :global -- | -- $::crelay::me(transmit) -- | -- $::crelay::me(receive) -- |"
  1089. puthelp "PRIVMSG $nick :pub -- | -- $::crelay::trans_pub -- | -- $::crelay::recv_pub -- |"
  1090. puthelp "PRIVMSG $nick :act -- | -- $::crelay::trans_act -- | -- $::crelay::recv_act -- |"
  1091. puthelp "PRIVMSG $nick :nick -- | -- $::crelay::trans_nick -- | -- $::crelay::recv_nick -- |"
  1092. puthelp "PRIVMSG $nick :join -- | -- $::crelay::trans_join -- | -- $::crelay::recv_join -- |"
  1093. puthelp "PRIVMSG $nick :part -- | -- $::crelay::trans_part -- | -- $::crelay::recv_part -- |"
  1094. puthelp "PRIVMSG $nick :quit -- | -- $::crelay::trans_quit -- | -- $::crelay::recv_quit -- |"
  1095. puthelp "PRIVMSG $nick :topic -- | -- $::crelay::trans_topic -- | -- $::crelay::recv_topic -- |"
  1096. puthelp "PRIVMSG $nick :kick -- | -- $::crelay::trans_kick -- | -- $::crelay::recv_kick -- |"
  1097. puthelp "PRIVMSG $nick :mode -- | -- $::crelay::trans_mode -- | -- $::crelay::recv_mode -- |"
  1098. puthelp "PRIVMSG $nick :who -- | -- $::crelay::trans_who -- | -- $::crelay::recv_who -- |"
  1099. puthelp "PRIVMSG $nick :nicks appears as $::crelay::hlnick$nick$::crelay::hlnick"
  1100. puthelp "PRIVMSG $nick :\002 END of STATUS"
  1101. }
  1102. # proc help
  1103. proc help:cmds { nick host handle arg } {
  1104. puthelp "NOTICE $nick :/msg $::botnick trans <type> on|off to change the transmissions"
  1105. puthelp "NOTICE $nick :/msg $::botnick recv <type> on|off to change the receptions"
  1106. puthelp "NOTICE $nick :/msg $::botnick rc.status to see my actual status"
  1107. puthelp "NOTICE $nick :/msg $::botnick rc.help for this help"
  1108. puthelp "NOTICE $nick :/msg $::botnick rc.light <bo|un|off> to bold, underline or no higlight"
  1109. puthelp "NOTICE $nick :/msg $::botnick rc.net <yes|no> to show the network"
  1110. }
  1111.  
  1112. }
  1113.  
  1114. ::crelay::init
  1115.  
  1116. putlog "CHANRELAY $::crelay::version by \002$::crelay::author\002 loaded - http://www.eggdrop.fr"
  1117.  
  1118. @
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement