Results 1 to 11 of 11

Thread: Unknown identifier 'DropTo'

  1. #1
    Join Date
    Sep 2007
    Posts
    638
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Unknown identifier 'DropTo'

    I get this

    Line 160: [Error] (16541:7): Unknown identifier 'DropTo' in script
    When trying to run this

    SCAR Code:
    procedure Drops;
    begin
    if not (LoggedIn) then exit;
    if (InvFull) then
    begin
      case [WieldAxe] of
        True: DropTo(2,28); ///////line of the error
        False: DropAll;
      end;
    end;
    end;

    WieldAxe is a constant

    SCAR Code:
    WieldAxe = True;       //Are you wielding the axe? False for no

    Using SCAR 3.15b and revisoin #31 (I think, I already tried reinstalling SRL)

  2. #2
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    DropTo was taken out of SRL?

    SCAR Code:
    {*******************************************************************************
    Procedure DropAllExcept(A : Array of Integer);
    By: Sand Storm
    Description: Drops everything except the user defined inventory spaces.
    *******************************************************************************}

    procedure DropAllExcept(A : Array of Integer);
    var
      i: Integer;
    begin
      If (Not (LoggedIn)) Then Exit;
      For I:=1 To 28 Do
           if not(InIntArray(a, i)) then
             DropItem(i);
    end;

    Add that in and change it to this:

    SCAR Code:
    true : DropAllExcept([1]);

    ~Sandstorm

  3. #3
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    SCAR Code:
    procedure Drops;
    begin
      if not (LoggedIn) then exit;
      if (InvFull) then
      begin
        for i:= 2 to 28 do
        begin
          case [WieldAxe] of
            True: DropItem(i);
            False: DropAll;
         end;
       end;
      end;
    end;
    Jus' Lurkin'

  4. #4
    Join Date
    Oct 2007
    Location
    http://ushort.us/oqmd65
    Posts
    2,605
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    There is no thing as dropto anymore (they removed it.)

    Use this.
    SCAR Code:
    procedure Drops;
    begin
    if not (LoggedIn) then exit;
    if (InvFull) then
    begin
      case [WieldAxe] of
        True: begin  
                For I := 2 To 28 Do
                DropItem(I);
                end;

        False: DropAll;
      end;
    end;
    end;

    EDIT: MY IS THE SHORTEST OF ALL 2 ABOVE ME. SO I WIN!
    I do visit every 2-6 months

  5. #5
    Join Date
    Sep 2007
    Posts
    638
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ToF - Wouldn't that try to drop all 27 times if WieldAxe was false?

    Thanks guys. Any idea of why DropTo got removed from SRL?

  6. #6
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    no, because it doesnt use the variable i.
    Jus' Lurkin'

  7. #7
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Torrent of Flame View Post
    no, because it doesnt use the variable i.
    Yes, it would. If it was false, it would drop all, then try again, and again, and again, because every time it loops through, it has to try again.

    ~Sandstorm

  8. #8
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    SCAR Code:
    procedure Drops;
    begin
      if not (LoggedIn) then exit;
      if (InvFull) then
      begin
        begin
          case [WieldAxe] of
            True: for i := 1 to 28 then
                    begin
                      DropItem(i);
                    end;
            False: for i := 2 to 28 then
                     begin
                       DropItem(i);
                     end;
         end;
      end;
    end;
    Jus' Lurkin'

  9. #9
    Join Date
    Sep 2007
    Posts
    638
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Sorry ToF but zasz's is much shorter and easier. Thank you for the help anyway. True only needs to be DropAll;

  10. #10
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    zasz's is backwords... just switch the true and false in the case and its right.

  11. #11
    Join Date
    Sep 2007
    Posts
    638
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yes, but the concept was the right idea.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Hello everyone I need help,Unknown identifier
    By Kasmember13 in forum OSR Help
    Replies: 13
    Last Post: 01-11-2009, 08:33 PM
  2. Replies: 2
    Last Post: 03-25-2008, 12:23 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
  •