Using micromacro with smartphone app via PC?
Using micromacro with smartphone app via PC?
Hello,
So there is an app I would like to use a macro on for farming.
First of all, I know initial requirements are: Free&jailbreak smartphone, use app to link/use smartphone from PC (via a window)
Now, my question is: Can I build something for farming in this scenario with micromacro Or should I use something else?
I know I could use something like "easy macro recorder" but there is a very long refresh period between farming respawns therefore not sure it would work out (i think the macro would be "lost" as soon as the first farming item was not there. Also I would feel more comfortable using micromacro.
Any initial thoughts? (please do not be too harsh)
So there is an app I would like to use a macro on for farming.
First of all, I know initial requirements are: Free&jailbreak smartphone, use app to link/use smartphone from PC (via a window)
Now, my question is: Can I build something for farming in this scenario with micromacro Or should I use something else?
I know I could use something like "easy macro recorder" but there is a very long refresh period between farming respawns therefore not sure it would work out (i think the macro would be "lost" as soon as the first farming item was not there. Also I would feel more comfortable using micromacro.
Any initial thoughts? (please do not be too harsh)
- Administrator
- Site Admin
- Posts: 5312
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Using micromacro with smartphone app via PC?
So, you want to run MicroMacro on your PC, but able to control it with your phone? Or did I misunderstand you?
If that's the case, you might be able to just use TeamViewer or something to control your PC.
If that's the case, you might be able to just use TeamViewer or something to control your PC.
Re: Using micromacro with smartphone app via PC?
the way I understand it they want to do this.
PC has micromacro
Iphone has an App
PC and Iphone are linked up together
they want to use micromacro to automate doing something in the app.
PC has micromacro
Iphone has an App
PC and Iphone are linked up together
they want to use micromacro to automate doing something in the app.
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Using micromacro with smartphone app via PC?
Yes that is correct Lisa
I guess the "no go" is that the visualisation of the app in the PC is probably just a picture (therefore I am guessing no addresses etc?)
It is maybe a long shot, just asking
A key reason I was thinking about micromacro was hoping that micromacro would detect that the item to farm (on the screen) is not there and jump to the next section of the macro with the right instructions.
I know I know, a bit of a noob, if it is too far fetched that is fine, just asking in case i was missing something obvious (what you have already done with Micromacro and ROM is fantastic thanks lol)
I guess the "no go" is that the visualisation of the app in the PC is probably just a picture (therefore I am guessing no addresses etc?)
It is maybe a long shot, just asking
A key reason I was thinking about micromacro was hoping that micromacro would detect that the item to farm (on the screen) is not there and jump to the next section of the macro with the right instructions.
I know I know, a bit of a noob, if it is too far fetched that is fine, just asking in case i was missing something obvious (what you have already done with Micromacro and ROM is fantastic thanks lol)
Re: Using micromacro with smartphone app via PC?
I think it would all come down to how windows interacts with the app, if it is purely showing an image and can't control the app in any way then it probably won't be possible.
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Using micromacro with smartphone app via PC?
Hello again, I was trying to find some options but the solutions I have been finding are very manual, this means I tried macro recorders but I did not have edit options via text editors (which makes the task very tedious and prone to errors). Therefore I am coming back for another try with Micromacro due to its edit macros flexibility.lisa wrote:I think it would all come down to how windows interacts with the app, if it is purely showing an image and can't control the app in any way then it probably won't be possible.
So... When viewing the app from the PC it is NOT ONLY an image as I can do whatever I can do in the iPhone FROM the PC (via mouse and keyboard strokes).
My plan is to have a series of actions, then copy and paste them in the text editor, then change some coordinates for each paste (or do this with word such as when u do a mailing list link to a template letter with a long list of addresses?).
I will play a bit with Micromacro, although I am not sure if i will have problems such as the window not being in the "right" place when running the repeat actions. Any thoughts are welcome
Thank again.
Re: Using micromacro with smartphone app via PC?
well if you can interact with the app with keypresses there is a very good chance you can get MM to do those keypresses for you, obviously since I don't have the setup I won't be to much help with it.
The tricky part usually is getting it to attach to the programme, I still haven't been able to attach to something in a webpage.
The tricky part usually is getting it to attach to the programme, I still haven't been able to attach to something in a webpage.
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Using micromacro with smartphone app via PC?
Yes, I was going through the MM manual about (x,y) and I thought... "How do I link it to the game window or determine the coordinates on the window?" (Not sure if it makes a difference but it is an application window rather than a webpage).lisa wrote:well if you can interact with the app with keypresses there is a very good chance you can get MM to do those keypresses for you, obviously since I don't have the setup I won't be to much help with it.
The tricky part usually is getting it to attach to the programme, I still haven't been able to attach to something in a webpage.
But if MM can be used with other games, there must be a way to link it to the window coordinates (lack of knowing what the correct term would be here), will continue looking at the manual see if I am jumping a step ^^
Re: Using micromacro with smartphone app via PC?
Ok well you should look at learning to use cheat enguine, you will find it very useful if you can manage to use it.
Secondly there is a function, which escapes my memory at the moment which will do a print of all processes and their names, this makes it much easier to determine the name of the class, which you will need.
Secondly you will need to start writing your own little scripts for it and just start small by doing prints, especially to check if it is getting the right process.
Lol I secondly twice.
Anyway.
So make a new folder in scripts/ and call it what ever you want.
In that folder make a new .lua file, you will need to get an editor like notepad++ to help write the code.
put at the top of the file
the ArenaNet_Dx_Window_Class is where you need to put the class for your programme you use(I'll have a look for the function which will make it easier). Basically when you run that file it will look for the window, if you have the name wrong it will print to MM
You need to run Some App first!
Secondly there is a function, which escapes my memory at the moment which will do a print of all processes and their names, this makes it much easier to determine the name of the class, which you will need.
Secondly you will need to start writing your own little scripts for it and just start small by doing prints, especially to check if it is getting the right process.
Lol I secondly twice.
Anyway.
So make a new folder in scripts/ and call it what ever you want.
In that folder make a new .lua file, you will need to get an editor like notepad++ to help write the code.
put at the top of the file
Code: Select all
local windowList = findWindowList("*","ArenaNet_Dx_Window_Class");
if( #windowList == 0 ) then
print("You need to run Some App first!");
return 0;
end
function getWin()
if( __WIN == nil ) then
__WIN = windowList[1]
end
return __WIN;
end
function getProc()
if( __PROC == nil or not windowValid(__WIN) ) then
if( __PROC ) then closeProcess(__PROC) end;
__PROC = openProcess( findProcessByWindow(getWin()) );
end
return __PROC;
end
You need to run Some App first!
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Using micromacro with smartphone app via PC?
I couldn't find the function, I might have even added in my own at the time I remember using it *shrug*
Anyway to get the class name you can do it this way.
Google winspector and download + install it
start up your thingy and then start winspector, at the top of winspector there is a cross hair, drag it to the thingy you use and then let go. You will get something like this pic. In this example I used Guild wars 2, so it auto expands the right spot and has it "highlighted"
You can see the executable name as GW2 and also the window name as "Guild Wars 2" the bit next to window name is class name, in this case the ArenaNet_Dx_Window_Class which i mentioned in the last post.
After that it is pretty much easy sailing, lol not really but it's a start.
Anyway to get the class name you can do it this way.
Google winspector and download + install it
start up your thingy and then start winspector, at the top of winspector there is a cross hair, drag it to the thingy you use and then let go. You will get something like this pic. In this example I used Guild wars 2, so it auto expands the right spot and has it "highlighted"
You can see the executable name as GW2 and also the window name as "Guild Wars 2" the bit next to window name is class name, in this case the ArenaNet_Dx_Window_Class which i mentioned in the last post.
After that it is pretty much easy sailing, lol not really but it's a start.
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Using micromacro with smartphone app via PC?
Hoookeey... Sorry brains just a bit overloaded lol...
So I started to look into cheat engine and the tutorial but still struggling there on how it fits in.
I guess that Winspector replaces what I think you where initially suggesting to do with cheat engine.
I got the information from Winspector and used your .lua file with the new Class. When running the .lua file I did not get any errors and the script stopped (which I guess is good).
When you say build the script I guess you mean use the MM functions in the .lua file (e.g. mouse control () )? Maybe obvious but getting introduced to a new world of tools
For the coordinates for each action (e.g. mouse control) I was thinking about using the size available from Winspector as a basis for the coordinates. So if the measures are: 320,481 then I guess coords 320,481 is top right and 1,1 is bottom left?
Maybe this is when you say the cheat engine kicks in? But would this coords approach work?
Thank you and I hope I am not pushing it
So I started to look into cheat engine and the tutorial but still struggling there on how it fits in.
I guess that Winspector replaces what I think you where initially suggesting to do with cheat engine.
I got the information from Winspector and used your .lua file with the new Class. When running the .lua file I did not get any errors and the script stopped (which I guess is good).
When you say build the script I guess you mean use the MM functions in the .lua file (e.g. mouse control () )? Maybe obvious but getting introduced to a new world of tools
For the coordinates for each action (e.g. mouse control) I was thinking about using the size available from Winspector as a basis for the coordinates. So if the measures are: 320,481 then I guess coords 320,481 is top right and 1,1 is bottom left?
Maybe this is when you say the cheat engine kicks in? But would this coords approach work?
Thank you and I hope I am not pushing it
Re: Using micromacro with smartphone app via PC?
yup no errors is good.Atlas123 wrote:I did not get any errors and the script stopped (which I guess is good).
ok so if it didn't do the print I mentioned then you should have the correct class name.
Next step is to add code to that file now, after the other stuff, just assume anything I post you add to that file at the end.
Code: Select all
local wx, wy, ww, wh = windowRect(getWin());
printf("X: %d, Y:%d, Width: %d, Height: %d\n" wx,wy,ww,wh)
Taking it slow now you have that part going =)
CE will help if you want to read info from memory, you may or may not need/want to. So you can just work on key presses and such first.
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Using micromacro with smartphone app via PC?
mmm... did play around with that and searched around but I get:
:S')' expected near 'wx'
Re: Using micromacro with smartphone app via PC?
I missed a ,
Code: Select all
printf("X: %d, Y:%d, Width: %d, Height: %d\n", wx,wy,ww,wh)
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Using micromacro with smartphone app via PC?
Yes that worked great thank you
I got the X the Y the width and the height. If i change the location of the window the X/Y changes also (which I guess will not be an issue as the window is attached?)
I started looking at the mouse function and I understand that I cannot see actions of the virtual mouse (although then I have no idea what it is doing and where)
So I tried this code from one of the queries Admin responded to for a different thing:
I know it does not follow the previous code you gave me but I was struggling to add the action into that code so I was trying things...
The result was a visible mouse move on the screen but entirely outside the "TvnWindowClass"... Am I jumping again too many steps?
I got the X the Y the width and the height. If i change the location of the window the X/Y changes also (which I guess will not be an issue as the window is attached?)
I started looking at the mouse function and I understand that I cannot see actions of the virtual mouse (although then I have no idea what it is doing and where)
So I tried this code from one of the queries Admin responded to for a different thing:
Code: Select all
function main()
attach( findWindow("TvnWindowClass") );
mouseSet(1, 200);
for j = 0,50 do
mouseSet(1 + j, 200);
rest(10);
end
end
startMacro(main, true);
The result was a visible mouse move on the screen but entirely outside the "TvnWindowClass"... Am I jumping again too many steps?
Re: Using micromacro with smartphone app via PC?
I am pretty sure the X/Y is the location of the window on your screen, so yeah moving the window will change those values.
So when doing mouse movements you want to use it as part of the width or height of the window and not a spot on your entire screen.
With that code I am pretty sure it will be at that spot on your screen, not window.
So you would use those values you get from the code I posted earlier.
So that should make the mouse be at the top left? of the window, might be bottom left, can't remember.
you can then use the width and height to point to specific places on your window.
So for example if you wanted to point at the very middle of your window you would do the position + half the width/height.
Doing the mouse like this will make it work no matter where on screen the window is.
you can also use another function to find where the mouse is pointing.
Some things you might find interesting, some not so much. At the end of the day what you use will be what you want to use
So next question is, what do you want MM to do in your app?
So when doing mouse movements you want to use it as part of the width or height of the window and not a spot on your entire screen.
With that code I am pretty sure it will be at that spot on your screen, not window.
So you would use those values you get from the code I posted earlier.
Code: Select all
local wx, wy, ww, wh = windowRect(getWin());
mouseSet(wx, wy);
you can then use the width and height to point to specific places on your window.
So for example if you wanted to point at the very middle of your window you would do the position + half the width/height.
Code: Select all
local wx, wy, ww, wh = windowRect(getWin());
mouseSet(wx + ww/2, wy+ wh/2);
you can also use another function to find where the mouse is pointing.
Code: Select all
local mouseX, mouseY = mouseGetPos()
So next question is, what do you want MM to do in your app?
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
- Administrator
- Site Admin
- Posts: 5312
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Using micromacro with smartphone app via PC?
Code: Select all
attach( findWindow("TvnWindowClass") );
Re: Using micromacro with smartphone app via PC?
Hello Admi, you are right, the code I used was taken out of context and therefore was missing that, but it is in Lisas code Thanks.
Hello Lisa,
1/ Some successes:
Got to play with cords and making sure they adapted to the window location with ( for example):
2/ Some challenges:
I may have got a bit mixed up but I could not find coords with the code you gave me:
So I managed to find the mouse cords (x,y) with some code from Admin i found:
But I cannot get Width and Height, therefore I tried this:
But I still cannot get Width and Height for the mouse location printed… Any thoughts?
As for what MM will do, that is a series of approx 25 actions for each farming target, I can imagine how cheat engine, a single process template and a table with coordinates could simplify things but better for me to learn how to walk before I try to fly
Again thank you for all the help
Hello Lisa,
1/ Some successes:
Got to play with cords and making sure they adapted to the window location with ( for example):
Code: Select all
local wx, wy, ww, wh = windowRect(getWin());
mouseSet(wx + ww-300, wy+ wh-270);
I may have got a bit mixed up but I could not find coords with the code you gave me:
Code: Select all
local mouseX, mouseY = mouseGetPos()
Code: Select all
local x,y = mouseGetPos();
printf("x: %d, y: %d\n", x, y);
But I cannot get Width and Height, therefore I tried this:
Code: Select all
local wx, wy, ww, wh = mouseGetPos();
print("X: %d, Y:%d, Width: %d, Height: %d\n", wx,wy,ww,wh);
As for what MM will do, that is a series of approx 25 actions for each farming target, I can imagine how cheat engine, a single process template and a table with coordinates could simplify things but better for me to learn how to walk before I try to fly
Again thank you for all the help
Re: Using micromacro with smartphone app via PC?
yeah use this instead
Code: Select all
local windowList = findWindowList("*","TvnWindowClass");
if( #windowList == 0 ) then
print("You need to run Some App first!");
return 0;
end
function getWin()
if( __WIN == nil ) then
__WIN = windowList[1]
end
return __WIN;
end
function getProc()
if( __PROC == nil or not windowValid(__WIN) ) then
if( __PROC ) then closeProcess(__PROC) end;
__PROC = openProcess( findProcessByWindow(getWin()) );
end
return __PROC;
end
attach(getWin())
--add code after here to do what you want.
local wx, wy, ww, wh = windowRect(getWin());
printf("X: %d, Y:%d, Width: %d, Height: %d\n", wx,wy,ww,wh)
local x,y = mouseGetPos();
printf("x: %d, y: %d\n", x, y);
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Using micromacro with smartphone app via PC?
Actually I hadn't said to use attach yet.Atlas123 wrote:Hello Admi, you are right, the code I used was taken out of context and therefore was missing that, but it is in Lisas code Thanks.
Ok little explanation.Hello Lisa,
1/ Some successes:
Got to play with cords and making sure they adapted to the window location with ( for example):
2/ Some challenges:Code: Select all
local wx, wy, ww, wh = windowRect(getWin()); mouseSet(wx + ww-300, wy+ wh-270);
I may have got a bit mixed up but I could not find coords with the code you gave me:
So I managed to find the mouse cords (x,y) with some code from Admin i found:Code: Select all
local mouseX, mouseY = mouseGetPos()
Code: Select all
local x,y = mouseGetPos(); printf("x: %d, y: %d\n", x, y);
But I cannot get Width and Height, therefore I tried this:
But I still cannot get Width and Height for the mouse location printed… Any thoughts?Code: Select all
local wx, wy, ww, wh = mouseGetPos(); print("X: %d, Y:%d, Width: %d, Height: %d\n", wx,wy,ww,wh);
functions return a set number of values,
mouseGetPos() returns 2
when you use a function with
Code: Select all
HGFHGFG, yyhrgfdffj = mouseGetPos()
windowRect(getWin()) returns 4 values.
Code: Select all
lollies, fruit, sugar, flour = windowRect(getWin())
printf("X: %d, Y:%d, Width: %d, Height: %d\n", lollies,fruit,sugar,flour)
yes crawling before walking would be a good start as well =)As for what MM will do, that is a series of approx 25 actions for each farming target, I can imagine how cheat engine, a single process template and a table with coordinates could simplify things but better for me to learn how to walk before I try to fly
Again thank you for all the help
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Who is online
Users browsing this forum: No registered users and 3 guests