Results 1 to 7 of 7

Thread: My First Wc'er.

  1. #1
    Join Date
    May 2007
    Location
    Tennessee
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default My First Wc'er.

    Hi. This Is My First Woodcutting Script. And I'd Be More Then Happy To Listen To Any Feedback.

    [x]Basic AntiRandoms
    [x]Progress Report
    [x]Failsafes.

    Code:
    Program PowerChopper;
    {.include SRL/SRL.scar}
    
    Var
    Clicks,Loads: Integer;
    
    Const
    Tree = 4025476; {Setup This Constant With The Color Of Your Tree}
    
    procedure AntiRandoms;
    Begin
      FindTalk;
      FindNormalRandoms;
      if(FindFight=True) then
    Begin
      RunAwayDirection('E');
      Wait(10000+random(3000));
      RunBack;
    End;
    
    procedure Cut;
    Begin
      SetupSRL;
      Repeat
        if(FindColor(xx,yy,Tree,3,3,532,-140)) then
        MMouse(x,y,0,0);
        Wait(200+random(100));
        Mouse(x,y,0,0,True);
        Wait(200+random(100));
        AntiRandoms;
        Clicks:=Clicks+1;
      Until(InvFull);
    End;
    
    Procedure Drop;
    Begin
      DropAll;
      Loads:=Loads+1
    End;
    
    procedure ProgressReport;
    begin
      ClearDebug;
      Writeln('Progress Report');
      Writeln('Did' + IntToStr(Loads) +' Loads');
      Writeln('And Did' + IntToStr(Clicks) +' Clicks');
    end;
    
    
    Begin
      SetupSRL;
      Repeat
        if(not(LoggedIn)) then
        Exit;
      End Else
    RepeatClicking;
    Drop;
    ProgressReport;
    until(false);
    end.

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

    Default

    Its pretty simple, but everyone has to start from somewhere! Theres no randomness on those Wait Times! But looks good for first script. keep it going!

  3. #3
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You should have checked if the script compiled before posting

    here are the errors, then I'll post the script fixed:

    1: In your anti randoms procedure, you needed an extra "end;". You had 2 begins and 1 "end;".

    2: Your variables xx and yy need to be declared like var xx,yy: Integer; like I did in the fixed script.

    3: In your main loop, you can't have an end else for your first begin of the procedure, because its not doing something else if a condition doesn't happen. I just took out the end else thing and it works good now, and does the exact same thing in the main loop as you wanted it too I think. If its not logged in it exits (Good fail safe ), then it does the clicking.

    4: You have in the main loop repeat clicking? Thats not a procedure or a function in your script. I think that you wanted it to do the Cut procedure so I put that in there.

    Its an ok script for your first one, but I have a feeling you copied a lot of things from other peoples scripts, pasted it into your own without knowing what they did at all.

    Heres the fixed script though:

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

    Var
    Clicks,Loads,xx,yy: Integer;

    Const
    Tree = 4025476; {Setup This Constant With The Color Of Your Tree}

    procedure AntiRandoms;
    Begin
      FindTalk;
      FindNormalRandoms;
      if(FindFight=True) then
    Begin
      RunAwayDirection('E');
      Wait(10000+random(3000));
      RunBack;
    End;
    End;

    procedure Cut;
    Begin
      SetupSRL;
      Repeat
        if(FindColor(xx,yy,Tree,3,3,532,-140)) then
        MMouse(x,y,0,0);
        Wait(200+random(100));
        Mouse(x,y,0,0,True);
        Wait(200+random(100));
        AntiRandoms;
        Clicks:=Clicks+1;
      Until(InvFull);
    End;

    Procedure Drop;
    Begin
      DropAll;
      Loads:=Loads+1
    End;

    procedure ProgressReport;
    begin
      ClearDebug;
      Writeln('Progress Report');
      Writeln('Did' + IntToStr(Loads) +' Loads');
      Writeln('And Did' + IntToStr(Clicks) +' Clicks');
    end;


    Begin
      SetupSRL;
      Repeat
        if(not(LoggedIn)) then
        Exit;
    Cut;
    Drop;
    ProgressReport;
    until(false);
    end.

    suggestions to improve the script a LOT.

    1: Add tolerance to your color finding using FindColorTolerance instead of FindColor.

    2: Add random parameters to your mouse movements using Mouse(x,y,2,2,true)...etc.

    3: I'd have it Move the mouse to the tree using random parameters like

    MMouse(x,y,2,2)
    if(IsUpText('Chop'))then
    begin
    GetMousePos(x,y);
    Mouse(x,y,0,0,true)
    end;

    do that after looking for the color.

    Also, this script will not work because your looking for the color, and saving the position to xx,yy , but your Clicking the mouse at x,y. You gotta change either of those to match.

    Good try, keep it up and keep reading tutorials!

  4. #4
    Join Date
    May 2007
    Location
    Some where fun.
    Posts
    2,891
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)

    Default

    it says identifier expected in script at line 21

  5. #5
    Join Date
    Mar 2007
    Posts
    674
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Would the

    SetupSRL;
    be really necessary in the cut procedure? I am not sure myself.

  6. #6
    Join Date
    May 2007
    Location
    http://www.srl-forums.com
    Posts
    265
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Good work.

    Really good work.........

  7. #7
    Join Date
    Mar 2007
    Posts
    3,681
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by The devil View Post
    Good work.
    Yer your right i think it should come first in the main loop...right?

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
  •