Results 1 to 2 of 2

Thread: Few different functions

  1. #1
    Join Date
    Jan 2008
    Location
    Alberta
    Posts
    727
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Few different functions

    I will add more when I find more ideas for things to do for skills.

    These look similar, but they're different.

    Camo Kyle has 1 more function that I will add that we both did, I will add that too when I get it.

    Thieving.scar:
    SCAR Code:
    {*******************************************************************************
    function FindStall(var x, y: integer; Text: TStringArray): Boolean;
    By: Iron man
    Description: Finds a thieving stall. Doesn't click, but returns the coords that
    it has.
    For what to put for Text; do only what's partially in the UpText,
    preferably with the UpText being what type of stall it is.
    Example:
    FindStall(x, y, ['aker']); would find a baker's stall if visible.
    Highest angle recommended.
    *******************************************************************************}

    function FindStall(var x, y: integer; Text: TStringArray): Boolean;
    var
      TPA: TPointArray;
      i, hATPA, CTS: integer;
      ATPA: T2DPointArray;
      a: TPoint;
    begin
      CTS := GetColorToleranceSpeed;
      try
        ColorToleranceSpeed(2);
        SetColorSpeed2Modifiers(0.08, 0.67);
        FindColorsTolerance(TPA, 8953773, msx1, msy1, msx2, msy2, 8);
      except
      finally
        ColorToleranceSpeed(CTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
      end;
      if (Length(TPA) = 0) then
      begin
        WriteLn('FindStall could not find any points.');
        Exit;
      end;
      SortTPAFrom(TPA, Point(mscx, mscy));
      ATPA := TPAToATPA(TPA, 35);
      hATPA := High(ATPA);
      for i := 0 to hATPA do
      begin
        a := MiddleTPA(ATPA[i]);
        MMouse(a.x, a.y, 3, 3);
        Wait(150 + random(100));
        if IsUpTextMultiCustom(Text) then
        begin
          Result := True;
          GetMousePos(x, y);
          Exit;
        end;
      end;
      WriteLn('FindStall could not find your stall; it was either already stolen or it was not visible.');
    end;
    Partial credits to Camo Kyle:
    SCAR Code:
    {******************************************************************************
    function FindChest(var rx, ry : Integer) : Boolean;
    By: Iron Man & Camo¤Kyle
    Description: Finds a chest returns the coords that it was located at.
    *******************************************************************************}

    function FindChest(var rx, ry : Integer) : Boolean;
    var
      TPA: TPointArray;
      i, cATPA, CTS: integer;
      ATPA: T2DPointArray;
      x: TPoint;
    begin
      CTS := GetColorToleranceSpeed;
      try
        ColorToleranceSpeed(2);
        SetColorSpeed2Modifiers(0.10, 0.50);
        FindColorsTolerance(TPA, 791579, MSX1, MSY1, MSX2, MSY2, 10);
      except
      finally
        ColorToleranceSpeed(CTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
      end;
      if (Length(TPA) = 0) then
      begin
        WriteLn('FindChest could not find any points.');
        Exit;
      end;
      SortTPAFrom(TPA, Point(MSCX, MSCY));
      ATPA := TPAToATPA(TPA, 15);
      cATPA := High(ATPA);
      for i := 0 to cATPA do
      begin
        x := MiddleTPA(ATPA[i]);
        MMouse(x.x, x.y, 3, 3);
        Wait(150 + random(100));
        if IsUpTextMultiCustom(['est', 'hes', 'Chest', 'hest']) then
        begin
          Result := True;
          GetMousePos(rx, ry);
          Exit;
        end;
      end;
    end;

    Summoning.scar:
    SCAR Code:
    {*******************************************************************************
    function FindObelisk(var x, y: integer; Location: string): Boolean;
    By: Iron man
    Description: Finds a obelisk, only the pouch crafting ones.
    For location, put 'taverly' or 'gutanoth'. It only supports those 2 locations.
    Example:
    FindObelisk(x, y, 'taverly');
    Highest angle recommended.
    *******************************************************************************}

    function FindObelisk(var x, y: integer; Location: string): Boolean;
    var
      TPA: TPointArray;
      ATPA: T2DPointArray;
      CTS, i, hATPA: integer;
      Info: TVariantArray;
      o: TPoint;
    begin
      case LowerCase(Location) of
        'taverly', 'tav', 'falador', 'tavarly, taverli': Info := [10071171, 0.08, 0.25, 14];
      else
        Info := [1998543, 0.78, 1.39, 7];
      end;
      CTS := GetColorToleranceSpeed;
      try
        ColorToleranceSpeed(2);
        SetColorSpeed2Modifiers(Info[1], Info[2]);
        FindColorsTolerance(TPA, Info[0], msx1, msy1, msx2, msy2, Info[3]);
      finally
        ColorToleranceSpeed(CTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
      end;
      if (Length(TPA) = 0) then
      begin
        WriteLn('FindObelisk could not find any points.');
        Exit;
      end;
      SortTPAFrom(TPA, Point(mscx, mscy));
      ATPA := SplitTPA(TPA, 30);
      hATPA := High(ATPA);
      for i := 0 to hATPA do
      begin
        o := MiddleTPA(ATPA[i]);
        MMouse(o.x, o.y, 5, 5);
        Wait(200 + random(100));
        if IsUpText('nfuse') then
        begin
          GetMousePos(x, y);
          Result := True;
          Exit;
        end;
      end;
      WriteLn('FindObelisk failed.');
    end;


    All feedback/comments and ideas for functions for other skills (members included) appreciated.

  2. #2
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    SCAR Code:
    {******************************************************************************
    function FindChest(var rx, ry : Integer) : Boolean;
    By: Iron Man & Camo¤Kyle
    Description: Finds a chest returns the coords that it was located at.
    *******************************************************************************}

    function FindChest(var rx, ry : Integer) : Boolean;
    var
      TPA: TPointArray;
      i, cATPA, CTS: integer;
      ATPA: T2DPointArray;
      x: TPoint;
    begin
      CTS := GetColorToleranceSpeed;
      try
        ColorToleranceSpeed(2);
        SetColorSpeed2Modifiers(0.10, 0.50);
        FindColorsTolerance(TPA, 791579, MSX1, MSY1, MSX2, MSY2, 10);
      except
      finally
        ColorToleranceSpeed(CTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
      end;
      if (Length(TPA) = 0) then
      begin
        WriteLn('FindChest could not find any points.');
        Exit;
      end;
      SortTPAFrom(TPA, Point(MSCX, MSCY));
      ATPA := TPAToATPA(TPA, 15);
      cATPA := High(ATPA);
      for i := 0 to cATPA do
      begin
        x := MiddleTPA(ATPA[i]);
        MMouse(x.x, x.y, 3, 3);
        Wait(150 + random(100));
        if IsUpTextMultiCustom(['est', 'hes', 'Chest', 'hest']) then
        begin
          Result := True;
          GetMousePos(rx, ry);
          Exit;
        end;
      end;
    end;
    Nice

    ~Camo
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Functions
    By lordsaturn in forum OSR Help
    Replies: 1
    Last Post: 08-13-2007, 10:12 PM
  2. Help with some functions
    By Pinqvin in forum OSR Help
    Replies: 6
    Last Post: 03-06-2007, 01:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •