Page 3 of 10 FirstFirst 12345 ... LastLast
Results 51 to 75 of 239

Thread: Randoms Development

  1. #51
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

    Quote Originally Posted by DannyRS View Post
    that would be great
    See attached
    Attached Images Attached Images

  2. #52
    Join Date
    Mar 2006
    Posts
    13,241
    Mentioned
    228 Post(s)
    Quoted
    267 Post(s)

    Default

    Here is a thought for detecting the maze random (Already shared this with Justin)



    So the maze random is probably the only place in runescape where there are a series of perfectly collinear orthogonal angles. Basically that is saying all of the corners line up in a straight line. I'd say shooting to find 3 collinear corners would be enough to prove it is maze. Also wouldn't matter of the camera rotation or which line of corners you go for. As you rotate the camera the corners to morph slightly however, all of the corners in the same series morph in the same way, so they will still be detected as the same shape/angle.

    Thoughts?
    STOP PM'ING ME

  3. #53
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

    Quote Originally Posted by Hobbit View Post
    Here is a thought for detecting the maze random (Already shared this with Justin)



    So the maze random is probably the only place in runescape where there are a series of perfectly collinear orthogonal angles. Basically that is saying all of the corners line up in a straight line. I'd say shooting to find 3 collinear corners would be enough to prove it is maze. Also wouldn't matter of the camera rotation or which line of corners you go for. As you rotate the camera the corners to morph slightly however, all of the corners in the same series morph in the same way, so they will still be detected as the same shape/angle.

    Thoughts?
    Sounds good to me, but how would you find that?

  4. #54
    Join Date
    Mar 2006
    Posts
    13,241
    Mentioned
    228 Post(s)
    Quoted
    267 Post(s)

    Default

    Well, you could start from the centre of the minimap and choose the first corner you come across as the start point, call it A. From A, extend out along a side of the same square to A' (doesn't have to be the corner, could be anywhere along that line). Then extend from A to B (The next corner out). From B extend along the side of that square the same direction as A' to B'. From B extend to C and extend from C along the side in the same direction as A' and B' to C'. We now have 3 lines AA' BB' and CC' which all intersect the green line (For now, dont assume it is a straight line, assume it has two segments AB and BC). So by Euclid's 9th property, the traversal of a straight line is 180°. Thus looking at the intersection of BB' and the green line, the purple angle and the blue angle must add up to 180°, if they do, the green line is straight, thus the points A,B,C are collinear, if it is not 180°, then it is not a straight line and points A,B,C are not collinear. Further way to double check this is by the theorem of parallel lines which says that parallel lines intersecting the same line will intersect it in the same angle. This is saying that the blue angles must be equal and the purple angles must be equal.

    Last edited by Hobbit; 03-07-2013 at 04:14 AM.
    STOP PM'ING ME

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

    Default

    Interesting post, but wouldn't a simple TPA for the red colors and gray colors work out just as wel?

    Script source code available here: Github

  6. #56
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

    Quote Originally Posted by J J View Post
    Interesting post, but wouldn't a simple TPA for the red colors and gray colors work out just as wel?
    Do you lose tabs when you go into the maze? If so then yeah it would probably be easier to check for missing tabs then check for red and gray colors

  7. #57
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default






    I guess for those 2 randoms, just detect if gametabs missing, map is black, check for song name?

    Forum account issues? Please send me a PM

  8. #58
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

    Actually molly is missing one more tab. So count the number of missing tabs, if MM is black then etc

  9. #59
    Join Date
    Mar 2006
    Posts
    13,241
    Mentioned
    228 Post(s)
    Quoted
    267 Post(s)

    Default

    Any updates? Anything where the detection still works?
    STOP PM'ING ME

  10. #60
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Im pretty sure srl4 detected every random perfectly, why dont we release that first and work on improving at a later date if needed.

  11. #61
    Join Date
    Mar 2006
    Posts
    13,241
    Mentioned
    228 Post(s)
    Quoted
    267 Post(s)

    Default

    Can someone start testing the SRL 4 detection at least and verify please.
    STOP PM'ING ME

  12. #62
    Join Date
    Mar 2006
    Posts
    13,241
    Mentioned
    228 Post(s)
    Quoted
    267 Post(s)

    Default

    Justin's idea to bring this back. I created a new thread for SRL-OSR. Please put this in your sigs

    PHP Code:
    [img]http://villavu.com/forum/images/ranks/developer.gif[/img][img]http://villavu.com/forum/images/ranks/randomdeveloper.png[/img][SIZE="6"][URL="http://villavu.com/forum/showthread.php?t=98207"][COLOR="Sienna"][FONT="Impact"]DEVS NEED RANDOM ACCOUNTS![/FONT][/COLOR][/URL][/SIZE][img]http://villavu.com/forum/images/ranks/randomdeveloper.png[/img][img]http://villavu.com/forum/images/ranks/developer.gif[/img] 
    STOP PM'ING ME

  13. #63
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

    I've only had a few randoms :/ and have taken pics of them all. Also I updated in the infight detection. This reminds me of an idea I had. So if the script is for combat, having it run away anytime it detects you are under attack wouldn't be smart. So what if we had FindNonCombatRandoms which only looked for randoms that don't attack you? Then just findnormalrandoms which searches for both? B/c with w/c I just had it run away anytime it detected we were in combat, but that would be dumb if you are training combat in the first place. Am I thinking straight?

  14. #64
    Join Date
    Mar 2006
    Posts
    13,241
    Mentioned
    228 Post(s)
    Quoted
    267 Post(s)

    Default

    Might be more strainght forward to have one function with a param like "FindNormalRandoms('Combat');" and "FindNormalRandoms('Skill');" or a boolean or something.
    STOP PM'ING ME

  15. #65
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

    Quote Originally Posted by Hobbit View Post
    Might be more strainght forward to have one function with a param like "FindNormalRandoms('Combat');" and "FindNormalRandoms('Skill');" or a boolean or something.
    Oh yeah a boolean would be good, like the script writer would need to set findcombatrandoms to false during script setup (like usefindmod etc)

  16. #66
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default

    Code:
    Screenshot of: IP Log 1 Minutes and 16 Seconds
    [RANDOM_DETECTION] Frog detection: True
    [IN RANDOM] PercentBlackMM: 37
    [IN RANDOM] FROG_GREEN: 345
    [IN RANDOM] FROG_RED: 73
    [IN RANDOM] FROG_YELLOW: 14
    Welcome to Runescape.
    [retracted]@Hotmail.Com
    Screenshot of: IP Log 2 Minutes and 1 Seconds
    [RANDOM_DETECTION] Frog detection: True
    [IN RANDOM] PercentBlackMM: 35
    [IN RANDOM] FROG_GREEN: 412
    [IN RANDOM] FROG_RED: 71
    [IN RANDOM] FROG_YELLOW: 17
    Welcome to Runescape.
    [retracted]@Hotmail.Com
    Screenshot of: IP Log 2 Minutes and 45 Seconds
    [RANDOM_DETECTION] Frog detection: True
    [IN RANDOM] PercentBlackMM: 42
    [IN RANDOM] FROG_GREEN: 648
    [IN RANDOM] FROG_RED: 73
    [IN RANDOM] FROG_YELLOW: 10
    Welcome to Runescape.
    [retracted]@Hotmail.Com
    Screenshot of: IP Log 3 Minutes and 29 Seconds
    [RANDOM_DETECTION] Frog detection: True
    [IN RANDOM] PercentBlackMM: 39
    [IN RANDOM] FROG_GREEN: 527
    [IN RANDOM] FROG_RED: 229
    [IN RANDOM] FROG_YELLOW: 62
    Welcome to Runescape.
    [retracted]@Hotmail.Com
    Screenshot of: IP Log 4 Minutes and 14 Seconds
    [RANDOM_DETECTION] Frog detection: True
    [IN RANDOM] PercentBlackMM: 37
    [IN RANDOM] FROG_GREEN: 291
    [IN RANDOM] FROG_RED: 96
    [IN RANDOM] FROG_YELLOW: 20
    Welcome to Runescape.
    [retracted]@Hotmail.Com
    Screenshot of: IP Log 4 Minutes and 59 Seconds
    [RANDOM_DETECTION] Frog detection: True
    [IN RANDOM] PercentBlackMM: 42
    [IN RANDOM] FROG_GREEN: 413
    [IN RANDOM] FROG_RED: 132
    [IN RANDOM] FROG_YELLOW: 9
    Welcome to Runescape.
    [retracted]@Hotmail.Com
    Screenshot of: IP Log 5 Minutes and 16 Seconds
    [RANDOM_DETECTION] Frog detection: True
    [IN RANDOM] PercentBlackMM: 37
    [IN RANDOM] FROG_GREEN: 452
    [IN RANDOM] FROG_RED: 143
    [IN RANDOM] FROG_YELLOW: 25
    Welcome to Runescape.
    [retracted]@Hotmail.Com
    Screenshot of: IP Log 6 Minutes and 0 Seconds
    [RANDOM_DETECTION] Frog detection: True
    [IN RANDOM] PercentBlackMM: 38
    [IN RANDOM] FROG_GREEN: 370
    [IN RANDOM] FROG_RED: 135
    [IN RANDOM] FROG_YELLOW: 26
    Welcome to Runescape.
    [retracted]@Hotmail.Com
    Screenshot of: IP Log 6 Minutes and 44 Seconds
    [RANDOM_DETECTION] Frog detection: True
    [IN RANDOM] PercentBlackMM: 39
    [IN RANDOM] FROG_GREEN: 319
    [IN RANDOM] FROG_RED: 176
    [IN RANDOM] FROG_YELLOW: 41
    Welcome to Runescape.
    [retracted]@Hotmail.Com
    Screenshot of: IP Log 7 Minutes and 30 Seconds
    [RANDOM_DETECTION] Frog detection: True
    [IN RANDOM] PercentBlackMM: 38
    [IN RANDOM] FROG_GREEN: 744
    [IN RANDOM] FROG_RED: 182
    [IN RANDOM] FROG_YELLOW: 47
    Welcome to Runescape.
    [retracted]@Hotmail.Com
    Screenshot of: IP Log 8 Minutes and 15 Seconds
    [RANDOM_DETECTION] Frog detection: True
    [IN RANDOM] PercentBlackMM: 37
    [IN RANDOM] FROG_GREEN: 337
    [IN RANDOM] FROG_RED: 142
    [IN RANDOM] FROG_YELLOW: 33
    Welcome to Runescape.
    [retracted]@Hotmail.Com
    Screenshot of: IP Log 9 Minutes and 0 Seconds
    [RANDOM_DETECTION] Frog detection: True
    [IN RANDOM] PercentBlackMM: 44
    [IN RANDOM] FROG_GREEN: 335
    [IN RANDOM] FROG_RED: 80
    [IN RANDOM] FROG_YELLOW: 22
    World selected is full, sorry.
    Welcome to Runescape.
    [retracted]@Hotmail.Com
    Screenshot of: IP Log 9 Minutes and 15 Seconds
    [RANDOM_DETECTION] Frog detection: True
    [IN RANDOM] PercentBlackMM: 37
    [IN RANDOM] FROG_GREEN: 348
    [IN RANDOM] FROG_RED: 169
    [IN RANDOM] FROG_YELLOW: 20
    Welcome to Runescape.
    [retracted]@Hotmail.Com
    Screenshot of: IP Log 9 Minutes and 59 Seconds
    [RANDOM_DETECTION] Frog detection: True
    [IN RANDOM] PercentBlackMM: 36
    [IN RANDOM] FROG_GREEN: 439
    [IN RANDOM] FROG_RED: 135
    [IN RANDOM] FROG_YELLOW: 40
    Welcome to Runescape.
    [retracted]@Hotmail.Com
    Screenshot of: IP Log 10 Minutes and 44 Seconds
    [RANDOM_DETECTION] Frog detection: True
    [IN RANDOM] PercentBlackMM: 40
    [IN RANDOM] FROG_GREEN: 458
    [IN RANDOM] FROG_RED: 225
    [IN RANDOM] FROG_YELLOW: 11
    Welcome to Runescape.
    [retracted]@Hotmail.Com
    Screenshot of: IP Log 11 Minutes and 29 Seconds
    [RANDOM_DETECTION] Frog detection: True
    [IN RANDOM] PercentBlackMM: 35
    [IN RANDOM] FROG_GREEN: 269
    [IN RANDOM] FROG_RED: 89
    [IN RANDOM] FROG_YELLOW: 23
    Welcome to Runescape.
    [retracted]@Hotmail.Com
    Screenshot of: IP Log 12 Minutes and 13 Seconds
    [RANDOM_DETECTION] Frog detection: True
    [IN RANDOM] PercentBlackMM: 39
    [IN RANDOM] FROG_GREEN: 373
    [IN RANDOM] FROG_RED: 262
    [IN RANDOM] FROG_YELLOW: 30
    Sending pull request. Failed frog detection: Detected and working.

    Forum account issues? Please send me a PM

  17. #67
    Join Date
    Oct 2011
    Posts
    422
    Mentioned
    15 Post(s)
    Quoted
    116 Post(s)

  18. #68
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default

    Quote Originally Posted by J J View Post
    Simba Code:
    (**
     * Author: Coh3n, J J
     * Description: Uses the lamp on the skill of choice
     *)

    function UseLamp: boolean;
    var
      Skill: Integer;
      Slot: TPoint;
      Box: TBox;

    begin
      //Skill := Players[currentPlayer].lampSkill;
      Skill := SKILL_MAGIC;

      case Skill of
        SKILL_ATTACK              : slot := Point(0, 0);
        SKILL_STRENGTH            : slot := Point(1, 0);
        SKILL_RANGE               : slot := Point(2, 0);
        SKILL_MAGIC               : slot := Point(3, 0);
        SKILL_DEFENCE             : slot := Point(4, 0);
        SKILL_HITPOINTS, SKILL_HP : slot := Point(0, 1);
        SKILL_PRAYER              : slot := Point(1, 1);
        SKILL_AGILITY             : slot := Point(2, 1);
        SKILL_HERBLORE            : slot := Point(3, 1);
        SKILL_THIEVING            : slot := Point(4, 1);
        SKILL_CRAFTING            : slot := Point(5, 1);
        SKILL_RUNECRAFTING        : slot := Point(0, 2);
        SKILL_SLAYER              : slot := Point(1, 2);
        SKILL_FARMING             : slot := Point(2, 2);
        SKILL_MINING              : slot := Point(3, 2);
        SKILL_SMITHING            : slot := Point(4, 2);
        SKILL_FISHING             : slot := Point(5, 2);
        SKILL_COOKING             : slot := Point(0, 3);
        SKILL_FIREMAKING          : slot := Point(1, 3);
        SKILL_WOODCUTTING         : slot := Point(2, 3);
        SKILL_FLETCHING           : slot := Point(3, 3);
        SKILL_CONSTRUCTION        : slot := Point(4, 3);
        SKILL_HUNTER              : slot := Point(5, 3);
      end;

      { INFO
        8 pixels between each box horizontal
        4 pixels between each box vertical

        Row 0
        189, 144 -> 213, 149
        203, 134 -> 204, 158
        Box: 24, 24

        Row 1, 2, 3
        -------------------
        174, 182 ->  198, 179
        187, 164 -> 189, 188
        Box: 24, 24
      }


      if Slot.y > 0 then
        Box := IntToBox(173 + Slot.x * 24 + Slot.x * 8,
                        164 + (Slot.y-1) * 24 + (Slot.y-1) * 4,
                        173 + Slot.x * 24 + Slot.x * 8 + 24,
                        164 + (Slot.y-1) * 24 + (Slot.y-1) * 4 + 24)
      else
        Box := IntToBox(189 + Slot.x * 24 + Slot.x * 8,
                        134 + Slot.y * 24 + Slot.y * 4,
                        189 + Slot.x * 24 + Slot.x * 8 + 24,
                        134 + Slot.y * 24 + Slot.y * 4 + 24);

      writeln('Lamp box: ' + ToStr(Box));
    end;
    Missed this post. Have made a pull request.

    Forum account issues? Please send me a PM

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

    Default

    Quote Originally Posted by Justin View Post
    Missed this post. Have made a pull request.
    Okay but it doesn't actually click submit yet as I couldn't test it on RS yet. But the boxes should be fine!

    Can you give me the code of your sig?

    Script source code available here: Github

  20. #70
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default

    Quote Originally Posted by J J View Post
    Okay but it doesn't actually click submit yet as I couldn't test it on RS yet. But the boxes should be fine!

    Can you give me the code of your sig?
    All good; Added that in

    PHP Code:
    [CENTER][img]http://villavu.com/forum/images/ranks/developer.gif[/img][img]http://villavu.com/forum/images/ranks/randomdeveloper.png[/img][SIZE="6"][URL="http://villavu.com/forum/showthread.php?t=98207"][COLOR="Sienna"][FONT="Impact"]DEVS NEED RANDOM ACCOUNTS![/FONT][/COLOR][/URL][/SIZE][img]http://villavu.com/forum/images/ranks/randomdeveloper.png[/img][img]http://villavu.com/forum/images/ranks/developer.gif[/img][/CENTER] 

    Forum account issues? Please send me a PM

  21. #71
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

    Does anyone know if the findtalk (not sure of exact function name) that detects a players nickname being spoken on the MS still exists or if the one from SRL4 works? This is to handle all talking randoms. If not I will whip one up

    Edit:

    Found it. I'll take on solving and detecting all chat only randoms. I'm just gonna port the stuff over from srl4
    Last edited by Ashaman88; 03-09-2013 at 03:07 PM.

  22. #72
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

    I've got the findtalk working and can identify all the talking randoms. I still need to test out on all the ones that talk to you, but then we can start on solvers (the solver is just commented out right now)

    Simba Code:
    VAR
      NICKNAMEBMP:  integer;

    {*******************************************************************************
    procedure SetScreenName(ScreenName: String);
    by: WT-Fakawi edited by Ashaman88
    Description: Sets screenname for use with FindTalk and one Player.
    *******************************************************************************}


    procedure SetScreenName(ScreenName: string);
    begin
      NickNameBMP := BitmapFromText(ScreenName, upchars07);
    end;

    {*******************************************************************************
    function SolveTalkingRandom(RawMenuText: String): Boolean;
    By: Ashaman88
    Description: Talking Random Handler. Called by FindTalkingRandom. (FindTalk)
    *******************************************************************************}


    function SolveTalkingRandom(RawMenuText: string): Boolean;
    var
      IC, FI: Byte;
     // A: Boolean;
    begin
      TakeScreen('Solving Talking Random - '+RawMenuText);
    // Security Guard Handler
      if (Pos('uard', RawMenuText) <> 0) or (Pos('ecur', RawMenuText) <> 0) then
      begin
        writeln('Found GUARD random');
        for IC := 1 to 2 do
        begin
          Wait(1000 + Random(500));
          ClickToContinue;
          Wait(50 + Random(50));
        end;
        Result := True;
        Exit;
      end;

    // Freaky Forrester Handler.

      if (Pos('reak', RawMenuText) <> 0) or (Pos('orest', RawMenuText) <> 0) then
      begin
        writeln('Found FORRESTER random');
        CloseWindow;
        Logout;
        Result := False;
        Exit;
      end;

    // Sandwich Lady Handler.

      if (Pos('ady', RawMenuText) <> 0) or (Pos('ich', RawMenuText) <> 0) then
      begin
        writeln('Found SANDWICH random');
        //if (not (UseSandwichSolver)) then
        begin
          CloseWindow;
          Logout;
          Result := False;
          Exit;
        end;

        ClickToContinue;
        Wait(500 + Random(500));
       // SetupSandWich;
       // if SolveSandWich then
        begin
          Result := True;
          CloseWindow;
          Exit;
        end
       // else
        begin
          CloseWindow;
          Result := False;
          Logout;
          Exit;
        end;
      end;

      // Genie Handler.

      if (Pos('Geni', RawMenuText) <> 0) or (Pos('enie', RawMenuText) <> 0) then
      begin
        writeln('Found geni random');
        Wait(1000 + Random(500));
        //if SolveGenie(LampSkill) then
        begin
          Exit;
        end
        //else
        begin
          Exit;
        end;
      end;

      // Certer Handler

      if (Pos('ile', RawMenuText) <> 0) or (Pos('iles', RawMenuText) <> 0) then
      begin
        writeln('Found certer random');
        Wait(1000 + Random(500));
    //    ClickToContinue;

       // if UseCerterSolver then
       //   A := SolveCerter
      //  else
       //   A := FindCerter;

       // if A then
        begin
          Exit;
        end
        //else
        begin
          Logout;
          Exit;
        end;
      end;

      // Frog Handler

      if (Pos('rog', RawMenuText) <> 0) or (Pos('Fro', RawMenuText) <> 0) then
      begin
        writeln('Found Frog random');
       // if SolveFrog then
        begin
          Exit;
        end
        //else
        begin
          for FI := 0 to 3 do
            ClickToContinue;
          Wait(10000);
        //  if DetectFrogCave then if SolveFrogSwamp then
            begin
             // Frogs := Frogs + 1;
              Exit;
            end
          //  else
            begin
          //    NOFrogs := NOFrogs + 1;
          //    WriteLn('Frogs Missed Twice');
              Logout;
          //    SRLRandomsReport;
              Exit;
            end;
        end
      end;

      // Rick Handler

      if (Pos('ick', RawMenuText) <> 0) or (Pos('urpen', RawMenuText) <> 0) then
      begin
        writeln('Found RICK random');
        Wait(1000 + Random(500));
        ClickToContinue;
       // Ricks := Ricks + 1;
        //SRLRandomsReport;
        Exit;
      end;

      // Dwarf Handler. (Might add: DwarfItem)

      if (Pos('runk', RawMenuText) <> 0) or (Pos('warf', RawMenuText) <> 0) then
      begin
        writeln('Found DWARF random');
        Wait(1000 + Random(500));
        ClickToContinue;
        //Dwarfs := Dwarfs + 1;
        //SRLRandomsReport;
        Exit;
      end;

      // Cap 'n Hand (ler).

      if (Pos('Cap ', RawMenuText) <> 0) or (Pos('Hand', RawMenuText) <> 0) then
      begin
        writeln('Found CAP random');
        Wait(1000 + Random(500));
        ClickToContinue;
       // Caps := Caps + 1;
        //SRLRandomsReport;
        Exit;
      end;

      // Mysterious Old Man Handler.

      if (Pos('yste', RawMenuText) <> 0) or (Pos('rious', RawMenuText) <> 0) then
      begin
        writeln('Found OLD MAN random');
        Wait(1000 + Random(500));
        ClickToContinue;
       // Oldmen := Oldmen + 1;
        //SRLRandomsReport;
        Exit;
      end;

      //Dr Jekyll Handler

      if (Pos('eky', RawMenuText) <> 0) or (Pos('kyll', RawMenuText) <> 0) then
      begin
        writeln('Found JEKYLL random');
        for IC := 1 to 4 do
        begin
          Wait(1000 + Random(500));
          ClickToContinue;
        end;
        //Jekylls := Jekylls + 1;
      end;
    end;

    {*******************************************************************************
    function ChooseOptionGetMenuText(RawMenuText: String; Texts: TStringArray; Action: fnct_ActionOptions): Boolean;
    By: Ashaman88.
    Description: Gets the option of which random we have
    *******************************************************************************}



    function ChooseOptionGetMenuText(var RawMenuText: string; Texts: TStringArray; Action: fnct_ActionOptions): Boolean;
    var
       B: TBox;
       i, H, x, R: Integer;
       T: TPoint;
       Options: array of TOptions;
    begin
      Result := False;
      Options := GetChooseOptions();
      if (Length(Options) < 1) then
        Exit;
      H := High(Options);
      for i := 0 To H do
      begin
        if ArrInStr(Texts, Options[i].Str) then
        begin
          Result := True;
          RawMenuText:= Options[i].Str;
          B := Options[i].Bounds;
          GetMousePos(T.x, T.y);
          R:= Min(((B.X2 - B.X1) shr 1), 5); //Prevents x2 passed to MouseBoxEx being smaller than x1
          case Action of
            ClickLeft:
              if PointInBox(T, B) then
                ClickMouse2(true)
              else
                MouseBoxEx(B.x1 + R, B.Y1, B.x2 - R, B.Y1 + 5, R, mouse_Left);
            Move:
              if not PointInBox(T, B) then
                MouseBoxEx(B.x1 + R, B.Y1, B.x2 - R, B.Y1 + 5, R, mouse_move);

            Nothing:
              begin
              end;

            else
              srl_warn('ChooseOptionMultiEx', 'ClickRight not a valid click for RS menus!', warn_AllVersions);
          end;
          Exit;
        end;
      end;
      B := Options[0].BigBox;//to mmouse away
      if Action <> Nothing then
      begin
        x := Max(B.X1 - 52, 0);
        if x = 0 then
          x := B.X2+10;
        MMouse(x, Max(B.Y1 - 50, 0), 40, B.Y2-B.Y1);
        Wait(200 + Random(100));
      end;
    end;

    {*******************************************************************************
    function FindTalk: Boolean;
    by: Ashaman88
    Description: Searches screen for NickName and handles ALL Talking Randoms
    *******************************************************************************}



    const gTalkOldComputer = False;
    const gTalkSaveBitmap = False;

    var
      gtalksBox, YelSkipBoxs: array of TBox;
      gTalksCount: Integer;

    function FindTalk: Boolean;
    var
      ax, ay, yCount, zCount, Count2, x1, y1, x2, y2, Count1, bmpScreen: Integer;
      RawMenuText: string;
    begin
      Result := False;
      if (GetArrayLength(Players) < 1) then Exit;

      if FindColor(ax, ay, 65535, MSX1, MSY1, MSX2, MSY2) then
      begin

        SetArrayLength(gtalksBox, 0);
        SetArrayLength(YelSkipBoxs, 0);

        //while FindColor(ax, ay, 65535, MSX1, MSY1, MSX2, MSY2) do
        begin

          y1 := ay;
          if ( ( ay + 5 ) > 334 ) then y2 := 334 else y2 := ay + 5;

          x1 := ax; x2 := x1;
          zCount := 0;

          repeat
            if FindColor(ax, ay, 65535, x2, y1 + 2, x2 + 3, y2 + 3) then
              zCount := 0
            else
              zCount := zCount + 1;

            if ( zCount = 4 ) then Break;
            x2 := x2 + 3;
          until ( x2 + 3 > 515 );

          if ( x2 + 3 <= 515 ) then x2 := x2 - 12;

          if (x2 - x1 >= length(Players[CurrentPlayer].Nick) * 4) then
          begin

            x1 := x1 - 8;
            y1 := y1 - 8;
            x2 := x2 + 8;
            y2 := y2 + 8;

            if ( x1 < 0 ) then x1 := 0;
            if ( y1 < 0 ) then y1 := 0;
            if ( x2 > 515 ) then x2 := 515;
            if ( y2 > 334 ) then y2 := 334;

            Count2 := Count2 + 1;
            Count1 := Count1 + 1;
            SetArrayLength(gtalksBox, Count2);
            gtalksBox[Count2 - 1].x1 := x1;
            gtalksBox[Count2 - 1].y1 := y1;
            gtalksBox[Count2 - 1].x2 := x2;
            gtalksBox[Count2 - 1].y2 := y2 + 6;

            SetArrayLength(YelSkipBoxs, Count1);
            YelSkipBoxs[Count1 - 1].x1 := x1;
            YelSkipBoxs[Count1 - 1].y1 := y1;
            YelSkipBoxs[Count1 - 1].x2 := x2;
            YelSkipBoxs[Count1 - 1].y2 := y2;

          end else
          begin
            y1 := y1 - 2;
            y2 := y2 + 8;
            x1 := x1 - 5;
            x2 := x2 + 5;
            if ( x1 < 0 ) then x1 := 0;
            if ( y1 < 0 ) then y1 := 0;
            if ( x2 > 515 ) then x2 := 515;
            if ( y2 > 334 ) then y2 := 334;

            Count1 := Count1 + 1;
            SetArrayLength(YelSkipBoxs, Count1);
            YelSkipBoxs[Count1 - 1].x1 := x1;
            YelSkipBoxs[Count1 - 1].y1 := y1;
            YelSkipBoxs[Count1 - 1].x2 := x2;
            YelSkipBoxs[Count1 - 1].y2 := y2;
          end;
        end;

        if ( GetArrayLength(gtalksBox) <> 0 ) then
        begin
          for yCount := 0 to GetArrayLength(gtalksBox) - 1 do
          begin
            if FindBitmapMaskTolerance(NickNameBMP, ax, ay, gtalksBox[yCount].x1, gtalksBox[yCount].y1, gtalksBox[yCount].x2, gtalksBox[yCount].y2, 0, 40) then
            begin
              WriteLn('Found NickName');
              ax := (gtalksBox[yCount].x2 + gtalksBox[yCount].x1) shr 1;
              ay := gtalksBox[yCount].y2 - 2;

              if gTalkSaveBitmap then
              begin
                bmpScreen := BitmapFromString(515, 334, '');
                CopyClientToBitmap(bmpScreen, 1, 1, 515, 334);

                if ( gtalksBox[yCount].x1 = 0 ) then x1 := 1 else x1 := gtalksBox[yCount].x1;
                if ( gtalksBox[yCount].y1 = 0 ) then y1 := 1 else y1 := gtalksBox[yCount].y1;

                gTalksCount := gTalksCount + 1;
                for Count1 := -1 to 1 do
                  for Count2 := -1 to 1 do
                    FastSetPixel(bmpScreen, Count1 + x1, Count2 + y1, 255);

                if ( gtalksBox[yCount].x2 = 515 ) then x1 := 515 else x1 := gtalksBox[yCount].x2;
                if ( gtalksBox[yCount].y2 = 334 ) then y1 := 334 else y1 := gtalksBox[yCount].y2;

                for Count1 := -1 to 1 do
                  for Count2 := -1 to 1 do
                    FastSetPixel(bmpScreen, Count1 + x1, Count2 + y1, 255);

                for Count1 := -1 to 1 do
                  for Count2 := -1 to 1 do
                    FastSetPixel(bmpScreen, Count1 + ax, Count2 + ay, 255);
                SaveBitmap(bmpScreen, ScriptPath + 'FTalk' + IntToStr(gTalksCount) + '.bmp');
                FreeBitmap(bmpScreen);
              end;

              MMouse(ax, ay, 0, 0);
              Wait(100 + Random(50));
              if WaitUpTextMulti(['Talk', 'lk-to', 'uard', 'ard'],RandomRange(300,400)) then
              begin
                Mouse(ax, ay, 0, 0, False);
                Wait(300 + Random(100));


                if (ChooseOptiongetMenuText(RawMenuText, ['Talk'], ClickLeft)) then
                begin
                  WriteLn('******** FOUND TALKING RANDOM TEXT********: ' + RawMenuText);
                  Flag;
                  Wait(1000 + Random(500))
                  SolveTalkingRandom(RawMenuText);
                  Result := True;
                  Exit;
                end;
              end;
            end;
          end;
        end;
      end;
    end;


    You just need to put something in the declareplayers for the nick - for me i just put man88. Just call findtalk


    Edit: I'll be updating these functions as I go
    Last edited by Ashaman88; 03-09-2013 at 06:14 PM.

  23. #73
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Done sandwich lady solver, can someone check my logic and standards ? and how are random solvers going to be called etc? so we can make them compatible with detection call

    Simba Code:
    program SandwichTestScript;

    {$I SRL-OSR/SRL.simba}

    var
      SandwichTimeOutTimer: integer;

    function StopSandwichSearch: boolean;
    begin
      Result := False;
      if (CountColor(39423, 490, 10, 513, 32) < 5) then
        Result := True;
      if (TimeFromMark(SandwichTimeOutTimer) > 35000) then
        Result := True;
    end;

    procedure SandwichMessage(Message: string);
    begin
      WriteLn('[Sandwich Random] ' + Message);
    end;

    procedure SelectSandwich(SandwichNumber: integer);
    var
      SPoint: tpoint;
    begin
      SPoint := Point(-1,-1);
      case SandwichNumber of
        0: SPoint := Point(155, 120);
        1: SPoint := Point(260, 122);
        2: SPoint := Point(365, 132);
        3: SPoint := Point(110, 210);
        4: SPoint := Point(205, 219);
        5: SPoint := Point(315, 213);
        6: SPoint := Point(395, 217);
      end;
      if (SPoint.X < 0) then
      begin
        SandwichMessage('[ERROR] Invalid sandwich number');
        Exit;
      end;
      if (StopSandwichSearch) then Exit;
      MMouse(RandomRange(SPoint.X-4,SPoint.X+4),
          RandomRange(SPoint.Y-4,SPoint.Y+4), 0, 0);
      ClickMouse2(mouse_left);
    end;

    function GetSandwichName: string;
    var
      FoundString, SWName: string;
    begin
      Result := ''; SWName := '';
      FoundString := Trim(GetTextAtExWrap(80, 270, 400, 303,
          0, 3, 1, 2070783, 0, 'UpChars07'));
      SWName := Trim(Between('Have a', 'for free', FoundString));
      if (not (SWName='')) then
        Result := SWName;
    end;

    function SandwichSearchBox(BoxNumber: integer): tbox;
    begin
      case BoxNumber of
        0: Result := IntToBox(100,80,205,155);
        1: Result := IntToBox(215,80,305,160);
        2: Result := IntToBox(320,80,410,163);
        3: Result := IntToBox(71,170,160,255);
        4: Result := IntToBox(165,175,255,260);
        5: Result := IntToBox(260,175,355,265);
        6: Result := IntToBox(360,175,435,270);
      end;
    end;

    function FindSandwichBoxNumber: integer;
    var
      tmpCTS, i, SColor, STol, MinSSize: integer;
      SHM, SSM: extended;
      SName: string;
      SB: tbox;
      SWTPA: tpointarray;
    begin
      Result := -1;
      SName := GetSandwichName;
      tmpCTS := GetColorToleranceSpeed;
      if (SName='') then
      begin
        SandwichMessage('[ERROR] Unable to get sandwich name');
        Exit;
      end;
      SandwichMessage('Sandwich Name: ' + SName);
      case Lowercase(SName) of
        'baguette'         : begin
                               SColor:=2910074;
                               STol:=10;
                               SHM:=0.03;
                               SSM:=0.08;
                               MinSSize:=35;
                             end;
        'chocolate bar'    : begin
                               SColor:=2375783;
                               STol:=7;
                               SHM:=0.03;
                               SSM:=0.24;
                               MinSSize:=110;
                             end;
        'kebab'            : begin
                               SColor:=1276942;
                               STol:=3;
                               SHM:=0.08;
                               SSM:=0.59;
                               MinSSize:=25;
                             end;
        'meat pie'         : begin
                               SColor:=5395289;
                               STol:=24;
                               SHM:=0.10;
                               SSM:=0.08;
                               MinSSize:=150;
                             end;
        'bread roll'       : begin
                               SColor:=1280167;
                               STol:=9;
                               SHM:=0.01;
                               SSM:=0.24;
                               MinSSize:=110;
                             end;
        'triangle sandwich': begin
                               SColor:=2276602;
                               STol:=2;
                               SHM:=0.05;
                               SSM:=0.81;
                               MinSSize:=25;
                             end;
        'square sandwich'  : begin
                               SColor:=5143435;
                               STol:=6;
                               SHM:=0.01;
                               SSM:=0.05;
                               MinSSize:=110;
                             end;
        else
        begin SandwichMessage('[ERROR] Invalid sandwich name found'); Exit; end;
      end;
      SandwichMessage('Scanning for sandwich');
      SetColorToleranceSpeed(2);
      SetToleranceSpeed2Modifiers(SHM, SSM);
      repeat
        for i:=0 to 6 do
        begin
          SB := SandwichSearchBox(i);
          FindColorsTolerance(SWTPA, SColor, SB.X1, SB.Y1, SB.X2, SB.Y2, STol);
          if (Length(SWTPA) < MinSSize) then Continue;
          Result := i;
          Break;
        end;
      until (Result > -1) or (StopSandwichSearch);
      SetColorToleranceSpeed(tmpCTS);
      SetToleranceSpeed2Modifiers(0.02, 0.02);
    end;

    procedure SolveSandwichLadyRandom;
    begin
      Wait(RandomRange(2500,3500));
      MarkTime(SandwichTimeOutTimer);
      if (StopSandwichSearch) then
      begin
        SandwichMessage('[ERROR] SandwichLady select screen not up');
        Exit;
      end;
      SelectSandwich(FindSandwichBoxNumber);
    end;

    begin
      SetupSRL;
      SolveSandwichLadyRandom;
    end.


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  24. #74
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

  25. #75
    Join Date
    Mar 2006
    Posts
    13,241
    Mentioned
    228 Post(s)
    Quoted
    267 Post(s)

    Default

    Is anyone working on the Quiz Master? A user PM'd me account details with one stuck in quiz master. Ill forward you the info if you're working on it.
    STOP PM'ING ME

Page 3 of 10 FirstFirst 12345 ... 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
  •