botlending forum  

Go Back   botlending forum > Eggdrop & TCL > Tcl scripting

Tcl scripting Tcl scripting related questions

Reply
 
LinkBack Thread Tools Display Modes
Old 07-06-2008, 23:45   #1 (permalink)
Junior Member
 
Join Date: Feb 2007
Posts: 9
Rep Power: 0
Smile is an unknown quantity at this point
Post Self check if have X access

Am acest TCL in care egg-ul verifica chan-ul ... el merge dar ash vrea ca eggul sa verifice dupa acele 2 min in care trebuie sa i se dea access... sa verifice singur access-ul la X iar in caz ca nu are ... sa dea part singur de pe chan



Code:
bind bot B freechans bot:freechans

proc bot:freechans {bot com txt} {

global settings

if {[llength [channels]] < $settings(max_chans)} {

putbot $bot "chansfree"

}

}

bind bot B addchan bot:addchan

proc bot:addchan {bot com txt} {

set txt [split $txt]

set chan [lindex $txt 0]

set who [lindex $txt 1]

set x [lrange $txt 2 5]

set mix [lindex $txt 6]



pub:join [lindex $x 1] $chan $who $x $mix

}





proc speak {chan} {

global tchan

set tchan "$chan"

bind pubm - "* nu-mi amintesc sa-l fi vazut pe *" chan:purge

bind pubm - "* i don`t remember seeing *" chan:purge

puthelp "privmsg $chan :2Va rugam asteptati pana voi verifica canalul 4$chan."

puthelp "privmsg $chan :2Please wait untill I will verify the channel 4$chan."

}



proc speak2 {chan} {

global tchan

set tchan "$chan"

puthelp "privmsg $chan :!seen a"

}



proc speak3 {chan} {

global chanserv

set tchan "$chan"

if {[onchan X $chan]} {puthelp "PRIVMSG $chan :2Te rog adauga botului 499 si autoop la X astfel: 4/msg X adduser $chan $::chanserv(user) 499 2& 4/msg x modinfo $chan automode $::chanserv(user) op 2 si da paste la confirmari pe acest canal. Ai 2 minute sa dai paste la confirmare, in caz contrar voi parasi canalul !!"} else { puthelp "PRIVMSG $chan :2Te rog adauga autoop la psyBNC astfel: 4/addautoop $chan :*!*@$::chanserv(user).users.undernet.org2 si da paste la confirmare pe acest canal. Ai 2 minute sa dai paste la confirmare, in caz contrar voi parasi canalul !!" }

utimer 65 [unbind pubm - "* nu-mi amintesc sa-l fi vazut pe *" chan:purge]

utimer 66 [unbind pubm - "* i don`t remember seeing *" chan:purge]

bind pubm - "* am setat AUTOMODE la OP *" chan:cycle

bind pubm - "* set AUTOMODE to OP *" chan:cycle

bind pubm - "* hostmask *" chan:cycle

bind pubm - "* hostul *" chan:cycle

}

proc speak4 {chan} {

global chanserv

set tchan "$chan"

if {[onchan X $chan]} {puthelp "PRIVMSG $chan :2Please add 499 and autoop to X using: 4/msg X adduser $chan $::chanserv(user) 499 2& 4/msg x modinfo $chan automode $::chanserv(user) op2 and paste the confirmations in here. You have 2 minute to paste the confirmation, else I will leave the channel !!"} else { puthelp "PRIVMSG $chan :2Please add autoop to the psyBNC using: 4/addautoop $chan :*!*@$::chanserv(user).users.undernet.org2 and paste the confirmation in here. You have 2 minute to paste the confirmation, else I will leave the channel !!" }

}



proc chan:cycle {nick host hand chan txt} {

putquick "part $chan :2Cycling channel to see if I can get autoop on $chan"

}



proc speak5 {chan} {

global tchan

set tchan "$chan"

utimer 180 [unbind pubm - "* am setat AUTOMODE la OP *" chan:cycle]

utimer 181 [unbind pubm - "* set AUTOMODE to OP *" chan:cycle]

utimer 182 [unbind pubm - "* hostmask *" chan:cycle]

utimer 183 [unbind pubm - "* hostul *" chan:cycle]

puthelp "privmsg $chan :4Inregistrare COMPLETA.2 Va rugam sa nu abuzati de botul #U&U, in caz contrat acesta va pleca de pe canalul dumneavoastra."

puthelp "privmsg $chan :4Registration COMPLETED.2 Please don`t abuse to the #U&U eggdrop, in the other way he will leave you channel."

}

putlog "\00304 Request 2 loaded"


Mersi ! Astept Reply !
__________________
...::: Just Smile :::....

Last edited by UniversaliA; 18-06-2008 at 15:57.
Smile is offline   Reply With Quote
Old 18-06-2008, 15:59   #2 (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 acest script, ai altceva pe bot? De exemplu a&a light (daca da, ce versiune)? Ca sa stiu ce rutine pot folosi sau trebuie scris totul din nou.

P.S. Data viitoare, sa dai te rog o denumirea la thread mai adecvata, de exemplu cum am schimbat eu acuma. Merci anticipat :)
UniversaliA is offline   Reply With Quote
Old 20-06-2008, 03:27   #3 (permalink)
Junior Member
 
Join Date: Feb 2007
Posts: 9
Rep Power: 0
Smile is an unknown quantity at this point
Default :)

Ok am inteles srry voi tine minte next time

Versiunea la egg e
Code:
Eggdrop version: 1.6.18, script version: a&a ...
e a&a_light

Mersi !
__________________
...::: Just Smile :::....
Smile is offline   Reply With Quote
Old 30-06-2008, 01:06   #4 (permalink)
Administrator

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

Code:
bind bot B freechans bot:freechans
proc bot:freechans {bot com txt} {
 global settings
 if {[llength [channels]] < $settings(max_chans)} {putbot $bot "chansfree"}
}
 
bind bot B addchan bot:addchan
proc bot:addchan {bot com txt} {
 global tchan
 set txt [split $txt]
 set chan [lindex $txt 0]
 set who [lindex $txt 1]
 set x [lrange $txt 2 5]
 set mix [lindex $txt 6]
 set tchan "$chan"
 pub:join [lindex $x 1] $chan $who $x $mix
}
 
proc speak {chan} {
 bind pubm - "* nu-mi amintesc sa-l fi vazut pe *" chan:purge
 bind pubm - "* i don`t remember seeing *" chan:purge
 puthelp "privmsg $chan :2Va rugam asteptati pana voi verifica canalul 4$chan."
 puthelp "privmsg $chan :2Please wait untill I will verify the channel 4$chan."
 puthelp "privmsg $chan :!seen a"
}
 
proc speak3 {chan} {
 if {[onchan X $chan]} {puthelp "PRIVMSG $chan :2Te rog adauga botului 499 si autoop la X astfel: 4/msg X adduser $chan $::chanserv(user) 499 2& 4/msg x modinfo $chan automode $::chanserv(user) op 2 si da paste la confirmari pe acest canal. Ai 2 minute sa dai paste la confirmare, in caz contrar voi parasi canalul !!"} else { puthelp "PRIVMSG $chan :2Te rog adauga autoop la psyBNC astfel: 4/addautoop $chan :*!*@$::chanserv(user).users.undernet.org2 si da paste la confirmare pe acest canal. Ai 2 minute sa dai paste la confirmare, in caz contrar voi parasi canalul !!" }
 bind pubm - "* am setat AUTOMODE la OP *" chan:cycle
 bind pubm - "* set AUTOMODE to OP *" chan:cycle
 bind pubm - "* hostmask *" chan:cycle
 bind pubm - "* hostul *" chan:cycle
}
 
proc speak4 {chan} {
 global chanserv
 if { [onchan X $chan]} {puthelp "PRIVMSG $chan :2Please add 499 and autoop to X using: 4/msg X adduser $chan $::chanserv(user) 499 2& 4/msg x modinfo $chan automode $::chanserv(user) op2 and paste the confirmations in here. You have 2 minute to paste the confirmation, else I will leave the channel !!"} else { puthelp "PRIVMSG $chan :2Please add autoop to the psyBNC using: 4/addautoop $chan :*!*@$::chanserv(user).users.undernet.org2 and paste the confirmation in here. You have 2 minute to paste the confirmation, else I will leave the channel !!" }
}
 
proc chan:cycle {nick host hand chan txt} {
 putquick "part $chan :2Cycling channel to see if I can get autoop on $chan"
}
 
proc speak5 {chan} {
 puthelp "privmsg $chan :4Inregistrare COMPLETA.2 Va rugam sa nu abuzati de botul #U&U, in caz contrat acesta va pleca de pe canalul dumneavoastra."
 puthelp "privmsg $chan :4Registration COMPLETED.2 Please don`t abuse to the #U&U eggdrop, in the other way he will leave you channel."
 utimer 180 a:unbind 
}
 
proc a:unbind {} {
 
 catch {unbind pubm - "* am setat AUTOMODE la OP *" chan:cycle}
 catch {unbind pubm - "* set AUTOMODE to OP *" chan:cycle}
 catch {unbind pubm - "* hostmask *" chan:cycle}
 catch {unbind pubm - "* hostul *" chan:cycle}
 catch {unbind pubm - "* nu-mi amintesc sa-l fi vazut pe *" chan:purge}
 catch {unbind pubm - "* i don`t remember seeing *" chan:purge}
}
 
 
putlog "\00304 Request 2 loaded"

Nu ai dat tot script`ul. Sunt variabile care nu inteleg pentru ce ai nevoie, procese care nu sunt initiate nici de un eveniment etc etc.
  1. Toate unbind`urile le pui in un singur proces si nu generezi sute de utime`uri.
  2. Cand setezi un unbind verifici daca acest bind exista sau il executi prin catch. Altfel risti la o anumita eroare (care sigur va fi) si script`ul sa nu lucreze pana la urma.
  3. Nu am vazut procedura cum verifici daca ai autoop, desi cycle pentru aceasta dai.
  4. De "proc speak2" nu ai nevoie, ili poti uni cu "proc speak" deoadata.
  5. Folosesti "global tchan". Daca bot`ul in acelas moment verifica doua sau mai multe canale, script`ul cam nu va lucra. Sau seteaza ca bot`ul sa poata verifica doar un canal si dupa ce termina sa se ocupe de altul (faci aceasta in "proc bot:freechans") sau "global tchan" folosesti ca lista, din care ar fi posibil de gasit toate canalele de care bot`ul se ocupa la moment.
  6. Folosesti in fiecare proces "set tchan $chan". Incorect. De ce o faci? Setezi o singura data in "proc bot:addchan" - in restul proceselor doar il citesti, daca ai nevoie. Pentru moment nu ai nevoie in nici proc.
  7. Ar fi bine in "proc bot:freechans" sa verifici ca bot`ul sa fie conectat la server`ul IRC mai mult de cateva zeci de minute (sa excludem lag`ul) si ideal ar fi bine de verificat daca nu are multe in puthelp, putserv & putquick.
  8. In "proc speak3" sau folosesti "global chanserv" sau prefixezi "$::chanserv(user)" cu "::".
  9. Nu folosesti rutine pentru X care au fost implementate in a&a light si dai comenzi directe la X, nu e ok. Rutinele pentru X verifica sa nu fie X flood`at si comenzile prioritare sa fie executate in primul rand.
Cum am mai spus la inceput, nu am toate procesele la script. Deci nu vad logica cum si cand fiecare proces este executat. Sau imi arati tot script`ul (dupa ce aplici modificarile care deja am sugerat si faci in plus schimbarile necesare care am mentionat mai sus) sau iti spun algoritmic cum faci.

Deci, algoritimic. Dupa ce toate rutinele de verificare sunt trecute cu succes
  • dai comanda la "X info $botnick"
  • faci bind de la X la mesajul "Channels: *".
In bind pentru acest mesaj verifici daca are bot`ul acces sau nu. Daca are e ok, poti chiar sa-l faci sa spuna msg pe consola sau undeva in log ca e ok totul si are asa access, sa verifici daca nivelul de acces e ok etc etc.

Deasemenea in rutinele de verificare in afara de seen as include
  • numarul de oameni pe canal
  • daca nu-i X, cine a cerut bot sa fie cu OP
  • daca in general pe canal este OP
  • un !help sau un !usage pe canal, cu acelas rol ca la !seen
  • whois la toti care sunt opati pe canal, in caz daca la ei in info scrie ca ei sunt boti

Last edited by UniversaliA; 30-06-2008 at 02:43.
UniversaliA 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] give X access & autoop spy Tcl scripting 8 28-08-2008 03:20
modificare nivelului de access GoRaPiD a&a light script 3 06-08-2004 02:07
Tcl error [pub:takeovers]: illegal access mode "banprinxtake.txt" razwan Tcl scripting 3 17-07-2004 15:03


All times are GMT +3. The time now is 12:41.


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