Results 1 to 2 of 2

Thread: FindSymbol messes up

  1. #1
    Join Date
    Oct 2007
    Location
    Denmark
    Posts
    409
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default FindSymbol messes up

    Currently working on a Draynor TreeCutter but my script won't accept 'bank' as a valid input for FindSymbol. Actually it won't accept any inputs at all since they will all create the same error:
    ** Warning in GetSymbolColorIn: bank is not a valid name.**

    My script:
    pascal Code:
    program New;
    {.include SRL/SRL.Scar}
    {.include SRL/SRL/Misc/Users.Scar}
    {.include SRL/SRL/Skill/Woodcutting.Scar}

    const
      RepeatPlayers = True;

    var
      TheFS: Integer;
      Loads: Integer;
      Active: Boolean;
     
    procedure W(WaitTime: Integer);
    begin
      Wait(WaitTime + Random(1000));
    end;

    function FS(Times: Integer): Boolean;
    begin
      if (TheFS >= Times) then
      begin
        TheFS := 0;
        Result := True;
      end;
      Inc(TheFS);
    end;

    procedure Setup;
    begin
      SetupSRL;
      SRLPlayerForm(True, ['Bank Logs'], ['Loads each turn', 'MaxLoads'], [], []);
      Active := RepeatPlayers;
    end;

    procedure Prepare;
    begin
      SetRun(True);
      SetAngle(True);
      MakeCompass('n');
      if (Players[CurrentPlayer].Integers[0] > Players[CurrentPlayer].Integers[1]) or not(FindAxe) then
      begin
        Active := False;
        Logout;
      end;
    end;

    procedure NextMan;
    begin
      if LoggedIn then
        Exit;
      NextPlayer(Active);
      Active := RepeatPlayers;
      Prepare;
    end;

    procedure CheckLocation;
    var
      x, y: Integer;
    begin
      if FindSymbol(x, y, 'bank') then
      begin
        while not FindBank('db') do
        begin
          if FS(10) then
            Break;
          Mouse(x, y, 5, 5, True);
          FFlag(5);
        end;
        Writeln('We have opened the bank');
      end;
    end;

    begin
    Setup;
    repeat
      NextMan;
      CheckLocation;
      //if AtBank then
        //WalkToTrees;
      //Chop;
      //WalkToBank;
      //BankLogs;
    until AllPlayersInactive;
    end.

  2. #2
    Join Date
    Mar 2007
    Posts
    1,700
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Replace line 655 of core/Symbol.scar to
    SCAR Code:
    if (BitmapToString(SymbolBitmap) <> '') and (Color <> 0) then
    If you plan to release your script, then you will want to make sure that everyone using the script does the same.

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
  •