Results 1 to 6 of 6

Thread: My Scirpt is not stoping

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

    Default My Scirpt is not stoping

    Well now it does some loads then stops with no proggy or anything please help
    SCAR Code:
    Program New;
    {.include SRL/SRL.scar}
    {.include srl/srl/misc/Reports.scar}

    Var x, y, i, LoadsDone, Loads2Do, Tree, LogsCut, AntibanUsed, Timer, Failed, A: 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]:= 10;        // Loads to Do.
       Players[0].Strings[0] := 'normal'; // ALL lowercase; normal, oak, willow, normal/oak (To make less botty)
       Players[0].Strings[1] := 'true';   // Is your axe equipped? Lowercase
    end;

    Procedure Spin;
    begin
    MarkTime(Timer);
    repeat
    Case Random(4) of
    1: begin
       MakeCompass('N');
       end;
    2: begin
       MakeCompass('E');
       end;
    3: begin
       Makecompass('W');
       end;
    4: begin
       MakeCompass('s');
       end;
    end;
       begin
       Wait(250 + random(500));
       end;
    until (TimeFromMark(Timer) > 2000+random(1000))
    end;

    Procedure AntiBan;
    begin
      if not LoggedIn then Exit;
      Inc(AntibanUsed);
      case 7+random(18) of
        0: HoverSkill('Random', false);
        1: PickUpMouse;
        3: BoredHuman;
        4: begin
             MakeCompass('N');
             wait(10+random(55));
             MakeCompass('S');
             wait(10+random(55));
             MakeCompass('N');
           end;
        5: RandomRClick;
        6: RandomMovement;
        10: Spin;
      end;
    end;

    procedure AntiRandoms;
    begin
      LampSkill := 'Woodcutting';
      FindNormalRandoms;
    end;

     Procedure SetTree;
    begin
       case lowercase(Players[CurrentPlayer].Strings[0]) of
       'normal' : begin
                    Tree := 4555383;
                    Text := ['ree']
                    end;
       'oak'    : begin
                    Tree := 5017731;
                    Text := ['Oak']
                    end;
       'willow' : begin
                    Tree := 6653571;
                    Text := ['illow']
                    end;
     'normaloak':begin
                    Tree := 4555383;
                    Text := ['ree', 'Oak', 'ak']
                    end;
       end;
    end;

    procedure Drop;
    begin
     Inc(LoadsDone);
        case lowercase(Players[CurrentPlayer].Strings[1]) of
        'true': begin
                 for i:= 1 to 28 do
                  begin
                    DropAll;
                    IncEx(LogsCut, 28);
                  end;
                end;
        'false': begin
                  for i:= 2 to 28 do
                   begin
                     DropItem(i);
                     IncEx(LogsCut, 27);;
                   end;
                 end;
        end;
        AntiBan;
        AntiRandoms;
    end;



    Procedure CutTree;
    Begin
      If (not LoggedIn) then
       Exit;
       MouseSpeed := RandomRange(14, 19);
        begin
         MarkTime(Timer);
          repeat
           if(TimeFromMark(Timer) > 600000+random(100000))then
            begin
             Writeln('Problem chopping the logs');
             Exit;
            end;
             SetTree;
             FindObjTPA(x, y, Tree, 7, 2, 20, 20, 12, Text);
             GetMousePos(x,y);
              if(random(2) = 1)then
               begin
                 Mouse(x, y, 0, 0, False);
                 Wait(1500 + Random(2000));
                 ChooseOption('hop');
               end else
                 begin
                  Mouse(x, y, 0, 0, True);
                  Wait(4500 + Random(3000));
                  AntiRandoms;
                  AntiBan;
                 end;
                   if not(FindObjTPA(x, y, Tree, 7, 2, 20, 20, 12, Text)) then
                     repeat
                       Spin;
                       AntiBan;
                       Wait(6000 + random(1000));
                       Inc(Failed);
                     until (FindObjTPA(x, y, Tree, 7, 2, 20, 20, 12, Text)) or (Failed = 7);
                       if (Failed = 7) then
                       NextPlayer(False);
          until (Invfull)
        end;
    end;

    Procedure Intro;
    begin
      ClearDebug;
      Writeln('                                 ____________     ')
      Wait(100)
      Writeln('                                / Thanks     \    ')
      Wait(100)
      Writeln('                               /     For      \   ')
      Wait(100)
      Writeln('                              /       Using    \  ')
      Wait(100)
      Writeln('                              |         Power   | ')
      Wait(100)
      Writeln('                              |        Tree     | ')
      Wait(100)
      Writeln('                               \      Noobe     / ')
      Wait(100)
      Writeln('                                \______________/  ')
      Wait(100)
      Writeln('           Please post Proggys      |     |       ')
      Wait(100)
      Writeln('           And Bugs                 |     |       ')
      Wait(100)
      Writeln('           Thanks                   |     |       ')
      Wait(100)
      Writeln('                                    |     |       ')
      Wait(100)
      Writeln('                                    |_____|       ')
      Writeln('          By Rya                                  ')
      Wait(750)
    end;


    Procedure Proggy;
    begin
      ClearDebug;
      Writeln('===================================');
      Writeln('===== Time Running : ' + TimeRunning);
      Writeln('===== Logs Cut     : ' + IntToStr(LogsCut));
      Writeln('===== Loads Done   : ' + IntToStr(LoadsDone));
      Writeln('===== This is Version  1.1');
      Writeln('===== Please Post This Proggy');
      Writeln('===================================');
    end;

    Procedure Mainloop;
    begin
      DeclarePlayers;
      LoginPlayer;
      LoadsDone := 0;
      MakeCompass('N');
      SetAngle(True);
      Wait(1000);
       repeat
        repeat
          CutTree;
          AntiRandoms;
          AntiBan;
          Drop;
          AntiRandoms;
        until (LoadsDone >= Loads2Do) or (not LoggedIn)
              if LoadsDone >= Loads2Do then
              NextPlayer(False);
              Proggy;
                if (not LoggedIn) then
                NextPlayer(False);
                LoginPlayer;
       until (AllPlayersInactive);
         Proggy;
    end;


    begin
    SetupSRL;
    Intro;
    Mainloop;
    end.
    Last edited by rya; 08-21-2009 at 06:02 AM.

  2. #2
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Do you increasing LoadsDone?
    And if yes it's always better to use "<" and ">" too because the loop might skip just 1 in the counting and it's all messed up.
    I am talking about the lines

    SCAR Code:
    until (LoadsDone = Loads2Do) or (not LoggedIn)
     if LoadsDone = Loads2Do then

    should be

    SCAR Code:
    until (LoadsDone >= Loads2Do) or (not LoggedIn)
     if LoadsDone >= Loads2Do then

    Also take a look at this:
    http://www.villavu.com/forum/showthread.php?t=3293
    Standards are very good to know things.

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

    Default

    Ok thanks but how do you make a player Inactive?

  4. #4
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    NextPlayer(False);

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

    Default

    Quote Originally Posted by NCDS View Post
    NextPlayer(False);
    Thanks

  6. #6
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Just to make one player inactive without doing anything:
    Players[CurrentPlayer].Active := False;

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
  •