SRL Archive - Suggestions

Scripting in Python


Wizzup?

2009-12-15 15:10:18

Hi,

I had some free time today, so I quickly wrote a simplistic way of calling mufasa function from python. Basically, you create a .so file with mufasa procedures in it, and you can export certain procedures to python.


>>> import PyMinMod
>>> PyMinMod.MoveMouse
<built-in function MoveMouse>
>>> PyMinMod.MoveMouse(5,5)
0

That moved the mouse. :)

Adding structures shouldn't be too hard either.

mastaraymond

2009-12-15 15:44:59

How about TPA's?

Wizzup?

2009-12-15 15:55:55

From: mastaraymond
How about TPA's?


You can export types to python as classes.

class rgb(Structure):
_fields_ = [('r', c_ubyte), ('g', c_ubyte), ('b', c_ubyte)]

I think array exporting in general isn't easy with Python, especially if we want speed. But then again, speed isn't really an issue atm.