Results 1 to 10 of 10

Thread: Quiz.scar

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

    Default Quiz.scar

    Patch:
    Simba Code:
    Index: quiz.scar
    ===================================================================
    --- quiz.scar   (revision 692)
    +++ quiz.scar   (working copy)
    @@ -34,7 +34,9 @@
     function InQuizRandom : Boolean;
     begin
       if (InBlack) then
    -    Result := (PercentBlackMM > 95);
    +    Result := (PercentBlackMM > 95) and
    +      InRange(CountColorTolerance(13882589, MSx1, MSy1, MSx2, MSy2, 13), 2700, 4200) and
    +        (Length(GetMiniMapDotsIn('npc', MMx1, MMy1, MMx2, MMy2)) = 1);
     end;
    When running...
    Simba Code:
    writeln(IntToStr(CountColorTolerance(13882589, MSx1, MSy1, MSx2, MSy2, 13)));
    every output was between 3000 and 4000, but I added the extra to each end just to be safe.

    Has been tested many times with this:
    Simba Code:
    begin
      SetupSRL;
      ActivateClient;
      if InQuizRandom then
      begin
        Writeln('in quiz');
        SolveQuiz;
      end;
      if InCerterRandom then
        Writeln('in certer');
    end.
    The certer stuff is in there to make sure there are no false positives as I'm working on that too. This has also been tested in the certer random a few times to check for the same thing. All attempts successful.

    Output:
    Progress Report:
    Compiled succesfully in 609 ms.
    SRL Compiled in 15 msec
    in quiz
    Trout Fish Small, with a score of 9
    Tuna Fish Big, with a score of 9
    BattleAxe Small, with a score of 9
    Use: Edible, Count: 2
    Use: Weapon, Count: 1
    We need to pick BattleAxe Small, and it's use is Weapon and located at slot 3
    Tuna Fish Small, with a score of 9
    Trout Fish Big, with a score of 9
    Ring Small, with a score of 9
    Use: Edible, Count: 2
    Use: Jewelry, Count: 1
    We need to pick Ring Small, and it's use is Jewelry and located at slot 3
    Helmet Small, with a score of 9
    Tuna Fish Big, with a score of 7
    Trout Fish Small, with a score of 7
    Use: Weapon, Count: 1
    Use: Edible, Count: 2
    We need to pick Helmet Small, and it's use is Weapon and located at slot 1
    Sword Small, with a score of 7
    Tuna Fish Big, with a score of 7
    Trout Fish Small, with a score of 7
    Use: Weapon, Count: 1
    Use: Edible, Count: 2
    We need to pick Sword Small, and it's use is Weapon and located at slot 1
    Successfully executed.


    Certer fix should be coming soon as well.
    Last edited by Wanted; 01-20-2011 at 07:47 PM.

  2. #2
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Only thing, would you mind posting what the colour is?

    Also, could you run some speed tests, let us know how fast it is on average.

    Did you also test with multiple compass angles?
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

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

    Default

    Quote Originally Posted by Nava2 View Post
    Only thing, would you mind posting what the colour is?
    The color is the white from the spotlights around your char.

    Quote Originally Posted by Nava2 View Post
    Also, could you run some speed tests, let us know how fast it is on average.
    The account is no longer in the random, but I've got ~12 more to check so hopefully one of them will be and I'll do this.

    Quote Originally Posted by Nava2 View Post
    Did you also test with multiple compass angles?
    Yes, but never all the way down. Again, I'll test it that way if I have another account in the random. Could always just include a SetAngle(True); if really necessary I guess, but let me check what I have first.


    Edit: Out of 65 accounts, only 1 was in quiz

    If anyone has an account in quiz please let me know and I will test Nava's suggestions. Until then, I'm on to Certer and Arnav.

  4. #4
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by NCDS View Post
    The color is the white from the spotlights around your char.
    Please make that a constant with some description/doc.

    Quote Originally Posted by NCDS View Post
    The account is no longer in the random, but I've got ~12 more to check so hopefully one of them will be and I'll do this.
    OK, please report back, because this looks slightly slow.. See my later suggestions for speed increases. Remember, with functions like this, they must be fast to make sure they are not slowing down scripts unintentionally.

    Quote Originally Posted by NCDS View Post
    Yes, but never all the way down. Again, I'll test it that way if I have another account in the random. Could always just include a SetAngle(True); if really necessary I guess, but let me check what I have first.
    NO.

    We must have our checks not modify the current state of the character. SRL should behave behind the scenes. When a script writer calls FindNormalRandoms, they do not want to worry about the compass angle having adjustment issues.


    Quote Originally Posted by NCDS View Post
    Until then, I'm on to Certer and Arnav.
    Careful you do not get too over your head.

    To increase speed, perhaps Freeze() the client upon entering the function, then Unfreeze() it upon leaving the function. It removes the time taken for grabbing the client data each time. Considering all of these are necessary for the result to be true, we have to check all of them.

    E: Because of Boolean `Short-circuit' evaluation, you should switch the last two parts of the result. GetDots is faster than CountColors I think.. if its not I apologize and take this as a friendly reminder of short-circuit evaluation with booleans. Its good to see you contributing btw
    Last edited by Nava2; 01-21-2011 at 02:18 AM.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

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

    Default

    Quote Originally Posted by Nava2 View Post
    Please make that a constant with some description/doc.
    Simba Code:
    InQuizSpotlight := 13882589; // White Spotlight color around your char
    ?

    Quote Originally Posted by Nava2 View Post
    OK, please report back, because this looks slightly slow.. See my later suggestions for speed increases. Remember, with functions like this, they must be fast to make sure they are not slowing down scripts unintentionally.
    I will time it as soon as I get an opportunity.

    Quote Originally Posted by Nava2 View Post
    NO.

    We must have our checks not modify the current state of the character. SRL should behave behind the scenes. When a script writer calls FindNormalRandoms, they do not want to worry about the compass angle having adjustment issues.
    A few randoms do this. Frog and Abyss are 2 that come to mind immediately. Regardless, when I get another account in the random I'll be sure to make it unnecessary.

    Quote Originally Posted by Nava2 View Post
    Careful you do not get too over your head.
    I like having set things to work on when I sit down to do something

    Quote Originally Posted by Nava2 View Post
    To increase speed, perhaps Freeze() the client upon entering the function, then Unfreeze() it upon leaving the function. It removes the time taken for grabbing the client data each time. Considering all of these are necessary for the result to be true, we have to check all of them.
    I will look into doing this when I test the time it takes.

    Quote Originally Posted by Nava2 View Post
    E: Because of Boolean `Short-circuit' evaluation, you should switch the last two parts of the result. GetDots is faster than CountColors I think.. if its not I apologize and take this as a friendly reminder of short-circuit evaluation with booleans. Its good to see you contributing btw
    I can't see CountColors being slower as it should only include FindColorsTolerance and the Result would be the Length, whereas GetMiniMapDotsIn has a case then FindColorsSpiralTolerance and a few conditionals. Now that I think about it, it would probably be quicker to just CountColor for the npc dot on the MM. I can test with that too if you think it might be beneficial. I generally keep timing with short-circuit evaluation in mind anyhow.

    Thanks for doing this btw Nava, I really appreciate it.

    Edit: Arnav has SetAngle(True); as well. Is the goal to avoid that in SRL 5 I'm assuming? If so, I'll keep that in mind while fixing/rewriting the solvers.
    Last edited by NCDS; 01-21-2011 at 03:20 AM.

  6. #6
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by NCDS View Post
    Simba Code:
    InQuizSpotlight := 13882589; // White Spotlight color around your char
    ?
    Simba Code:
    srl_rand_QuizSpotlight = 13882589

    Would be better.

    Quote Originally Posted by NCDS View Post
    A few randoms do this. Frog and Abyss are 2 that come to mind immediately. Regardless, when I get another account in the random I'll be sure to make it unnecessary.
    EEEK! I had no idea that they did.. If I had known I would have said something much sooner. Please, if you have time, feel free to change this so its not dependant on changing the compas angle.

    Quote Originally Posted by NCDS View Post
    I like having set things to work on when I sit down to do something
    .. never a bad thing!

    Quote Originally Posted by NCDS View Post
    I will look into doing this when I test the time it takes.
    Can't really remember what this was in reference to.. >.<

    E: I see now.. and I still have nothing to say !

    Quote Originally Posted by NCDS View Post
    I can't see CountColors being slower as it should only include FindColorsTolerance and the Result would be the Length, whereas GetMiniMapDotsIn has a case then FindColorsSpiralTolerance and a few conditionals. Now that I think about it, it would probably be quicker to just CountColor for the npc dot on the MM. I can test with that too if you think it might be beneficial. I generally keep timing with short-circuit evaluation in mind anyhow.
    Great! I only brought it up so you could improve regardless if it was necessary in this instance. It is good to know more, eh? Because knowledge is power!

    Check out the Freeze() and Unfreeze() functions though.. it makes a significant difference in the speed when you are doing multiple checks on something that should stay consistent. (no need to re-remind).

    Quote Originally Posted by NCDS View Post
    Thanks for doing this btw Nava, I really appreciate it.
    Happy to. Only thing is, I feel like I'm being rude.. but know I am happy with the work, I just want to see you improve. Thus, I'm being much more harsh on you than I might on others!

    Quote Originally Posted by NCDS View Post
    Edit: Arnav has SetAngle(True); as well. Is the goal to avoid that in SRL 5 I'm assuming? If so, I'll keep that in mind while fixing/rewriting the solvers.
    It was always the intention.. I thought at least. Perhaps this needs to be brought up elsewhere. When Zeph worked on the original system he had it have minimal effects, I always thought that was the intent.. Huh.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

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

    Default

    Quote Originally Posted by Nava2 View Post
    Simba Code:
    srl_rand_QuizSpotlight = 13882589

    Would be better.
    Yeah, the '?' was because I wasn't sure what type of naming scheme you wanted to use. Although..
    Simba Code:
    rand_Quiz_Spotlight = 13882589
    may be a little more fitting as it should be obvious it's in SRL? Your the Dev though, and I have no objections to either one.

    Quote Originally Posted by Nava2 View Post
    EEEK! I had no idea that they did.. If I had known I would have said something much sooner. Please, if you have time, feel free to change this so its not dependant on changing the compas angle.
    I think it's necessary for a couple thing's, but I've got plenty of accounts in randoms (all except quiz ) so I'll see what I can do to work around that.

    Quote Originally Posted by Nava2 View Post
    Happy to. Only thing is, I feel like I'm being rude.. but know I am happy with the work, I just want to see you improve. Thus, I'm being much more harsh on you than I might on others!
    This is mentoring, no? and I can't thank you enough for doing it.

  8. #8
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by NCDS View Post
    Yeah, the '?' was because I wasn't sure what type of naming scheme you wanted to use. Although..
    Simba Code:
    rand_Quiz_Spotlight = 13882589
    may be a little more fitting as it should be obvious it's in SRL? Your the Dev though, and I have no objections to either one.
    I agree with you on this one, but we have `srl_' prepended to all of our constants. Should probably stick with that.. also, uppercase consts .

    Quote Originally Posted by NCDS View Post
    I think it's necessary for a couple thing's, but I've got plenty of accounts in randoms (all except quiz ) so I'll see what I can do to work around that.
    Great! Unfortunately, I do not have time to do it right now.

    Quote Originally Posted by NCDS View Post
    This is mentoring, no? and I can't thank you enough for doing it.
    Call it what you want, I get excuses to be harsh! <3
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  9. #9
    Join Date
    Mar 2007
    Posts
    1,700
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Here's a critique: contribute something original and/or innovative, not just fixing bugs.

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

    Default

    Quote Originally Posted by lordsaturn View Post
    Here's a critique: contribute something original and/or innovative, not just fixing bugs.
    I don't control what new material Jagex updates RS with, and I also see no point in re-writing code that already works.

    If you have any thought or suggestions, I'm very open to them. Otherwise, I'll continue to wait for an update.

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
  •