Page 1 of 2 12 LastLast
Results 1 to 25 of 30

Thread: ShopScreen fix

  1. #1
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default ShopScreen fix

    I just noticed it wasn't working and decided to make a fix for it quick.


    Original function:
    SCAR Code:
    {*******************************************************************************
    function ShopScreen: Boolean;
    By: ZephyrsFury
    Description: Returns true if a shop interface is opened.
    *******************************************************************************}

    function ShopScreen: Boolean;
    begin
      Result := FindTextTpa(2070783, 0, 226, 305, 340, 320, 'Player', StatChars, Nothing);
    end;

    Fix's:
    SCAR Code:
    function ShopScreen: Boolean;
    begin
      Result := (CountColor(2070783, 58, 303, 85, 317) = 63);
    end;
    or
    SCAR Code:
    function ShopScreen : Boolean;
    begin
      Result := FindTextTPA(2070783, 10, 58, 303, 85, 317, 'Right', StatChars, Nothing);
    end;
    Both fix's search the same area for the same word, just using two different methods.
    Last edited by Wanted; 05-09-2010 at 10:43 PM.

  2. #2
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Cool, replace the countcolor with a FindText and I, or someone else, will commit it. The reason it needs to be OCR based is so there is no chance of failure; but I'm sure you knew that already

  3. #3
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    OCR no chance of failure?

    LOL

  4. #4
    Join Date
    Jan 2008
    Location
    10° north of Hell
    Posts
    2,035
    Mentioned
    65 Post(s)
    Quoted
    164 Post(s)

    Default

    Quote Originally Posted by IceFire908 View Post
    OCR no chance of failure?

    LOL
    Im gonna guess s/he ment no chance of false negatives

    Dg's Small Procedures | IRC Quotes
    Thank Wishlah for my nice new avatar!
    Quote Originally Posted by IRC
    [22:12:05] <Dgby714> Im agnostic
    [22:12:36] <Blumblebee> :O ...you can read minds

  5. #5
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    ^ He.

  6. #6
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Dgby714 View Post
    Im gonna guess s/he ment no chance of false negatives
    Yup, false positives.
    And Ice, we're talking about SIMBA's flawless OCR.
    I'd rather it be a text function, seeing as most of the ones in SRL are.

  7. #7
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by Naum View Post
    Cool, replace the countcolor with a FindText and I, or someone else, will commit it. The reason it needs to be OCR based is so there is no chance of failure; but I'm sure you knew that already
    Yeah I figured that was the case. I'll let you know when I've switched it.

  8. #8
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I don't think the OCR is just as accurate as using a proper countcolor. But that's just me
    “Ignorance, the root and the stem of every evil.”

  9. #9
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by Blumblebee View Post
    I don't think the OCR is just as accurate as using a proper countcolor. But that's just me
    I agree to an extent. I use CountColor variations for near everything and they work extremely well.
    However, it does leave a possibility for a false positive as Naum pointed out. Though unlikely, it's still possible.

    As long as the text's remain updated I have no problem using a FindText function.

  10. #10
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Use countcol...

  11. #11
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by IceFire908 View Post
    Use countcol...
    In that case the one already posted works.

    When I get home tomorrow I'll add a FindText one and let Dev's decide I suppose.

  12. #12
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by IceFire908 View Post
    OCR no chance of failure?

    LOL
    Sure. It hardly gives false positives, and since the text is already known in this case, it is even better.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  13. #13
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Wizzup? View Post
    Sure. It hardly gives false positives, and since the text is already known in this case, it is even better.
    Exactly :

    SCAR Code:
    Function ShopScreen : Boolean;
    Begin
      Result := FindTextTPA(2070783, 10, 154, 3, 435, 35, 'Store', UpChars, Nothing);
    End;

    Did it myself, see if it works.

  14. #14
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    I can test when I get home today. I'm at my moms with nathan right now but I should be home in 4 or 5 hours.
    That's why I hadn't done it yet

  15. #15
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Wizzup? View Post
    Sure. It hardly gives false positives, and since the text is already known in this case, it is even better.
    Sure the odds of it giving a false positive are about equal to that of someone typing in the chatbox the text to be detected and it being picked up in the right location so that the script thinks a shop screen open, but probably less than instances of the color 2070783 being found exactly 63 times in the small box of 58, 303, 85, 317. So... false positives it's debatable really, but lets think about this... how many times has OCR failed for no apparent reason? Lets think about this... we are searching for Text... why we already know what's it's going to say? CountCol just checks for pixel points.. plus it's many times faster and less laggy than any OCR. So false negatives, there's really no debate there, CountCol in comparison the OCR in false negatives is nonexistent... when OCR could fail as much as 10% or 1% of the time.

  16. #16
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by IceFire908 View Post
    Sure the odds of it giving a false positive are about equal to that of someone typing in the chatbox the text to be detected and it being picked up in the right location so that the script thinks a shop screen open, but probably less than instances of the color 2070783 being found exactly 63 times in the small box of 58, 303, 85, 317. So... false positives it's debatable really, but lets think about this... how many times has OCR failed for no apparent reason? Lets think about this... we are searching for Text... why we already know what's it's going to say? CountCol just checks for pixel points.. plus it's many times faster and less laggy than any OCR. So false negatives, there's really no debate there, CountCol in comparison the OCR in false negatives is nonexistent... when OCR could fail as much as 10% or 1% of the time.
    No, you're completely wrong. As I have stated before, this is searching for known text. It has nothing to do with identifying text. There is a BIG advantage to use OCR, because if the fonts change, all we will have to do is update the fonts, and when we have the correct fonts, it is 100% accurate. When you use CountColors, you will have to update the amount of colours for every instance. It's primitive and stupid. Use it only when you can't use anything else.

    Simba's OCR is not laggy, and I doubt it is much faster than the way we use to find text.

    Speed comparison?
    FindTextTPA is basically FindColors + TPAInTPA
    CountColors is a FindColors too. There is hardly a difference in speed.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  17. #17
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Wizzup? View Post
    No, you're completely wrong. As I have stated before, this is searching for known text. It has nothing to do with identifying text. There is a BIG advantage to use OCR, because if the fonts change, all we will have to do is update the fonts, and when we have the correct fonts, it is 100% accurate. When you use CountColors, you will have to update the amount of colours for every instance. It's primitive and stupid. Use it only when you can't use anything else.

    Simba's OCR is not laggy, and I doubt it is much faster than the way we use to find text.

    Speed comparison?
    FindTextTPA is basically FindColors + TPAInTPA
    CountColors is a FindColors too. There is hardly a difference in speed.
    What are you basing these facts off of? You obviously do not use scripting for practical uses in runescape... with OCR you will get an occasional error using this, as in it will be open and say it isn't.

  18. #18
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Just want to state here that OCR has nothing to do with Text finding.. OCR is recognizing characters out of a piece of color.. Whilst Text finding is just searching for a set of colors known beforehand.

    E: So yes, text finding is just like DTM finding... Which should be pretty fast + accurate, no matter what.
    Last edited by mastaraymond; 05-09-2010 at 06:05 PM.
    Verrekte Koekwous

  19. #19
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by mastaraymond View Post
    E: So yes, text finding is just like DTM finding... Which should be pretty fast + accurate, no matter what.
    Results and experience say otherwise.

    I also find it interesting why Wizzup used CountCol in his essence miner if he thinks FindTexTPA is more reliable.

  20. #20
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by IceFire908 View Post
    What are you basing these facts off of? You obviously do not use scripting for practical uses in runescape... with OCR you will get an occasional error using this, as in it will be open and say it isn't.
    Pardon the language, but what the fuck? I do not use scripting for practical uses in RuneScape?

    Just because SCAR's OCR is laggy and you only want to use SCAR doesn't mean OCR is general is laggy.

    What I am basing these facts off? Source code! See for yourself.

    Quote Originally Posted by IceFire908 View Post
    Results and experience say otherwise.

    I also find it interesting why Wizzup used CountCol in his essence miner if he thinks FindTexTPA is more reliable.
    What experience? You don't even know how FindTextTPA works.

    Several reasons:
    • > Just because SCAR's OCR is laggy and you only want to use SCAR doesn't mean OCR is general is laggy. (There was only SCAR when I made that script)
    • Aside from that, FindTextTPA was invented rather late by Raymond and me. Do you know why it was invented? Because SCAR's was so damn slow.
    • I probably even had it in my script before FindTextTPA was invented
    Last edited by Wizzup?; 05-09-2010 at 06:11 PM.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  21. #21
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Keep it out of SRL 4, then.

  22. #22
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Regardless of what you compare the accuracy of counting colors to, you can decrease the amount of false positives for counting colors by dividing the area into smaller areas and doing multiple counts.

  23. #23
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Whatever I'm not hear to discuss the ethics of this, I'm just simply stating the CountCol has yielded more reliable results from first hand experience while using it for runescape text, and it has. You can ignore my opinion if you want, it doesn't really matter.

  24. #24
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by IceFire908 View Post
    Keep it out of SRL 4, then.
    Actually, since you use SCAR it would be in your advantage to use the FindTextTPA ray and I wrote. Since it doesn't use SCAR's findtext stuff at all, it is just as stable as in Simba.

    Yes, CountColors has served its uses, but I don't see why we should use it in this case.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  25. #25
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Wizzup? View Post
    Pardon the language, but what the fuck? I do not use scripting for practical uses in RuneScape?

    Just because SCAR's OCR is laggy and you only want to use SCAR doesn't mean OCR is general is laggy.

    What I am basing these facts off? Source code! See for yourself.



    What experience? You don't even know how FindTextTPA works.

    Several reasons:
    • > Just because SCAR's OCR is laggy and you only want to use SCAR doesn't mean OCR is general is laggy. (There was only SCAR when I made that script)
    • Aside from that, FindTextTPA was invented rather late by Raymond and me. Do you know why it was invented? Because SCAR's was so damn slow.
    • I probably even had it in my script before FindTextTPA was invented
    not to be a douchebag but Simba's OCR needs work if it's going to be relied on. I continually get Sa''?on instead of Salmon, Po,,ta? for Portal, etc. I think using countcolor() negates the chance of that happening. However if the OCR is working 100% then it would be far more accurate I suppose.
    “Ignorance, the root and the stem of every evil.”

Page 1 of 2 12 LastLast

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
  •