Go Back   FlashFXP Forums > > > >

Harm's scripts ioBanana, Readd script, ioVote

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-02-2005, 01:56 PM   #1
Frodo
Junior Member
ioFTPD Foundation User
 
Join Date: Sep 2003
Posts: 15
Default [Fixed] daystats to include top downloaders

How to enable ioBanana to include stats of downloaders?

ioBanana script do include irc daily stats for the biggest uploaders, is it possilbe to do that with downloaders as well? If so how, and what code do I need to add, if any?
Frodo is offline   Reply With Quote
Old 08-03-2005, 01:25 AM   #2
Harm
Too much time...
Ultimate Scripter
 
Join Date: Jul 2003
Posts: 1,430
Default

Code:
proc ioB:daystats {} {
	global ioBvar dsto
	set ee ""; set ioBvar(ftp_error) ""
	if {[unixtime] < $dsto} {return}
	set day [clock format [expr [clock seconds]+(12*60*60)] -format "%d" -gmt true]
	set weekday [clock format [expr [clock seconds]+(12*60*60)] -format "%A" -gmt true]
	if {$day==01} {
		putlog "\[\002ioB\002\] endOfMonth... displaying monthstats"
		set month [clock format [expr [clock seconds]-(12*60*60)] -format "%B" -gmt true]
		set year [clock format [expr [clock seconds]-(12*60*60)] -format "%Y" -gmt true]
		set output $ioBvar(t_daystats_month_header)
		set output [ioB:replacevar $output "%month" "$month"]
		set output [ioB:replacevar $output "%year" "$year"]
		ioB:tsend chan $ioBvar(announcechannel) $output
		set status [catch {set ee [::ftp::Quote $ioBvar(ftp) SITE BSTATS MONTHUP ALL ALL 10 "\"$ioBvar(sections)\""]} result]
		if {$status==1 && [string equal $ioBvar(ftp_error) "Not connected!"]} {dccbroadcast "\[\002ioB\002\] Force Login... Status=$status - Result=$result"; ioB:ftp_force_login; return}
		set lines [split $ee \n]
		set lines [lreplace $lines end end]
		foreach line $lines {
			set lbit [split [string range $line 4 end] ";"]
			set rank [lindex $lbit 0]
			set nick [lindex $lbit 1]
			set group [lindex $lbit 2]
			set transfer [lindex $lbit 3]
			if {$rank!=""} {
				if {[string length $rank]==1} {set rank "0$rank"}
				set output $ioBvar(t_daystats_body)
				set output [ioB:replacevar $output "%pos" "$rank"]
				set output [ioB:replacevar $output "%name" "$nick"]
				set output [ioB:replacevar $output "%group" "$group"]
				set output [ioB:replacevar $output "%total" [ioB:fixsm $transfer]]
				ioB:tsend chan $ioBvar(announcechannel) $output
			}
		}
		ioB:tsend chan $ioBvar(announcechannel) "And our Top 10 Leechers are:"
		set status [catch {set ee [::ftp::Quote $ioBvar(ftp) SITE BSTATS MONTHDN ALL ALL 10 "\"$ioBvar(sections)\""]} result]
		if {$status==1 && [string equal $ioBvar(ftp_error) "Not connected!"]} {dccbroadcast "\[\002ioB\002\] Force Login... Status=$status - Result=$result"; ioB:ftp_force_login; return}
		set lines [split $ee \n]
		set lines [lreplace $lines end end]
		foreach line $lines {
			set lbit [split [string range $line 4 end] ";"]
			set rank [lindex $lbit 0]
			set nick [lindex $lbit 1]
			set group [lindex $lbit 2]
			set transfer [lindex $lbit 3]
			if {$rank!=""} {
				if {[string length $rank]==1} {set rank "0$rank"}
				set output $ioBvar(t_daystats_body)
				set output [ioB:replacevar $output "%pos" "$rank"]
				set output [ioB:replacevar $output "%name" "$nick"]
				set output [ioB:replacevar $output "%group" "$group"]
				set output [ioB:replacevar $output "%total" [ioB:fixsm $transfer]]
				ioB:tsend chan $ioBvar(announcechannel) $output
			}
		}
		ioB:tsend chan $ioBvar(announcechannel) $ioBvar(t_daystats_month_footer)
		if {$ioBvar(checkquota)==1} {
			ioB:sitestat "deleteok" "" "" $ioBvar(announcechannel) "quotas123"
			ioB:sitestat "deleteok" "" "" $ioBvar(announcechannel) "grpquota123"
		}
	} elseif {[string equal $weekday "Monday"]} {
		putlog "\[\002ioB\002\] endOfWeek... displaying wkstats"
		set weeknum [expr [clock format [expr [clock seconds]-(12*60*60)] -format "%W" -gmt true] +1]
		set year [clock format [expr [clock seconds]-(12*60*60)] -format "%Y" -gmt true]
		set output $ioBvar(t_daystats_week_header)
		set output [ioB:replacevar $output "%weeknum" "$weeknum"]
		set output [ioB:replacevar $output "%year" "$year"]
		ioB:tsend chan $ioBvar(announcechannel) $output
		set status [catch {set ee [::ftp::Quote $ioBvar(ftp) SITE BSTATS WKUP ALL ALL 10 "\"$ioBvar(sections)\""]} result]
		if {$status==1 && [string equal $ioBvar(ftp_error) "Not connected!"]} {dccbroadcast "\[\002ioB\002\] Force Login... Status=$status - Result=$result"; ioB:ftp_force_login; return}
		set lines [split $ee \n]
		set lines [lreplace $lines end end]
		foreach line $lines {
			set lbit [split [string range $line 4 end] ";"]
			set rank [lindex $lbit 0]
			set nick [lindex $lbit 1]
			set group [lindex $lbit 2]
			set transfer [lindex $lbit 3]
			if {$rank!=""} {
				if {[string length $rank]==1} {set rank "0$rank"}
				set output $ioBvar(t_daystats_body)
				set output [ioB:replacevar $output "%pos" "$rank"]
				set output [ioB:replacevar $output "%name" "$nick"]
				set output [ioB:replacevar $output "%group" "$group"]
				set output [ioB:replacevar $output "%total" [ioB:fixsm $transfer]]
				ioB:tsend chan $ioBvar(announcechannel) $output
			}
		}
		ioB:tsend chan $ioBvar(announcechannel) "And our Top 10 Leechers are:"
		set status [catch {set ee [::ftp::Quote $ioBvar(ftp) SITE BSTATS WKDN ALL ALL 10 "\"$ioBvar(sections)\""]} result]
		if {$status==1 && [string equal $ioBvar(ftp_error) "Not connected!"]} {dccbroadcast "\[\002ioB\002\] Force Login... Status=$status - Result=$result"; ioB:ftp_force_login; return}
		set lines [split $ee \n]
		set lines [lreplace $lines end end]
		foreach line $lines {
			set lbit [split [string range $line 4 end] ";"]
			set rank [lindex $lbit 0]
			set nick [lindex $lbit 1]
			set group [lindex $lbit 2]
			set transfer [lindex $lbit 3]
			if {$rank!=""} {
				if {[string length $rank]==1} {set rank "0$rank"}
				set output $ioBvar(t_daystats_body)
				set output [ioB:replacevar $output "%pos" "$rank"]
				set output [ioB:replacevar $output "%name" "$nick"]
				set output [ioB:replacevar $output "%group" "$group"]
				set output [ioB:replacevar $output "%total" [ioB:fixsm $transfer]]
				ioB:tsend chan $ioBvar(announcechannel) $output
			}
		}
		ioB:tsend chan $ioBvar(announcechannel) $ioBvar(t_daystats_week_footer)
	} else {
		putlog "\[\002ioB\002\] endOfDay... displaying daystats"
		ioB:tsend chan $ioBvar(announcechannel) $ioBvar(t_daystats_day_header)
		set status [catch {set ee [::ftp::Quote $ioBvar(ftp) SITE BSTATS DAYUP ALL ALL 3 "\"$ioBvar(sections)\""]} result]
		if {$status==1 && [string equal $ioBvar(ftp_error) "Not connected!"]} {dccbroadcast "\[\002ioB\002\] Force Login... Status=$status - Result=$result"; ioB:ftp_force_login; return}
		set lines [split $ee \n]
		set lines [lreplace $lines end end]
		foreach line $lines {
			set lbit [split [string range $line 4 end] ";"]
			set rank [lindex $lbit 0]
			set nick [lindex $lbit 1]
			set group [lindex $lbit 2]
			set transfer [lindex $lbit 3]
			if {$rank!=""} {
				if {[string length $rank]==1} {set rank "0$rank"}
				set output $ioBvar(t_daystats_body)
				set output [ioB:replacevar $output "%pos" "$rank"]
				set output [ioB:replacevar $output "%name" "$nick"]
				set output [ioB:replacevar $output "%group" "$group"]
				set output [ioB:replacevar $output "%total" [ioB:fixsm $transfer]]
				ioB:tsend chan $ioBvar(announcechannel) $output
			}
		}
		ioB:tsend chan $ioBvar(announcechannel) "And our Top 3 Leechers are:"
		set status [catch {set ee [::ftp::Quote $ioBvar(ftp) SITE BSTATS DAYDN ALL ALL 3 "\"$ioBvar(sections)\""]} result]
		if {$status==1 && [string equal $ioBvar(ftp_error) "Not connected!"]} {dccbroadcast "\[\002ioB\002\] Force Login... Status=$status - Result=$result"; ioB:ftp_force_login; return}
		set lines [split $ee \n]
		set lines [lreplace $lines end end]
		foreach line $lines {
			set lbit [split [string range $line 4 end] ";"]
			set rank [lindex $lbit 0]
			set nick [lindex $lbit 1]
			set group [lindex $lbit 2]
			set transfer [lindex $lbit 3]
			if {$rank!=""} {
				if {[string length $rank]==1} {set rank "0$rank"}
				set output $ioBvar(t_daystats_body)
				set output [ioB:replacevar $output "%pos" "$rank"]
				set output [ioB:replacevar $output "%name" "$nick"]
				set output [ioB:replacevar $output "%group" "$group"]
				set output [ioB:replacevar $output "%total" [ioB:fixsm $transfer]]
				ioB:tsend chan $ioBvar(announcechannel) $output
			}
		}
		ioB:tsend chan $ioBvar(announcechannel) $ioBvar(t_daystats_day_footer)
	}
	set dsto [expr [unixtime] + 30*60]
	return
}
Try to replace proc ioB:daystats (ioBanana.tcl) with this one.
Harm is offline   Reply With Quote
Old 08-03-2005, 07:53 AM   #3
Frodo
Junior Member
ioFTPD Foundation User
 
Join Date: Sep 2003
Posts: 15
Default

Thanks
Frodo is offline   Reply With Quote
Reply

Tags
add, downloaders, include, iobanana, stats

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 Off
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 03:56 PM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)