Results 1 to 3 of 3

Thread: Finding Uptext

  1. #1
    Join Date
    Dec 2011
    Location
    United States
    Posts
    960
    Mentioned
    21 Post(s)
    Quoted
    504 Post(s)

    Default [Answered] Finding Uptext

    Any ideas of why it wont find the uptext? It successfully moves the mouse to a point where the uptext is present but it fails to check the uptext.

    Code:
    program new;
    {$i srl/srl.simba}
    {$i sps/sps.simba}
    var
    x,y:integer;
    
    
    
    
    Procedure ReturnValues(colors: TIntegerArray; var HueMods, SatMods: Extended; var color, Tolerance: Integer);
      Var
        h, s, t: Extended;
        I,II : integer;
        HSLColor : Array[1..3] of Extended;
        HSL : Array[0..1] of Array[1..3] of Extended;
      begin;
        For I:= 1 to 3 do
        begin;
          HSL[0][i] := 255;
        end;
    
        For I:= 0 to High(Colors) do
        begin;
          ColortoHSL(Colors[i],HSLColor[1],HSLColor[2],HSLColor[3]);
          For II:= 1 to 3 do
          begin;
            HSL[0][II] := MinE(HSLColor[II],HSL[0][II]);
            HSL[1][II] := MaxE(HSLColor[II],HSL[1][II]);
          end;
        end;
    
        H := (HSL[1][1] - HSL[0][1]);
        S := (HSL[1][2] - HSL[0][2]);
        T := (HSL[1][3] - HSL[0][3]);
    
        try
          HueMods := (H/T);
          SatMods := (S/T);
          Tolerance := Round(t);
        except
          HueMods := 0;
          SatMods := 0;
          Tolerance := Round(0.0);
        end;
    
        Color := HSLToColor((HSL[1][1] + HSL[0][1]) div 2,(HSL[1][2] + HSL[0][2]) div 2,(HSL[1][3] + HSL[0][3]) div 2);
      end;
    
    Function FindFishingSpot(Var X,Y: Integer): Boolean;
      var
        B: TBox;
        TPA: TPointArray;
        Hmod,Smod: Extended;
        L,i,Tol,CTS,Col: Integer;
        ATPA: T2DPointArray;
      begin
        Result := False;
    
        ReturnValues([5345425,6466990,5279375 ,5273457], Hmod, Smod, Col, Tol);
        CTS := GetColorToleranceSpeed;
        ColorToleranceSpeed(2);
        SetColorSpeed2Modifiers(Hmod, SMod);
        FindColorsSpiralTolerance(MSCX, MSCY, TPA, Col, MSX1, MSY1, MSX2, MSY2, Tol);
        ColorToleranceSpeed(CTS);
        if (Length(TPA) < 1) then
          Exit;
        ATPA := TPAToATPAEx(TPA, 40, 40);
        SortATPAFrom(ATPA, Point(MSCX,MSCY));
        L := High(ATPA);
        SetArrayLength(ATPA, L+1);
        for i := 0 to L do
        begin
          if (GetArrayLength(ATPA[i]) > 5) then
          begin
            B := GetTPABounds(ATPA[i]);
    
            MiddleTPAEx(ATPA[i], X, Y);
            MMouse(X, Y, 2, 2);
            if WaitUpTextMulti(['ick', 'Pic'], 400) then
            begin
              Result := True;
              GetMousePos(X, Y);
              Exit;
              writeln('Found Spot');
            end else
              Result := False;
    
          end;
        end;
      end;
    
    begin
        MouseSpeed := RandomRange(15, 25);
     If FindFishingSpot(x, y) then
     WriteLn(x);
     WriteLn(y);
    end.
    Last edited by Wetish; 08-12-2012 at 12:43 AM.

  2. #2
    Join Date
    Oct 2008
    Location
    behind you!
    Posts
    1,688
    Mentioned
    2 Post(s)
    Quoted
    40 Post(s)

    Default

    Does this also happen with your script only or other scripts too? In that case try to re-install everything related to simba

    Edit: nvm found the problem

    Simba Code:
    begin
              Result := True;
              GetMousePos(X, Y);
              Exit;              // REMOVE THIS
              writeln('Found Spot');
            end else
              Result := False;
              // It should be here i think.
          end;
        end;
      end;
    Last edited by Tickyy; 08-11-2012 at 11:43 PM.
    Hi

  3. #3
    Join Date
    Dec 2011
    Location
    United States
    Posts
    960
    Mentioned
    21 Post(s)
    Quoted
    504 Post(s)

    Default

    Quote Originally Posted by Tickyy View Post
    Does this also happen with your script only or other scripts too? In that case try to re-install everything related to simba

    Edit: nvm found the problem

    Simba Code:
    begin
              Result := True;
              GetMousePos(X, Y);
              Exit;              // REMOVE THIS
              writeln('Found Spot');
            end else
              Result := False;
              // It should be here i think.
          end;
        end;
      end;
    Thanks

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
  •