Results 1 to 10 of 10

Thread: Help with my First

  1. #1
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Help with my First

    Thanks its now working


    Well i just wrote my first scirpt and i can't even run it could some help me on msn or something please
    Thanks
    Edit: sorry
    SCAR Code:
    Program New;
    {.include SRL/SRL.scar}

    procedure DeclarePlayers;
    begin
       HowManyPlayers := 1; //How many Players
       NumberOfPlayers(HowManyPlayers);
       CurrentPlayer :=0; //Starting Player

       Players[0].Name := '';
       Players[0].Pass := '';
       Players[0].Nick := '';
       Players[0].Active := True;
       Players[0].Integers[0]:= 50;        // Loads to Do.
       Players[0].Strings[0] := 'normal'; // ALL lowercase; normal, oak, willow, maple or yew
       Players[0].Strings[1] := 'True';   // Is your axe equipped?
    end;









    Var x, y, i, LoadsDone, Loads2Do, tree: Integer;
          Text: array of string;


    Procedure CutTree;
    Begin
         If (not LoggedIn) then
          Exit;
           MouseSpeed := RandomRange(14, 19);
           begin
            repeat
              FindObjTPA(x, y, Tree, 30, 2, 15, 25, 10, Text)
              Wait(50 + Random(500));
              MMouse(x, y, 3, 2);
              begin
                Wait(100 + Random(600));
                case Random(2) of
                  0  :  begin
                          Mouse(x, y, 4, 3, False);
                          Wait(200 + Random(100));
                          ChooseOption('hop');
                        end;
                  1  :  begin
                          Mouse(x, y, 3, 4, True);
                        end;
              end;
             until(Invfull) or not FindObjTPA(x, y, Tree, 30, 2, 15, 25, 10, Text);
             while (not FindObjTPA(x, y, Tree, 30, 2, 15, 25, 10, Text)) do
             sWait(300);
             if (not FindObjTPA(x, y, Tree, 30, 2, 15, 25, 10, Text))
             BoredHuman;
             MakeCompass('N');
             SetAngle(True);
    end;

    Procedure SetTree;
    begin
      case lowercase(Players[CurrentPlayer].strings[0]) of
        'normal' : begin
                     Tree := 1461313, 4491386, 2119756;
                     Text := ['Tree', 'Tre', 'ree'];
                   end;
        'oak'    : begin
                     Tree := 3307111, 2251600, 2318161;
                     Text := ['Oak', 'Oa', 'ak'];
                   end;
    end;

    procedure Drop;
    begin
        case lowercase(Players[CurrentPlayer].Strings[1]) of

        'true': begin
                for i:= 1 to 28 do
                  begin
                    DropItem(i);
                  end;
                end;

        'false': begin
                 for i:= 2 to 28 do
                   begin
                     DropItem(i);
                   end;
                 end;
        end;
      end;
    end;

    Procedure Mainloop;
    begin
      LoadsDone := 0;
      MakeCompass('N');
      SetAngle(True);
      Wait(1000);
       repeat
        repeat
          SetTree;
          CutTree;
          Drop;
        until (LoadsDone = Loads2Do) or (not LoggedIn)
        if LoadsDone = Loads2Switch then
           NextPlayer(True);
        if (not LoggedIn) then
           NextPlayer(True);
        LoginPlayer;
      until (AllPlayersInactive);
    end;
     

    begin
    SetupSRL;
    end.
    Is it that i have been looking at out-dated stuff?
    Must be the best noob here first the scirpt then not putting [scar ] then 101 problems with the scirpt itself
    Last edited by rya; 08-19-2009 at 08:53 PM.

  2. #2
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Put the script in between:
    [scar][/scar ]

    Take away the space at the end.

    T~M

  3. #3
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    begin
    SetupSRL;
    end.

    Not gonna work like that.

    Try
    SCAR Code:
    begin
    SetupSRL;
    MainLoop;
    end.

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  4. #4
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by rogeruk View Post
    SCAR Code:
    begin
    SetupSRL;
    end.

    Not gonna work like that.

    Try
    SCAR Code:
    begin
    SetupSRL;
    MainLoop;
    end.
    Sorry thats not how i meant it i can't get it to compile even

  5. #5
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Have you just copied this off of other peoples scripts?
    Because
    1. Loads2Switch - Where is the Const?
    2. If you can code TPAs and stuff but can't even do a mainloop or compile a script....
    Is the error to do with Loads2...?

    T~M

  6. #6
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by The Man View Post
    Have you just copied this off of other peoples scripts?
    Because
    1. Loads2Switch - Where is the Const?
    2. If you can code TPAs and stuff but can't even do a mainloop or compile a script....
    Is the error to do with Loads2...?

    T~M
    Well yes and no i have been trying to do as much as i can myself just to try and make a working scirpt and my error at the moment is

    Identifier expected in script

    that is on line 53
    SCAR Code:
    until(Invfull) or not FindObjTPA(x, y, Tree, 30, 2, 15, 25, 10, Text);

  7. #7
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    SCAR Code:
    Program New;
    {.include SRL/SRL.scar}

    Var x, y, i, LoadsDone, Loads2Do, Tree: Integer;
          Text: array of string;

    procedure DeclarePlayers;
    begin
       HowManyPlayers := 1; //How many Players
       NumberOfPlayers(HowManyPlayers);
       CurrentPlayer :=0; //Starting Player

       Players[0].Name := '';
       Players[0].Pass := '';
       Players[0].Nick := '';
       Players[0].Active := True;
       Players[0].Integers[0]:= 50;        // Loads to Do.
       Players[0].Strings[0] := 'normal'; // ALL lowercase; normal, oak, willow, maple or yew
       Players[0].Strings[1] := 'True';   // Is your axe equipped?
    end;

    //Don't Touch Below
    Procedure CutTree;
    Begin
         If (not LoggedIn) then
          Exit;
           MouseSpeed := RandomRange(14, 19);
           begin
            repeat
              FindObjTPA(x, y, Tree, 30, 2, 15, 25, 10, Text)
              Wait(50 + Random(500));
              MMouse(x, y, 3, 2);
              begin
                Wait(100 + Random(600));
                case Random(2) of
                  0  :  begin
                          Mouse(x, y, 4, 3, False);
                          Wait(200 + Random(100));
                          ChooseOption('hop');
                        end;
                  1  :  begin
                          Mouse(x, y, 3, 4, True);
                        end;
              end;
             until(Invfull) or not FindObjTPA(x, y, Tree, 30, 2, 15, 25, 10, Text);
             while (not FindObjTPA(x, y, Tree, 30, 2, 15, 25, 10, Text)) do
             sWait(300);
             if (not FindObjTPA(x, y, Tree, 30, 2, 15, 25, 10, Text))
             BoredHuman;
             MakeCompass('N');
             SetAngle(True);
    end;

    Procedure SetTree;
    begin
      case lowercase(Players[CurrentPlayer].strings[0]) of
        'normal' : begin
                     Tree := 1461313, 4491386, 2119756;
                     Text := ['Tree', 'Tre', 'ree'];
                   end;
        'oak'    : begin
                     Tree := 3307111, 2251600, 2318161;
                     Text := ['Oak', 'Oa', 'ak'];
                   end;
    end;

    procedure Drop;
    begin
        case lowercase(Players[CurrentPlayer].Strings[1]) of
        'true': begin
                for i:= 1 to 28 do
                  begin
                    DropItem(i);
                  end;
                end;
        'false': begin
                 for i:= 2 to 28 do
                   begin
                     DropItem(i);
                   end;
                 end;
        end;
      end;
    end;

    Procedure Mainloop;
    begin
      LoadsDone := 0;
      MakeCompass('N');
      SetAngle(True);
      Wait(1000);
       repeat
        repeat
          SetTree;
          CutTree;
          Drop;
        until (LoadsDone = Loads2Do) or (not LoggedIn)
        if LoadsDone = Loads2Switch then
           NextPlayer(True);
        if (not LoggedIn) then
           NextPlayer(True);
        LoginPlayer;
      until (AllPlayersInactive);
    end;
     

    begin
    SetupSRL;
    Mainloop;
    end.

    Try that.

    T~M

  8. #8
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by The Man View Post
    SCAR Code:
    Program New;
    {.include SRL/SRL.scar}

    Var x, y, i, LoadsDone, Loads2Do, Tree: Integer;
          Text: array of string;

    procedure DeclarePlayers;
    begin
       HowManyPlayers := 1; //How many Players
       NumberOfPlayers(HowManyPlayers);
       CurrentPlayer :=0; //Starting Player

       Players[0].Name := '';
       Players[0].Pass := '';
       Players[0].Nick := '';
       Players[0].Active := True;
       Players[0].Integers[0]:= 50;        // Loads to Do.
       Players[0].Strings[0] := 'normal'; // ALL lowercase; normal, oak, willow, maple or yew
       Players[0].Strings[1] := 'True';   // Is your axe equipped?
    end;

    //Don't Touch Below
    Procedure CutTree;
    Begin
         If (not LoggedIn) then
          Exit;
           MouseSpeed := RandomRange(14, 19);
           begin
            repeat
              FindObjTPA(x, y, Tree, 30, 2, 15, 25, 10, Text)
              Wait(50 + Random(500));
              MMouse(x, y, 3, 2);
              begin
                Wait(100 + Random(600));
                case Random(2) of
                  0  :  begin
                          Mouse(x, y, 4, 3, False);
                          Wait(200 + Random(100));
                          ChooseOption('hop');
                        end;
                  1  :  begin
                          Mouse(x, y, 3, 4, True);
                        end;
              end;
             until(Invfull) or not FindObjTPA(x, y, Tree, 30, 2, 15, 25, 10, Text);
             while (not FindObjTPA(x, y, Tree, 30, 2, 15, 25, 10, Text)) do
             sWait(300);
             if (not FindObjTPA(x, y, Tree, 30, 2, 15, 25, 10, Text))
             BoredHuman;
             MakeCompass('N');
             SetAngle(True);
    end;

    Procedure SetTree;
    begin
      case lowercase(Players[CurrentPlayer].strings[0]) of
        'normal' : begin
                     Tree := 1461313, 4491386, 2119756;
                     Text := ['Tree', 'Tre', 'ree'];
                   end;
        'oak'    : begin
                     Tree := 3307111, 2251600, 2318161;
                     Text := ['Oak', 'Oa', 'ak'];
                   end;
    end;

    procedure Drop;
    begin
        case lowercase(Players[CurrentPlayer].Strings[1]) of
        'true': begin
                for i:= 1 to 28 do
                  begin
                    DropItem(i);
                  end;
                end;
        'false': begin
                 for i:= 2 to 28 do
                   begin
                     DropItem(i);
                   end;
                 end;
        end;
      end;
    end;

    Procedure Mainloop;
    begin
      LoadsDone := 0;
      MakeCompass('N');
      SetAngle(True);
      Wait(1000);
       repeat
        repeat
          SetTree;
          CutTree;
          Drop;
        until (LoadsDone = Loads2Do) or (not LoggedIn)
        if LoadsDone = Loads2Switch then
           NextPlayer(True);
        if (not LoggedIn) then
           NextPlayer(True);
        LoginPlayer;
      until (AllPlayersInactive);
    end;
     

    begin
    SetupSRL;
    Mainloop;
    end.

    Try that.

    T~M
    Thanks but i still get

    Line 45: [Error] (20170:1): Identifier expected in script

    SCAR Code:
    until(Invfull) or not FindObjTPA(x, y, Tree, 30, 2, 15, 25, 10, Text);

  9. #9
    Join Date
    Jan 2007
    Posts
    834
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You need another end; before the

    Code:
    until(Invfull) or not FindObjTPA(x, y, Tree, 30, 2, 15, 25, 10, Text);

  10. #10
    Join Date
    Aug 2009
    Posts
    242
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Junkj View Post
    You need another end; before the

    Code:
    until(Invfull) or not FindObjTPA(x, y, Tree, 30, 2, 15, 25, 10, Text);
    Thanks i have it working now your great all of you here

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
  •