SRL Archive - MML Library Development

Updates to libMML and pyMML!


i luffs yeww

2014-11-17 23:52:15

Hello,

I've been spending some time with libMML/pyMML again lately and have been slowly making progress this time! To anyone who doesn't know what libMML or pyMML are, you can read about them here.

My biggest additions thus far are functioning keyboard and bitmap units in libMML and pyMML. There have been a few other additions, but they're either untested or just not working. Currently bitmap functions in pyMML are (seemingly) mostly working. There are several data types that I'm not sure how I want to deal with yet, but for the most part it's okay.

You can find my current progress on GitHub.

If you want to test it out, just run
python final_test.py
in the pymml directory and have this image visible somewhere. It should find it and move the mouse to a certain point on the image. Bitmap finding and mouse moving in Python with MML! Neat!

If anyone is curious or wants to help, please, feel free to ask. My biggest concern is getting pyMML in a spot where it works well and is more idiomatic. That would be the biggest help to me at the moment.

This could be the start of how scripts are written in the future!

from mml import MMLCore
from mml import Bitmap
from mml import Mouse

from ctypes import *

DLL = MMLCore('../mml.dll')
client = DLL.dll.create_client()

bitmap = Bitmap(DLL, client)
mouse = Mouse(DLL, client)

i = bitmap.loadBitmap('flickr_test.bmp')

a = bitmap.findBitmap(i)

if (a[2]): # "Found"
print "bitmap (%d) found at (%d, %d)!" % (i, a[0], a[1])
mouse.setPos((a[0], a[1]))

bitmap.freeBitmap(i)
print "bitmaps freed!"

del DLL

Hacking Tutorial

EDIT: PLEASE! Remember this is very early in (active) development, so things will change for the better soon!

Kyle

2014-11-18 00:08:27

Wow! This looks super interesting. Definitetly would have the potential to make scripting significantly more efficient that's for sure.

i luffs yeww

2014-11-18 00:19:49

From: elfyyy
Wow! This looks super interesting. Definitetly would have the potential to make scripting significantly more efficient that's for sure.


Possibly, yes! The main aspect that I think is neat is libMML, since it will allow people to script in any language which can load a DLL. Python is just the first language being wrapped around libMML.

Scripting in Python (once pyMML looks nicer) will be pretty freakin' cool though. ;)

TomTuff

2014-11-18 01:54:24

From: elfyyy
Wow! This looks super interesting. Definitetly would have the potential to make scripting significantly more efficient that's for sure.


It will also open up SRL to a wider audience. I'm really glad to see more progress on this - while I won't get any direct use of it myself since I don't (currently) know python, it will still be a great boon for the community once finished.

i luffs yeww

2014-11-18 01:57:03

From: TomTuff
It will also open up SRL to a wider audience. I'm really glad to see more progress on this - while I won't get any direct use of it myself since I don't (currently) know python, it will still be a great boon for the community once finished.


But you may know Ruby, Java, C, Lua, or other languages, and with libMML (and a few hours of work) you can use MML in your language of choice!

Frement

2014-11-24 05:44:45

Whats the status of this?

i luffs yeww

2014-11-24 13:21:07

From: Frement
Whats the status of this?


I'm not sure if you're asking about how much is done, how active it is, or something else. But to answer what I think you're asking, I'm still actively working on it when I have time. I'm definitely putting more time into libMML, and I especially will now as I continue, as I'm concerned I will have to be the one to rewrite pyMML properly, and I'd rather focus on one thing at a time.

I am planning on exporting (almost) everything from MML, so libMML will still take some time for sure. I don't think I'll export things that aren't strictly related to MML like file and internet functions, but I'm not sure. I suppose it wouldn't hurt to include them anyway. If a language being implemented on top of libMML (pyMML for example) doesn't want to use MML for certain features then that's no problem. But having everything (within reason) available is my goal, currently.

I would love help with actually working on libMML, pyMML, or maybe even a different language, so if you're interested, let me know! Honestly libMML isn't too difficult. It's just a lot of busy work with a few hiccups when dealing with data types.