Advertisement
Guest User

Untitled

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