Results 1 to 11 of 11

Thread: Quick Help Please

  1. #1
    Join Date
    Jul 2007
    Location
    Mo-Town
    Posts
    259
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Quick Help Please

    Hey Everyone.

    I am making a firemaking script and I am working on the walking for it (I am using reflection). Whenever I run it I get This error and I can't figure out how to fix it.
    SCAR Code:
    Line 80: [Hint] (17911:10): Variable 'Result' never used in script E:\Program Files\SCAR 3.15\Scripts\MyBurner.scar
    Line 106: [Error] (17937:1): Identifier expected in script E:\Program Files\SCAR 3.15\Scripts\MyBurner.scar

    Here is the function with the line in question bolded.

    SCAR Code:
    Function WalkToStart: Boolean;
    begin
      If (StartNumber = 1) then
        If WalkPath(Start1,8) then
          Begin
            Result := True;
            Writeln('Walked to Start Position One')
            StartNumber := StartNumber + 1;
          end;
        [B]else Writeln('Couldn''t Walk to Start Position One');[/B]
      else if (StartNumber = 2) then
        If WalkPath(Start2,8) Then
          Begin
            Result := True;
            Writeln('Walked to Start Position Two')
            StartNumber := StartNumber - 1;
          end;
        else Writeln('Couldn''t Walk to Start Position One');
      else Writeln('WTF Invalid StartNumber Value');
    end;

    If Anyone can help it would be appreciated and I will rep anyone that helps.
    Also, Here is the whole script if you want to give feedback/ideas. It is nowhere close to done so I know I have a lot to do.

    SCAR Code:
    program New;
    {.include srl/srl/misc/smart.scar}
    {.include srl/srl.scar}
    {.incluse srl/srl/skill/firemaking.scar}
    {.include srl/srl/reflection/reflection.scar}

    var
      StartNumber:integer;
    var
      Bank, Start1, Start2: TPointArray;
     
    Const
      SmartWorld = 66;

    {if openbankglass('db',true,true) then
      if pinscreen then
         inpin('')
      if bankscreen then
         writeln('Opened Bank')
      else writeln('Coulnd''t open the bank')}



    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name := '';          //Runescape Username.
      Players[0].Pass := '';        //Password for Runescape Username.
      Players[0].Nick := 'ike';              //3-4 consecutive letters from Username.
      Players[0].Active := True;            //Player is active.
    end;

    Procedure LoadPaths;
    begin
      SetLength(Bank, 2);
      Bank[0] := (Point(2598, 3097));
      Bank[1] := (Point(2613, 3094));
                 
      SetLength(Start1, 1);
      Start1[0] := (Point(2608, 3098));
                 
      SetLength(Start2, 1);
      Start2[0] := (Point(2607, 3097));
    end;

    //Editted by Drags111 to work for WalkPath;
    {*******************************************************************************
    function WalkToPathTile(Tile: TPoint; Randomness: Integer): Boolean;
    By: Wizzup and TheGuyWhoGotOn / Drags111
    Description: Took any Flag procedures out to fit my WalkPath needs.
    *******************************************************************************}

    function WalkToPathTile(Tile: TPoint; Randomness: Integer): Boolean;
    var
       wTile: TPoint;
       t: Integer;
    begin
      Tile.X := RandomRange(Tile.X-Randomness, Tile.X+Randomness);
      Tile.Y := RandomRange(Tile.Y-Randomness, Tile.Y+Randomness);
      wTile := TileToMM(Tile);
      While not TileOnMM(Tile) do wait(100+Random(200));
      if not TileOnMM(Tile) then
      begin
        Result := False;
        Writeln('Tile not on MM!');
        Exit;
      end;
      Result := True;
      Mouse(wTile.x, wTile.y, 0, 0, true);
      t := getsystemtime;
      Result := (GetSystemTime - t) < 60000;
    end;

    {*******************************************************************************
    function WalkPath(Path: TPointArray): boolean;
    By: Drags111
    Description: Walks path (Path) human like. Usage: WalkPath(LoadPath1); (example)
    *******************************************************************************}

    function WalkPath(Path: TPointArray; FlagDist: Integer): boolean;
    var
      i: integer;
    begin
      if not WalkToPathTile(Path[i], 2)then Exit;
      for i := 0 to High(Path) do
      begin
        if i < High(Path) then
        begin
          while not TileOnMM(Point(Path[i+1].x, Path[i+1].y)) do wait(100+Random(100));
          wait(200+Random(700));
          WalkToPathTile(Path[i+1], 1);
        end else FFlag(FlagDist);
        wait(400+Random(200));
      end;
    end;

    Function WalkToStart: Boolean;
    begin
      If (StartNumber = 1) then
        If WalkPath(Start1,8) then
          Begin
            Result := True;
            Writeln('Walked to Start Position One')
            StartNumber := StartNumber + 1;
          end;
        else Writeln('Couldn''t Walk to Start Position One');
      else if (StartNumber = 2) then
        If WalkPath(Start2,8) Then
          Begin
            Result := True;
            Writeln('Walked to Start Position Two')
            StartNumber := StartNumber - 1;
          end;
        else Writeln('Couldn''t Walk to Start Position One');
      else Writeln('WTF Invalid StartNumber Value');
    end;

    Function WalkToBank: Boolean;
    begin
      If WalkPath(Bank,8) Then
        Result := True
      else Begin
        Writeln('Couldn''t Walk To Bank')
        Nextplayer(False);
      end;
    end;

    procedure FireWait;   //By Dankness, Edited by me
    var
      i: Integer;
      s: string;
    begin
      LastChatter(s);
      if (Pos('att', s) > 0) or (Pos('emp', s) > 0) or (Pos('lig', s) > 0) then
      begin
        repeat
          Wait(100 + Random(100));
          FindTalk;
          if (not (LoggedIn)) then
            Exit;
          LastChatter(s);
          Inc(i);
        until (Pos('cat', s) > 0) or (Pos('and', s) > 0) or (Pos('ire', s) > 0) or (i > 35);
      end else wait(1350+Random(100));
    end;

    Procedure BurnLogs;
    var i,x,y:integer;
    begin
      for i := 2 to 28 do
      if(ExistsItem(i)) then
        begin
          mouseitem(1,true);
          wait(50+random(100));
          mmouseitem(i);
          wait(50+random(100));
          if (IsUpText('og')) then
          begin
            GetMousePos(x, y);
            mouse(x,y,0,0,true);
          end else mouseitem(i + 1, true);
          wait(100+random(100));
          FireWait;
          FindNormalRandoms;
        end;
      for i := 2 to 28 do
      if(ExistsItem(i)) then
        begin
          mouseitem(1,true);
          wait(50+random(100));
          mmouseitem(i);
          if (IsUpText('og')) then
          begin
            GetMousePos(x, y);
            mouse(x,y,0,0,true);
          end else mouseitem(i + 1, true);
          wait(50+random(200));
          FireWait;
          FindNormalRandoms;
        end;
    end;

    Procedure SetupSMART;
    begin
      SmartSetupEx(SmartWorld, False, True, False);
      SetTargetDC(SmartGetDC);
    end;

    begin
      setupsrl;
      setupfiremaking;
      declareplayers;
      StartNumber := 1
      activateclient;
      wait(500+random(500));
      {burnlogs;}
      If WalkToBank then
        Writeln('Walked to Bank');
      else Writeln('Couldn''t Walk To Bank!')
    end.
    Quote Originally Posted by Napolean
    In Politics, Stupidity is Not a Handicap
    Quote Originally Posted by Unknown
    Marriage is like a bank. You put it in, Pull it out, then lose interest.

  2. #2
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    Function WalkToStart: Boolean;
    begin
      If (StartNumber = 1) then
        If WalkPath(Start1,8) then
          Begin
            Result := True;
            Writeln('Walked to Start Position One')
            StartNumber := StartNumber + 1;
          end
          else Writeln('Couldn''t Walk to Start Position One');
      else if (StartNumber = 2) then
        If WalkPath(Start2,8) Then
          Begin
            Result := True;
            Writeln('Walked to Start Position Two')
            StartNumber := StartNumber - 1;
          end
        else Writeln('Couldn''t Walk to Start Position One');
      else Writeln('WTF Invalid StartNumber Value');
    end;
    When you do end else, don't put a semicolon after the end

  3. #3
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Rofl look closly,

    SCAR Code:
    'Couldn''t

    you have 2 apostrophes ('). Acutally, you have the problem two times in the function alone, so you mightg wanna look over all your writelns. if you want an apostrophe written by scar for things like "couldn't" then just use

    SCAR Code:
    'Couldn'#39't'//#39 is the apostrophe symbol in scar

    hope im of some help,

    -Blumblebee
    “Ignorance, the root and the stem of every evil.”

  4. #4
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You can use 2 apostrophes to make an apostrophe -.-

  5. #5
    Join Date
    Jul 2007
    Location
    Mo-Town
    Posts
    259
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Still get the same error and actually I'm pretty sure you are wrong about your comment but I'll look at it.
    Quote Originally Posted by Napolean
    In Politics, Stupidity is Not a Handicap
    Quote Originally Posted by Unknown
    Marriage is like a bank. You put it in, Pull it out, then lose interest.

  6. #6
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ummm well ill look more into it, but when u you have a space between you need a + otherwise theres no identifier.

    Edit: 0.0 didnt know you didnt need em
    “Ignorance, the root and the stem of every evil.”

  7. #7
    Join Date
    Jul 2007
    Location
    Mo-Town
    Posts
    259
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I understand what you are saying but I get the same error even if I take out both the apostrophes and just make it
    SCAR Code:
    else Writeln('Couldnt Walk to Start Position One');
    so that is obviously not the problem, Thanks for trying though

    EDIT: Just Tested. If you don't think it works BumbleBee then put this into scar and run it

    SCAR Code:
    program New;
    begin
    writeln('Couldn''t');
    end.

    It will put "Couldn't" In the debug.
    Quote Originally Posted by Napolean
    In Politics, Stupidity is Not a Handicap
    Quote Originally Posted by Unknown
    Marriage is like a bank. You put it in, Pull it out, then lose interest.

  8. #8
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    erm, i think voice in your head answered it btw, if you look at his post.
    “Ignorance, the root and the stem of every evil.”

  9. #9
    Join Date
    Jul 2007
    Location
    Mo-Town
    Posts
    259
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Oh thanks, He hadn't posted a solution but apparently he edited and added.

    EDIT: TViYH I tried what you said and I still get the same error, Thanks for Trying though.
    Quote Originally Posted by Napolean
    In Politics, Stupidity is Not a Handicap
    Quote Originally Posted by Unknown
    Marriage is like a bank. You put it in, Pull it out, then lose interest.

  10. #10
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You really need to work on your standards.
    Don't capitalize bolded words!

    SCAR Code:
    function WalkToStart: Boolean;
    begin
      case StartNumber of
        1: begin
            if WalkPath(Start1, 8) then
            begin
              Result := True;
              WriteLn('Walked to Start Position One.');
              Inc(StartNumber);
            end else
              WriteLn('Couldn''t walk to Start Position One.');
           end;
        2: begin
            if WalkPath(Start2, 8) then
            begin
              Result := True;
              WriteLn('Walked to Start Position Two.');
              StartNumber := StartNumber - 1;
            end else
              WriteLn('Couldn''t walk to Start Position Two.');
           end;
      end;
    end;

  11. #11
    Join Date
    Jul 2007
    Location
    Mo-Town
    Posts
    259
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yea, I know. Write now I'm just trying to get it written out and working then I'll go back and fix the little things like that.

    EDIT: The function using cases works but after changing another small error it compiles then I get this.

    SCAR Code:
    Successfully compiled (4890 ms)
    Line 80: [Hint] (18048:10): Variable 'Result' never used in script E:\Program Files\SCAR 3.15\Scripts\MyBurner.scar
    SRL Compiled in 296 msec
    [Runtime Error] : Out Of Range in line 84 in script E:\Program Files\SCAR 3.15\Scripts\MyBurner.scar

    Line 84 is

    SCAR Code:
    if not WalkToPathTile(Path[i], 2)then Exit;

    which is in

    SCAR Code:
    {*******************************************************************************
    function WalkPath(Path: TPointArray): boolean;
    By: Drags111
    Description: Walks path (Path) human like. Usage: WalkPath(LoadPath1); (example)
    *******************************************************************************}

    function WalkPath(Path: TPointArray; FlagDist: Integer): boolean;
    var
      i: integer;
    begin
      if not WalkToPathTile(Path[i], 2)then Exit;
      for i := 0 to High(Path) do
      begin
        if i < High(Path) then
        begin
          while not TileOnMM(Point(Path[i+1].x, Path[i+1].y)) do wait(100+Random(100));
          wait(200+Random(700));
          WalkToPathTile(Path[i+1], 1);
        end else FFlag(FlagDist);
        wait(400+Random(200));
      end;
    end;

    Normally OutOfRange is do to not setting up declare players right but I don't see anything wrong with it (In mine it has user and pass). And the WalkPath procedure I got from the D-Include (so I wouldn't have to make people download D-Include when I eventually release it).

    Also, here is the full script after edits

    SCAR Code:
    program New;
    {.include srl/srl/misc/smart.scar}
    {.include srl/srl.scar}
    {.include srl/srl/skill/firemaking.scar}
    {.include srl/srl/reflection/reflection.scar}

    var
      StartNumber:integer;
    var
      Bank, Start1, Start2: TPointArray;
     
    Const
      SmartWorld = 66;

    {if openbankglass('db',true,true) then
      if pinscreen then
         inpin('')
      if bankscreen then
         writeln('Opened Bank')
      else writeln('Coulnd''t open the bank')}



    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name := '';          //Runescape Username.
      Players[0].Pass := '';        //Password for Runescape Username.
      Players[0].Nick := 'ike';              //3-4 consecutive letters from Username.
      Players[0].Active := True;            //Player is active.
    end;

    Procedure LoadPaths;
    begin
      SetLength(Bank, 2);
      Bank[0] := (Point(2598, 3097));
      Bank[1] := (Point(2613, 3094));
                 
      SetLength(Start1, 1);
      Start1[0] := (Point(2608, 3098));
                 
      SetLength(Start2, 1);
      Start2[0] := (Point(2607, 3097));
    end;

    //Editted by Drags111 to work for WalkPath;
    {*******************************************************************************
    function WalkToPathTile(Tile: TPoint; Randomness: Integer): Boolean;
    By: Wizzup and TheGuyWhoGotOn / Drags111
    Description: Took any Flag procedures out to fit my WalkPath needs.
    *******************************************************************************}

    function WalkToPathTile(Tile: TPoint; Randomness: Integer): Boolean;
    var
       wTile: TPoint;
       t: Integer;
    begin
      Tile.X := RandomRange(Tile.X-Randomness, Tile.X+Randomness);
      Tile.Y := RandomRange(Tile.Y-Randomness, Tile.Y+Randomness);
      wTile := TileToMM(Tile);
      While not TileOnMM(Tile) do wait(100+Random(200));
      if not TileOnMM(Tile) then
      begin
        Result := False;
        Writeln('Tile not on MM!');
        Exit;
      end;
      Result := True;
      Mouse(wTile.x, wTile.y, 0, 0, true);
      t := getsystemtime;
      Result := (GetSystemTime - t) < 60000;
    end;

    {*******************************************************************************
    function WalkPath(Path: TPointArray): boolean;
    By: Drags111
    Description: Walks path (Path) human like. Usage: WalkPath(LoadPath1); (example)
    *******************************************************************************}

    function WalkPath(Path: TPointArray; FlagDist: Integer): boolean;
    var
      i: integer;
    begin
      if not WalkToPathTile(Path[i], 2)then Exit;
      for i := 0 to High(Path) do
      begin
        if i < High(Path) then
        begin
          while not TileOnMM(Point(Path[i+1].x, Path[i+1].y)) do wait(100+Random(100));
          wait(200+Random(700));
          WalkToPathTile(Path[i+1], 1);
        end else FFlag(FlagDist);
        wait(400+Random(200));
      end;
    end;

    function WalkToStart: Boolean;
    begin
      case StartNumber of
        1: begin
            if WalkPath(Start1, 8) then
            begin
              Result := True;
              WriteLn('Walked to Start Position One.');
              Inc(StartNumber);
            end else
              WriteLn('Couldn''t walk to Start Position One.');
           end;
        2: begin
            if WalkPath(Start2, 8) then
            begin
              Result := True;
              WriteLn('Walked to Start Position Two.');
              StartNumber := StartNumber - 1;
            end else
              WriteLn('Couldn''t walk to Start Position Two.');
           end;
      end;
    end;

    Function WalkToBank: Boolean;
    begin
      If WalkPath(Bank,8) Then
        Result := True
      else Begin
        Writeln('Couldnt Walk To Bank')
        Nextplayer(False);
      end;
    end;

    procedure FireWait;   //By Dankness, Edited by me
    var
      i: Integer;
      s: string;
    begin
      LastChatter(s);
      if (Pos('att', s) > 0) or (Pos('emp', s) > 0) or (Pos('lig', s) > 0) then
      begin
        repeat
          Wait(100 + Random(100));
          FindTalk;
          if (not (LoggedIn)) then
            Exit;
          LastChatter(s);
          Inc(i);
        until (Pos('cat', s) > 0) or (Pos('and', s) > 0) or (Pos('ire', s) > 0) or (i > 35);
      end else wait(1350+Random(100));
    end;

    Procedure BurnLogs;
    var i,x,y:integer;
    begin
      for i := 2 to 28 do
      if(ExistsItem(i)) then
        begin
          mouseitem(1,true);
          wait(50+random(100));
          mmouseitem(i);
          wait(50+random(100));
          if (IsUpText('og')) then
          begin
            GetMousePos(x, y);
            mouse(x,y,0,0,true);
          end else mouseitem(i + 1, true);
          wait(100+random(100));
          FireWait;
          FindNormalRandoms;
        end;
      for i := 2 to 28 do
      if(ExistsItem(i)) then
        begin
          mouseitem(1,true);
          wait(50+random(100));
          mmouseitem(i);
          if (IsUpText('og')) then
          begin
            GetMousePos(x, y);
            mouse(x,y,0,0,true);
          end else mouseitem(i + 1, true);
          wait(50+random(200));
          FireWait;
          FindNormalRandoms;
        end;
    end;

    Procedure SetupSMART;
    begin
      SmartSetupEx(SmartWorld, False, True, False);
      SetTargetDC(SmartGetDC);
    end;

    begin
      setupsrl;
      setupfiremaking;
      declareplayers;
      StartNumber := 1
      activateclient;
      wait(500+random(500));
      {burnlogs;}
      If WalkToBank then
        Writeln('Walked to Bank');
    end.
    Quote Originally Posted by Napolean
    In Politics, Stupidity is Not a Handicap
    Quote Originally Posted by Unknown
    Marriage is like a bank. You put it in, Pull it out, then lose interest.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Just a quick question? Did I say quick?
    By SeanJohn in forum OSR Help
    Replies: 3
    Last Post: 01-28-2009, 12:03 AM
  2. I need some quick help
    By AJ2VM in forum OSR Help
    Replies: 45
    Last Post: 12-19-2007, 03:17 PM
  3. quick ? plz
    By rjbk1989 in forum OSR Help
    Replies: 3
    Last Post: 05-07-2007, 12:43 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
  •