botlending forum  

Go Back   botlending forum > Eggdrop & TCL > Tcl scripting

Tcl scripting Tcl scripting related questions

Reply
 
LinkBack Thread Tools Display Modes
Old 18-02-2005, 12:04   #1 (permalink)
TCB & Ratings projects Member, #Mythic representative
 
arcade's Avatar
 
Join Date: Jun 2004
Location: In fatza calculatorului!!
Age: 19
Posts: 221
Rep Power: 37
arcade is on a distinguished road
Send a message via Yahoo to arcade
Default Need help with greet

Am un script de greet si vreu sa ii fac niste modificari:
1 sa inlocuiasca daca pun ca greet welcome %nick% to %chan% %nick% si %chan% cu nick-ul celui care a intrat pe canal si %chan% cu canalul
2 scriptul sa verifice dak e activat chanset +greet si daca e activat sa puna greet, dak nu sa dea un msg pe canal
Code:
proc greet:replace { nick chan line } {
  global botnick
  if {[string match "*%nick%*" $line]} { regsub -all %nick% $line $nick line }
  if {[string match "*%chan%*" $line]} { regsub -all %chan% $line $chan line }
  if {[string match "*%bot%*" $line]} { regsub -all %bot% $line $botnick line }
  return $line
}

proc set_greet {nick uhost hand chan} {
  global random_greet setgreet botnick

 if {$botnick != $nick} {
  if {[info exists setgreet([string tolower $chan])] && [lindex $setgreet([string tolower $chan]) 0] != ""} {
    set i $setgreet([string tolower $chan]) 
    puthelp "NOTICE $nick :$i"

   } {

     foreach i [array names random_greet] {
        if {[lsearch -exact [string tolower [channels]] [string tolower $i]] != -1} {
            if {[lindex $random_greet([string tolower $i]) 0] != ""} {
              set greet [lindex $random_greet($i) [rand [llength $random_greet($i)]]]
                if {$chan == $i} {
                  puthelp "NOTICE $nick :$greet"
                }
            }
        } {
            unset random_greet($i)
          }
      }
   }
 }
}
arcade is offline   Reply With Quote
Old 21-02-2005, 11:32   #2 (permalink)
Administrator

aka aqwzsx
 
Join Date: Jun 2004
Posts: 832
Blog Entries: 126
Rep Power: 3
UniversaliA is on a distinguished road
Default

1. Pentru a inlocui %chan% %nick% si %chan% - tu deja ai proc`ul greet:replace. Stii cum sa-l folosesti ?

2. Ca sa verifici daca chan`ul are setat greet, simplu:
Code:
if { [channel get $chan greet]} {... greet user ...} {... ignore user ...}
UniversaliA is offline   Reply With Quote
Old 21-02-2005, 13:08   #3 (permalink)
TCB & Ratings projects Member, #Mythic representative
 
arcade's Avatar
 
Join Date: Jun 2004
Location: In fatza calculatorului!!
Age: 19
Posts: 221
Rep Power: 37
arcade is on a distinguished road
Send a message via Yahoo to arcade
Default

merci da cu greet:replace am ceva prb k nuj chiar exact cum sa il folosesc pt k eu is incepator intr`ale tcl si m-am inspirat putin din alt script cand am facut proc`u

Last edited by UniversaliA; 21-02-2005 at 22:07. Reason: in acest caz nu era nevoie de quote
arcade is offline   Reply With Quote
Old 21-02-2005, 22:14   #4 (permalink)
Administrator

aka aqwzsx
 
Join Date: Jun 2004
Posts: 832
Blog Entries: 126
Rep Power: 3
UniversaliA is on a distinguished road
Default

Dubios la tine e greet`ul. Raspuns la intrebarea ta:
Code:
puthelp "NOTICE $nick :$greet
inlocuiesti cu
Code:
puthelp "NOTICE $nick :[greet:replace $nick $chan $greet]
Si inca o mica nuanta.
Code:
if {[string match "*%bot%*" $line]} { regsub -all %bot% $line $botnick line }
Acest rand, poti sterge din proc`ul greet:replace, din motiv ca nu este folosit.
UniversaliA is offline   Reply With Quote
Old 09-05-2005, 23:31   #5 (permalink)
Junior Member
 
Topsy's Avatar
 
Join Date: Dec 2004
Location: Petrosani
Age: 18
Posts: 14
Rep Power: 0
Topsy is an unknown quantity at this point
Send a message via Yahoo to Topsy
Unhappy cam asta ar fi versiunea finala nu ?

HTML Code:
 proc greet:replace { nick chan line } {
  global botnick
  if {[string match "*%nick%*" $line]} { regsub -all %nick% $line $nick line }
  if {[string match "*%chan%*" $line]} { regsub -all %chan% $line $chan line }
  if {[string match "*%bot%*" $line]} { regsub -all %bot% $line $botnick line }
  return $line
}

proc set_greet {nick uhost hand chan} {
  global random_greet setgreet botnick

 if {$botnick != $nick} {
  if {[info exists setgreet([string tolower $chan])] && [lindex $setgreet([string tolower $chan]) 0] != ""} {
    set i $setgreet([string tolower $chan]) 
    puthelp "NOTICE $nick :$i"

   } {

     foreach i [array names random_greet] {
        if {[lsearch -exact [string tolower [channels]] [string tolower $i]] != -1} {
            if {[lindex $random_greet([string tolower $i]) 0] != ""} {
              set greet [lindex $random_greet($i) [rand [llength $random_greet($i)]]]
                if {$chan == $i} {
                  puthelp "NOTICE $nick :$greet"
                }
            }
        } {
            unset random_greet($i)
          }
      }
   }
 }
}
Asta ar fi nu ?Daca asta ii cand o pun pe A&ALightScript nu mere ... cu source nu mege si am incercat si cum a zis Virtual sa redenumesc fisierul sal pun in aScript dar tot nu mere (
Topsy is offline   Reply With Quote
Old 10-05-2005, 00:12   #6 (permalink)
Administrator

aka aqwzsx
 
Join Date: Jun 2004
Posts: 832
Blog Entries: 126
Rep Power: 3
UniversaliA is on a distinguished road
Default

bind la join unde e ? care sa activeze greet`ul tau. Aici este doar procesul greet, dar bot`ul trebuie sa stie cand sa-l activeze, corect ? Si greet trebuie activat la join, pentru aceasta se faci bind la join unde se spune ca bot`ul sa execute procesul greet. Plus ia seama ca nu ai antiflood la greet, bot`ul cam risca sa faca lag cand revine din split sau la flood join.
UniversaliA is offline   Reply With Quote
Old 10-05-2005, 20:45   #7 (permalink)
Junior Member
 
Topsy's Avatar
 
Join Date: Dec 2004
Location: Petrosani
Age: 18
Posts: 14
Rep Power: 0
Topsy is an unknown quantity at this point
Send a message via Yahoo to Topsy
Unhappy hmm :(

Nu prea stiu multe despre tcl ... care mil face si mie complet cu tot cei nevoie ? pls dau o bere scuze ca va tot bat la cap dar am vrut demult greet la A&ALightScript si deaia ...

Last edited by Topsy; 10-05-2005 at 23:09.
Topsy is offline   Reply With Quote
Old 11-05-2005, 10:33   #8 (permalink)
Administrator

aka aqwzsx
 
Join Date: Jun 2004
Posts: 832
Blog Entries: 126
Rep Power: 3
UniversaliA is on a distinguished road
Default

In afara de bind join tu ai nevoie de 2 variabile globale random_greet setgreet sa fie setate. Sincer cel mai optimal e sa te uiti in sursa de unde ai luat acest cod, sa ai toate setarile corespunzatoare. Daca nu mai tii minte de unde ai sursa, incearca pe egghelp.org.
UniversaliA is offline   Reply With Quote
Old 22-08-2005, 15:20   #9 (permalink)
TCB & Ratings projects Member, #Mythic representative
 
arcade's Avatar
 
Join Date: Jun 2004
Location: In fatza calculatorului!!
Age: 19
Posts: 221
Rep Power: 37
arcade is on a distinguished road
Send a message via Yahoo to arcade
Default

Sursa e multigreet
eu nu am cerut decat ce mi-a trebuit mie, Toopsy vezi egghelp.org pt script
Totusi am uitat sa mentionez k greet:replace nu mere si nuj d c

Last edited by arcade; 22-08-2005 at 15:43.
arcade is offline   Reply With Quote
Old 22-08-2005, 21:00   #10 (permalink)
Member
 
caesar's Avatar
 
Join Date: Dec 2004
Location: Under a rock!
Posts: 116
Rep Power: 32
caesar will become famous soon enough
Lightbulb

Voi la script-urile pe care le copiati/folositi nu va uitati asa de curiozitate ce si cum a facut omu acolo? In loc de regsub ar trebui sa folositi comanda subst (citez "perform backslash, command, and variable substitutions") "care este" mult mai rapid. Cine stie cunoaste.

Edit: A si nu ar strica sa mai aruncati si voi un ochi peste docs/tcl-commands.doc pentru ca o sa va ajute ENORM. De ex, in loc de
Code:
 if {$botnick != $nick} {
(care apropo e gresit din start pentru ca ABC nu este aceiasi cu abc)
ar trebui inlocuit cu:
Code:
 if {![isbotnick $nick]} {
si asa mai departe..
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
[Correct script] Eroare Botnet [Welcome,Leave,Greet] SoLLo Tcl scripting 1 24-05-2007 19:07
[Correct script] HELP - greet :) vR|Ar Tcl scripting 5 07-04-2007 16:11
Greet AdrianK a&a light script 0 28-02-2007 23:05
Exista greet la join? BizZu #a&a 3 27-09-2005 18:29


All times are GMT +3. The time now is 10:50.


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