Results 1 to 3 of 3

Thread: Why wont this Script click on a Tree to start cutting

  1. #1
    Join Date
    Nov 2011
    Posts
    23
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Why wont this Script click on a Tree to start cutting

    Code:
    program MyWoodcutter;
    {$DEFINE SMART}
    {$i srl/srl.simba}
    {$i sps/sps.simba}
    
    const
    {SMART Setup Constants}
      WORLD = 0;  // Set a world, if you'd like. Leave 0 to choose a random world.
      MEMBERS = False;  // Are you Members or Free-To-Play? False for F2P, True for P2P.
      SIGNED = True;
      loadcount = 50;
      var
      count: integer;
    {---------------------------}
    {--------Script Info--------}
      //Author = 'SuperSaiyanGoku';
      //Name = 'MyWoodcutter';
      //Version = '1.0';
    {---------------------------}
    procedure DeclarePlayers; //This declares the players to be used in the script.
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
    
      Players[0].Name := ''; //Your Runescape username
      Players[0].Pass := ''; //Your Runescape password
      Players[0].Nick := ''; //3 or 4 lowercase letters from your Runescape username. Used as a Nickname.
      Players[0].Active := True; //Set to true if you want to use this player. Set to False to disable this player.
      Players[0].Pin := ''; //Leave blank if the player doesn't have a Bank PIN.
    end;
    procedure SetupScript;
    begin;
      WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
      WriteLn('Hope you enjoy this Yew cutting script.');
      WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
      WriteLn('I made this My self.');
      WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
    end;
    procedure AntiBan;
    begin
      case random(50) of
          0: RandomRClick;
          1: PickUpMouse;
          2: RandomRClick;
          3: HoverSkill('woodcutting', False);
          4: SetAngle(SRL_ANGLE_HIGH);
      end;
    end;
    
    Procedure WalkToBank;
        Var
          ToBank:TPointArray;
        Begin
        SetupSRL;
        SPS_Areas := ['11_6','11_7'];
    ToBank:= [Point(3828, 3360), Point(3845, 3297), Point(3845, 3226), Point(3847, 3191), Point(3867, 3196), Point(3867, 3209)];
     SPS_WalkPath(ToBank);
     end;
    
    procedure ChopTree; //This chops your trees.
    var x, y: integer;
    begin
        repeat
        FindNormalRandoms;
        ToggleXPBar(true);
        WriteLn('ChopTree procedure activated! Finding tree.');
        WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
        if FindObjCustom(x,y, ['ew','hop','own'], [3097151, 4675164],5) then//This finds the object, records the X and Y values, and tells the script to find the option "Tree".
        begin
        WriteLn('Tree found! Clicking option.');
        WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
          Mouse(x, y, 0, 0, true);
          ChooseOption('ew');  //This tells the script to left-click on the object and select "Yew".
        end;
          repeat
          Wait(RandomRange(2000, 3000))
          AntiBan;
          Until not IsUpText('ew') or (InvFull);
        Until (InvFull);
        writeLn('Banking');
    end;
    
    Procedure Bank;
    begin
    if not LoggedIn then
    Exit;
    repeat
    SetAngle(srl_angle_high);
    OpenBanknpc;
    Wait(Random(700));
    until BankScreen or PinScreen;
    if PinScreen then
    begin
    repeat
    InPin(Players[0].Pin);
    until BankScreen or not (LoggedIn);
    end;
      begin
        if Players[CurrentPlayer].Booleans[0] then
            DepositAll else
            Deposit(2 ,28 ,true);
            CloseBank;
            stats_IncVariable('Times Banked',1);
      end
      Writeln('Bout to bank these logs');
      End;
    
    Procedure WalkToYews;
    Var
      ToYews:TPointArray;
     Begin
    SetupSRL;
    SPS_Areas := ['11_6','11_7'];
    ToYews :=  [Point(3873, 3213), Point(3847, 3273), Point(3842, 3338), Point(3819, 3375), Point(3878, 3346), Point(3898, 3341)];
     SPS_WalkPath(ToYews);
     end;
    
      Begin
      Smart_Server := WORLD;
      Smart_Members := MEMBERS;
      Smart_Signed := SIGNED;
      Smart_SuperDetail := False;
      SetupSRL;
      SetupScript;
      declarePlayers;
      LoginPlayer;
    
      begin
      WalkToBank;
      Bank;
      WalkToYews;
      repeat
      Antiban;
      ChopTree;
      WalkToBank;
      Bank;
      walkToYews;
      Inc(count);
      until (count=loadcount)
      end;
      end.
    
    
    
    //Notice that AntiRandoms isn't in here. It would be useless to include because Reflection is currently broken.
    
    
       //This stops the script completely once your player has failed. e.g. Gotten into a random event, died (almost impossible) or failed to find a tree.
    Why wont the script start cutting down a Yew Log at Fally? Trying to Modify a GE Yew Cutter to a Fally it compiles correctly but the mouse wont go over im using ACA v2 Color Aid for help finding the colors
    Last edited by Goku123; 02-10-2012 at 11:15 PM.

  2. #2
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    Code:
    {---------------------------}
    {--------Script Info--------}
      //Author = 'SuperSaiyanGoku';
      //Name = 'MyWoodcutter';
      //Version = '1.0';
    {---------------------------}
    please post in the scripts thread

  3. #3
    Join Date
    Dec 2011
    Location
    New York, USA
    Posts
    1,242
    Mentioned
    12 Post(s)
    Quoted
    193 Post(s)

    Default

    Simba Code:
    Mouse(x, y, 0, 0, true);

    Should be

    Simba Code:
    Mouse(x, y, 0, 0, false);

    Simba Code:
    if FindObjCustom(x,y, ['ew','hop','own'], [3097151, 4675164],5) then//This finds the object, records the X and Y values, and tells the script to find the option "Tree".
        begin
        WriteLn('Tree found! Clicking option.');
        WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
          Mouse(x, y, 0, 0, false);  //True means left click, false means right click.
          ChooseOption('ew');

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •