Results 1 to 9 of 9

Thread: script help

  1. #1
    Join Date
    Mar 2006
    Posts
    81
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default script help

    i haven't scripted before this in over a year so its been difficult trying to get it back. i wanted to post what i am working on just for general advice because i know it needs a lot of things. help would be appreciated.

    also when i try to compile i get this...
    Line 88: [Error] (12540:23): Invalid number of parameters in script
    line 88 is.. if(FindEnt(treecolor1))or
    Code:
    //********* ****     *     *    *      *   ******///////////////////////////
    //    *     *   *    *     *    **    **   *    *//////////////////////////
    //    *     *    *   *     *    * **** *   *   *//////////////////////////
    //*   *     *    *   *     *    *      *   *****/////////////////////////
    //*   *     *   *    *     *    *      *   *    *///////////////////////
    //  * *     ****     *******    *      *   ******//////////////////////
    //////////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////
    ///////Powercutter//////////////////////////////////////////////
    //{  <<===Version 1===<<  }////////////////////////////////////
    ///// PowerCutting////////////////////////////////////////////
    //Ax in first slot///////////////////////////////////////////
    ////////////////////////////////////////////////////////////
    program Cutter;
    {.include SRL\SRL.scar}
    {.include SRL\SRL\skill\woodcutting.scar}
    var x,y,Logs:integer;
    const
    
    
    {  <===SETUP===<<  }
    treecolor1=3432545;
    treecolor2=3432545;
    treecolor3=3432545;
    CutTime   = 4000;
    tol       = 15;
    directiontorun='N';
    runfar=true;
    directionofcompass='N';
    {  <===END SETUP===<<  }
    
    function FindFastRandoms: Boolean; //WT-Fawki
    var
      i: Integer;
    begin
      for i:=1 to 9 do
      begin
        case I of
         1:  If FindDead then
               Result := True;
         2:  If FindMod then
               Result := True;
         3:  If FindMime then
               Result := True;
         4:  If FindMaze then
               Result := True;
         5:  If FindQuiz then
               Result := True;
         6:  If FindDemon then
               Result := True;
         7: begin
               if NoGameTab then
               begin
                 Result := True;
                 Logout;
                 Exit;
               end;
             end;
         7: begin
               if InBlack then
               begin
                 Result := True;
                 Logout;
                 Exit;
               end;
             end;
         8: if(RC)then
              Result := True;
         9: if FindTalk then
              Result := True;
        end;
        wait(1);
      end;
    
      if Result then
    end;
    
    
    
    procedure FindingEnts;/////IEatJ00erBaybees
    var
      Ents: Integer;
    begin
        if(FindEnt(treecolor1))or
        (FindEnt(treecolor2))or
        (FindEnt(treecolor3))then
        begin
          WriteLn('Ent Found');
          RunAwayDirection('N');
          wait(7000+random(3000));
          RunBack;
          Ents := Ents + 1;
        end;
    end;
    
    
    
    
    
    procedure report;
    begin
    ClearReport;
    writeln  ('***********************************************')
    writeln  ('********* ****     *     *    *      *   ******')
    writeln  ('    *     *   *    *     *    **    **   *    *')
    writeln  ('    *     *    *   *     *    * **** *   *   *' )
    writeln  ('*   *     *    *   *     *    *      *   *****' )
    writeln  ('*   *     *   *    *     *    *      *   *    *')
    writeln  (' * *      ****     *******    *      *   ******')
    writeln  ('***********************************************')
    AddToReport('Cutter By Jdumber2k');
    AddToReport('------------------------');
    AddToReport('Cut ' + inttostr(Logs) + ' Logs');
    AddToReport('Avoided ' + inttostr(Ents) + ' Ents');
    end;
    
    procedure CutTrees;
    begin
    repeat
                  if(not(LoggedIn)) then Exit;
              if (FindColorSpiralTolerance(x, y, treecolor1, 454, 454, 454, 454, tol)) or
               (FindColorSpiralTolerance(x, y, treecolor2, 454, 454, 454, 454, tol)) or
               (FindColorSpiralTolerance(x, y, treecolor3, 454, 454, 454, 454, tol)) and
               isupext('ree'); then
               begin
                       wait(1000+random(300));
                       FindingEnts;
                       findfastrandoms;
                       wait(50+random(25));
                       mouse(x,y,0,0,false)
                       wait(50+random(25));
                       chooseoption('Chop')
                       wait(300+random(500))
                       findfastrandoms;
                       Findhead;
                       if(infight)then
                       RunTo(directiontorun,runfar);
                       wait(7000+random(3000));
                       Runback;
                       if FindNewBox then
                       SolveBox;
                       wait(cuttime+random(1000))
                       end;
                       else
                       begin
                       Writeln('Couldnt find a tree!');
                       Logout;
            end;
    Antiban;
    until(InvFull)
    end;
    
    
    
    
    
    
    begin
    Findaxeheadcolor(true);
    repeat
    if(not(LoggedIn)) then Exit;
    MakeCompass(directionofcompass);
    CutTrees;
    Logs:=Logs+27;
    DropToPosition(2,28)
    Report;
    until(false)
    end.

  2. #2
    Join Date
    Jan 2007
    Posts
    117
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    err dificult to look at without standards.. for starters u can remove findhead cause that random no longer happens.
    No Signature Assigned.

  3. #3
    Join Date
    Mar 2006
    Posts
    81
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks for the advice. i don't really play rs anymore so i wouldn't know
    but isnt there a converter that makes ur scripts in standard form? i remember there used to be one

  4. #4
    Join Date
    Aug 2007
    Posts
    282
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by jdumber2k View Post
    thanks for the advice. i don't really play rs anymore so i wouldn't know
    but isnt there a converter that makes ur scripts in standard form? i remember there used to be one
    ive never heard of anything like that.. but there might be

  5. #5
    Join Date
    Mar 2006
    Posts
    81
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i made it a little better lol

    Code:
    //********* ****     *     *    *      *   ******///////////////////////////
    //    *     *   *    *     *    **    **   *    *//////////////////////////
    //    *     *    *   *     *    * **** *   *   *//////////////////////////
    //*   *     *    *   *     *    *      *   *****/////////////////////////
    //*   *     *   *    *     *    *      *   *    *///////////////////////
    //  * *     ****     *******    *      *   ******//////////////////////
    //////////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////
    ///////Powercutter//////////////////////////////////////////////
    //{  <<===Version 1===<<  }////////////////////////////////////
    ///// PowerCutting////////////////////////////////////////////
    //Ax in first slot///////////////////////////////////////////
    ////////////////////////////////////////////////////////////
    program Cutter;
    {.include SRL\SRL.scar}
    {.include SRL\SRL\skill\woodcutting.scar}
    var x,y,Logs:integer;
    const
    
    
    {  <===SETUP===<<  }
    treecolor1=3432545;
    treecolor2=3432545;
    treecolor3=3432545;
    CutTime   = 4000;
    tol       = 15;
    directiontorun='N';
    runfar=true;
    directionofcompass='N';
    {  <===END SETUP===<<  }
    
    function FindFastRandoms: Boolean; //WT-Fawki
    var
      i: Integer;
    begin
      for i:=1 to 9 do
      begin
        case I of
         1:  If FindDead then
               Result := True;
         2:  If FindMod then
               Result := True;
         3:  If FindMime then
               Result := True;
         4:  If FindMaze then
               Result := True;
         5:  If FindQuiz then
               Result := True;
         6:  If FindDemon then
               Result := True;
         7: begin
               if NoGameTab then
               begin
                 Result := True;
                 Logout;
                 Exit;
               end;
             end;
         7: begin
               if InBlack then
               begin
                 Result := True;
                 Logout;
                 Exit;
               end;
             end;
         8: if(RC)then
              Result := True;
         9: if FindTalk then
              Result := True;
        end;
        wait(1);
      end;
    
      if Result then
    end;
    
    
    
    procedure FindingEnts;/////IEatJ00erBaybees
    var
      Ents: Integer;
        begin
        if(FindEnt(treecolor1))or
        (FindEnt(treecolor2))or
        (FindEnt(treecolor3))then
        begin
          WriteLn('Ent Found');
          RunAwayDirection('N');
          wait(7000+random(3000));
          RunBack;
          Ents := Ents + 1;
        end;
    end;
    
    
    
    
    
    procedure report;
    begin
    ClearReport;
    writeln  ('***********************************************')
    writeln  ('********* ****     *     *    *      *   ******')
    writeln  ('    *     *   *    *     *    **    **   *    *')
    writeln  ('    *     *    *   *     *    * **** *   *   *' )
    writeln  ('*   *     *    *   *     *    *      *   *****' )
    writeln  ('*   *     *   *    *     *    *      *   *    *')
    writeln  (' * *      ****     *******    *      *   ******')
    writeln  ('***********************************************')
    AddToReport('Cutter By Jdumber2k');
    AddToReport('------------------------');
    AddToReport('Cut ' + inttostr(Logs) + ' Logs');
    AddToReport('Avoided ' + inttostr(Ents) + ' Ents');
    end;
    
    procedure CutTrees;
    begin
    repeat
                if(not(LoggedIn)) then
                       Exit;
                if (FindColorSpiralTolerance(x, y, treecolor1, 454, 454, 454, 454, tol)) or
               (FindColorSpiralTolerance(x, y, treecolor2, 454, 454, 454, 454, tol)) or
               (FindColorSpiralTolerance(x, y, treecolor3, 454, 454, 454, 454, tol)) and
               isupext('ree'); then
               begin
                       wait(1000+random(300));
                       FindingEnts;
                       findfastrandoms;
                       wait(50+random(25));
                       mouse(x,y,0,0,false)
                       wait(50+random(25));
                       chooseoption('Chop')
                       wait(300+random(500))
                       findfastrandoms;
               if(infight)then
                       RunTo(directiontorun,runfar);
                       wait(7000+random(3000));
                       Runback;
               if FindNewBox then
                       SolveBox;
                       wait(cuttime+random(1000))
               end else
               begin
                       Writeln('Couldnt find a tree!');
                       Logout;
                       end;
                       Antiban;
            until(InvFull)
               end;
    
    
    
    
    
    
    begin
    repeat
    if(not(LoggedIn)) then Exit;
    MakeCompass(directionofcompass);
    CutTrees;
    Logs:=Logs+27;
    DropToPosition(2,28)
    Report;
    until(false)
    end.

  6. #6
    Join Date
    Jan 2007
    Posts
    117
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    if(infight)then
                       RunTo(directiontorun,runfar);
                       wait(7000+random(3000));
                       Runback;

    you need a begin and end with this is statement (and several others) otherwise it will only associate the first command with the if. fixed:
    SCAR Code:
    if(infight)then
                        begin
                          RunTo(directiontorun,runfar);
                          wait(7000+random(3000));
                          Runback;
                        end;

    hope that helps, and also your entfinding procedure rellies on the srl function which no longer works very effectively in the slightest. try yohojo's, or my modified version of yohojos below:
    SCAR Code:
    Procedure EntChecker;  //by yohojo, altered slightly by joerobo
    Var
      BX, BY : integer;
      CX, CY : integer;
    Begin
      Status('Checking For Ent')
      Flag;
      If (FindObjEx(BX, BY, 'illow', Ax - 50, Ay -50, Ax + 50, Ay + 50, Colour1, 4, 0, 0, 0, true)) then
      Begin
        MMouse(Bx, BY, 0, 0)
        Mx := Bx
        My := By
          If FindColorTolerance( CX, CY, 55769, 85, 15, 115, 15, 20) then
          Begin
            Status('Ent Found');
            MouseFindFlag(648,83,5,5);
            Wait(15000+Random(5000));
            EntsAvoided := EntsAvoided + 1
          end;
       end;
    end;
    this is slightly complicated because ax and ay must be declared as global variables and should be used in yr mani wc procedure also- eg:
    SCAR Code:
    (FindColorSpiralTolerance(AX, AY, treecolor3, 454, 454, 454, 454, tol))
    yo would have to do this on all three findcolorspiraltollerance commands.

    If your still eager to improve yr script then multiplayer is always very good to implement and proper antiban- currently u r using a restricted number of antiban features and only when you fail to find a tree. hope this helps!

    also thereis something which will standardise yr scirpt, nt sure wat it is tho, ask cnr_sport i think if yr desperate.
    No Signature Assigned.

  7. #7
    Join Date
    Mar 2006
    Posts
    81
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thank you very much that helped a lot. ill continue to update it and get better at scar again and that ent function to change it to normal trees would i only have to change the text or are the colors out of whack too?

    Code:
    //********* ****     *     *    *      *   ******///////////////////////////
    //    *     *   *    *     *    **    **   *    *//////////////////////////
    //    *     *    *   *     *    * **** *   *   *//////////////////////////
    //*   *     *    *   *     *    *      *   *****/////////////////////////
    //*   *     *   *    *     *    *      *   *    *///////////////////////
    //  * *     ****     *******    *      *   ******//////////////////////
    //////////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////
    ///////Powercutter//////////////////////////////////////////////
    //{  <<===Version 1===<<  }////////////////////////////////////
    ///// PowerCutting////////////////////////////////////////////
    //Ax in first slot///////////////////////////////////////////
    ////////////////////////////////////////////////////////////
    program Cutter;
    {.include SRL\SRL.scar}
    {.include SRL\SRL\skill\woodcutting.scar}
    var ax,ay,x,y,Logs:integer;
    const
    
    
    {  <===SETUP===<<  }
    treecolor1=3432545;
    treecolor2=3432545;
    treecolor3=3432545;
    CutTime   = 4000;
    tol       = 15;
    directiontorun='N';
    runfar=true;
    directionofcompass='N';
    {  <===END SETUP===<<  }
    
    function FindFastRandoms: Boolean; //WT-Fawki
    var
      i: Integer;
    begin
      for i:=1 to 9 do
      begin
        case I of
         1:  If FindDead then
               Result := True;
         2:  If FindMod then
               Result := True;
         3:  If FindMime then
               Result := True;
         4:  If FindMaze then
               Result := True;
         5:  If FindQuiz then
               Result := True;
         6:  If FindDemon then
               Result := True;
         7: begin
               if NoGameTab then
               begin
                 Result := True;
                 Logout;
                 Exit;
               end;
             end;
         7: begin
               if InBlack then
               begin
                 Result := True;
                 Logout;
                 Exit;
               end;
             end;
         8: if(RC)then
              Result := True;
         9: if FindTalk then
              Result := True;
        end;
        wait(1);
      end;
    
      if Result then
    end;
    
    
    
    procedure FindingEnts;/////IEatJ00erBaybees
    var
      Ents: Integer;
        begin
        if(FindEnt(treecolor1))or
        (FindEnt(treecolor2))or
        (FindEnt(treecolor3))then
        begin
          WriteLn('Ent Found');
          RunAwayDirection('N');
          wait(7000+random(3000));
          RunBack;
          Ents := Ents + 1;
        end;
    end;
    
    
    
    
    
    procedure report;
    begin
    ClearReport;
    writeln  ('***********************************************')
    writeln  ('********* ****     *     *    *      *   ******')
    writeln  ('    *     *   *    *     *    **    **   *    *')
    writeln  ('    *     *    *   *     *    * **** *   *   *' )
    writeln  ('*   *     *    *   *     *    *      *   *****' )
    writeln  ('*   *     *   *    *     *    *      *   *    *')
    writeln  (' * *      ****     *******    *      *   ******')
    writeln  ('***********************************************')
    AddToReport('Cutter By Jdumber2k');
    AddToReport('------------------------');
    AddToReport('Cut ' + inttostr(Logs) + ' Logs');
    AddToReport('Avoided ' + inttostr(Ents) + ' Ents');
    end;
    
    procedure CutTrees;
    begin
    repeat
                if(not(LoggedIn)) then
                begin
                       Exit;
                end;
                if (FindColorSpiralTolerance(ax, ay, treecolor1, 454, 454, 454, 454, tol)) or
               (FindColorSpiralTolerance(ax, ay, treecolor2, 454, 454, 454, 454, tol)) or
               (FindColorSpiralTolerance(ax, ay, treecolor3, 454, 454, 454, 454, tol)) and
               isupext('ree'); then
               begin
                       wait(1000+random(300));
                       FindingEnts;
                       findfastrandoms;
                       wait(50+random(25));
                       mouse(x,y,0,0,false)
                       wait(50+random(25));
                       chooseoption('Chop')
                       wait(300+random(500))
                       findfastrandoms;
               if(infight)then
                        begin
                          RunTo(directiontorun,runfar);
                          wait(7000+random(3000));
                          Runback;
                        end;
               if (FindNewBox) then
                        begin
                          SolveBox;
                          wait(cuttime+random(1000))
                        end;
               end else
               begin
                       Writeln('Couldnt find a tree!');
                       Logout;
                       end;
            until(InvFull)
                       Antiban;
               end;
    
    
    
    
    
    
    begin
    repeat
    if(not(LoggedIn)) then
    begin
    Exit;
    end;
    MakeCompass(directionofcompass);
    CutTrees;
    Logs:=Logs+27;
    DropToPosition(2,28)
    Report;
    until(false)
    end.

  8. #8
    Join Date
    Jan 2007
    Posts
    117
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    no probs, glad to be of help nd willing to help more should u need it, but gd luc doing it on yr own
    No Signature Assigned.

  9. #9
    Join Date
    Mar 2006
    Posts
    81
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i also would like some suggestions for this fallybanktoyews procedure and if you think in theory it would work or not(i havent filled in cords yet for colors only radial)

    Code:
    Function YewsPresent: Boolean;
    begin
    If(FindObjMultiText(tx, ty, 'ew', 'Yew', 'w', treecolor1, tol)) or
    If(FindObjMultiText(tx, ty, 'ew', 'Yew', 'w', treecolor2, tol)) or
    If(FindObjMultiText(tx, ty, 'ew', 'Yew', 'w', treecolor3, tol)) then
    begin
           Result := True;
    end else
    begin
           Result := False;
    end;
        end;
    
    
    Procedure ToTrees;
    begin
    RadialRoadWalk(FindFallyRoadColor, 229, 209, -47, 0, 0);
    RadialRoadWalk(FindFallyRoadColor, 195, 190, 66, 0, 0);
    RadialRoadWalk(FindFallyRoadColor, 191, 183, 66, 0, 0);
    case Random(1) of
    
        0: begin
                Writeln('Going to the left spot');
           if (FindColorSpiralTolerance(ax, ay, TreeMM, 613, 64, 705, -14524750, tol)) then
           begin
                Mouse(ax,ay,0,0,true);
                Flag;
           end;
                if (YewsPresent) then
           begin
             Spot:=1
           end else
           begin
                  if (FindColorSpiralTolerance(ax, ay, FindFallyRoadColor, 613, 64, 705, -14524750, tol)) then
           begin
                Mouse(ax,ay,0,0,true);
                Flag;
           end;
                           if (FindColorSpiralTolerance(ax, ay, TreeMM, 831, -14524785, 800, -14524759, tol)) then
           begin
                Mouse(ax,ay,0,0,true);
                Flag;
             Spot:=2
             Writeln('No yews at left spot going to the right');
           end;
        end;
        end;
    
        1: begin
                Writeln('Going to the right spot');
               if (FindColorSpiralTolerance(ax, ay, TreeMM, 831, -14524785, 800, -14524759, tol)) then
           begin
                Mouse(ax,ay,0,0,true);
                Flag;
                if (YewsPresent) then
           begin
             Spot:=1
             Writeln('No yews at right spot going to the left');
           end else
           begin
                  if (FindColorSpiralTolerance(ax, ay, FindFallyRoadColor, 613, 64, 705, -14524750, tol)) then
           begin
                Mouse(ax,ay,0,0,true);
                Flag;
           end;
                  if (FindColorSpiralTolerance(ax, ay, TreeMM, 831, -14524785, 800, -14524759, tol)) then
           begin
                Mouse(ax,ay,0,0,true);
                Flag;
             Spot:=1
           end;
        end;
        end;
    
           end;
        end;
    end;
    end;

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
  •