PDA

View Full Version : [Filled] !credits <user> for IRC


wooolF[RM]
01-20-2004, 02:59 PM
Needed : Trigger credits <user> for IRC

I just "converted" from normal FTP to ratio system so many users asked me to do !credits trigger... I thought about making one but then forgot about it... Yesterday I've installed a script by badass ( http://www.ioftpd.com/board/showthread.php?s=&threadid=2398 ) which have actually displayed credits of any user on IRC. Therefore I'm asking here if anyone could do this lil script :)

Prolly badass himself (my repsect to him) can make this one :)

Good luck and thnx in advance :)

wooolF[RM]
01-22-2004, 08:59 PM
arf! hope to see this in next rls of ioBanana ;)

/me humps Harm :banana:

SomeoneWhoCares_2
01-22-2004, 10:06 PM
<user> !credits ioFTPD
<bot> ioFTPD has 4.98 GB credits

outputs total of all credit sections combined for user.

dunno if this is what u wanted but here u go...
thx to bad for his static.tcl which this is based on..

wooolF[RM]
01-22-2004, 10:54 PM
My best regards for this one :) neat and usefull (for me and my users). Thank you very much!

rage2001
01-25-2004, 01:46 PM
Small problem with the script .... IF a user does not exsist on the site, it still returns an amount for them.... For example:

<rage2001> !credits rage
<********> rage has 356.01 GB credits

<rage2001> !rgecredits gay
<********> gay has 52.83 GB credits


Now rage does exsist on the site... so perfect... but gay is not a user .... any user that does not exsist returns 52.83 GB creds in my case .... Any chance of getting that fixed? Its a neat little script!

rage2001

SomeoneWhoCares_2
01-25-2004, 01:55 PM
sorry bout that... here u go! have fun :D

wooolF[RM]
01-25-2004, 03:34 PM
tnx for the fix, SomeoneWhoCares :) nice work :banana:

wooolF[RM]
01-25-2004, 04:34 PM
btw, just noticed one interested thing lol :D
user1 had -8623Mb credits
<me> !credits user1
<bot> user1 has -8829047.00 KB credits

O.o
:D

MIC_vBa
02-20-2004, 04:13 AM
is it possible to add blowfish encryption to credits script ???

would be nice :)))

jason
02-24-2004, 08:49 PM
where can we DL this good script ?

Mouton
02-24-2004, 09:07 PM
'Where has the attachment gone ?'
http://www.ioftpd.com/board/showthread.php?s=&postid=19305#post19305

jason
02-24-2004, 09:43 PM
static tcl doesn't appear here: http://www.ioftpd.com/scripts/

so where can we find it ?

wooolF[RM]
02-25-2004, 09:01 AM
http://ioftpd.humandroids.net/ > Downloads > search for "static"

jason
02-25-2004, 01:10 PM
Yes Its goood :]


THXXX

Kilimanjaro_2
11-24-2004, 07:36 PM
This fine script does not work with iosharedb :(

wooolF[RM]
11-24-2004, 10:38 PM
You could try to bug badass at #ioM0d or #ngZS (irc.efnet.org)...

wooolF[RM]
01-25-2005, 10:29 AM
This script needed a small update because of negative results at some point (when user have too much credits). So here's updated script :


#credits.tcl 1.1
set passwd "C:/ioFTPD/etc/UserIdTable"
set userroot "C:/ioFTPD/users"
proc credits {nick uhost handle chan args} {
global passwd userroot
if {[lindex $args 0] == ""} {putserv "PRIVMSG $chan :usage !credits user";return}
set fileid [open $passwd r]
set data [read $fileid]
close $fileid
foreach line [split $data \n] {
if {[string equal [lindex $args 0] [lindex [split $line :] 0]]} {
set data $line
}
}
foreach dline [split $data \n] {
set cname [lindex [split $dline :] 0]
set dline [lindex [split $dline :] 1]
if {[regexp -- "[lindex $args 0]" $cname]} {set exist 1} else {set exist 0}
if {![string equal {} $dline] } {
if {![file exists $userroot/$dline]} {
return
}
set fileid [open $userroot/$dline r]
set sata [read $fileid]
close $fileid
foreach line [split $sata \n] {
set line [string tolower $line]
}
}
}
foreach line [split $sata \n] {
if {[string equal "credits" [lindex [split $line " "] 0]]} {
set credsex $line
set credsec0 [lindex $credsex 1]
set credsec1 [lindex $credsex 2]
set credsec2 [lindex $credsex 3]
set credsec3 [lindex $credsex 4]
set credsec4 [lindex $credsex 5]
set credsec5 [lindex $credsex 6]
set credsec6 [lindex $credsex 7]
set credsec7 [lindex $credsex 8]
set credsec8 [lindex $credsex 9]
set credsec9 [lindex $credsex 10]
set allcreds [expr ($credsec0 + $credsec1 + $credsec2 + $credsec3 + $credsec4 + $credsec5 + $credsec6 + $credsec7 + $credsec8 + $credsec9) * 1.0]
}
}
if {$exist == 1} {
putserv "PRIVMSG $chan :[lindex $args 0] has \002[formatkb $allcreds]\002 credits"} else {
putserv "PRIVMSG $chan :User does not exist!"
}
}
proc formatkb {size} {
if {$size >= 1073741824} {
set amount "[format %.2f [expr $size/1073741824.0]] TB"
} elseif {$size >= 1048576} {
set amount "[format %.2f [expr $size/1048576.0]] GB"
} elseif {$size >= 1024} {
set amount "[format %.2f [expr $size/1024.0]] MB"
} else {
set amount "[format %.2f $size] KB"
}
return $amount
}
bind pub -|- !credits credits
putlog "credit script 1.1 loaded!!!"

PS: All credits goes to SomeoneWhoCares for making it and to badass because it was based on his static.tcl

|Killer|999
01-30-2005, 10:04 AM
Originally posted by wooolF[RM]
This script needed a small update because of negative results at some point (when user have too much credits). So here's updated script :


#credits.tcl 1.1
set passwd "C:/ioFTPD/etc/UserIdTable"
set userroot "C:/ioFTPD/users"
proc credits {nick uhost handle chan args} {
global passwd userroot
if {[lindex $args 0] == ""} {putserv "PRIVMSG $chan :usage !credits user";return}
set fileid [open $passwd r]
set data [read $fileid]
close $fileid
foreach line [split $data \n] {
if {[string equal [lindex $args 0] [lindex [split $line :] 0]]} {
set data $line
}
}
foreach dline [split $data \n] {
set cname [lindex [split $dline :] 0]
set dline [lindex [split $dline :] 1]
if {[regexp -- "[lindex $args 0]" $cname]} {set exist 1} else {set exist 0}
if {![string equal {} $dline] } {
if {![file exists $userroot/$dline]} {
return
}
set fileid [open $userroot/$dline r]
set sata [read $fileid]
close $fileid
foreach line [split $sata \n] {
set line [string tolower $line]
}
}
}
foreach line [split $sata \n] {
if {[string equal "credits" [lindex [split $line " "] 0]]} {
set credsex $line
set credsec0 [lindex $credsex 1]
set credsec1 [lindex $credsex 2]
set credsec2 [lindex $credsex 3]
set credsec3 [lindex $credsex 4]
set credsec4 [lindex $credsex 5]
set credsec5 [lindex $credsex 6]
set credsec6 [lindex $credsex 7]
set credsec7 [lindex $credsex 8]
set credsec8 [lindex $credsex 9]
set credsec9 [lindex $credsex 10]
set allcreds [expr ($credsec0 + $credsec1 + $credsec2 + $credsec3 + $credsec4 + $credsec5 + $credsec6 + $credsec7 + $credsec8 + $credsec9) * 1.0]
}
}
if {$exist == 1} {
putserv "PRIVMSG $chan :[lindex $args 0] has \002[formatkb $allcreds]\002 credits"} else {
putserv "PRIVMSG $chan :User does not exist!"
}
}
proc formatkb {size} {
if {$size >= 1073741824} {
set amount "[format %.2f [expr $size/1073741824.0]] TB"
} elseif {$size >= 1048576} {
set amount "[format %.2f [expr $size/1048576.0]] GB"
} elseif {$size >= 1024} {
set amount "[format %.2f [expr $size/1024.0]] MB"
} else {
set amount "[format %.2f $size] KB"
}
return $amount
}
bind pub -|- !credits credits
putlog "credit script 1.1 loaded!!!"

PS: All credits goes to SomeoneWhoCares for making it and to badass because it was based on his static.tcl

how can i fix it when channel is encrypted ?
bot wont respons now on !credits
thx already

wooolF[RM]
01-30-2005, 12:58 PM
#credits.tcl 1.2
set passwd "C:/ioFTPD/etc/UserIdTable"
set userroot "C:/ioFTPD/users"

set cr_blow(KEY) "keyhere" ;# "" not to use
set cr_blow(HEAD) "+OK" ;# leave as is if you dont know what this is

#convert iputs to privmsg
proc cr_iputs_irc {data} {global cr_blow chanx_cr
if {$cr_blow(KEY) == ""} {
putquick "PRIVMSG $chanx_cr :$data"
} else {
putquick "PRIVMSG $chanx_cr :$cr_blow(HEAD) [encrypt $cr_blow(KEY) $data]"
}
}

proc credits {nick uhost handle chan args} {global passwd userroot
set chanx_cr $chan
if {[lindex $args 0] == ""} {cr_iputs_irc "PRIVMSG $chan :usage !credits user";return}
set fileid [open $passwd r]
set data [read $fileid]
close $fileid
foreach line [split $data \n] {
if {[string equal [lindex $args 0] [lindex [split $line :] 0]]} {
set data $line
}
}
foreach dline [split $data \n] {
set cname [lindex [split $dline :] 0]
set dline [lindex [split $dline :] 1]
if {[regexp -- "[lindex $args 0]" $cname]} {set exist 1} else {set exist 0}
if {![string equal {} $dline] } {
if {![file exists $userroot/$dline]} {
return
}
set fileid [open $userroot/$dline r]
set sata [read $fileid]
close $fileid
foreach line [split $sata \n] {
set line [string tolower $line]
}
}
}
foreach line [split $sata \n] {
if {[string equal "credits" [lindex [split $line " "] 0]]} {
set credsex $line
set credsec0 [lindex $credsex 1]
set credsec1 [lindex $credsex 2]
set credsec2 [lindex $credsex 3]
set credsec3 [lindex $credsex 4]
set credsec4 [lindex $credsex 5]
set credsec5 [lindex $credsex 6]
set credsec6 [lindex $credsex 7]
set credsec7 [lindex $credsex 8]
set credsec8 [lindex $credsex 9]
set credsec9 [lindex $credsex 10]
set allcreds [expr ($credsec0 + $credsec1 + $credsec2 + $credsec3 + $credsec4 + $credsec5 + $credsec6 + $credsec7 + $credsec8 + $credsec9) * 1.0]
}
}
if {$exist == 1} {
cr_iputs_irc "PRIVMSG $chan :[lindex $args 0] has \002[formatkb $allcreds]\002 credits"} else {
cr_iputs_irc "PRIVMSG $chan :User does not exist!"
}
}
proc formatkb {size} {
if {$size >= 1073741824} {
set amount "[format %.2f [expr $size/1073741824.0]] TB"
} elseif {$size >= 1048576} {
set amount "[format %.2f [expr $size/1048576.0]] GB"
} elseif {$size >= 1024} {
set amount "[format %.2f [expr $size/1024.0]] MB"
} else {
set amount "[format %.2f $size] KB"
}
return $amount
}
bind pub -|- !credits credits
putlog "credit script 1.2 with blowfish support loaded!!!"

NOT tested

Again, all credits goes to SomeoneWhoCares for making it and to badass because it was based on his static.tcl

|Killer|999
01-30-2005, 01:15 PM
also not working either :(
but thx for helping me
bot dont resond on !credits in channel works great when bot dont use fishkey

wooolF[RM]
01-30-2005, 07:46 PM
check this URL

http://badaas.ownage.ws/swbCREDITS_1_4-io.zip

Should work

oldhouse80
02-16-2005, 01:37 PM
any mod to make it work with ioShareDB where u don't have userfiles?

scoonydeus
09-21-2005, 05:42 AM
Hi all,

Normal cause only the ioBANANA part is blowfish encrypted ... u need to take off the encrytpion of the iobanana ( or the other bot announce part ).
And u can find a script to crypt natively all the bot...

Enjoy http://www.donationcoder.com/Software/Mouser/mircryption/others_eggdrop.shtml