Advertisement
Guest User

Untitled

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