eval.py
eval.py is a Battlefield 2 server script that allows execution of Python code via RCON. It's much hipper than the similar command built into the debug build of the client!
Download Link
How to Install
- Browse to
admin/standard_adminin your server directory - Edit
__init__.pyso it looks similar to the following. Theimport evalandeval.init()lines are what you need to add.import autobalance import tk_punish import eval autobalance.init() tk_punish.init() eval.init() - Put the script in the
admin/standard_adminfolder. - Make sure RCON is configured, then run your server. If
comes up in your server console it should work from there.eval.py loaded
Usage
To use it, run eval <statement>. An example would be something like the following:
rcon> eval for i in dir(bf2.objectManager.getObjectsOfTemplate('c4_explosives')[0]): ctx.write(str(i) + '\n')
Which then might return:
__doc__
getChildren
getParent
getPosition