Question
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.
-
- Posts: 8
- Joined: Thu May 08, 2008 10:21 pm
Question
In Lua is it possible to search for text inside of Firefox? If so, how? I cannot figure out how to do it. Also, mouseSet(x, y) hides my mouse even after attachMouse("My window") Please help
- Administrator
- Site Admin
- Posts: 5313
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Question
You would need to use memory reading functions to read information out of FireFox. You should, instead, just use the cURL plugin and natively read and post information from/to the website in question.
Additionally, what do you mean it "hides" your mouse? I assume you mean it moves the mouse (probably to a location off the screen). The reason for that is because you aren't attaching right. Here's how you should do it:
Additionally, what do you mean it "hides" your mouse? I assume you mean it moves the mouse (probably to a location off the screen). The reason for that is because you aren't attaching right. Here's how you should do it:
Code: Select all
attachMouse( findWindow("Something") );
mouseSet(x, y);
-
- Posts: 8
- Joined: Thu May 08, 2008 10:21 pm
Re: Question
I used this to get the process:
duelsWinCheck = findWindow("Duels - Mozilla Firefox");
print(duelsWinCheck);
and this to get the x, y of a button
mouseGetPos();
Pirint(MouseGetPos);
attachMouse(findWindow(131600))
finally mouseSet(x, y) --- from mouseGetPos
rest(1)
mouseLClick();
Then mouse cursor disappears
duelsWinCheck = findWindow("Duels - Mozilla Firefox");
print(duelsWinCheck);
and this to get the x, y of a button
mouseGetPos();
Pirint(MouseGetPos);
attachMouse(findWindow(131600))
finally mouseSet(x, y) --- from mouseGetPos
rest(1)
mouseLClick();
Then mouse cursor disappears
- Administrator
- Site Admin
- Posts: 5313
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Question
All of the code you have provided is broken.
Code: Select all
duelsWinCheck = findWindow("Duels - Mozilla Firefox");
print(duelsWinCheck);
local x,y = mouseGetPos();
printf("x: %d, y: %d\n", x, y);
attachMouse(duelsWinCheck);
mouseSet(x, y);
rest(1);
mouseLClick();
-
- Posts: 8
- Joined: Thu May 08, 2008 10:21 pm
Re: Question
thanks for your help. I used the wiki process, memory, etc stuff. Trying to learn Lua on my own but I can't find any book at borders or barnes and noble. I am also trying learn the structure and usage of functions from the shaiya script. I got the screen to restore using sw.maximize(131600). And was able to VK_**** but the mouse pointer confused me. Also, one last thing, how can u search memory address to search for a button or text within a window like flirefox? I am currently writing web-game-based with chickenfoot that uses the language Javascript but I would like to become an expect at lua since it can do more. Thanks for your time, I really am trying.
- Administrator
- Site Admin
- Posts: 5313
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Question
You should probably start smaller. Attempting to modify a game within a browser, such as FireFox, via memory is a lot more difficult than it sounds.
You can find the Lua manual here: http://www.lua.org/manual/5.1/
It'll teach you most of what you need to know.
You can find the Lua manual here: http://www.lua.org/manual/5.1/
It'll teach you most of what you need to know.
-
- Posts: 8
- Joined: Thu May 08, 2008 10:21 pm
Re: Question
Thanks for your help. Can you suggest same small projects that focus on LUA capabilities or u think it would be ok to do the same things I did to learn Java?
- Administrator
- Site Admin
- Posts: 5313
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Question
If you play Runes of Magic, you could consider writing a few functions or addons for the bot. That would be a good start because most of the hard stuff is done for you.
-
- Posts: 8
- Joined: Thu May 08, 2008 10:21 pm
Re: Question
I am gonna play that game just to learn Lua. Thanks for everything
Who is online
Users browsing this forum: No registered users and 0 guests