ID:178892
 
Ok the title states what I'm looking for. I know there has got to be some good help on this haven't found it yet. Any pointers???

LJR
Please define your problem. If you mean adding a title to an HTML page loaded by a savefile (which is the most I can pick out), take a look at this:
var/html_file = {"
<html><head><title>TITLE</title></head>
<body>
<h1>Content</h1>
</body></html>
"}

client/proc/DisplayPage(var/title = "")
src << browse(treplace(html_file,"TITLE",title))


treplace() is a proc that replaces one text piece within a string with another. I trust that you can build such a proc by yourself. If I got you wrong in what you wanted, please clarify yourself and I'll re-reply.

-Lord of Water
LordJR wrote:
Ok the title states what I'm looking for. I know there has got to be some good help on this haven't found it yet. Any pointers???

I'm a little unclear on what you mean. Are you talking about something more along the lines of using stored files to include in HTML like SSI, or do you mean saving new versions of HTML files based on changes that occur in the game?

In either case, file2text() and text2file() should do what you want.

Lummox JR
In response to Lord of Water
Sorry I was be general to see what kinda suggestions popped in in case I missed something. No actually all I need is a Top 20 List saving two thing. 1) Player's Key.name, 2) Checks the list for the high score, if it meets or passes it it puts them in the list and bumps everyone else down. Kinda like Runica had it for that contest. But I've not messed with HTML and savefiles in this way yet.

LJR
In response to LordJR
Okay, I'll try to type you up a simple code before my lunch hour begins...
mob/var/Points = 0
var/list/Placers = list("1st" = 0,"2nd" = 0,"1name" = "","2name" = "")
mob/verb/PlayGame(var/mob/M = src,var/mob/MM as mob in world)
var/winner = rand(1,2)
var/points = rand(40,60)
if(winner == 1)
M.Points += points
else MM.Points += points
checkPlace(M)
checkPlace(MM)
var/html = {"
<html>
<h1>Overall 1st Place:
[Placers[1]]</h1>
<h2>Overall 2nd Place:
[Placers[2]]</h2>
</html>}"
M.browse(html)
MM.browse(html)
proc/checkPlace(var/mob/M)
if(M.points > Placers
["1st"])
Placers
["2nd"] = Placers["1st"]
Placers
["2name"] = Placers["1name"]
Placers
["1st"] = M.Points
Placers
["1name"] = M.key
goto NEXT
if(M.points > Placers
["2nd"])
Placers
["2nd"] = M.Points
Placers
["2name"] = M.key)
NEXT
var/savefile/S = new("HighScores.sav")
S
["HighScores"] << Placers
world/New()
..()
var/savefile/S = new("HighScore.sav")
S
["HighScores"] >> Placers


There you go! Expand on that and it should work the way you need it to.

-Lord of Water
In response to Lord of Water
Looks worth a try... 1 question though, where would be the best place to set this up? As I can just do references to the mob/pc's if I need to. I was thinking not under anything So it would be like a global var, and only have one instance of it. As the only vars related to the actual mobs will be Their names and score. Also I'll be putting a looped timer on this, anyone see any problems with this?

LJR