![]() |
|
|||||||
| Tcl scripting Tcl scripting related questions |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Junior Member
Join Date: Jun 2004
Posts: 9
Rep Power: 0 ![]() |
Code:
bind pub n|n ${cmdpfix}cleanuserlist pub:cleanuserlist
bind time - "00 01 * * *" autocleanuserlist
# Sterge userii pe care nu i-am vazut de X zile:
# Procedura manuala
# Ete asa: .cleanuserlist
proc pub:cleanuserlist {nick host hand chan arg} {
global The_Owner
if { [accnr $hand $chan] < 13 } { return 0 }
autocleanuserlist 1 1 1 1 1
putcmdlog "<<$nick>> !$hand! cleanuserlist"
}
# Procedura automata se executa automat in fiecare zi la miezul noptii
# .autocleanuserlist
proc autocleanuserlist {min hour day month year} {
global botnick Auto_Clean_Days
if { $Auto_Clean_Days == 0 } { return 0 }
set expire_time [expr $Auto_Clean_Days * 86400]
set delcount 0
set cur_time [unixtime]
foreach u [userlist] {
set lt [lindex [getuser $u LASTON] 0]
if { $lt == "" } { set lt 0 }
set time_diff [expr ($cur_time - $lt)]
if { $time_diff > $expire_time } {
set acc_chk 0
foreach c [channels] {
set h_chk [chattr $u $c]
if { [regexp "o" $h_chk] || [regexp "b" $h_chk] || [regexp "v" $h_chk] || [regexp "k" $h_chk] } { set acc_chk 1 }
}
if { $acc_chk == 0 } {
putlog "AUTO-CLEAN: Userul \0032$u\0032 nu a fost vazut de [duration $time_diff] - STERS"
deluser $u
incr delcount
}
}
}
putlog "AUTO-CLEAN: $delcount User Sters."
}
zice-ti-mi si mie de ce nu merje pls Last edited by UniversaliA; 12-07-2004 at 03:34. |
|
|
|
|
|
#2 (permalink) |
|
Administrator
aka aqwzsx |
dupa bind time - "00 01 * * *" autocleanuserlist adaugi doar randul urmator set Auto_Clean_Days 60
60 e numarul de zile, daca botul nu a avazul user-ul timp de 60 zile - el il sterge. Saca setezi 0 - BOTul nu va sterge pe nimeni. E o eroare elementara, in eroare clar e zis ca Auto_Clean_Days nu e definit Last edited by UniversaliA; 12-07-2004 at 03:39. |
|
|
|
|
|
#4 (permalink) |
|
Junior Member
Join Date: Jun 2004
Posts: 9
Rep Power: 0 ![]() |
ete mai am o problema, la asta ma chinui de ceva timp, poate ma ajutzi
Code:
bind join - * user_join
# Join handler.
# This reminds users who don't have their password set to set it.
# Also, if a user joins in with a different host mask, tells what to do to add current hostmask to him.
proc msg:user_join {nick host hand chan} {
global botnick
if { [strlen $nick] > 9 } {
set who ""
for {set x 0} {$x < 9} {incr x} { set who "$who[stridx $nick $x]" }
} { set who $nick }
set flag_chk [chattr $who $chan]
if { $hand == "*" } {
if { ([validuser $who]) && ([regexp "o" "$flag_chk"]) && ([passwdok $who ""] != 1) } {
notice $nick "Your hostmask doesnt match the hostmask in my user list for current nick."
notice $nick "To add this hostmask to your hostmask list, \002/msg $botnick addmask <password>"
}
}
set flag_chk [chattr $hand $chan]
if { ([passwdok $hand ""] == 1) && ([regexp "o" "$flag_chk"]) && (![regexp "b" "$flag_chk"])} {
notice $nick "You have operator (or higher) access and you don't have your password set yet"
notice $nick "Please set your password by typing: \002/msg $botnick pass \002<\002password\002>"
return 0
}
}
Tcl error [user_join]: invalid command name "user_join" Last edited by razwan; 12-07-2004 at 17:02. |
|
|
|
|
|
#5 (permalink) |
|
Administrator
aka aqwzsx |
shimbi denumirea de la proc msg:user_join {nick host hand chan} { in proc user_join {nick host hand chan} {
ca sa nu ai probleme cu nick-uri din 12 caractere shimba 9 in 12, tu ai luat acest cod din kalich, in acest caz nu cel mai reusit cod. in orice caz ideia care a dorit el sa o implenteze ar arata asa mai bine: Code:
bind join - * user_join
proc user_join {nick host hand chan} {
global botnick
if {[string length $nick] > 12 } {set nick [string range $nick 0 11]} {set who $nick}
if {[validuser $who] && ![string equal -nocase $who $hand] && [matchattr $who o|o $chan] && ![passwdok $who ""]} {
notice $nick "Your hostmask doesnt match the hostmask in my user list for current nick."
notice $nick "To add this hostmask to your hostmask list, \002/msg $botnick addmask <password>"
} elseif { [validuser $hand] && [matchattr $hand -b+o|o $chan] && [passwdok $hand ""]} {
notice $nick "You have operator (or higher) access and you don't have your password set yet"
notice $nick "Please set your password by typing: \002/msg $botnick pass \002<\002password\002>"
}
}
Last edited by UniversaliA; 14-07-2004 at 10:15. |
|
|
|
|
|
#6 (permalink) |
|
Junior Member
Join Date: Jun 2004
Posts: 9
Rep Power: 0 ![]() |
am schimbat ce mi-ai zis si merge ..
am incercat si varianta ta dar aia nu merge .. adika de fiecare daca cand intra cineva cu access pe canal ii zice ca nu-i recunoaste hostul, chiar daca ala e hostul si daca dai comanda sa adauge hostul da o eroare oricum mersi, merge prima |
|
|
|
|
|
#8 (permalink) |
|
Junior Member
Join Date: Jun 2004
Posts: 9
Rep Power: 0 ![]() |
imi cer scuze daca te-am jignit, nu asta a fost intentia.
stiu ca poti sa gresesti si tu, si stiu si ca poti sa rezolvi "problema" "mersi oricum" era de fapt "mersi, oricum" adika iti multumesc pentru ajutor si nu mai e nevoie sa o mai rezolvi pe a doua ca merge prima (pe care de altfel tot tu ai rezolvat-o). in concluzie am zis asta ca sa nu te mai aglomerez, gandindu-ma ca mai ai si alte probleme. scuze inca o data & keep the good work! |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Botlending Coordinator, SubProject "Botlending School" | UniversaliA | Polls & announcements | 8 | 08-05-2006 01:54 |
| Botlending Coordinator, SubProject "Trusted Channels Benchmarking" | UniversaliA | Polls & announcements | 6 | 08-05-2006 00:01 |
| Regulile "Botlending On IRC" | AdrianK | Botlending channels | 4 | 20-01-2005 13:18 |
| Tcl error [pub:takeovers]: illegal access mode "banprinxtake.txt" | razwan | Tcl scripting | 3 | 17-07-2004 15:03 |