Results 1 to 7 of 7

Thread: FindSymbol - Transportation.

  1. #1
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default FindSymbol - Transportation.

    EDIT: Sorry, found it, it was called 'arrow' feel free to delete.

    I am writing a function for my script to check whether it is at the correct location to proceed with doing whatever it needs to at each location, so far I have this.
    Simba Code:
    function CheckLocation: Integer;
    var
      x,y: integer;
    begin
      if FindSymbol(x,y,'bank') then
      begin
        Result := 0;
        WriteLn('We are at the bank.');
      end else
      if FindSymbol(x,y,'altar') then
      begin
        Result := 1;
        WriteLn('We are at the ruins.');
      end else
      if FindSymbol(x,y,'TRANSPORTATION SYMBOL') then
      begin
        Result := 2;
        WriteLn('We are at the altar.');
      end else
      WriteLn('We are not at a known location.');
      TerminateScript;
    end;
    But I'm trying to find a symbol for the 'transportation' icon on the minimap. Like you would find at portals in the essence mine and/or runecrafting altars I have searched through the include and haven't found anything that would suggest there is a pre-made bitmap in the include for this, do I need to make my own bitmap?
    Last edited by P1ng; 06-07-2012 at 05:25 AM. Reason: Sorry, found it, it was called 'arrow' feel free to delete.

  2. #2
    Join Date
    Dec 2011
    Location
    The Netherlands
    Posts
    1,631
    Mentioned
    47 Post(s)
    Quoted
    254 Post(s)

    Default

    This achieves the same with less lines:
    Simba Code:
    function CheckLocation: String;
    var
      X, Y, i: integer;
      Symbols: Array of String;

    begin
      Symbols := ['bank', 'altar', 'arrow'];
      for i:=0 to 2 do
        begin
          if FindSymbol(X, Y, Symbols[i]) then
            begin
              Result := Symbols[i];
              Break;
            end;
        end;
    end;
    Other then that, good you got it sorted out :P

    Then you can have a case to define where you are in the mainloop
    Simba Code:
    //Mainloop;
    begin
      case CheckLocation of
        'bank':  begin
                   WriteLn('We are at the bank');
                   //Banking procedures
                 end;
        'altar': begin
                   WriteLn('We are at the ruins');
                   //Ruins procedures
                 end;
        'arrow': begin
                   WriteLn('We are at the altar');
                   //Altar procedures
                 end;
      end;
    end.
    Last edited by J J; 06-07-2012 at 07:57 AM.

    Script source code available here: Github

  3. #3
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    Thanks for the reply but I ended up separating it up into individual functions so that it would return a boolean and I could use it with WaitFunc

  4. #4
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Btw you know there are symbol constants, like Symbol_Bank instead of 'bank'

  5. #5
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    What is the difference between using them and the string?

  6. #6
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by p1ng View Post
    What is the difference between using them and the string?
    In SRL 6 it is likely that they will be updated to integers, if you change to constants now then your scripts won't be broken by it

  7. #7
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    Ahh, great to know! thank-you very much

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
  •