Who Verb Efficiency in Developer Help
|
|
Code:
if("Who") if(list["target"]) var/mob/mobile=locate(list["target"]) if(!mobile) {usr<<"This player has either left the server or joined the game";usr.client.Topic("action=Who",list("action"="Who"));return} usr<<browse( {" <html> <body bgcolor="#111111"> <table align="center" width="400px" cellspacing="0" cellpadding="0" style="border:1px dashed #333;font-family:tahoma;color:#fff;"> <tr> <td colspan="3" bgcolor="#000000" style="text-align:center;font-weight:bold;font-family:comic sans ms;"> [mobile.name][(lentext("[mobile.type]")>=5)?" the [uppertext(copytext(mobile.gender,1,2))+copytext(mobile.gender,2)] [copytext("[mobile.type]",6)]":] </td> </tr> <tr> <td bgcolor="#222222"> <b>Key</b>: [mobile.key] <br><b>BYOND Member</b>: [(mobile.client.IsByondMember())?"<a href='http://members.byond.com/[mobile.key]' target='_new'>Yes</a>.":"No."] <br><b>Inactivity Time</b>: [mobile.client.inactivity/10] seconds. [(lentext("[mobile.type]")>=5)?"<br><b>Location</b>: [mobile.x] x, [mobile.y] y, [mobile.z] z.":] </td> </tr> </table> <table align="center" width="400px" style="border:1px dashed #333;font-family:tahoma;color:#fff"> <tr> <td bgcolor="#000000" style="text-align:center;font-weight:bold;font-family:comic sans ms;"> Actions </td> </tr> <br> <tr> <td style="text-align:center;" bgcolor="#222222"> [(lentext("[mobile.type]")>=5)?"<a href=?action=Whisper&target=\ref[mobile]>Whisper</a> - Challenge - ":]<a href="?action=close&target=[mobile.key]">Close</a> </td> </tr> </table> </body> </html> "},"window=[mobile.key],size=480x240") else var{l;k;done} var/Who={" <html> <body bgcolor="#222222"> <table align="center" width="450px" style="color:#fff;font-family:tahoma;font-size:15px;border:1px inset #111111;" cellpadding="0" cellspacing="0"> <tr> <td colspan="3" bgcolor="#000000"> <b><big><font family="comic sans ms"><center>Players In Game</center></font></big></b> </td> </tr> <tr> <td bgcolor="#333333" style="text-align:center;"> "} for(var/mob/M in world)if(M.client&&lentext("[M.type]")>=5) src<<browse_rsc(M.icon,"MIC") l++ Who+={" <br><img src='MIC'> <a href='?action=Who&target=\ref[M]'>[M.name]</a>([M.key]) the [uppertext(copytext(M.gender,1,2))+copytext(M.gender,2)] [copytext("[M.type]",6)]. [(M.away)?"[M.name] is away \[[M.awaymsg]\].":] "} Who+={" </td> </tr> </table><br> "} for(var/mob/C in world)if(C.client&&lentext("[C.type]")<5) done=1 Who+={" <table align="center" width="450px" style="color:#fff;font-family:tahoma;border:1px inset #111111;" cellpadding="0" cellspacing="0"> <tr> <td colspan="3" bgcolor="#000000"> <b><big><font family="comic sans ms"><center>Players Not In Game</center></font></big></b> </td> </tr> <tr> <td bgcolor="#333333" style="text-align:center;"> "} break if(done) for(var/mob/A in world)if(A.client&&lentext("[A.type]")<5) k++ Who+={" <br><a href='?action=Who&target=\ref[A]&extra=nowhisper'>[A.key]</a> "} Who+={" </td> </tr> </table><br> "} if(l) Who+="<br><center><font color='#FFFFFF' face='comic sans ms'> [l] player[(l>1)?"s":] in-game[(k)?"":".</font>"]" if(k) Who+=", [k] player[(k>1)?"s":] not playing.</font>" Who+={" <br><a href="?action=close&target=Who">Close</a></center> </body> </html> "} usr<<browse(Who,"window=Who,size=500x300")
|
Problem description: Not so much of a problem as a request, though the description for this forum says get help with pieces of your code, and I suppose this can be considered as asking for help. There is nothing wrong in terms of this code working, but it seems there would be a better way to go about doing this. Basically what I want is a more efficient/secure way to do this.
|