Issue: Update/Fix SetBrightness Function

  1. issueid=313 08-02-2014 08:27 AM
    Registered User
    Update/Fix SetBrightness Function
    SetBrightness contains invalid coordinates for each option

    The coordinates for the SetBrightness function are completely off. I don't know if this is due to an update or just hasn't been changed from the original SRL, but it is currently impossible to change the Brightness using this function. I have tested the code I propose below, and it seems to be working.

    It also seems unnecessary to have "0" as a valid brightness argument if it just exits later on before reaching the code to change the brightness...
    Simba Code:
    if (Brightness=0) then Exit;


    Current Code:
    Simba Code:
    function SetBrightness(Brightness:Integer): Boolean;
    var
      PA: TPointArray;
      P: TPoint;
    begin
      Result:=False;
      if (not loggedin) then Exit;

      if (not GameTab(tab_Options)) then exit;

      if (not InRange(Brightness, 0, 4)) then
        srl_Warn('GameTab ', 'SetBrightness must be between 0 and 4', warn_AllVersions)
      else
      begin
        if (Brightness=0) then Exit;
        SetLength(PA,4);
        PA:= [Point(610,226),Point(641,226),Point(672,226),Point(706,226)];
        P := PA[(Brightness - 1)];
        if (not (GetColor(P.X, P.Y) = 16777215)) then
        begin
          MouseBox(P.X, P.Y, P.X+4, P.Y+4, mouse_left);
          Result:=True;
        end;
      end;
    end;

    A proposed change:
    Simba Code:
    function SetBrightness(Brightness:Integer): Boolean;
    var
      PA: TPointArray;
      P: TPoint;
    begin
      Result:=False;
      if (not loggedin) then Exit;

      if (not GameTab(tab_Options)) then exit;

      if (not InRange(Brightness, 1, 4)) then
        srl_Warn('GameTab ', 'SetBrightness must be between 1 and 4', warn_AllVersions)
      else
      begin
        PA:= [Point(614,290),Point(645,290),Point(676,290),Point(710,290)];
        P := PA[(Brightness - 1)];
        if (not (GetColor(P.X, P.Y) = 10172937)) then
        begin
          MouseBox(P.X, P.Y, P.X+4, P.Y+4, mouse_left);
          Result:=True;
        end;
      end;
    end;
Issue Details
Issue Number 313
Issue Type Task
Project SRL-OSR Bugs and Suggestions
Status Suggested
Votes to perform 1
Votes not to perform 0
Assigned Users (none)
Tags (none)




+ Reply