botlending forum  

Go Back   botlending forum > Eggdrop & TCL > Tcl scripting

Tcl scripting Tcl scripting related questions

Reply
 
LinkBack Thread Tools Display Modes
Old 12-07-2004, 03:30   #1 (permalink)
Junior Member
 
Join Date: Jun 2004
Posts: 9
Rep Power: 0
razwan is an unknown quantity at this point
Default Tcl error [pub:cleanuserlist]: can't read "Auto_Clean_Days": no such variable

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.
razwan is offline   Reply With Quote
Old 12-07-2004, 03:37   #2 (permalink)
Administrator

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

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.
UniversaliA is offline   Reply With Quote
Old 12-07-2004, 04:02   #3 (permalink)
Junior Member
 
Join Date: Jun 2004
Posts: 9
Rep Power: 0
razwan is an unknown quantity at this point
Default

lol ce bleg sunt ))) uitasem sa setez variabila haha
mersi, sunt obosit rau :P
razwan is offline   Reply With Quote
Old 12-07-2004, 04:11   #4 (permalink)
Junior Member
 
Join Date: Jun 2004
Posts: 9
Rep Power: 0
razwan is an unknown quantity at this point
Default

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
	}
}
la scriptu asta zice asa:
Tcl error [user_join]: invalid command name "user_join"

Last edited by razwan; 12-07-2004 at 17:02.
razwan is offline   Reply With Quote
Old 12-07-2004, 05:13   #5 (permalink)
Administrator

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

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.
UniversaliA is offline   Reply With Quote
Old 13-07-2004, 14:02   #6 (permalink)
Junior Member
 
Join Date: Jun 2004
Posts: 9
Rep Power: 0
razwan is an unknown quantity at this point
Default

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
razwan is offline   Reply With Quote
Old 14-07-2004, 10:16   #7 (permalink)
Administrator

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

Era o eroare in varianta mea & te rog mai mult sa nu zici "mersi oricum". Eu improvizez scriptele si cateodata mai scap ceva, daca nu merge - zici ca nu merge si eu corijez. Acuma e ok, lucreaza.
UniversaliA is offline   Reply With Quote
Old 15-07-2004, 16:48   #8 (permalink)
Junior Member
 
Join Date: Jun 2004
Posts: 9
Rep Power: 0
razwan is an unknown quantity at this point
Default

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!
razwan is offline   Reply With Quote
Old 17-07-2004, 04:46   #9 (permalink)
Administrator

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

nu e vorba de a ma jigni deloc e vorba de ca eu duc pina la capat ce am inceput nimic mai mult :P
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
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


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


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