Results 1 to 9 of 9

Thread: How reliant is UpText?

  1. #1
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default How reliant is UpText?

    So I'm trying to make a script that is heavily reliant on uptext as it is the only way I can think of doing it. I am having problems with IsUpText and WaitUpText though because it doesn't seem to be accurate. Here is an example. I ran my script to hover over the slot in my invy with my allotment seed, put a 1 second wait, then Writeln the current uptext. The seed was a potato seed and this is what was written

    Code:
    Loading variables...
    Use Pocaco seed / 2 more options
    Your alloment seed slot is incorrect, please change in script settings
    So I guess my question is there any way to make uptext more accurate? It detected Potato as Pocaco, and as funny as that is, it will not make my script run as well as I would like it to. I think I remember seeing something where you choose the color of the uptext(the text of Potato is orange) but maybe I'm thinking of ChooseOption.

  2. #2
    Join Date
    Nov 2011
    Posts
    1,532
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Do it by trial and error. Uptext is quite reliable in that it usually works, but sometimes the spacing might mess it up, as well as RS updates. Better failsafe it, or think of a backup method in case it doesn't work.
    Current activity: Recovering from vacation
    - Nulla pars vitae vacare officio potest -
    SRL membership? Can I buy that?
    Scripts - AGS - SWF - WAR - EMS - W100S-EM
    If you need scripting help, you can pm me. Remember, if you need help you have to ask for it properly though

  3. #3
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Just did another test and this is what it showed. O.O

    Code:
    Loading variables...
    Use ..c.c.!c.. .i.i... / 2 more options
    Sooo....I guess the text finding on the orange text isn't too good. I'm thinking it has to do with the background color being the farming patch, but regardless I guess I need to find another way. Kinda sucks but oh well.

    Upon further investigation, I think it had to do with the orange text color. When I am looking for patches I have it writeln the uptext and it works 100% of the time but the color of the text is blue.

    Code:
    Pick Marigold / 5 more options
    Found grown crop
    Harvesting
    Patch is Flower
    Finding Flower patch
    Inspect Flower Patch / 3 more options *47 .
    Centering
    Finding Harvest patch
    Inspect Marigold / 3 more options *9 .
    Pick Herbs / 5 more options *9 .
    Found grown crop
    Harvesting
    Patch is Herb
    Finding Herb patch
    Inspect Herb patch / 3 more options *15 .
    Centering
    Finding Harvest patch
    Inspect Marigold / 3 more options *13 .
    Inspect Herbs / 3 more options *13 .
    Inspect Potato plant / 3 more options *13 .
    Inspect Potato plant / 3 more options *13 .
    Inspect Potato plant / 3 more options -l-1.3 .
    Clear Dead potatoes / 4 more options
    Found a dead Allotment crop
    Finding Allotment patch
    Inspect Allotment / 3 more options
    Centering
    Finding Harvest patch
    Inspect Marigold / 3 more options *8 .
    Inspect Herbs / 3 more options *8 .
    Inspect Potato plant / 3 more options *8 .
    Inspect Potato plant / 3 more options *8 .
    Inspect Potato seed / 3 more options
    Inspect Potato plant / 3 more options
    Inspect Potato seed / 3 more options
    Inspect Potato plant / 6 more options
    Inspect Potato seed / 3 more options
    Inspect Potato seed / 3 more options
    Inspect Potato plant / 3 more options
    Inspect Potato seed / 6 more options
    Nothing to harvest, back to alching
    So I'll jut use OptionsExist to load the variable since it seems to be more accurate than IsUpText for orange text.
    Last edited by Total; 04-16-2012 at 01:34 AM.

  4. #4
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    I'm thinking whatever is in the background is causing the UpText to be misread. My advice is that you use ClickNorth(1) before checking for uptext, it may change the background color and help you read the uptext correctly

  5. #5
    Join Date
    Dec 2011
    Location
    The Netherlands
    Posts
    1,631
    Mentioned
    47 Post(s)
    Quoted
    254 Post(s)

    Default

    You can much better use bitmaps/DTM's to find stuff in your inventory.

    Here is an example of a part of my procedure that drinks a summoning flask:
    Simba Code:
    procedure RenewFamiliar;
    var
      Flask, SumTab, X, Y: Integer;

    begin
    if TimeFromMark(n)>300000 then
      begin;
      if FindColor(X, Y, 127, 0, 338, 518, 479) then
        begin
          ResetTime;
          WriteLn('Renewing familiar');
          if GetCurrentTab = (tab_Inv) then
          begin
            WriteLn('Inventory tab')
          end else
          begin
            MouseBox(642, 168, 671, 204, 1);    //FTab(tab_Inv);
            WriteLn('Inventory tab');
            Wait(100 + Random(100));
          end;

          Flask := DTMFromString('mAAEAAHic42FgYHBiYmBwBmJrKLYEYhsgdgRidyD2BmIfKA3iPwPquQHEt4H4ARC/AOIPQPwJit8C8ROo3B0glj12BkgyEY3/A0lGGmJkAAAVShDj');
          if FindDTM(Flask, X, Y, MIX1, MIY1, MIX2, MIY2) then
          MMouse(X, Y, 5, 5);
            case Random(6) of
              0..3: Mouse(X, Y, 0, 0, 1);
              4..5: begin;
                      Mouse(X, Y, 0, 0, 0);
                      WaitOptionMulti(['Dri', 'ink'], 150);
                    end;
            end;
          FreeDTM(Flask);
          WriteLn('Renewed summoning points');
          Wait(100 + Random(300));

    DTM Guide: http://villavu.com/forum/showthread.php?t=77691
    Bitmap guide: http://villavu.com/forum/showthread.php?t=47374

    This way you won't have to use UpText

    Script source code available here: Github

  6. #6
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    But I don't want to get a bitmap/DTM of every single type of seed and of every single stack type(they have different pictures for each size stack 1 - 5 i believe). That would be way too much of a hassle and probably not even possible.

  7. #7
    Join Date
    Dec 2011
    Location
    The Netherlands
    Posts
    1,631
    Mentioned
    47 Post(s)
    Quoted
    254 Post(s)

    Default

    Well, you can just make it a requirement for the users to make sure they have atleast 5 or more seeds. Making a farming script takes extremely long, but it's definately worth it to make bitmaps or DTM's IMO. Makes the script much more stable.

    You can rely on uptext though, but there are some minor problems with detecting the uptext with certain backgrounds.

    Script source code available here: Github

  8. #8
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

  9. #9
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    It's only checking the uptext of the seeds once in the beginning to know what type of seed it is, then storing it in a variable to check for grown crops so it isn't a big deal to just right click them and check for the option in the beginning. Also making DTM's/Bitmaps for the herb seeds would be completely useless as they all look the same. You need some way to distinguish them from one another so I pretty much have to use uptext.

    And no, will have to take a look at it if I decide to go back to uptext. Thanks.
    Last edited by Total; 04-17-2012 at 06:14 PM.

Thread Information

Users Browsing this Thread

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

Posting Permissions

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