Page 3 of 3

Re: Using micromacro with smartphone app via PC?

Posted: Tue Oct 09, 2012 3:10 pm
by Atlas123
I thought of a cheeky way around this... I can replicate the individual drag actions I need with a macro recorder, I just need to know how to give instructions in the script to open the file.

Is that using loadpaths? how?

Thanks

Re: Using micromacro with smartphone app via PC?

Posted: Tue Oct 09, 2012 7:44 pm
by lisa
Atlas123 wrote:Is that using loadpaths?
nope, loadpaths is specifically to get data from a waypoint file.

This macro thing, what type of file is it and how can it be used?

I would normally just say to use include() but I don't know if that would do the click for a "macro" thing.

example

Code: Select all

include("addresses.lua")
That would include the code that is in the file addresses.lua which is in the same folder as the script being run, if the file you want is in another folder it gets a bit more tricky.

Re: Using micromacro with smartphone app via PC?

Posted: Wed Oct 10, 2012 4:10 pm
by Atlas123
It is Workspace Macro Pro, extension .wksp I just need to initiate the file (file will run the short macro and with enough yrest it works)

At present I have the file below the App window and the micromacro double clicks on the file lol, a bit dodgy so would be nice to just call the file from MM

Re: Using micromacro with smartphone app via PC?

Posted: Wed Oct 10, 2012 6:53 pm
by lisa
ok in that case you would need MM to execute the file, pretty sure there is a function for it in MM, can't recall it's name off hand, might be run or execute.

Re: Using micromacro with smartphone app via PC?

Posted: Thu Oct 11, 2012 2:13 am
by Atlas123
I looked in the wiki but if it is not loadpath the other most similar ones are for filesystem functions but none seem to be for running a file.

I looked in the forums but most of it is to load loadpath related

Admin, any hints?

Thank you

Re: Using micromacro with smartphone app via PC?

Posted: Thu Oct 11, 2012 2:53 am
by lisa
you will probably be looking at using

Code: Select all

os.execute()
Never used it myself.
The lua reference has this for it
http://www.lua.org/manual/5.1/manual.ht ... os.execute

So something like this would be my guess.

Code: Select all

os.execute("somename.wksp")

Re: Using micromacro with smartphone app via PC?

Posted: Thu Oct 11, 2012 3:27 pm
by Atlas123
The file is in the same folder as the script

I tried with:

Code: Select all

 function fileA()
os.execute("macrotroops.wksp")
end

--First try

fileA()
But it says: " 'macrotroops.wksp' is not recognized as an internal or external command, operable program or batch file"

I also tried without the quotations marks inside the brackets but no luck

Re: Using micromacro with smartphone app via PC?

Posted: Thu Oct 11, 2012 6:02 pm
by lisa
I suspected it might not like the extension, back up plan is to make a short cut for the .wksp file and then tell MM to execute the shortcut =)

Re: Using micromacro with smartphone app via PC?

Posted: Thu Oct 11, 2012 8:24 pm
by Administrator
He would need to execute the program with the filename as an argument. The file is not a command, so it doesn't know what to do with it.

Re: Using micromacro with smartphone app via PC?

Posted: Thu Oct 11, 2012 9:47 pm
by lisa
Administrator wrote:He would need to execute the program with the filename as an argument. The file is not a command, so it doesn't know what to do with it.
ummm

Code: Select all

os.execute("START macrotroops.wksp")
?

Re: Using micromacro with smartphone app via PC?

Posted: Thu Oct 11, 2012 10:54 pm
by Administrator
More like

Code: Select all

system("C:\\whatever\\whatever.exe " .. getExecutionPath() .. "\\macrotrools.wksp");

Re: Using micromacro with smartphone app via PC?

Posted: Thu Oct 11, 2012 10:57 pm
by lisa
ahh ok so it is a bit like a file.txt and opening it with notepad, you need to execute the notepad.exe and tell it to open up the file.txt.

Yeah I got no idea what opens a .wksp file, *steps back into the shadows*