<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Usermade (clientside)interface]]></title><description><![CDATA[<p>To my knowledge you do something like this to run user scripts.</p>
<p><img src="https://i.imgur.com/vXUK26A.png" alt="alt text" class="img-responsive img-markdown" /></p>
<p>Which results in the loop member of the users module getting run.</p>
<p><img src="https://i.imgur.com/Rrd1Z9I.png" alt="alt text" class="img-responsive img-markdown" /></p>
<p>It is then not too much of a stretch to think that you could maybe return more values than just a function.</p>
<p><img src="https://i.imgur.com/h4fG8q2.png" alt="alt text" class="img-responsive img-markdown" /></p>
<p>To be fair there is little to no use for that as there is nothing checking for that value on the backend.
But what if there was.</p>
<p>Something that could display custom values on screen.</p>
<p><img src="https://i.imgur.com/VzPmzhl.png" alt="alt text" class="img-responsive img-markdown" /></p>
<p>Now, there's roomvisuals and the memorywatcher for that which are well and plenty.</p>
<p>But why restrict ourselves to simple values when the most powerfull tool for converting strings to visuals is already in use, Internet browsers. All the tools are already in place we just need to use them.</p>
<p>what i'm suggesting is, what if there was some way to send html from the module object to the webclient?</p>
<p><img src="https://i.imgur.com/8ohrw3X.png" alt="alt text" class="img-responsive img-markdown" /></p>
<p>And have it be inserted into the clients wepage.</p>
<p><img src="https://i.imgur.com/IgRuc9n.png" alt="alt text" class="img-responsive img-markdown" /></p>
<p>(at this point it might be worth it to point out that i only really have a clue as to how webpages work and that everything is just pseudocode)</p>
<p>Now there's a quite blaring issue with this (i'm sure there's plenty actually), what happens if you write something invalid, or a big black box you can't click through, make the page redirect somewhere etc etc, you get the point. Someting so bad it can't be recovered from using normal means.</p>
<p>To that i say, make it a per session opt in. if you fuck up so bad you can't recover reload the page/restart the client change/remove your html value and re-opt-in</p>
<p><img src="https://i.imgur.com/ujmMHlO.png" alt="alt text" class="img-responsive img-markdown" /></p>
<p>With just the ability to do this you could do some pretty amazing things, but what i'll think it'll be used for most is custom, usermade interfaces.</p>
<p><img src="https://i.imgur.com/hDuc4AI.png" alt="alt text" class="img-responsive img-markdown" /></p>
<p>Something like this would open up a wealth of possibilities for players for a relatively small amount of backend work.</p>
<p>As an addendum, since any code written this way is run clientside and only parsed on command (where as normal scripts are parsed and run once a tick) there will likely only be a negligable strain on the servers</p>
]]></description><link>http://screeps.com/forum/topic/2489/usermade-clientside-interface</link><generator>RSS for Node</generator><lastBuildDate>Mon, 16 Mar 2026 18:24:13 GMT</lastBuildDate><atom:link href="http://screeps.com/forum/topic/2489.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 09 Dec 2018 21:28:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Usermade (clientside)interface on Sun, 09 Dec 2018 21:28:59 GMT]]></title><description><![CDATA[<p>To my knowledge you do something like this to run user scripts.</p>
<p><img src="https://i.imgur.com/vXUK26A.png" alt="alt text" class="img-responsive img-markdown" /></p>
<p>Which results in the loop member of the users module getting run.</p>
<p><img src="https://i.imgur.com/Rrd1Z9I.png" alt="alt text" class="img-responsive img-markdown" /></p>
<p>It is then not too much of a stretch to think that you could maybe return more values than just a function.</p>
<p><img src="https://i.imgur.com/h4fG8q2.png" alt="alt text" class="img-responsive img-markdown" /></p>
<p>To be fair there is little to no use for that as there is nothing checking for that value on the backend.
But what if there was.</p>
<p>Something that could display custom values on screen.</p>
<p><img src="https://i.imgur.com/VzPmzhl.png" alt="alt text" class="img-responsive img-markdown" /></p>
<p>Now, there's roomvisuals and the memorywatcher for that which are well and plenty.</p>
<p>But why restrict ourselves to simple values when the most powerfull tool for converting strings to visuals is already in use, Internet browsers. All the tools are already in place we just need to use them.</p>
<p>what i'm suggesting is, what if there was some way to send html from the module object to the webclient?</p>
<p><img src="https://i.imgur.com/8ohrw3X.png" alt="alt text" class="img-responsive img-markdown" /></p>
<p>And have it be inserted into the clients wepage.</p>
<p><img src="https://i.imgur.com/IgRuc9n.png" alt="alt text" class="img-responsive img-markdown" /></p>
<p>(at this point it might be worth it to point out that i only really have a clue as to how webpages work and that everything is just pseudocode)</p>
<p>Now there's a quite blaring issue with this (i'm sure there's plenty actually), what happens if you write something invalid, or a big black box you can't click through, make the page redirect somewhere etc etc, you get the point. Someting so bad it can't be recovered from using normal means.</p>
<p>To that i say, make it a per session opt in. if you fuck up so bad you can't recover reload the page/restart the client change/remove your html value and re-opt-in</p>
<p><img src="https://i.imgur.com/ujmMHlO.png" alt="alt text" class="img-responsive img-markdown" /></p>
<p>With just the ability to do this you could do some pretty amazing things, but what i'll think it'll be used for most is custom, usermade interfaces.</p>
<p><img src="https://i.imgur.com/hDuc4AI.png" alt="alt text" class="img-responsive img-markdown" /></p>
<p>Something like this would open up a wealth of possibilities for players for a relatively small amount of backend work.</p>
<p>As an addendum, since any code written this way is run clientside and only parsed on command (where as normal scripts are parsed and run once a tick) there will likely only be a negligable strain on the servers</p>
]]></description><link>http://screeps.com/forum/post/12349</link><guid isPermaLink="true">http://screeps.com/forum/post/12349</guid><dc:creator><![CDATA[Fiskmans]]></dc:creator><pubDate>Sun, 09 Dec 2018 21:28:59 GMT</pubDate></item><item><title><![CDATA[Reply to Usermade (clientside)interface on Invalid Date]]></title><description><![CDATA[<p>I've been wanting to extend the client on my own for a while now, and I totally support the base concept. However I find the solution you're proposing here to be quite unadequate.</p>
<p>If you send this through module.exports, it <em>will</em> be interpreted by the server in some way, making it prone to error that'd stop your script, and use up some cpu even if so little, CPU.</p>
<p>Plus since <em>the server</em> is the one interpreting the main module, there's no telling it's even possible to send the interpreted code to the client (I highly doubt it).<br />
The client will need to do some interpreting anyway; since it receives a copy of the code, you might as well do everything from the client, and not have the backend involved in the process in any way whatsoever :</p>
<p>The way I'd envision an &quot;easy&quot; client extension, there would be another sort of <code>main.js</code> module, let's call it <code>client.js</code>. For the server, it would be a module like every other: you don't include it anywhere in <code>main</code>, and so it will never be run by the server; however, <em>the client</em> will seek this module, and run it like its very own main module.<br />
From there all bet's open to define what we'll be able to do out of it, and how we would do it. That completely depends on the client's architecture.</p>
<p>Now we know this kind of thing could be possible, because some people already built there own <a href="http://screeps.high5r.com/" rel="nofollow">custom clients</a>; they totally have the power to achieve what you describe, and even more.<br />
However <strong>I won't tell you</strong> to &quot;just do that&quot;; that would be a humongous task, I don't even have the time or will to do it myself, and I believe most people who'd try would only end up with a downgraded makeshift client rather than an enhanced one, which beats the whole point...</p>
<p>However one thing <em>I would</em> try myself at, is branch off the <em>official client</em>'s and extending it into supporting this kind of feature. But to do that we would need to have the client's source code on hand.<br />
(@ devs; We already have a github for the server's code, will we get something similar for the client? Please? I'm really looking forward to that.)</p>
]]></description><link>http://screeps.com/forum/post/12351</link><guid isPermaLink="true">http://screeps.com/forum/post/12351</guid><dc:creator><![CDATA[Estecka]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Usermade (clientside)interface on Tue, 11 Dec 2018 02:10:03 GMT]]></title><description><![CDATA[<p>Doing this through to the server seems very strange to me.</p>
<p>Don't forget you can run Javascript in the client through <code>&lt;script&gt;</code> tags in the console. Consider writing a function you can call from the console that modifies your client UI, or check #client-abuse in Slack for examples. (They're working on a redesign for the UI though, so choose carefully how much time you invest.)</p>
]]></description><link>http://screeps.com/forum/post/12370</link><guid isPermaLink="true">http://screeps.com/forum/post/12370</guid><dc:creator><![CDATA[keenathar]]></dc:creator><pubDate>Tue, 11 Dec 2018 02:10:03 GMT</pubDate></item></channel></rss>