Register for your free account! | Forgot your password?

Go Back   elitepvpers > Off-Topics > Tutorials
You last visited: Today at 10:12

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Obtaining Rough Health Levels through Pixels - With Macro Monkey

Discussion on Obtaining Rough Health Levels through Pixels - With Macro Monkey within the Tutorials forum part of the Off-Topics category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Dec 2008
Posts: 25
Received Thanks: 5
Obtaining Rough Health Levels through Pixels - With Macro Monkey

Introduction
This tutorial aims to help those who wish to obtain information on Health, Mana, etc of a character in a game.
With the information here you'll have a good set of information to get started

I figured this method out through playing around with a game or two and I'd like to share it.
This method cannot compare to directly reading these values in memory, but it is generally enough to keep your avatars alive.

After having gone through the tutorial feel free to leave comments, ask question, and give advice on the method to both myself and others in a constructive way. I hope everyone enjoys, so lets get started



Tools
Macro Monkey - This logic can be applied to other macro programs, but it's up to you to do so
Microsoft Paint - Other tools can quite possibly be better, however this one is ready and available for anyone for free
Notepad - Many other text editors will server better, I personally use Notepad++
Calculator - Comes with windows. We are doing simple math, but I save time by just using this
Screen Shot - Full hp, see below
Knowledge - You'll need a bit of programming experience to get the most out of this tutorial. Understanding of variables and conditional loops are a must. Specific API functions of Macro Monkey can be found:



Getting started
First of all ensure you have all your tools, your character is in-game, and has nothing obstructing the health bar and your at full hp.
Ok, so we need to begin with a screen shot of our game. There are a multitude of ways to go about this, but since we are here, lets use Macro Monkey :thumbup:

I've Provided a zip file containing both script files, you'll want to start by modifying Screenshot.mms to be accurate for target your game.

After running this program with macro monkey we now have a screen shot in the same directory as your Screenhot.mms called GameScreen.bmp.
So we now have our screen shot, try to make this as basic as possible. For my game I was able to remove text from the bars, but with a bit more logic we can overcome that problem.
For getting a rough hp percentage this shouldn't be too much of a problem




Now we want to open up our image in Paint, it does help to crop out the rest of the image, but it's not needed. If you do crop, be sure to leave the top and left side of the image where it applies to the health bars. This is important to get accurate pixel locations.

Here I have cropped my image, and zoomed in a considerable amount.




After we have out workable screen shot, we want to obtain a color sample of one side of the bar. Make sure, that to obtain a correct sample you use the same row, I removed out the rest of the hp bar to illustrate.

I also pointed to 1 pixel as Macro Monkey (as well as paint) will recognize.




Use the little color picker tool to obtain the color information.



After that you want to click up on the color mixer (edit colors) to obtain the information of that pixel.



Here is the information.



All we will need are the RGB information to do this.
For our purpose this information is: RGB: 239 138 137

Now that we have the information of this pixel, if we go back to our screen shot and look int he lower left hand corner we can see just what pixel this is, you want to do this for the left, and the right hand side of your hp bar, but be sure your in the same row.




For my image, the left is 102 and the right is 181 both on row 34.
I stored this information like so:
102, 34
181, 34

Now that we have the range of our hp bar, we know a few important parts of information.
For starters our marker for 100% hp is 181-102, which comes out to 79 pixels.
Note: Games with a range much larger then 80 pixels will have a better hp reading then this example game.



Logic:
Since our range here is 79 pixels, we can create a loop to compare each pixel in the 102 to 181 range and divide that by 79 to get our health percentage. This won't be 100% accurate, but generally it serves it's purpose well enough.
Each game is different, and you can come up with a more accurate reading by changing the dividend around a bit and comparing the obtained percentage with the actual percentage you get when you divide your current hp by your total hp (use that calculator).
Also comparing at different levels of health while fighting helps a lot too, but in games where your character regains hp while idle... you'll need to be fast or use screen shots.

I went through the macro code being pretty thorough in leaving comments. In itself, your not going to be able to do a whole lot. You need to go through all the work, and if done correctly you should be able to get a somewhat accurate health reading with this program.



Conclusion:
Now that you've gone through this tutorial, please review ReadHealth.mms in the provided zip file.
I commented on a lot of code to help show the logic behind what is going on.
I skipped a lot of things, because I want everyone to read and learn.
The code itself will only give you a health reading (provided you set everything up properly).
If you have questions regarding your own bot and using this method, please post in the

I hope some of you learned something, and feel free to comment and leave suggestions.
I know this is not the best method, but it's simple to understand and works out well enough for my uses.



Further Reading:
In particular take a look at:
But I highly advise reading all of the documentation as it will help you understand using macro monkey a lot.

Also, in order to understand usage of Macro Monkey better, I would advise following the links to other resources provided in the documentation.
Of course, asking on the forums here will help you learn as well so long as you don't over do it
Attached Files
File Type: zip files.zip (1.8 KB, 15 views)
deadlyp99 is offline  
Thanks
2 Users
Reply


Similar Threads Similar Threads
How to get more than 32 levels Granted levels with RAF.
08/29/2009 - WoW Exploits, Hacks, Tools & Macros - 9 Replies
So I recently started RAF and got a warrior/priest to 58. I then granted all the levels from that character. Since I hadn't dinged 60 yet and still have 2 months of RAF, I decided to do a mage/pally. I leveled both to 10. I had my veteran account make another character and my mage was able to grant levels. This means you can level 4 classes and give 4 more classes 30 levels. This leaves only 1 class you have to level manually and a dk. Enjoy.
WTS/WTT lvl 85 rough/ 70 cleric
10/17/2008 - Silkroad Online Trading - 3 Replies
mostly full farmed only tihng is no items on it and its lvl 70 atm cuz of pk but with all 85 rough skill an 70 cleric still pk status has been cleard leave offers
Rough Ori / Elu converter Bug
07/30/2007 - Ragnarok Online - 1 Replies
First at all, its a self made Script by the Admin where i play at. (iam not sure if its selfmade, but i saw it the first time) He made it like this that you can enter a value of rough Elu / Ori and get your converted Elu's / Ori's. The thing is, that you get the Elu's / Ori's first before it takes your rough stuff My Idea is it to use a D/C Packet that disconnect you if you receive the
help with sizes and pixels
01/08/2007 - Conquer Online 2 - 2 Replies
Could anybody help me by telling me how do i resize the monster size? I mean any monster? Thank you in advance.



All times are GMT +2. The time now is 10:12.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.