client
New()
ClientLogin()
client
proc
ClientLogin()
var/html = "<html><head><title>Welcome</title></head>"
html += "<body bgcolor=#009966; scroll=no>"
html += "<p>Welcome</p>"
if(!mobs.len) html += "<p>You Currenly Have No Saved Characters</p>"
else
html += "<table width=95% border=3 bordercolor=#000000>"
for(var/c in mobs)
html += "<tr>"
html += "<td><a href=?@_[c]><B>[c]</B></a></td>"
html += "</tr>"
html += "</table>"
html += "<p><a href=?Create_Character>Create A New Character</a></p>"
html += "<p><a href=?Delete_Character>Delete A Character</a></p>"
html += "</body></html>"
src << browse(html,"window=who;size=300x300")
client
Topic(href)
if(findtext(href,"@_"))
var/c = copytext(href,findtext(href,"@_")+2)
C_LoadMob(c)
if(href == "Create_Character")
C_CreateMob()
if(href == "Delete_Character")
C_DeleteMob()
mobs is a list of the clients saved mobs if there are any
The problem is that the browser pops up and then closes almost instantaneously. Is there something else I have to do?
In your example, the <code>browse()</code> instruction returns immidiatly. <code>client/New()</code> ends as <code>ClientLogin()</code> returns, and you get forcibly kicked from the game since you have no mob.
For this, you would need a <code>while()</code> loop. You can stick one at the end of <code>ClientLogin()</code> like so:
Of course, you mustn't call <code>ClientLogin()</code> afterwards, or another loop will be started (if this is done a lot of times there will be lag).