botlending forum  

Go Back   botlending forum > Eggdrop & TCL > Tcl scripting

Tcl scripting Tcl scripting related questions

Reply
 
LinkBack Thread Tools Display Modes
Old 18-03-2007, 17:38   #1 (permalink)
Junior Member
 
Join Date: Mar 2007
Posts: 8
Rep Power: 0
MasT3r is an unknown quantity at this point
Question topic

Ceao de unde pot sa iau un tcl din-acesta ,am vazut pe forum un post,care suna ceva de genu
-----------------------------
zicea careva de un sistem de 3 topicuri ..
se aplica? mi se pare o idee buna

ex:
1.(sunt boti): http://FAQ.starbots.info Ask all you need in one line & wait. | Intreaba tot ce doresti intr-o linie & asteapta.
2.(no bots): http://FAQ.starbots.info There are no free bots | Nu sunt boti liberi
3.(no admins): http://FAQ.starbots.info There are no admins online | Nu sunt admini online

si DELPHINUS sa aiba "!topic 1" sau "!topic no-admins" ma rog ..
------------------------
si s-a spus ca o sa se faca in noul bot a&a..ceva de genu..
puteti sa faceti tcl-ul sau sa spuneti de unde pot sa il iau ?
ca sa dau !topic1 si sa apara la topic --> http://FAQ.starbots.info Ask all you need in one line & wait. | Intreaba tot ce doresti intr-o linie & asteapta.
topic2 -ca la 2,topic3 - ca la 3 ? ??
care ma ajuta ?
si dak se poate,tcl de spam ,da mesaj on join,ceva de genu sunt un egg al canalului $chan ..please do not reply this message .....si sa dea ban celor care raspund la el ? ? ca eu m-am chinuit la amanadoua tcl-urile...da' nu mi-a reusit...asha ca..care poate sami puna versiunea "finala" a tcl-ului, care sa fie si buna ? ca nu ma prea pricep la tcl-uri
MasT3r is offline   Reply With Quote
Old 19-03-2007, 02:44   #2 (permalink)
Member
 
Join Date: Jun 2004
Location: Canada
Age: 18
Posts: 145
Rep Power: 0
AdrianK is on a distinguished road
Default

in a&a_master_local.tcl
cauti

Code:
proc pub:topic {hand chan args x mix} {
si tot procesul il schimbi in

Code:
proc pub:topic {hand chan args x mix} {
	global botnick 

        set topic1 "sunt admini"
        set topic2 "nu sunt admini"
        set topic3 "sunt admini dar sunt prea proshti sa va ajute"

	set option [string tolower [lindex $args 0]]
	set args   [join [lrange  $args 0 end]]

	if {![string length $option]} { a:usage $x topic; return "FAILED: not all parameters specified" }
	if { [a:check -info $option]} { set option info }

	switch -exact -- $option {
	        1 {putserv "TOPIC $chan :$topic1"; return}
                2 {putserv "TOPIC $chan :$topic2"; return}
                3 {putserv "TOPIC $chan :$topic3"; return} 
		lock    { if {![channel get $chan topic] } {
				channel set $chan +topic
				::stats::channel -set $chan topicwhom "$hand"
				::stats::channel -set $chan topictext "[topic $chan]"
				a:tell $x 54 "$chan [topic $chan]"; return "LOCK" } else { 
				a:tell $x 55 $chan; return "FAILED TO LOCK: locked already" 
			}
		}
		enforce { if {![botisop $chan]}      { a:tell $x 96 $chan; return "FAILED: bot is not opped" }
			  if { [::stats::channel -get $chan topictext]==""} {
				a:tell $x 121 $chan; return "FAILED TO ENFORCE: no topic"} else {
				putserv "TOPIC $chan :[::stats::channel -get $chan topictext]"; return "ENFORCE" 
			}
		}
		unlock  { if { [channel get $chan topic]} {
				channel set $chan -topic
				a:tell $x 116 $chan; return "UNLOCK"} else {
				a:tell $x 117 $chan; return "FAILED TO UNLOCK: not locked" 
			}
		}
		info    { if { [::stats::channel -get $chan topictext] != "" } {
				a:tell $x 118 "[::stats::channel -get $chan topictext]"
				a:tell $x 119 "[::stats::channel -get $chan topicwhom] [iif [channel get $chan topic] + -]topic [iif [channel get $chan enforcetopic] + -]enforcetopic"; return "INFO"} else {
				a:tell $x 120; return "FAILED TO INFO: no info"
			}
		}
	}

	if {![botisop $chan]}      { a:tell $x 96 $chan; return "FAILED: bot is not opped" }
	if { [channel get $chan topic] } {
		a:tell $x 119 "[::stats::channel -get $chan topicwhom] [iif [channel get $chan topic] + -]topic [iif [channel get $chan enforcetopic] + -]enforcetopic"
		::stats::channel -set $chan topicwhom $hand
		::stats::channel -set $chan topictext $args
	} 

	putserv "TOPIC $chan :[join $args]"
	return "[join $args]"
}
Ca rezultat ai comanda topic cu optiunele 1, 2, 3 adaugate.
AdrianK is offline   Reply With Quote
Old 20-03-2007, 00:48   #3 (permalink)
Junior Member
 
Join Date: Mar 2007
Posts: 8
Rep Power: 0
MasT3r is an unknown quantity at this point
Default

pai da ,ar mai fi o problema ..in dcc chat...cand dau topic ....
[22:47:18] <trak3rt3am> [20:47] Tcl error [a:bind:topic]: invalid command name "a:bind:topic"
[22:47:19] <trak3rt3am> [20:47] Tcl error [a:bind:topic]: invalid command name "a:bind:topic"
si...aklo la local m ...cand ridic botu,ca nu e inca pe shell,zice : error :can't read args ...ce sa-i faccccc ??
MasT3r is offline   Reply With Quote
Old 20-03-2007, 02:50   #4 (permalink)
Member
 
caesar's Avatar
 
Join Date: Dec 2004
Location: Under a rock!
Posts: 116
Rep Power: 33
caesar will become famous soon enough
Default

Code:
set topic(chan) "#moo"
set topic(no1) "Topic 1"
set topic(no2) "Topic 2"
set topic(no3) "Topic 3"

bind pub o !topic pub:topic

proc pub:topic {nick uhost hand chan text} {
  global topic
  if {![string match -nocase $chan $topic(chan)]} {
    return
  }
  if {![botisop $chan]} {
    putserv "NOTICE $nick :Sorry, I'm not oped in $chan channel."
    return
  }
  set tl [llength [array name topic -regexp no]]
  if {[set no [lindex [split $text] 0]] == ""} {
    putserv "NOTICE $nick :Usage: .topic 1 to $tl to change the topic."
    return
  }
  if {$no > $tl} {
    putserv "NOTICE $nick :I got only \002$tl\002 topic[expr {$tl==1?"":"s"}] in memory."
    return
  }
  putserv "TOPIC $chan :$topic(no$no)"
}
O sa mearga doar pe canalul setat in variabila topic(chan).
caesar is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Request script] topic -join- ZmEu Tcl scripting 0 01-10-2008 23:14
mirc scripting [OFF TOPIC] Kurupt Tcl scripting 4 29-08-2006 11:15
Auto Topic DarK Tcl scripting 3 06-12-2004 10:40
topic DarkEngel Tcl scripting 9 09-11-2004 23:26


All times are GMT +3. The time now is 07:29.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.