egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need Help on html page in souperman trivia.tcl

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
janii
Halfop


Joined: 03 Aug 2011
Posts: 41

PostPosted: Sat Mar 23, 2013 9:13 pm    Post subject: Need Help on html page in souperman trivia.tcl Reply with quote

Hello Need Sum help adding top10 time , cps ,streak, answers , fastx , in customise soupeman trivia.tcl

Code:

#this generates an html file with all the people on the chan with
#their score, as well as a list of all scores, sorted by rank
# Table Colors
set tgbcolor "#000000"       ;#Border Color
set tgcellcolor "#E6E6FA"    ;#Cell color
set tgcellcolor_top "FFE1B5" ;# Table Head color

# Java chat available?
set tgjavachat "0" ;# 0 is no java chat, 1 is javachat
set tgjavaurl "http://axe4.axenet.org/index.php?page=chat&channel=trivia" ;# Url to point to
proc tghtml {} {
 global tgchan botnick tghtmlfile tghtmlrefresh server tgscoresbyname tgranksbyname
 global tgscorestotal tgranksbyname tgrealnames tgscoresbyrank tgranksbynum tgplaying
 global tgquestionstotal tghtmlrefreshtimer tghtmlfont
 global tgbcolor tgcellcolor tgcellcolor_top tgjavachat tgjavaurl
 tggetscores
 tgreadqdb
 set _file [open $tghtmlfile~new w]
 puts $_file "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">"
 puts $_file "<html>"
 puts $_file " <head>"
 puts $_file "  <title>$botnick's trivia channel: $tgchan on [lindex [split $server :] 0]</title>"
 puts $_file "  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">"
 puts $_file "  <meta http-equiv=\"refresh\" content=\"$tghtmlrefresh\">"
 puts $_file "  <meta name=\"generator\" content=\"Trivia.tcl script for #TriviaPoint. http://www.trivia.info/\">"
 puts $_file " </head>"
 puts $_file " <body>"
 puts $_file " <body bgcolor=\"#4682B4\">"
 puts $_file "  <table cellspacing=4 cellpadding=4 border=0 align=center><tr><td>"
 puts $_file " <b><font face=\"Verdana\" size=\"3\">Trivia Statistics for $tgchan on [lindex [split $server :] 0]</font></b><br><font face=\"Verdana\" size=\"3\"><b>Generated on [strftime %A,\ %d\ %B\ %Y\ @\ %H:%M:%S]</b></font><br>"
 if {$tgjavachat>0} {
  puts $_file " <a href=\"$tgjavaurl\">Play Now!</a>"
 }
 puts $_file " <HR ALIGN=LEFT NOSHADE SIZE=1 WIDTH=480>"
 if {![onchan $botnick $tgchan]} {
  puts $_file "  <p>Hmmm... for some reason I'm not on $tgchan at the moment. Please try again later.</p>"
 } else {
  puts $_file "  <p>Trivia game is currently <b>[expr $tgplaying==1?"on":"off"]</b>. There are <b>$tgquestionstotal</b> questions in the database."
    puts $_file "                    <p><b>$tgchan</b> is owned by <b>souperman</b> and <b>sniper</b> ."
}
   if {$tgscorestotal>0} {
   puts $_file "         <p>There [expr $tgscorestotal==1?"is":"are"] currently <b>$tgscorestotal</b> [expr $tgscorestotal==1?"nick":"nicks"] in the score table:<br>"
  set _rank 1
  puts $_file " <table width=\"100%\" cellspacing=\"1\" cellpadding=\"3\" bgcolor=\"$tgbcolor\" align=center><tr><td bgcolor=\"$tgcellcolor_top\"><b>Rank</b></td><td bgcolor=\"$tgcellcolor_top\"><b>Nickname</b></td><td bgcolor=\"$tgcellcolor_top\"><b>Score</b></td></tr> "
  while {$_rank<=$tgscorestotal} {
   puts $_file "<tr><td bgcolor=\"$tgcellcolor\"><b>$_rank</b></td><td bgcolor=\"$tgcellcolor\">$tgrealnames($tgranksbynum($_rank))</td><td bgcolor=\"$tgcellcolor\">$tgscoresbyrank($_rank)</td></tr>"
   incr _rank
  }
  puts $_file " </table> "
 } else {
  puts $_file "<p><small>There are currently no nicks in the score table.</small></p><br>"
 }
  puts $_file "  <p><b>People on $tgchan right now:</b><br><br>"
  puts $_file "  <table width=\"100%\" cellspacing=\"1\" cellpadding=\"3\" border=\"0\" bgcolor=\"$tgbcolor\">"
  puts $_file "   <tr>"
  puts $_file "    <td bgcolor=\"$tgcellcolor_top\"><b>Nick</b></td>"
  puts $_file "    <td bgcolor=\"$tgcellcolor_top\"><b>Score</b></td>"
  puts $_file "    <td bgcolor=\"$tgcellcolor_top\"><b>Rank</b></td>"
  puts $_file "    <td bgcolor=\"$tgcellcolor_top\"><b>Idle</b></td>"
  puts $_file "   </tr>"
  set _op ""; set _vo ""; set _reg "";
  foreach nick [lsort [chanlist $tgchan]] {
  if {[isop $nick $tgchan]} {
      lappend _op $nick
   } elseif {[isvoice $nick $tgchan]} {
      lappend _vo $nick
   } else {
      lappend _reg $nick
   }
 }

   set _chanlist [join "$_op $_vo $_reg"]
foreach nick $_chanlist {
         puts $_file "   <tr>"
         puts $_file "    <td bgcolor=\"$tgcellcolor\">[expr [isop $nick $tgchan]?"@":""][expr [isvoice $nick $tgchan]?"+":""]$nick[expr [string match $nick $botnick]?" (that's me!)":""]</td>"
         if {[info exists tgscoresbyname([strlwr $nick])]} {
            puts $_file "    <td bgcolor=\"$tgcellcolor\">$tgscoresbyname([strlwr $nick])</td>"
         } else {
            puts $_file "    <td bgcolor=\"$tgcellcolor\">-</td>"
         }
         if {[info exists tgranksbyname([strlwr $nick])]} {
            puts $_file "    <td bgcolor=\"$tgcellcolor\">$tgranksbyname([strlwr $nick])</td>"
         } else {
            puts $_file "    <td bgcolor=\"$tgcellcolor\">-</td>"
         }
         puts $_file "   <td bgcolor=\"$tgcellcolor\">[expr [getchanidle $nick $tgchan]>10?"[getchanidle $nick $tgchan]m":"-"]</td>"
         puts $_file "   </tr>"
      }

   puts $_file " </body>"
   puts $_file "</html>"
   close $_file
   file rename -force $tghtmlfile~new $tghtmlfile
   set tghtmlrefreshtimer [utimer $tghtmlrefresh tghtml]
}

My Question is about the below code
Code:

   if {$tgscorestotal>0} {
   puts $_file "         <p>There [expr $tgscorestotal==1?"is":"are"] currently <b>$tgscorestotal</b> [expr $tgscorestotal==1?"nick":"nicks"] in the score table:<br>"
  set _rank 1
  puts $_file " <table width=\"100%\" cellspacing=\"1\" cellpadding=\"3\" bgcolor=\"$tgbcolor\" align=center><tr><td bgcolor=\"$tgcellcolor_top\"><b>Rank</b></td><td bgcolor=\"$tgcellcolor_top\"><b>Nickname</b></td><td bgcolor=\"$tgcellcolor_top\"><b>Score</b></td></tr> "
  while {$_rank<=$tgscorestotal} {
   puts $_file "<tr><td bgcolor=\"$tgcellcolor\"><b>$_rank</b></td><td bgcolor=\"$tgcellcolor\">$tgrealnames($tgranksbynum($_rank))</td><td bgcolor=\"$tgcellcolor\">$tgscoresbyrank($_rank)</td></tr>"
   incr _rank
  }
  puts $_file " </table> "
 } else {
  puts $_file "<p><small>There are currently no nicks in the score table.</small></p><br>"
 }


Last edited by janii on Wed Mar 27, 2013 11:31 pm; edited 1 time in total
Back to top
View user's profile Send private message
Madalin
Master


Joined: 24 Jun 2005
Posts: 310
Location: Constanta, Romania

PostPosted: Sun Mar 24, 2013 8:21 am    Post subject: Reply with quote

Why don you use BogusTrivia ? Its a new trivia script and has HTML page with user statistics. That Souperman tribia script is old.

http://www.egghelp.org/tclhtml/3478-4-0-0-1-bogustrivia.htm

Further more the author of BogusTrivia frequenty helps on this forum so if you would have questions about the script im sure he will help you.
_________________
https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
janii
Halfop


Joined: 03 Aug 2011
Posts: 41

PostPosted: Sun Mar 24, 2013 9:42 am    Post subject: Reply with quote

Thanx Madalin but the above is an old trivia.tcl but i ve modified it to full extend i enhanched it with Chars per seconds words per minute , jackpot ,duel ,streaks , top time ,bonus , bonus breaker and many more options .. i ve used every tcl here spike trivia is the most stable one but every1 has its choice i like this trivia .. so m looking for the solution in here if any1 can help me tht ll be highly appreciated .. thanks
Back to top
View user's profile Send private message
janii
Halfop


Joined: 03 Aug 2011
Posts: 41

PostPosted: Mon Mar 25, 2013 8:22 pm    Post subject: I edited it to work for me but need help with a lil problem Reply with quote

Hello i ve managed to add top streakers command in the html successfully and can add cps toptime etc as well but therez a problem that it shows the whole streak list i want it to just show top10 streakers kindly help thanks
Code:

#this generates an html file with all the people on the chan with
#their score, as well as a list of all scores, sorted by rank
# Table Colors
set tgbcolor "#000000"       ;#Border Color
set tgcellcolor "#E6E6FA"    ;#Cell color
set tgcellcolor_top "FFE1B5" ;# Table Head color

# Java chat available?
set tgjavachat "0" ;# 0 is no java chat, 1 is javachat
set tgjavaurl "http://axe4.axenet.org/index.php?page=chat&channel=trivia" ;# Url to point to
proc tghtml {} {
 global tgchan botnick tghtmlfile tghtmlrefresh server tgscoresbyname tgranksbyname
 global tgscorestotal tgranksbyname tgrealnames tgscoresbyrank tgranksbynum tgplaying
 global tgquestionstotal tghtmlrefreshtimer tghtmlfont
 global tgbcolor tgcellcolor tgcellcolor_top tgjavachat tgjavaurl
 global tgpbstreakf tgpbstreaktotal tgpbstreak tgpbstreakbyname tgpbstreakranksbyname tgpbstreakranksbynum tgpbstreakrealnames tgpbstreakbyrank
 tggetscores
 tgreadqdb
 tggetpbstreak

 set _file [open $tghtmlfile~new w]
 puts $_file "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">"
 puts $_file "<html>"
 puts $_file " <head>"
 puts $_file "  <title>$botnick's trivia channel: $tgchan on [lindex [split $server :] 0]</title>"
 puts $_file "  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">"
 puts $_file "  <meta http-equiv=\"refresh\" content=\"$tghtmlrefresh\">"
 puts $_file "  <meta name=\"generator\" content=\"lotsatrivia.tcl script for #lotsatrivia. http://www.lotsatrivia.com/\">"
 puts $_file " </head>"
 puts $_file " <body>"
 puts $_file " <body bgcolor=\"#4682B4\">"
 puts $_file "  <table cellspacing=4 cellpadding=4 border=0 align=center><tr><td>"
 puts $_file " <b><font face=\"Verdana\" size=\"3\">Trivia Statistics for $tgchan on [lindex [split $server :] 0]</font></b><br><font face=\"Verdana\" size=\"3\"><b>Generated on [strftime %A,\ %d\ %B\ %Y\ @\ %H:%M:%S]</b></font><br>"
 if {$tgjavachat>0} {
  puts $_file " <a href=\"$tgjavaurl\">Play Now!</a>"
 }
 puts $_file " <HR ALIGN=LEFT NOSHADE SIZE=1 WIDTH=480>"
 if {![onchan $botnick $tgchan]} {
  puts $_file "  <p>Hmmm... for some reason I'm not on $tgchan at the moment. Please try again later.</p>"
 } else {
  puts $_file "  <p>Trivia game is currently <b>[expr $tgplaying==1?"on":"off"]</b>. There are <b>$tgquestionstotal</b> questions in the database."
    puts $_file "                    <p><b>$tgchan</b> is owned by <b>JuRiSt</b> and <b>I-M-BEST</b> ."
}
   if {$tgscorestotal>0} {
   puts $_file "         <p>There [expr $tgscorestotal==1?"is":"are"] currently <b>$tgscorestotal</b> [expr $tgscorestotal==1?"nick":"nicks"] in the score table:<br>"
  set _rank 1
  puts $_file " <table width=\"100%\" cellspacing=\"1\" cellpadding=\"3\" bgcolor=\"$tgbcolor\" align=center><tr><td bgcolor=\"$tgcellcolor_top\"><b>Rank</b></td><td bgcolor=\"$tgcellcolor_top\"><b>Nickname</b></td><td bgcolor=\"$tgcellcolor_top\"><b>Score</b></td></tr> "
  while {$_rank<=$tgscorestotal} {
   puts $_file "<tr><td bgcolor=\"$tgcellcolor\"><b>$_rank</b></td><td bgcolor=\"$tgcellcolor\">$tgrealnames($tgranksbynum($_rank))</td><td bgcolor=\"$tgcellcolor\">$tgscoresbyrank($_rank)</td></tr>"
   incr _rank
  }
  puts $_file " </table> "
 } else {
  puts $_file "<p><small>There are currently no nicks in the score table.</small></p><br>"
 }

  puts $_file "  <p><b>People on $tgchan right now:</b><br><br>"
  puts $_file "  <table width=\"100%\" cellspacing=\"1\" cellpadding=\"3\" border=\"0\" bgcolor=\"$tgbcolor\">"
  puts $_file "   <tr>"
  puts $_file "    <td bgcolor=\"$tgcellcolor_top\"><b>Nick</b></td>"
  puts $_file "    <td bgcolor=\"$tgcellcolor_top\"><b>Score</b></td>"
  puts $_file "    <td bgcolor=\"$tgcellcolor_top\"><b>Rank</b></td>"
  puts $_file "    <td bgcolor=\"$tgcellcolor_top\"><b>Idle</b></td>"
  puts $_file "   </tr>"
  set _op ""; set _vo ""; set _reg "";
  foreach nick [lsort [chanlist $tgchan]] {
  if {[isop $nick $tgchan]} {
      lappend _op $nick
   } elseif {[isvoice $nick $tgchan]} {
      lappend _vo $nick
   } else {
      lappend _reg $nick
   }
 }

   set _chanlist [join "$_op $_vo $_reg"]
foreach nick $_chanlist {
         puts $_file "   <tr>"
         puts $_file "    <td bgcolor=\"$tgcellcolor\">[expr [isop $nick $tgchan]?"@":""][expr [isvoice $nick $tgchan]?"+":""]$nick[expr [string match $nick $botnick]?" (that's me!)":""]</td>"
         if {[info exists tgscoresbyname([strlwr $nick])]} {
            puts $_file "    <td bgcolor=\"$tgcellcolor\">$tgscoresbyname([strlwr $nick])</td>"
         } else {
            puts $_file "    <td bgcolor=\"$tgcellcolor\">-</td>"
         }
         if {[info exists tgranksbyname([strlwr $nick])]} {
            puts $_file "    <td bgcolor=\"$tgcellcolor\">$tgranksbyname([strlwr $nick])</td>"
         } else {
            puts $_file "    <td bgcolor=\"$tgcellcolor\">-</td>"
         }
         puts $_file "   <td bgcolor=\"$tgcellcolor\">[expr [getchanidle $nick $tgchan]>10?"[getchanidle $nick $tgchan]m":"-"]</td>"
         puts $_file "   </tr>"
      }

   puts $_file " </body>"
   puts $_file "</html>"
   close $_file
   file rename -force $tghtmlfile~new $tghtmlfile
   set tghtmlrefreshtimer [utimer $tghtmlrefresh tghtml]
}


Last edited by janii on Wed Mar 27, 2013 11:33 pm; edited 1 time in total
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Mon Mar 25, 2013 9:30 pm    Post subject: Reply with quote

Code:

       if {$tgpbstreaktotal>0} {
  puts $_file "  <p><b>$tgchan Top Streakers :</b><br><br>"
  set _rank 1
  puts $_file " <table width=\"100%\" cellspacing=\"1\" cellpadding=\"3\" bgcolor=\"$tgbcolor\" align=center><tr><td bgcolor=\"$tgcellcolor_top\"><b>Rank</b></td><td bgcolor=\"$tgcellcolor_top\"><b>Nickname</b></td><td bgcolor=\"$tgcellcolor_top\"><b>Streakers</b></td></tr> "
  while {$_rank<=$tgpbstreaktotal} {
   puts $_file "<tr><td bgcolor=\"$tgcellcolor\"><b>$_rank</b></td><td bgcolor=\"$tgcellcolor\">$tgpbstreakrealnames($tgpbstreakranksbynum($_rank))</td><td bgcolor=\"$tgcellcolor\">$tgpbstreakbyrank($_rank)</td></tr>"
   incr _rank

   if {$_rank>"10"} { break }

  }
 

_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
Back to top
View user's profile Send private message Visit poster's website
janii
Halfop


Joined: 03 Aug 2011
Posts: 41

PostPosted: Mon Mar 25, 2013 9:50 pm    Post subject: hmmmm problem solved Reply with quote

hey spike thank you very very much for ur help once again you are one great helper u helped me i think 4 or 5 times here on this forum .. i knew if sum1 will solve my problem it ll be the great spike ... thanks once again man luv yaaa
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber