Question

Discuss, ask for help, share ideas, give suggestions, read tutorials, and tell us about bugs you have found with MicroMacro in here.

Do not post RoM-Bot stuff here. There is a subforum for that.
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.
Post Reply
Message
Author
FlyingCircus
Posts: 8
Joined: Thu May 08, 2008 10:21 pm

Question

#1 Post by FlyingCircus » Sat Dec 04, 2010 12:29 am

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

User avatar
Administrator
Site Admin
Posts: 5313
Joined: Sat Jan 05, 2008 4:21 pm

Re: Question

#2 Post by Administrator » Sat Dec 04, 2010 1:09 am

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:

Code: Select all

attachMouse( findWindow("Something") );
mouseSet(x, y);

FlyingCircus
Posts: 8
Joined: Thu May 08, 2008 10:21 pm

Re: Question

#3 Post by FlyingCircus » Sat Dec 04, 2010 12:40 pm

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

User avatar
Administrator
Site Admin
Posts: 5313
Joined: Sat Jan 05, 2008 4:21 pm

Re: Question

#4 Post by Administrator » Sat Dec 04, 2010 3:50 pm

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();

FlyingCircus
Posts: 8
Joined: Thu May 08, 2008 10:21 pm

Re: Question

#5 Post by FlyingCircus » Sat Dec 04, 2010 8:09 pm

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.

User avatar
Administrator
Site Admin
Posts: 5313
Joined: Sat Jan 05, 2008 4:21 pm

Re: Question

#6 Post by Administrator » Sat Dec 04, 2010 8:26 pm

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.

FlyingCircus
Posts: 8
Joined: Thu May 08, 2008 10:21 pm

Re: Question

#7 Post by FlyingCircus » Sat Dec 04, 2010 8:31 pm

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?

User avatar
Administrator
Site Admin
Posts: 5313
Joined: Sat Jan 05, 2008 4:21 pm

Re: Question

#8 Post by Administrator » Sun Dec 05, 2010 1:44 am

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.

FlyingCircus
Posts: 8
Joined: Thu May 08, 2008 10:21 pm

Re: Question

#9 Post by FlyingCircus » Sun Dec 05, 2010 11:29 am

I am gonna play that game just to learn Lua. Thanks for everything

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests