Recognizing gold menu

User Tag List

Results 1 to 3 of 3
  1. #1
    KcDan's Avatar Active Member
    Reputation
    53
    Join Date
    May 2007
    Posts
    39
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Recognizing gold

    I ran into a problem where I was trying to recognize gold on the ground so I wouldnt miss any and I couldnt figure out a solution that didnt get false positives.

    Well I figured out a solution and am posting it incase someone else was having the same problem. It probably needs to be modified for different screen setups but the method will still work.


    I took a screen shot of the gold label and noted points on the image that would not change due to the background or anything else.


    I got the color for each point and made a function that checked each point relative to an x,y (and just loop for all the pixels on the screen) and if it matches then its a gold label.

    I havent gotten any false positives from it and it's pretty quick. Please excuse the not so sexy C, but whatevs.

    Code:
    int IsGold(int x,int y){
    	if (GetPixel(ndc,x+4,y)!=16777215) return 0;
    	if (GetPixel(ndc,x+5,y)!=16777215) return 0;
    	if (GetPixel(ndc,x+18,y)!=16777215) return 0;
    	if (GetPixel(ndc,x+1,y+3)!=16777215) return 0;
    	if (GetPixel(ndc,x+13,y+3)!=16777215) return 0;
    	if (GetPixel(ndc,x+18,y+3)!=16777215) return 0;
    	if (GetPixel(ndc,x+23,y+3)!=16777215) return 0;
    	return 1;
    }
    This solution could be used for recognizing other shits with labels as well.

    Recognizing gold
  2. #2
    Rakurai's Avatar Sergeant
    Reputation
    16
    Join Date
    Jul 2012
    Posts
    42
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Brilliant idea, that's much better than trying to match a whole image. It has the potential to be much more efficient than comparing every single pixel in a rectangular area.

    It could be generalized, too. What if you made a generic function that you passed a pointer to a two dimensional array of coordinate pairs? Each pair would have an x modifier, y modifier, and color to match against. Your function could then iterate over each pixel in the target area and iterate through the array, checking each pixel. This is essentially what an image search does, except it checks every pixel in the target area against every pixel in the search image, which ends up being something like O(n^3) time.

    I'm probably not very clear, so if you happen to know the function that returns a screen area as an array of pixels, I could write an example.

    Anyway, great work, its very inspiring. +rep!

  3. #3
    d3maniacu's Avatar Private
    Reputation
    1
    Join Date
    Jun 2012
    Posts
    9
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by KcDan View Post
    I ran into a problem where I was trying to recognize gold on the ground so I wouldnt miss any and I couldnt figure out a solution that didnt get false positives.

    Well I figured out a solution and am posting it incase someone else was having the same problem. It probably needs to be modified for different screen setups but the method will still work.


    I took a screen shot of the gold label and noted points on the image that would not change due to the background or anything else.


    I got the color for each point and made a function that checked each point relative to an x,y (and just loop for all the pixels on the screen) and if it matches then its a gold label.

    I havent gotten any false positives from it and it's pretty quick. Please excuse the not so sexy C, but whatevs.

    Code:
    int IsGold(int x,int y){
    	if (GetPixel(ndc,x+4,y)!=16777215) return 0;
    	if (GetPixel(ndc,x+5,y)!=16777215) return 0;
    	if (GetPixel(ndc,x+18,y)!=16777215) return 0;
    	if (GetPixel(ndc,x+1,y+3)!=16777215) return 0;
    	if (GetPixel(ndc,x+13,y+3)!=16777215) return 0;
    	if (GetPixel(ndc,x+18,y+3)!=16777215) return 0;
    	if (GetPixel(ndc,x+23,y+3)!=16777215) return 0;
    	return 1;
    }
    This solution could be used for recognizing other shits with labels as well.
    How to code that for autoit?

Similar Threads

  1. 8 World of Warcraft Guide Packs (Gold, Profs and Skills)
    By Matt in forum World of Warcraft Guides
    Replies: 17
    Last Post: 09-23-2006, 10:53 AM
  2. Guide: Gold (Dupe 01)
    By janzi9 in forum World of Warcraft Guides
    Replies: 13
    Last Post: 09-18-2006, 09:02 PM
  3. Guide: Gold (Dupe 02)
    By janzi9 in forum World of Warcraft Guides
    Replies: 3
    Last Post: 09-17-2006, 10:01 PM
  4. Gold Farmer Scamming
    By Matt in forum World of Warcraft Exploits
    Replies: 2
    Last Post: 04-07-2006, 07:11 AM
  5. Raise skill, Keep Gold
    By Matt in forum World of Warcraft Exploits
    Replies: 2
    Last Post: 03-20-2006, 09:45 PM
All times are GMT -5. The time now is 01:44 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search