Results 1 to 10 of 10

Thread: Trimming and GetTextAtEx help..

  1. #1
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Trimming and GetTextAtEx help..

    So i have started to get into this private server, but there is this random. Here's a pic:

    So, since the buttons that you need to press are in the same spot every time, i figured.. "I can use the trim and GetTextAtEx functions to return just the orange text, or the button that you need to click on. So, my code so far is this:

    SCAR Code:
    Function SolveRandom:String;
    Var cx,cy, i: LongInt; tmpResult: String;
     
    Begin
       cx := 243;
       cy := 116;
          tmpResult := GetTextAtEx(cx, cy, 100, NPCChars, True, False, 0, 5, 45311, 7, True, tr_SmallLetters);
          if (Trim(tmpResult) = '') then
          for i := 1 to 31 do
          begin
             tmpResult := GetTextAtEx(cx + i , cy , 100, NPCChars, False, True, 0, 5, 45311, 7, True, tr_SmallLetters);
             if (Trim(tmpResult) <> '') then
                Exit;
             end;
          if (not (Trim(tmpResult) = '')) then
          Result := (Trim(GetTextAtEx(cx, cy, 100, NPCChars, False, True, 0, 5, 45311, 7, True, tr_SmallLetters)));
          Writeln('You have to click the ' +(Result)+' button');
    end;
    But every single time i run it, it leaves out a few letters, like in another one i got, my result was:
    SCAR Code:
    You have to click the farmng button
    Its missing the "I". This one isnt so bad, but some of the others are missing 3-4 key letters.

    Help is greatly appreciated.

    -Itschris917

  2. #2
    Join Date
    Oct 2006
    Posts
    1,071
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Just try fiddling with the coords, this just means your probably like 1 pixel off.

    EDIT sorry looking at your procedure, you only increase the value of cx, not cy, perhaps your cy value needs to be adjusted slightly.

  3. #3
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I've already gone up and down ten pixels on both the x and the y coordinates. Those coordinates are the only ones that work.. Its really strange.. thats what i thought too at first, but i guess there's something else..

  4. #4
    Join Date
    Oct 2006
    Posts
    1,071
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Then I would just go down the line of variables in GetTExtAtEx and mess with those, because honestly GetTextAtEx can be really frustrating lol and the only way I ever get it to work is with trial and error. Could it be CheckShadow or something?

  5. #5
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I highly doubt it could be shading, because i dont know about you, but if i made a video game.. I would make all the text either have shading, or not. But that's just me. I guess i'll have to do some trial and error, but i'll keep checking up on this thread every once in a while to see if anyone else has posted.

  6. #6
    Join Date
    Oct 2006
    Posts
    1,071
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Yeah good idea, sorry I'm not much more help, good luck!

  7. #7
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok. I figured it out. Someone can lock this post.. I'm going to bed now.. I stayed up till 2 in the morning trying to get that stupid thing to work.. But it payed off!

  8. #8
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    You can lock it since you started it
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  9. #9
    Join Date
    Oct 2006
    Posts
    1,071
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Sorry for posting on a dead thread, but just out of curiosity, what was the problem?

  10. #10
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Im not really sure, i just used IsTextInArea instead.. And it worked.. Sure, it takes up more code, but it worked. Im still waiting on a PM from Smartzkids, hopefully he can get GetTextAtEx to work, and clean up my code.

    Santa: How do i lock it? I see a a delete button? But no lock button.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. GetTextAtEx help, please :)
    By Macro_FTW in forum OSR Help
    Replies: 3
    Last Post: 01-10-2008, 03:27 AM
  2. gettextatex?
    By jhildy in forum OSR Help
    Replies: 11
    Last Post: 06-04-2007, 12:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •