Communauté Eggdrop
Proc incrementation des scores trivia fonctionnel - Version imprimable

+- Communauté Eggdrop (https://forum.eggdrop.fr)
+-- Forum : Eggdrop et scripts (https://forum.eggdrop.fr/forumdisplay.php?fid=8)
+--- Forum : Scripts (https://forum.eggdrop.fr/forumdisplay.php?fid=4)
+--- Sujet : Proc incrementation des scores trivia fonctionnel (/showthread.php?tid=1683)



Proc incrementation des scores trivia fonctionnel - Epsilon - 30/03/2017

J'ai eu quelques soucis avec les scores sur la version 1.3.4 du trivia (télécharger sur ce forum) voici la proc fonctionnel :

Code :
proc tgincrscore {who} { global tgscores tgscf tgpointsperanswer tgscorestotal tgscoresbyname tggetscores if {$tgscorestotal>0} { set i 0 if {![info exists tgscoresbyname([strlwr $who])]} { append _newscores "1,[expr 1000000000000.0/[unixtime]],$who,[strlwr $who] " } while {$i<[llength $tgscores]} { set _item [lindex $tgscores $i] set _nick [lindex [split $_item ,] 2] set _time [lindex [split $_item ,] 1] set _score [lindex [split $_item ,] 0] } } else { append _newscores "1,[expr 1000000000000.0/[unixtime]],$who,[strlwr $who]" } puts $_sfile "$_newscores" return }