Issue: progressScreen.isOpen()

  1. issueid=454 08-10-2015 11:38 AM
    SRL Member
    progressScreen.isOpen()
    progressScreen.isOpen() not working correctly for enchanting and possibly smithing

    The top line that is detected in isOpen() is opaque for some of the progressScreens, instead of a set colour. The bottom colour is also different for the magic progress screen.

    Here is an image of the difference:


    I solved the problem by overriding the function inside my script with:

    Simba Code:
    function TRSProgressScreen.__find(): boolean; override;
    const
      BORDER_COLOR = 5327681;
      BORDER_COLOR_BOTTOM = 5919042;
      BORDER_LENGTH = 226;
      BORDER_COLOR_MAGIC_BOTTOM=5458490;
      BORDER_LENGTH_MAGIC=232;
    var
      tpa: TPointArray;
      atpa: T2DPointArray;
      i, hh: integer;
      b: TBox;
      p: TPoint;
    begin
      result := false;

      if (not findColors(tpa, BORDER_COLOR, getClientBounds())) then
        exit();

      atpa := tpa.cluster(1);
      hh := high(atpa);

      for i := 0 to hh do
        if (length(atpa[i]) = BORDER_LENGTH) then
        begin
          b := atpa[i].getBounds();

          if (getColor(b.x1 - 34, b.y1 + 125) = BORDER_COLOR_BOTTOM) then
          begin
            self.setBounds([b.x1 - 54, b.y1 + 2, b.x2 + 58, b.y2 + 148]);
            exit(true);
          end;
        end else if (length(atpa[i]) = BORDER_LENGTH_MAGIC) then
        begin
          b := atpa[i].getBounds();

          if (getColor(b.x1 - 34, b.y1 + 102) = BORDER_COLOR_MAGIC_BOTTOM) then
          begin
            self.setBounds([b.x1 - 54, b.y1 + 2 - 23, b.x2 + 58, b.y2 + 125]);
            exit(true);
          end;
        end;
    end;

    In IRC, the Mayor said that it was not general enough to accept this solution as is, but feel free to use the provided code in any way you like.
Issue Details
Issue Number 454
Project SRL Bugs and Suggestions
Status Resolved
Users able to reproduce bug 0
Users unable to reproduce bug 0
Assigned Users The Mayor
Tags (none)




  1. 08-12-2015 07:29 AM
    Issue Changed by The Mayor
    • Status changed from Unconfirmed to Confirmed
    • User assignments modified
  2. 08-12-2015 08:10 AM
    Issue Changed by The Mayor
    • Status changed from Confirmed to Resolved
+ Reply