Page 1 of 1

Using MM to clean memory

Posted: Thu Jun 25, 2015 11:24 am
by noobbotter
Hi guys. On my computer, when playing Runes of Magic, to try to reduce crashes, I run CleanMem. I don't know that the version I have does auto cleaning so every so often I will right-click on my CleanMem Mini-Monitor and select "Clean Memory" and it seems to reduce the amount of memory being used.

So I was wondering if there is a way using LUA in MM to do that exact thing... click on my CleanMem mini-monitor and select "clean memory"?

Or if anyone has a better memory cleaning/optimization program/trick they use, that would be great too. Thanks.

Re: Using MM to clean memory

Posted: Thu Jun 25, 2015 11:43 am
by BlubBlab
I think you should read this first :
http://www.howtogeek.com/171424/why-mem ... n-useless/

Re: Using MM to clean memory

Posted: Thu Jun 25, 2015 12:01 pm
by Administrator
The best way of handling it, if you feel it is necessary, would be if you can call it by command-line. I believe the function to run a CLI command is (for MM2) system.exec() or (for MM1) system(). Alternatively, you can do it using plain Lua by using the os.execute() function.

Re: Using MM to clean memory

Posted: Fri Jun 26, 2015 1:14 am
by rock5
I used to run it with Windows Task Scheduler. I don't remember exactly how I had it set up but probably I had a batch file to run it and called the batch file in the task scheduler.

Re: Using MM to clean memory

Posted: Fri Jun 26, 2015 7:22 am
by noobbotter
Well, I actually figured it out and it wasn't too difficult, at least with the way I did it. I did figure out that I can set up a hotkey on my MemClean program to initiate a quick clean of memory. Oncy I did that (I set mine up as {CTRL+O}) I wrote a little vbs script as such:

Code: Select all

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys "^(%o)"
I put the .vbs file (named testmem.vbs) in the rom folder. Then in my waypoint file when I want it to clean memory (such as after dailies and before I launch minigames because of all the ports to move around, and once after each minigame) I run the command os.execute("cscript scripts/rom/testmem.vbs")

The only issue I found is that the game sees the "o" key press and it opens the friends list window (because that's what the game is supposed to do when i press "o") so if I just follow it up with RoMScript("CloseAllWindows()") I should be good to go. My script ran through all 9 of my characters last night without issue.