Guest User

Untitled

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