Results 1 to 3 of 3

Thread: Help WithBejewled Script.

  1. #1
    Join Date
    Jun 2009
    Location
    New Jersey
    Posts
    154
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Help WithBejewled Script.

    I've been trying to figure out how to find 2 gems that are right next to each other, but i just cant seem to do it.

    Here's the code as of now:

    SCAR Code:
    program New;
      {.include SRL/SRL.scar}
    var
      MyTPA : TPointArray;
      ATPA : T2DPointArray;
      x, y, i, HA, HT : Integer;
     
    const
      X1 = 167;
      X2 = 350;
      Y1 = 32;
      Y2 = 486;
     

    procedure findAllYellow; //Finds all yellow gems and moves mouse over them
    begin
      If FindColorsTolerance(MyTPA, 23697, X1, Y1, X2, Y2, 0) Then
        H := High(MyTPA);
        for i := 0 to H do
        begin
          Writeln('(' + IntToStr(MyTPA[i].x)+ ','+ IntToStr(MyTPA[i].y)+')');
          GetColor(MyTPA[i].x, MyTPA[i].y);
          xx := MyTPA[i].x + 40;
          if GetColor(MyTPA[i].x + 40, MyTPA[i].y) = 23697 then
          begin
            Mouse(xx, MyTPA[i].y, 0, 0, true);
            Mouse(MyTPA[i].x, MyTPA[i].y, 0, 0, true);
          end else
          Writeln('ugh');
        end;
    end;


    procedure findYellowDouble; //Tries to find 2 yellow gems next to eachother
    begin
      If FindColorsTolerance(MyTPA, 23697, X1, Y1, X2, Y2, 0) Then
        ATPA := TPAToATPAEx(MyTPA, 1, 40);
        HT := High(MyTPA);
        HA := High(ATPA);
        for i := 0 to HT do
          if length(ATPA) = 2 then
          begin
          Mouse(MyTPA[i].x, MyTPA[i].y, 0, 0, true);
          end else
          writeln('damn');
    end;




    Begin
      Setupsrl;
      ActivateClient;
      FindYellow;
    end.




    So basically what i want the function to do is, find the two gems highlighted in red then find the same matching gem (If there is one) that can be moved next to the two highlighted gems.

    Any Help would be very appreciated.
    Take a look at a new OpenDepositBox here.

  2. #2
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Your gonna want to make Tpoint boxes the size of each square. Then do a for to do loop going though each box, and each gem. As you do that you want to search one box over/under/left/right, and if that comes up true, then you want to search over/under/left/right (whivhever one was true the first time) X2 (since the next gem will be TWO boxes away). Sorry no code, that just an idea for making it.

    Im pretty sure SRL's inventory.scar should actually help out a lot with all of the box cords/slots ect. (rs inventory is basically a series of squares, so is bejewled).

    So once again, sorry no code, just some ideas, but its something! Good Luck

  3. #3
    Join Date
    Jun 2009
    Location
    New Jersey
    Posts
    154
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok, i think i know what you mean. I'll try it out. Thanks for the help YoHoJo ^.^
    Take a look at a new OpenDepositBox here.

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
  •