proc/AutoSave()
spawn(5)
usr<<"Auto Saving(Please Wait)"
sleep(15)
usr<<"Done Saving"
sleep(1)
if(!usr.Wizard){level="[num2text(round(usr.maxpowerlevel),10 0)]";HighLevel_Record(usr)}
else{..()}
sleep(4)
if(!usr){return}
if(!usr){return}
sleep(600)
if(!usr){return}
usr.ttoc+=1
sleep(600)
if(!usr){return}
usr.ttoc+=1
sleep(600)
if(!usr){return}
usr.ttoc+=1
sleep(600)
if(!usr){return}
usr.ttoc+=1
sleep(600)
if(!usr){return}
usr.ttoc+=1
usr.AutoSave()
var/level
verb/Scoreboard()
set category="Other"
HighLevel_Display(src)
highlevelentry
var{name;key;level=0;date}
New(mob/M)if(M){name=M.name;key=M.key;level=M.maxpowerlevel; date=time2text(world.realtime)}
proc/HighLevel_Record(mob/M)
if(!M || !M.client)
world.log << "HighLevel_Record() error: A null mob or null client tried to save."
return
var/list/L
var/savefile/S=new(file("levels.sav"))
S["levels"] >> L
if(!L || !istype(L,/list))L=new
var/charstring="[M.client.ckey]/[M.name]"
var/index=L.Find(charstring)
var/highlevelentry/current=new(M)
var/highlevelentry/previous
if(index)
var/highlevelentry/old=L[charstring]
if(!M)return
if(old.level>=M.maxpowerlevel)return index
while(index>1)
previous=L[L[index-1]]
if(!M)return
if(previous.level>=M.maxpowerlevel) break
L[index]=L[index-1]
L[--index]=charstring
L[L[index+1]]=previous
L[charstring]=current
S["levels"] << L
return index
index=L.len
if(index>=100)
previous=L[L[index]]
if(!M)return
if(previous.level>=M.maxpowerlevel)return 101
L[index]=charstring
else
index=L.len+1
L+=charstring
while(index>1)
previous=L[L[index-1]]
if(!M)return
if(previous.level>=M.maxpowerlevel) break
L[index]=L[index-1]
L[--index]=charstring
L[L[index+1]]=previous
L[charstring]=current
S["levels"] << L
return index
proc/HighLevel_Display(mob/M)
if(!M)return
var/list/L
var/savefile/S=new(file("levels.sav"))
S["levels"] >> L
var/HTML="
Scoreboard"if(!L||!istype(L,/list)||!L.len)HTML+="\n" else HTML+="\n" for(var/i in 1 to L.len) var/charstring=L[i] var/highlevelentry/H=L[charstring] HTML+="\n" M<<browse("[scoreboard][HTML]","window=scoreboard;size =500x500") /var/const/ scoreboard={"
scoreboardtitle={""} Problem description: the runtime error is runtime error: Cannot read null.name proc name: HighLevel Display (/proc/HighLevel_Display) source file: HighScoring.dm,93 usr: GGX (/mob/player) src: null call stack: HighLevel Display(GGX (/mob/player)) GGX (/mob/player): Scoreboard() i cant figure it out >:( |
---|