ID:2279638
 
(See the best response by Maximus_Alex2003.)
Code:
/proc/
RankingDisplay(var/mob/person)
var/list/levels=new()
var/savefile/F=new("World Save Files/System/Scoreboard/levels.sav")
F[("stuff")]>>(levels)
var/html="<center><TABLE BORDER=1><TR><TH><html><BODY><center><h1><U><font color=#DAA520>Level<font color=white></u></h1><TABLE CELLSPACING=10>"
if(!levels)html+="<TR><TD>No high rankings to display.</TD></TR>\n"
else
html+="<tr><th><B>#</th><th>Name <I>(key)</I></th><th>Level</th><th>Date</th></tr>\n<br>"
for(var/number in 1 to levels.len)
var{character=(levels[(number)]);Rank_Entry/player=(levels[(character)])}
html+="<tr><td><u>[(number)]\th</td><td></u>[(player.Name)] <I>([(player.Key)])</I></td><td>[num2text(round(player.Level),100)]</td><td>[(player.Date)]</td></tr>\n"
person<<browse("[scoreboardtitle][html]","window=scoreboard;size=524x344")


Problem description:
So I'm having a problem with my scoreboard.dm. It only updates when a client/player opens a scoreboard manually using the verb scoreboard. However I want to make it AutoUpdate without having players be online to update it, or even if they are online. If they don't open the scoreboard. I want the scoreboard to still be able to auto configure a updated board. I thought it had something to do with the spawn (Autosave) but I was wrong. I know its a single line of code. But I do not know what it is. Can someone please give assists. Thank you.
Using logical evaluation, you want to update the scoreboard anytime something changes. So, any time something changes, update the scoreboard.
In response to Maximus_Alex2003
Maximus_Alex2003 wrote:
Using logical evaluation, you want to update the scoreboard anytime something changes. So, any time something changes, update the scoreboard.

I do not understand. I'm not asking for the answer. Just need a way to understand what it is I need to do. Or what you're suggesting. :)
In response to Tenkichi
Best response
Tenkichi wrote:
Maximus_Alex2003 wrote:
Using logical evaluation, you want to update the scoreboard anytime something changes. So, any time something changes, update the scoreboard.

I do not understand. I'm not asking for the answer. Just need a way to understand what it is I need to do. Or what you're suggesting. :)

Basically, you don't need an autosave for the scoreboard. Search your code for everytime something could change the scoreboard and update the scoreboard from there. That way you're not having an unnecessary infinite loop running when it doesn't need to.

As in, logically, you only need to change something when something effects it. Newton's Third Law: 'For every action, there is an equal and opposite reaction.' Except, ignore the "equal and opposite". So, for example, you never want to continuously update a Health bar for a player, you only need to update if something changes. For example, only call your update-health-bar-proc when the player looses health or gains health.

Get what I mean?