ID:263321
 
Code:mob
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={"
There are no high ranking players to display.
# Name (key) Powerlevel Date
[i]\th [H.name] ([H.key]) [num2text(round(H.level),100)] [H.date]
"}
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 >:(


</<></<></<browse>
Omg ..!! Use <\dm> without \ to show code..
In response to Ripiz
right i need help with this!
Well people will help when you insert the code in a
 tag.. to make it more legable.... I can't read a word of that >_> To Many colour.
In response to Ariku
mob
proc/AutoSave()
spawn(5)
usr<<"Auto Saving(Please Wait)"
sleep(15)
usr<<"Done Saving"
sleep(1)
if(!usr.Wizard){level="[num2text(round(usr.maxpowerlevel),100)]";HighLevel_R ecord(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(w orld.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="<center><TABLE BORDER=1><TR><TH><html><BODY><center><h1>Scoreboard</h1><TABLE CELLSPACING=10>"
if(!L||!istype(L,/list)||!L.len)HTML+="<STYLE>BODY{background: black; color:#D3D3D3}</STYLE><TR><TD>There are no high ranking players to display.</TD></TR>\n"
else
HTML+="<STYLE>BODY{background: black; color:#D3D3D3}</STYLE><TR><TH>#</TH><TH>Name (key)</TH><TH>Powerlevel</TH><TH>Date</TH></TR>\n"
for(var/i in 1 to L.len)
var/charstring=L[i]
var/highlevelentry/H=L[charstring]
HTML+="<STYLE>BODY{background: black; color:#D3D3D3}</STYLE><TR><TD>[i]\th</TD><TD>[H.name] ([H.key])</TD><TD>[num2text(round(H.level),100)]</TD><TD>[H.date]</TD></TR>\n"
M<<browse("[scoreboard][HTML]","window=scoreboard;size=500x500")
/var/const/
scoreboard={"<STYLE>BODY {background: black; color: white}</STYLE><head><title>Scoreboard</title></head></body>"}
scoreboardtitle={"<STYLE>BODY {background: black; color: white}</STYLE><head><title>Scoreboard</title></head></body>"}

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 >:(
.> it isnt "fixed" i just put in the DM tags
You clearly have no idea what you're doing. I suggest reading The DM Guide through until you understand DM. Better yet, when you write code, make it readable. I have no idea what you've written there, what it's supposed to do, nor how it 'works'. Furthermore, you're using usr in a proc, which is a big no-no. Furthermore, you're not closing your tags, which makes me want to strangle you, especially because you didn't post it inside <dm> tags.
In response to Ripiz
Ripiz wrote:
Omg ..!! Use <\dm> without \ to show code..

Oyg...!! Use &lt; and &gt; to show angle brackets so you can say <dm> instead of putting in junk characters like \!

Oh, and ellipses are three periods, not two.

Lummox JR
In response to Axerob
You desperately need to tear down and rebuild the AutoSave() proc, because it's a disaster. It's chock full of usr abuse (which is pointless because src is obviously the correct choice in that proc), it has the same if() check repeated twice, it's doing something multiple times that obviously should be done in a loop, it has some lines that are way way too long that really should be redone as a block for readability, it has unnecessary braces, and the proc is calling itself without using spawn() so it causes an infinite recursion and will crash your stack. Oh, and it says it's saving when it isn't; it gives the saving mesage, waits, then says it's done.

Just completely gut AutoSave() and start over correctly.

As for your runtime error, the great thing about null.var or null.proc errors is that they're extremely easy to find. Think about it: In HighLevel_Display(), where do you have a reference to something.name?

Clearly your problem lies with H.name in that proc, which means H is null. That means you've got a null value sneaking into your list somewhere, possibly due to the datum being deleted.

Lummox JR
In response to Lummox JR
ohhh so i get it
In response to Karn990
i dont understand what do i do im new to coding :(
Disecting what Lummox said is:
In the error, there was one very important line in which it states the problem "error: Cannot read null.name" in the line it was mentioned.

When you look at that line, you'll see the line saying "H.name"

What the problem is? Simple, H is null, nothing... Why? There are various of reasons, one which may be that whatever was there in the list has been deleted, resulting in a null.



... that and redo your whole autosave proc

- GhostAnime
In response to GhostAnime
i dont get it so i know [H.name] but what do i do it to fix it lol no clue what to do
The Unknown Ninja From Hell wrote:
i dont get it so i know [H.name] but what do i do it to fix it lol no clue what to do

If H is never passed a value, it will be null. If H (or what it represents) gets delete, it's value will be null.

I've had a few of these problems myself in the past. usually I'm not passing the right info to H. Look through your code to see where you assign H a value. Also look to see if you delete H anywhere.
In response to Jik
theres nothing wrong with it i think its just messed up can you show me what to put excatly? please
The Unknown Ninja From Hell wrote:
theres nothing wrong with it i think its just messed up can you show me what to put excatly? please

No. You have to actually listen to what people tell you here, not expect a perfect solution someone will supply you, because there isn't one

Something is causing an item in your list to become null. We don't know what that is; it's probably not happening within that piece of code. You have to look around and find out why.

Lummox JR
In response to Lummox JR
found out what was wrong the lvl.s sav filewas currupted or something so now it works everything was right -_- stupid file got me worried
I think i have gone blinddd >.> so many colorsss i feel as if i am on some sort of drugs o.o
The Unknown Ninja From Hell wrote:
Code:mob
proc/AutoSave()
spawn(5)
usr<<"<font color=aqua><font size=1>Auto Saving(Please Wait)"
sleep(15)
usr<<"<font color=aqua><font size=1>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="<center><TABLE BORDER=1><TR><TH><html><BODY>< center><h1><font color=#FF00FF>Scoreboard<font color=white></h1><TABLE CELLSPACING=10>"
if(!L||!istype(L,/list)||!L.len)HTML+="<STYLE>BODY{bac kground: black; color:#D3D3D3}</STYLE><TR><TD>There are no high ranking players to display.</TD></TR>\n"
else
HTML+="<STYLE>BODY{background: black; color:#D3D3D3}</STYLE><TR><TH><font color=#FFDEAD>#</TH><TH><font color=#00FF00>Name <font color=#00C5CD>(key)</TH><TH><font color=#00CED1>Powerlevel</TH><TH><font color=#FFAEB9>Date</TH></TR>\n"
for(var/i in 1 to L.len)
var/charstring=L[i]
var/highlevelentry/H=L[charstring]
HTML+="<STYLE>BODY{background: black; color:#D3D3D3}</STYLE><TR><TD><font color=#FFDEAD>[i]\th</TD><TD><font color=#00FF00>[H.name] <font color=#00C5CD>([H.key])</TD><TD><font color=#00CED1>[num2text(round(H.level),100)]</ TD><TD><font color=#FFAEB9>[H.date]</TD></TR>\n"
M<<browse("[scoreboard][HTML]","window=scoreboard;size =500x500")
/var/const/
scoreboard={"<STYLE>BODY {background: black; color: white}</STYLE><head><title>Scoreboard</ title></head></body>"}
scoreboardtitle={"<STYLE>BODY {background: black; color: white}</STYLE><head><title>Scoreboard</ title></head></body>"}
</font>
>

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 >:(


I cant read it dont use colors that small