Reading text from a different game client.

Discussion in 'Scar/Simba Help' started by Addyrulez, Jan 1, 2009.

Reading text from a different game client.
  1. Unread #1 - Jan 1, 2009 at 7:27 PM
  2. Addyrulez
    Joined:
    Feb 28, 2007
    Posts:
    4
    Referrals:
    0
    Sythe Gold:
    0

    Addyrulez Newcomer

    Reading text from a different game client.

    I attempted to do this years ago, and failed. What I'm trying to do is read a line in the chat box by using bit masks of the font. If there is a better way than that, please let me know.
    The game client looks like this:
    [​IMG]

    I also wrote up some psuedo-code for this:
    Code:
    load font masks
    verify status of EO window
    switch to appropriate tab
    
    loop, get pixel color of first pixel in chat box,
    each iteration advance on the x axis by one, until color of font detected
    try all bitmap masks against previous x coordinate until matching mask is found
    x++
    repeat above until reaching the end of the chatbox
    Is there any better way to accomplish this? The reason it failed before was because of letters like "i" matching when the letter was actually "l", causing it to be extremely inaccurate. Any help is appreciated.
     
  3. Unread #2 - Jan 1, 2009 at 8:43 PM
  4. Town
    Joined:
    Jan 21, 2007
    Posts:
    3,776
    Referrals:
    3
    Sythe Gold:
    5

    Town Grand Master
    Scar Programmers

    Reading text from a different game client.

    There's really no simpler way to read or identify text. If you have to then you may want to make use of 'ands' and 'nots' to make sure you are reading the right letter. Something like this:

    Code:
    if (BitmapMaskFound(x, y, i, x1, y1, x2, y2)) then if (not (BitmapMaskFound(x, y, l, x-5, y-5, x+5, y+5))) then etc. 
    It may take a little more time to process, but it will be more accurate. You can use the same idea to read letters in order.
     
  5. Unread #3 - Jan 1, 2009 at 8:52 PM
  6. Addyrulez
    Joined:
    Feb 28, 2007
    Posts:
    4
    Referrals:
    0
    Sythe Gold:
    0

    Addyrulez Newcomer

    Reading text from a different game client.

    Thanks. I'm going to make a basic prototype and see if it works, try tweaking it etc. I haven't done any pascal/SCAR in years though so this may be a bit difficult :p
     
< TileOnMS lagging | need help with ess miner >

Users viewing this thread
1 guest


 
 
Adblock breaks this site