how to get pixel position in another application?
how to get pixel position in another application?
hello there!
i am planning to make a program that can detect the pixel/color position in another 3d program and process that pixel position to my program. is it posible? ummm is it posible to send command to that 3d program? sorry for my crazzzzzyness thing heh
ty in advance
i am planning to make a program that can detect the pixel/color position in another 3d program and process that pixel position to my program. is it posible? ummm is it posible to send command to that 3d program? sorry for my crazzzzzyness thing heh
ty in advance
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
hello netmaestro!
thank you for replying. about my question, its a kinda AI type program that i would like to code (without any good backround in PB and am not that good programmer too heh). the idea is to capture the location (x and y axis) of pixel in the 3d Online game then if the condition is true then the program will send a command. I think hooking/injecting technique is much better than my idea but i dont have yet that kind of programming knowledge. actually this is my second project. my first project was KLOGS (its a keylogger program - using in good way)
Why do i have to create this AI program? my brother and i love to play Online games specially FLYFF, but since we're so buisy and we can't play it everyday, just like i said, i want to make a AI program that can help us levelling our skills - its skill spammer type program. hey am not that bad person, skill spamming is aloud in FLYFF. i hope you understand and thank you.
thank you for replying. about my question, its a kinda AI type program that i would like to code (without any good backround in PB and am not that good programmer too heh). the idea is to capture the location (x and y axis) of pixel in the 3d Online game then if the condition is true then the program will send a command. I think hooking/injecting technique is much better than my idea but i dont have yet that kind of programming knowledge. actually this is my second project. my first project was KLOGS (its a keylogger program - using in good way)
Why do i have to create this AI program? my brother and i love to play Online games specially FLYFF, but since we're so buisy and we can't play it everyday, just like i said, i want to make a AI program that can help us levelling our skills - its skill spammer type program. hey am not that bad person, skill spamming is aloud in FLYFF. i hope you understand and thank you.
Your first program was a keylogger, and now you want to make a bot-type
app to keep up your skills against real human players when you're not there?
And I suppose you think nothing's wrong with that? Don't expect much help.
app to keep up your skills against real human players when you're not there?
And I suppose you think nothing's wrong with that? Don't expect much help.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.
sir PB, all of the players already doing that in flyff by means of using toothpick or paper inserting to a keyboard function key to keep their skills levelling while theiy are sleeping or while they are doing something and i think game moderator knows that. and i think that's not illegal in flyff and its not against real human players. sir its a skills level not the players level we are talking about here.
if I said something stupid with my idea, sorry. am just looking for help. ...am not that bad person.
"i know my limits when it comes to my programs...." if you cant help me its OKAY.
if I said something stupid with my idea, sorry. am just looking for help. ...am not that bad person.
"i know my limits when it comes to my programs...." if you cant help me its OKAY.
What is FLYFF?
I think i know what you want to do, as i used to use an official third party program (through their dev program) for Ultima Online. Basically it used to check the health bar on screen via a pixel reading. If that pixel turned green (rather than red) it mean't i was poisened, etc. and the macro program sent a key command to the UO client for the cure poisen spell. This helped train my magery and meditation in game as i cast poisen on myself. I also had macros running to check my health bar to make sure it didn't go below a certain level. This was acheived by making sure another pixel didn't turn black. If it did, i sent the command for a health spell to the client to heal myself. Simple stuff and very effective.
I guess it depends wether the game client runs in windowed or fullscreen mode, as i think fullscreen will be hard to check.
Also, one word of warning, unless official OK'ed these tools can be considered cheating and result in a ban.
I think i know what you want to do, as i used to use an official third party program (through their dev program) for Ultima Online. Basically it used to check the health bar on screen via a pixel reading. If that pixel turned green (rather than red) it mean't i was poisened, etc. and the macro program sent a key command to the UO client for the cure poisen spell. This helped train my magery and meditation in game as i cast poisen on myself. I also had macros running to check my health bar to make sure it didn't go below a certain level. This was acheived by making sure another pixel didn't turn black. If it did, i sent the command for a health spell to the client to heal myself. Simple stuff and very effective.
I guess it depends wether the game client runs in windowed or fullscreen mode, as i think fullscreen will be hard to check.
Also, one word of warning, unless official OK'ed these tools can be considered cheating and result in a ban.
thanks kale!
thanks GOD kale you hit the point. thats what am trying to say, i wanna know the exact pixel of the game. by checkng the health of the skills am now may be able to used potion without pressiing keys. my main goal is for skills only, bcoz levelling skills in flyff is to hard. by the way FLYFF means Fly For Fun you can visit the site here www.flyffworld.com or check the forum http://www.flyffworld.com/forums.
thanks GOD kale you hit the point. thats what am trying to say, i wanna know the exact pixel of the game. by checkng the health of the skills am now may be able to used potion without pressiing keys. my main goal is for skills only, bcoz levelling skills in flyff is to hard. by the way FLYFF means Fly For Fun you can visit the site here www.flyffworld.com or check the forum http://www.flyffworld.com/forums.
This is a simple routine which i don't know if it would work with fullscreen applications:
To send keystroke to an application, try a search 
http://www.purebasic.fr/english/viewtopic.php?t=3766
http://www.purebasic.fr/english/viewtopic.php?t=15503
Code: Select all
OpenConsole()
EnableGraphicalConsole(#True)
WindowDC.l = GetWindowDC_(#Null)
While GetAsyncKeyState_(#VK_ESCAPE) <> -32767
GetCursorPos_(Coords.POINT)
Colour = GetPixel_(WindowDC, Coords\x, Coords\y)
RedComponent.l = Red(Colour)
GreenComponent.l = Green(Colour)
BlueComponent.l = Blue(Colour)
ClearConsole()
PrintN("The colour at " + Str(Coords\x) + " x " + Str(Coords\y) + " is RGB(" + Str(RedComponent) + ", " + Str(GreenComponent) + ", " + Str(BlueComponent) + ")")
Delay(1)
Wend
CloseConsole()
End

http://www.purebasic.fr/english/viewtopic.php?t=3766
http://www.purebasic.fr/english/viewtopic.php?t=15503
wow thank you guyz...
sir PB thank you very much and sir kale thanks for the code and the links. i'll try it now
EDITED:
yup its working on Ragna client, but not in FLYFF client, may be you're right, it will not work in fullscreen app coz flyff is running in fullscreen mode. but there is a trick in flyff client, by inserting word "sunkist" in exe ini file, it will run in window mode, but the problem is PB program can't detect the client axis, still the desktop axis detecting. hmmm
sir PB thank you very much and sir kale thanks for the code and the links. i'll try it now
EDITED:
yup its working on Ragna client, but not in FLYFF client, may be you're right, it will not work in fullscreen app coz flyff is running in fullscreen mode. but there is a trick in flyff client, by inserting word "sunkist" in exe ini file, it will run in window mode, but the problem is PB program can't detect the client axis, still the desktop axis detecting. hmmm