Page 1 of 1
Question
Posted: Sat Dec 04, 2010 12:29 am
by FlyingCircus
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
Re: Question
Posted: Sat Dec 04, 2010 1:09 am
by Administrator
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);
Re: Question
Posted: Sat Dec 04, 2010 12:40 pm
by FlyingCircus
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
Re: Question
Posted: Sat Dec 04, 2010 3:50 pm
by Administrator
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();
Re: Question
Posted: Sat Dec 04, 2010 8:09 pm
by FlyingCircus
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.
Re: Question
Posted: Sat Dec 04, 2010 8:26 pm
by Administrator
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.
Re: Question
Posted: Sat Dec 04, 2010 8:31 pm
by FlyingCircus
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?
Re: Question
Posted: Sun Dec 05, 2010 1:44 am
by Administrator
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.
Re: Question
Posted: Sun Dec 05, 2010 11:29 am
by FlyingCircus
I am gonna play that game just to learn Lua. Thanks for everything