<div>Why don&#39;t you use a scripting host and inject commands into a ScriptEngine reusing a ScriptScope as you need to execute them?</div><div> </div><div>Kevin<br><br></div><div class="gmail_quote">On Mon, Jul 23, 2012 at 5:31 AM, Jesper Taxbøl <span dir="ltr">&lt;<a href="mailto:jesper@taxboel.dk" target="_blank">jesper@taxboel.dk</a>&gt;</span> wrote:<br>
<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote"><font color="#222222">Hi,</font><div><font color="#222222"><br>
</font></div><div><font color="#222222">I am not that familiar with Ironpython yet, but I have a question that I hope you can help me answer.</font></div><div>

<font color="#222222"><br></font></div><div><font color="#222222">I am working on a programming-game where I will allow users to do some simple python scripting against a simple API that I will control a game character. Instructions like move and shoot etc, alongside some simple sense functions that return info on the game world. </font></div>


<div><font color="#222222"><br></font></div><div><span style="color:rgb(34,34,34)">My current prototype creates an ironpython engine for each game character and executes the script in a thread by itself, which sort of works. But I have the problem that the outcome of executing the game gives different results every time. Therefore I would like to ask the question:</span></div>


<div><span style="color:rgb(34,34,34)"><br></span></div><div><span style="color:rgb(34,34,34)">Is it possible to execute a script inside the Ironpython engine gradually?</span></div><div><span style="color:rgb(34,34,34)"><br>


</span></div><div><span style="color:rgb(34,34,34)">I imagine that I could update a list of engines with a tick(int cycles) and get a fair sharing of resources between engines and ensure the same result every time.</span></div>


<div><span style="color:rgb(34,34,34)"><br></span></div><div><span style="color:rgb(34,34,34)">Kind regards </span></div><div><span style="color:rgb(34,34,34)"><br></span></div><div><font color="#222222">Tax</font></div>

<div>
<font color="#222222"><br></font></div><div><font color="#222222"><br></font></div><div><font color="#222222">P.S:</font></div><div><font color="#222222">As this is a programming game I would also like to be able to limit the available memory each script is using. Is there a way to limit this, so a script like this would be killed.</font></div>


<div><font color="#222222"><br></font></div><div><font color="#222222">x = 0</font></div><div><font color="#222222">v = {}</font></div><div><font color="#222222">while True:</font></div><div><font color="#222222">   v[x]=x</font></div>


<div><font color="#222222">   x= x + 1</font></div><div><font color="#222222"><br></font></div><div><font color="#222222"><br></font></div>
<br>_______________________________________________<br>
Ironpython-users mailing list<br>
<a href="mailto:Ironpython-users@python.org">Ironpython-users@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/ironpython-users" target="_blank">http://mail.python.org/mailman/listinfo/ironpython-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><span style="font-size:12pt"><strong><font face="Garamond">W. Kevin Hazzard</font></strong></span><div><font face="Garamond"><span><span style="font-size:8pt">Consultant, Author, Teacher, Microsoft MVP</span></span></font></div>
<div><font><span style="font-size:8pt"><span></span></span></font><font face="Garamond"><span style="font-size:8pt">(804) 928-3444</span></font></div><div><font face="Garamond"><span style="font-size:8pt"><a href="http://manning.com/hazzard" target="_blank">book</a> | <a href="https://mvp.support.microsoft.com/profile/Kevin.Hazzard" target="_blank">mvp</a> | <a href="http://twitter.com/#!/KevinHazzard" target="_blank">twitter</a> | <a href="http://www.facebook.com/wkhazzard" target="_blank">facebook</a> | <a href="http://www.linkedin.com/in/kevinhazzard" target="_blank">linkedin</a> | <a href="http://captechconsulting.com" target="_blank">captech</a></span></font></div>
<br>