Attaching to Window with Wierd Name
Forum rules
This is a sub-forum for things specific to MicroMacro.
This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
This is a sub-forum for things specific to MicroMacro.
This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
Attaching to Window with Wierd Name
I'm trying to make a bot in ESO http://eso.perfectworld.com/, but I'm having trouble getting getting micromacro to attach to the game window as it has a really wierd name in a chinese font. I've managed to make a list of all the windows but still haven't been able to attach to it. Is there a way to attach a window using an EXE?
- 3cmSailorfuku
- Posts: 354
- Joined: Mon Jan 21, 2008 6:25 pm
Re: Attaching to Window with Wierd Name
http://solarimpact.servegame.com/wiki/i ... ocessByExeeviltuna wrote:I'm trying to make a bot in ESO http://eso.perfectworld.com/, but I'm having trouble getting getting micromacro to attach to the game window as it has a really wierd name in a chinese font. I've managed to make a list of all the windows but still haven't been able to attach to it. Is there a way to attach a window using an EXE?
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Attaching to Window with Wierd Name
Attached input doesn't work with this game. I've already got a (very) basic bot set up, but most of the input doesn't work when attached. Tabbing, for example, works, but pressing skill hotkeys doesn't.
Re: Attaching to Window with Wierd Name
I am talking about the attach() fuction, not the openProcessbyExe, I know about that. Thanks though.3cmSailorfuku wrote:http://solarimpact.servegame.com/wiki/i ... ocessByExeeviltuna wrote:I'm trying to make a bot in ESO http://eso.perfectworld.com/, but I'm having trouble getting getting micromacro to attach to the game window as it has a really wierd name in a chinese font. I've managed to make a list of all the windows but still haven't been able to attach to it. Is there a way to attach a window using an EXE?
- 3cmSailorfuku
- Posts: 354
- Joined: Mon Jan 21, 2008 6:25 pm
Re: Attaching to Window with Wierd Name
Actually I was talking about getting like that the Process ID, which can be used as far as I can remember.eviltuna wrote:I am talking about the attach() fuction, not the openProcessbyExe, I know about that. Thanks though.3cmSailorfuku wrote:http://solarimpact.servegame.com/wiki/i ... ocessByExeeviltuna wrote:I'm trying to make a bot in ESO http://eso.perfectworld.com/, but I'm having trouble getting getting micromacro to attach to the game window as it has a really wierd name in a chinese font. I've managed to make a list of all the windows but still haven't been able to attach to it. Is there a way to attach a window using an EXE?
Although it's important in what encoding you are saving your files if you use Strings that contain anything else than western standards.
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Attaching to Window with Wierd Name
I'm guessing you're looking for a function like findProcessByWindow() but in reverse (findWindowByProcess()). In that case, no. There is no such function at this time. You could still write a set of functions to find what you need.
First, just get a list of all windows (findWindowList("*") should work), then iterate through each element in the returned list and check it's paired process using findProcessByWindow(). Here's an example script using exactly this method:
foundWin was exactly the same as notepadWin, which means it worked. Just copy/paste the findWindowByProcess() function into your script for now, as the function may be added to the core later. Since you should only be calling this once per execution, it shouldn't cause any slowdowns. Not that the code is overly heavy or anything.
First, just get a list of all windows (findWindowList("*") should work), then iterate through each element in the returned list and check it's paired process using findProcessByWindow(). Here's an example script using exactly this method:
Code: Select all
function findWindowByProcess(proc)
local windowList = findWindowList("*");
for i,v in pairs(windowList) do
local thisProc = findProcessByWindow(v);
if( thisProc == proc ) then
return v;
end
end
return nil; -- In case the process isn't found, return nil
end
function main()
local notepadWin = findWindow("Untitled - Notepad");
local notepadProc = findProcessByWindow(notepadWin);
printf("win: 0x%X, proc: 0x%X\n", notepadWin, notepadProc);
local foundWin = findWindowByProcess(notepadProc);
printf("Found win: 0x%X\n", foundWin);
end
startMacro(main);
Re: Attaching to Window with Wierd Name
Thats exactly what I was thinking of doing, but since you did it already, thanks =D
Administrator wrote:I'm guessing you're looking for a function like findProcessByWindow() but in reverse (findWindowByProcess()). In that case, no. There is no such function at this time. You could still write a set of functions to find what you need.
First, just get a list of all windows (findWindowList("*") should work), then iterate through each element in the returned list and check it's paired process using findProcessByWindow(). Here's an example script using exactly this method:foundWin was exactly the same as notepadWin, which means it worked. Just copy/paste the findWindowByProcess() function into your script for now, as the function may be added to the core later. Since you should only be calling this once per execution, it shouldn't cause any slowdowns. Not that the code is overly heavy or anything.Code: Select all
function findWindowByProcess(proc) local windowList = findWindowList("*"); for i,v in pairs(windowList) do local thisProc = findProcessByWindow(v); if( thisProc == proc ) then return v; end end return nil; -- In case the process isn't found, return nil end function main() local notepadWin = findWindow("Untitled - Notepad"); local notepadProc = findProcessByWindow(notepadWin); printf("win: 0x%X, proc: 0x%X\n", notepadWin, notepadProc); local foundWin = findWindowByProcess(notepadProc); printf("Found win: 0x%X\n", foundWin); end startMacro(main);
Re: Attaching to Window with Wierd Name
I've managed to attach to the window, but you are right, can't send any keys to it, except tab. I did try using AutoIt and was able to get keys sent using the Send() function, but ControlSend didn't work very well.
Who is online
Users browsing this forum: No registered users and 2 guests