Results 1 to 5 of 5

Thread: Function FindTalismanInBank

  1. #1
    Join Date
    Apr 2007
    Location
    Australia
    Posts
    4,163
    Mentioned
    9 Post(s)
    Quoted
    19 Post(s)

    Default Function FindTalismanInBank

    SCAR Code:
    {*******************************************************************************
    function FindTalismanInBank(TalismanName: String; tol: Integer): Boolean;
    By: The Claw - base on FindTalismanInInvent by Bebemycat2
    Description: Returns true if the specifyed talisman is in bank
    air - mind - water - earth - fire - body - cosmic - chaos - nature - law - death
    *******************************************************************************}


    function FindTalismanInBank(TalismanName: string; tol: Integer): Boolean;
    begin
      case LowerCase(TalismanName) of
        'air':
          begin
            if (FindBitmapToleranceIn(talis_air, x, y, MSX1, MSY1, MSX2, MSY2, tol))
              then
              Result := True
            else
              Result := False
          end;
        'mind':
          begin
            if (FindBitmapToleranceIn(talis_mind, x, y, MSX1, MSY1, MSX2, MSY2, tol))
              then
              Result := True
            else
              Result := False
          end;
        'water':
          begin
            if (FindBitmapToleranceIn(talis_water, x, y, MSX1, MSY1, MSX2, MSY2,
              tol)) then
              Result := True
            else
              Result := False
          end;
        'earth':
          begin
            if (FindBitmapToleranceIn(talis_earth, x, y, MSX1, MSY1, MSX2, MSY2,
              tol)) then
              Result := True
            else
              Result := False
          end;
        'fire':
          begin
            if (FindBitmapToleranceIn(talis_fire, x, y, MSX1, MSY1, MSX2, MSY2, tol))
              then
              Result := True
            else
              Result := False
          end;
        'body':
          begin
            if (FindBitmapToleranceIn(talis_body, x, y, MSX1, MSY1, MSX2, MSY2, tol))
              then
              Result := True
            else
              Result := False
          end;
        'cosmic':
          begin
            if (FindBitmapToleranceIn(talis_cosmic, x, y, MSX1, MSY1, MSX2, MSY2,
              tol)) then
              Result := True
            else
              Result := False
          end;
        'chaos':
          begin
            if (FindBitmapToleranceIn(talis_chaos, x, y, MSX1, MSY1, MSX2, MSY2,
              tol)) then
              Result := True
            else
              Result := False
          end;
        'nature':
          begin
            if (FindBitmapToleranceIn(talis_nature, x, y, MSX1, MSY1, MSX2, MSY2,
              tol)) then
              Result := True
            else
              Result := False
          end;
        'law':
          begin
            if (FindBitmapToleranceIn(talis_law, x, y, MSX1, MSY1, MSX2, MSY2, tol))
              then
              Result := True
            else
              Result := False
          end;
        'death':
          begin
            if (FindBitmapToleranceIn(talis_death, x, y, MSX1, MSY1, MSX2, MSY2,
              tol)) then
              Result := True
          end;
      end;
      FreeBitmap(talis_air)
      FreeBitmap(talis_body)
      FreeBitmap(talis_chaos)
      FreeBitmap(talis_cosmic)
      FreeBitmap(talis_death)
      FreeBitmap(talis_earth)
      FreeBitmap(talis_fire)
      FreeBitmap(talis_law)
      FreeBitmap(talis_mind)
      FreeBitmap(talis_nature)
      FreeBitmap(talis_water)
    end;

    Based heavily on FindTalismanInInvent by bebemycat. When I was updating my runecrafter, I thought this would be handy so I made a couple of changes and here it is.

    If you want to use it for whatever reason, remember to LoadSRLTalismanBitmaps before calling this.

  2. #2
    Join Date
    Jan 2007
    Location
    Kansas
    Posts
    3,760
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Very good for runecrafters


  3. #3
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    Nice

    You could shorten it a bit:

    SCAR Code:
    case LowerCase(TalismanName) of
      'air' : Bitmap := talis_air;
      'water' : Bitmap := talis_water;
    end;

    Result := FindBitmap(Bitmap, x, y, MSX1, MSY1, MSX2, MSY2, tol);
    FreeBitmap(Bitmap);
    Hup Holland Hup!

  4. #4
    Join Date
    Jan 2007
    Location
    Kansas
    Posts
    3,760
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Then you dont get the joy of scripting


  5. #5
    Join Date
    Apr 2007
    Location
    Australia
    Posts
    4,163
    Mentioned
    9 Post(s)
    Quoted
    19 Post(s)

    Default

    oh yup, true that nielsie. man, i suck at making code short lol.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 02-27-2008, 05:20 PM
  2. Replies: 2
    Last Post: 02-26-2008, 08:26 PM
  3. Any function that does this?
    By shadowpwner in forum OSR Help
    Replies: 2
    Last Post: 08-14-2007, 03:15 AM
  4. [FUNCTION] FindDoorColour: integer; By ZephyrsFury [FUNCTION]
    By ZephyrsFury in forum Research & Development Lounge
    Replies: 10
    Last Post: 07-27-2007, 08:45 AM

Posting Permissions

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