Detecting Gold Earned After/During Runs? menu

User Tag List

Results 1 to 7 of 7
  1. #1
    Timmywimmy's Avatar Corporal
    Reputation
    2
    Join Date
    Jun 2012
    Posts
    15
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Detecting Gold Earned After/During Runs?

    Hello Everyone, AutoIt Question,

    I've looked through several scripts in these threads and have only seen maybe one or two bots [USING AUTOIT] that will display gold gained. I have been trying to do this in my script but have not been successful. There is a barb script here which uses Tesseract.au3 and another .exe and then _TesseractScreenCapture() within the script itself. I can not figure out how this works or what it is I need to do in order to gather my gold gained. I have thought of two methods for doing this.

    1. Capture what gold was dropped on the ground after killing sark and the run is completed. Use this gold to display the gold earned that run and add it to another variable to gather total gold gained over the total runs to display total gold gained.
    2. Capture the gold listed in the inventory screen before the run, and then after the run, compare the two and then display the difference as gold gained on that run. Take that amount earned and added it with total earned so far to display total earned overall.
    - Both of these will allow for a portion of the code to obtain gold per hour once I know how to do this accurately.

    Neither of these methods can I get to work myself. Could anyone assist with this? Perhaps walk me through how to use _TesseractScreenCapture() and what it is I need to write in order to capture the correct data? I'm open to other ideas and suggestions as well. I've already gathered many other stats such as runs (successful and failed + percentage), total of each item gathered, white, yellow, orange, blue, etc, and vendor visits. The only missing stat that I can't seem to code myself is gold gained. Please let me know if you have any questions or need any other info to help assist me in my goal. Thanks ahead of time!

    Tim

    Detecting Gold Earned After/During Runs?
  2. #2
    BlackSack's Avatar Knight-Lieutenant
    Reputation
    56
    Join Date
    Jun 2012
    Posts
    343
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Tim, my tesseract code works simply by

    1) opening the inventory obviously you can be anywhere todo this does not matter where you stand
    2) grab the rectangle from the screen where it shows your gold display in the inventory
    3) perform OCR
    4) clean resultant string

    then you can use it for whatever you like. for example my script captures your gold after looting and compares it to your gold from previous run to calculate how much you picked up. it also captures it after vending items to calculate the value of all the items you just sold.

    So if its not working for you then its probably because you didnt open the inventory first

    This code should get your gold at any point you choose, be sure to include the clean function in your script too
    for more info you can see the forum of the author of this library http://www.autoitscript.com/forum/to...creen-ocr-udf/


    Send("i")
    Sleep(200)
    $mon = _TesseractScreenCapture(0, "", 1, 2, 1454 * $x_ratio, 508 * $y_ratio, (1920 - 1571) * $x_ratio, (1080 - 525) * $y_ratio, 0)
    $mon = CleanOCR($mon)
    Send("i")

    Func CleanOCR($text)
    $out = ""
    for $i = 1 to stringlen($text)
    $chr = asc(StringMid($text, $i, 1))
    if $chr >= 48 and $chr <= 57 Then $out = $out & chr($chr)
    Next
    Return $out
    EndFunc ;==>CleanOCR

  3. #3
    Timmywimmy's Avatar Corporal
    Reputation
    2
    Join Date
    Jun 2012
    Posts
    15
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ohhhh. I did not know you were opening the inventory and grabbing the info. I thought your script was grabbing the gold on the ground or what was being picked up. I used the CleanOCR() fuction but since it was grabbing the wrong information it was cleaning the wrong information...

    Could you tell me what it is the information in the () is doing and such. I've listed the areas in the () that I was curious as to what they do and say for example if I wanted to edit this to capture something else knowing what it is I need to put in there would be very helpful.

    _TesseractScreenCapture(0, "", 1, 2, 1454 * $x_ratio, 508 * $y_ratio, (1920 - 1571) * $x_ratio, (1080 - 525) * $y_ratio, 0)

  4. #4
    BlackSack's Avatar Knight-Lieutenant
    Reputation
    56
    Join Date
    Jun 2012
    Posts
    343
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You just need to look at the Tesserect file all the documentation is in there:

    ; Name...........: _TesseractScreenCapture()
    ; Description ...: Captures text from the screen.
    ; Syntax.........: _TesseractScreenCapture($get_last_capture = 0, $delimiter = "", $cleanup = 1, $scale = 2, $left_indent = 0, $top_indent = 0, $right_indent = 0, $bottom_indent = 0, $show_capture = 0)
    ; Parameters ....: $get_last_capture - Retrieve the text of the last capture, rather than
    ; performing another capture. Useful if the text in
    ; the window or control hasn't changed since the last capture.
    ; 0 = do not retrieve the last capture (default)
    ; 1 = retrieve the last capture
    ; $delimiter - Optional: The string that delimits elements in the text.
    ; A string of text will be returned if this isn't provided.
    ; An array of delimited text will be returned if this is provided.
    ; Eg. Use @CRLF to return the items of a listbox as an array.
    ; $cleanup - Optional: Remove invalid text recognised
    ; 0 = do not remove invalid text
    ; 1 = remove invalid text (default)
    ; $scale - Optional: The scaling factor of the screenshot prior to text recognition.
    ; Increase this number to improve accuracy.
    ; The default is 2.
    ; $left_indent - A number of pixels to indent the capture from the
    ; left of the screen.
    ; $top_indent - A number of pixels to indent the capture from the
    ; top of the screen.
    ; $right_indent - A number of pixels to indent the capture from the
    ; right of the screen.
    ; $bottom_indent - A number of pixels to indent the capture from the
    ; bottom of the screen.
    ; $show_capture - Display screenshot and text captures
    ; (for debugging purposes).
    ; 0 = do not display the screenshot taken (default)
    ; 1 = display the screenshot taken and exit

    You probably dont want to make any changes except the for the positioning, then just change 1454, 508, 1571, 525 to your own x1,y1,x2,y2 to choose a spot, do not remove the 1920, 1080 parts and the ratios as this allows scaling for other resolutions (i dont know if it actually scales correctly thou only know it works on 1080p)

  5. #5
    Shimizoki's Avatar Knight-Lieutenant
    Reputation
    32
    Join Date
    Jun 2012
    Posts
    358
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @BlackSack -
    Do you have an active understanding of how the screencapture works? I am finding it to be very temperamental (Will not capture the correct area). I am unsure if that is due to it running on Win7x64, or if its because its running on multi monitor setups.
    After much trial and error and reading docs I was able to heavily doctor it so that it would work, but it lost scaling functionality. I was wondering if you had any insight as to my dellima.
    -Darkling Lord

  6. #6
    chancity's Avatar Legendary
    CoreCoins Purchaser
    Reputation
    686
    Join Date
    Jun 2012
    Posts
    1,153
    Thanks G/R
    27/341
    Trade Feedback
    11 (55%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Shimizoki go to my thread and download all the files required, an editted include and the Tess install are in the download. After that open my script and search for goldperhour and call it when leaving game.

    Edit - just fully read your post, was on my cell phone when I sent that. Seems that you got it to work, but can't get it to scale with different 16:9 resolutions?
    Last edited by chancity; 06-20-2012 at 02:24 PM.

  7. #7
    Shimizoki's Avatar Knight-Lieutenant
    Reputation
    32
    Join Date
    Jun 2012
    Posts
    358
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by chancity View Post
    Shimizoki go to my thread and download all the files required, an editted include and the Tess install are in the download. After that open my script and search for goldperhour and call it when leaving game.

    Edit - just fully read your post, was on my cell phone when I sent that. Seems that you got it to work, but can't get it to scale with different 16:9 resolutions?
    Its not that... It does not search the specified area. To get it to look at where the gold is I would have to set the X coord to well over 2000 even though my resolution is only 1600 wide. And then when I start shrinking it down to fit it breaks. The only way to get it working was to remove most of the functionality... but then the scaling doesn't work so you wont have more accurate readings. I was wondering if having two monitors was part of the problem. Or if it was because I was running Win7x64. There were many edits that had to be made to account for those.

    Edit, and having looked over your version of tesseract.au3, it doesn't seem to have the proper fixes to get the OCR working on win7.
    Edit2: I mean the proper fixes to get the imageDisplay working on Win7
    Last edited by Shimizoki; 06-20-2012 at 02:38 PM.
    -Darkling Lord

Similar Threads

  1. [Selling] Gold/Silver Challenge Mode RUNS!!! (Horde)
    By IheroI in forum World of Warcraft Buy Sell Trade
    Replies: 16
    Last Post: 02-27-2013, 11:53 PM
  2. [Buying] Best farming gold spot (after crypt nerf)
    By holygift in forum Diablo 3 Buy Sell Trade
    Replies: 2
    Last Post: 06-09-2012, 03:16 PM
  3. [Gold] Massively Gold Earnings with Patch 4.2
    By paranoia69 in forum World of Warcraft Guides
    Replies: 4
    Last Post: 05-17-2011, 12:49 PM
  4. [GOLD]Earning gold from Midsummer event
    By raktipannan in forum World of Warcraft Guides
    Replies: 7
    Last Post: 06-22-2009, 10:09 PM
  5. Keep your gold safe after a scam (Don't lose it after you get repoted)
    By italiankidd in forum World of Warcraft Exploits
    Replies: 8
    Last Post: 11-17-2007, 07:24 PM
All times are GMT -5. The time now is 08:21 PM. 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