Results 1 to 18 of 18

Thread: Reflection simba willow chopper

  1. #1
    Join Date
    Jun 2009
    Location
    Hiding
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Reflection simba willow chopper

    This is my first simba script
    also my first reflection script
    dont have reflection
    go here
    http://villavu.com/forum/showthread....707#post710707
    this is a willow chopper and banker with reflection and antiban
    ~Austin~

  2. #2
    Join Date
    Oct 2006
    Posts
    468
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I looked through the code briefly and I suggest you take a look at these two tutorials. The way you have tried to create a failsafe is a little ineffective.

    Scripting standards -
    http://villavu.com/forum/showthread.php?t=3293

    Failsafes -
    http://villavu.com/forum/showthread.php?t=43037

    Also, you should add some time marks into your repeats so you don't have them repeating forever if the condition is not met. For instance, in bank1 you have

    SCAR Code:
    repeat
       OpenBank('db',true,true);
       wait(500);
    if (not(R_loggedin)) then
    loginplayer;
       until bankscreen = true
    You could do something like
    SCAR Code:
    MarkTime(z); // z should be declared as an integer
      repeat
       OpenBank('db',true,true);
       wait(500);
       if (not(R_loggedin)) then
         loginplayer;
       if(TimeFromMark(z) > 60000)then  
         TerminateScript;
    //60000 is 60 seconds. So, if the script has been trying to open the bank for 60 seconds and still hasn't done it, then the script will terminate.
      until bankscreen = true

    Good job for your first script, though.
    Last edited by bbri06; 05-17-2010 at 02:47 AM.

  3. #3
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    Pascal Code:
    program Treechopper;
    {.include srl/srl/misc/smart.scar}
    {.include srl/srl.scar}
    {.include srl/srl/reflection/reflection.simba}
    {dont have reflection http://blanddns.no-ip.org:81/repos/reflection}
    {see my tut to set it up http://villavu.com/forum/showthread.php?p=710707#post710707}


    var
      x, y, a, b, c, d, e2, f, t, t1, t2: Integer;
      r1, r2: String;
      Bank, Trees, e: TTile;

    {------------------------------------------------------------------------------}
    {------------------------------PLayer setup------------------------------------}
    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      with Players[0] do
      begin
        Name   := ''; // Your RuneScape username.
        Pass   := ''; // Your RuneScape password.
        Nick   := ''; // 3-4 LOWERCASE letters from username.
        Active := True;     // Use this player?
      end;
    end;
    {------------------------------------------------------------------------------}
    {---------------------------------keep out-------------------------------------}

    procedure Report;
    begin
      t := GetTimeRunning / 1000;
      t1 := t / 60;
      t2 := t1 / 60;
      d := c * 28;
      ClearDebug;
      Writeln('-----Willow tree------');
      Writeln('-------Chopper--------');
      Writeln('Total loads ' + IntToStr(c) + ' Total logs ' + IntToStr(d));
      Writeln('-----Current act------');
      Writeln(' ' + r1 + ' ');
      Writeln(' ' + r2 + ' ');
      Writeln('------Time running----');
      Writeln(' ' + IntToStr(t2) + ' hrs ' + IntToStr(t1) + ' mins ' + IntToStr(t) + ' sec');
      Writeln('Levels gained: ' + IntToStr(b));
      Writeln('Pos ' + IntToStr(e2) + ' anim ' + IntToStr(GetAnimation) + ' ');
    end;

    procedure StartUp;
    begin
      MakeCompass('n');
      SetAngle(True);
      r1 := 'Starting up.';
      r2 := 'Making compass north.';
      Report;
      Bank := Tile(3092, 3243);
      Trees := Tile(3085, 3237);
    end;

    procedure FaiSafe;
    begin
      repeat
        if (not(R_LoggedIn)) then
          LoginPlayer;
        if not(FindObjCustom(x, y, ['illow'], [10076602, 5207920], 5)) then
        begin
          Inc(a);
          Wait(2750 + Random(500));
          r1 := 'No tree found, waiting.';
          r2 := 'Try ' + IntToStr(a);
          Report;
          Writeln('No trees found waiting.');
        end else
        begin
          r1 := 'Tree found! Moving on.';
          r2 := 'Tries ' + IntToStr(a);
          Report;
          Writeln('Trees found right postion. Moving on.');
          Wait(250 + Random(500));
          a := 0;
          Exit;
        end;
        Writeln('Try ' + IntToStr(a));
        if(a = 5)then
        begin
          r1 := 'No tree found, max trys.';
          r2 := 'logging out';
          Report;
          Writeln('LOST! logging out.');
          LogOut;
          TerminateScript;
        end;
      until False;
    end;

    procedure Bank1;
    begin
      if (not(R_LoggedIn)) then
        LoginPlayer;
      WalkToTile(Bank, 0, 0);
      R_Flag;
      r1 := 'Walking...';
      r2 := ' ';
      Report;
      r1 := 'Looking for bank...';
      r2 := ' ';
      Report;
      repeat
        OpenBank('db', True, True);
        Wait(250 + Random(500));
        if (not(R_LoggedIn)) then
          LoginPlayer;
      until BankScreen;
      r1 := 'Depositing all.';
      r2 := ' ';
      Report;
      DepositAll;
      CloseBank;
      r1 := 'Waiting...';
      r2 := ' ';
      Report;
      WalkToTile(Trees, 0, 0);
      if (not(R_LoggedIn)) then
        LoginPlayer;
      R_Flag;
      r1 := 'Entering failsafe...';
      r2 := ' ';
      Report;
      FailSafe;
    end;

    procedure AntiBan;
    begin
      if (not(R_LoggedIn)) then
        LoginPlayer;
      case Random(8) of
        1..3: SmartMoveMouse(x + Random(342), y + Random(452));
        4: Wait(234 + Random(34));
        5: MakeCompass(Random(180));
        6: MakeCompass(Random(-180));
        7, 8: RandomMovement;
      end;
     end;


    procedure FindTrees;
    begin
      repeat
        if (not(R_loggedin)) then
          LoginPlayer;
        r1 := 'Searching for tree.';
        r2 := '';
        Report;
        if(FindObjCustom(x, y, ['illow'], [10076602, 5207920], 5))then
        begin
          SmartClickMouse(x, y, True);
          R_Flag;
          repeat
            AntiBan;
            Wait(1000 + Random(250));
            if(LevelUp)then
            begin
              Inc(b);
              LevelUp;
            end;
          until not((GetAnimation = 875) or (InvFull));
        r1 := 'Tree gone.';
        r2 := 'Or full.';
        Report;
        Wait(750 + Random(500));
     until InvFull;
     r1 := 'Full!';
     r2 := 'Banking.';
     Report;
     Bank1;
    end;



    begin
      SetupSRL;
      Report;
      DeclarePlayers;
      LoginPlayer;
      repeat
        Wait(50 + Random(50));
      until R_RSReady;
      StartUp;
      repeat
        FindTrees;
      until False;
    end.

    Just standardized it.

  4. #4
    Join Date
    Jun 2009
    Location
    Hiding
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    The fail safe worked before i added reflection and it work a bit during reflection its if it gets lost that its supposed to log out

    edit:
    i really suck at standerds but i look at how the script runs instead of what it looks like.

    edit2:
    If you really what i can reupload with the standerized one that some one posted
    btw not my first script
    could some one get a report?
    Last edited by austin2162; 05-17-2010 at 03:30 AM.
    ~Austin~

  5. #5
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    Standards are mostly just for readability and debugging. It's just something to have if you want it to look professional and be easy to fix.

  6. #6
    Join Date
    Jun 2009
    Location
    Hiding
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    So I've noticed. I suck at them. But I'm just happy if they work the way I want
    ~Austin~

  7. #7
    Join Date
    Feb 2009
    Posts
    1,447
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    This thread belongs in one of the scripts section. This isn't reflection development.

    On the other hand, good job with making this script.

  8. #8
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    moved.

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  9. #9
    Join Date
    Jun 2009
    Location
    Hiding
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks Rasta.
    ~Austin~

  10. #10
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    The flow of the script seemed quite odd. Actually, it was confusing and could have been done better. I'm not trying to sound rude, but I think that you could learn a lot by making this into different functions/procedures for more failsafes (if(CanBank)then DoBank; etc.). The reason for that is so it doesn't try to skip steps even if it didn't do the previous. And it wasn't very structured.

    Nothing too important, but I think you could learn a lot from expanding and perfecting this.

  11. #11
    Join Date
    Jun 2009
    Location
    Hiding
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Good news on yew chopper simba+reflection its gone for 3 hrs and collected 217 yew logs, it currently runs in edgeville and has dual tree support
    ~Austin~

  12. #12
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    I can standardize it for you.

  13. #13
    Join Date
    Jun 2009
    Location
    Hiding
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I ll send it to you when I finish
    ~Austin~

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

    Default

    So i think i fail at setting up reflection or maybe simba, when i run this i get this.
    Code:
    [Hint] C:\Users\Ryan\Desktop\Auto\Simba\Includes\srl\srl\Reflection\Characters.simba(131:3): Variable 'TESTSTRING' never used at line 130
    [Hint] C:\Users\Ryan\Desktop\Auto\Simba\Includes\srl\srl\Reflection\Characters.simba(167:3): Variable 'TESTSTRING' never used at line 166
    [Hint] C:\Users\Ryan\Desktop\Auto\Simba\Includes\srl\srl\Reflection\Characters.simba(211:3): Variable 'I' never used at line 210
    [Error] C:\Users\Ryan\Desktop\Auto\Simba\Includes\srl\srl\Reflection\Objects.simba(90:21): Unknown identifier 'SmartGetFieldShort' at line 89
    Compiling failed.
    i think every things upto date
    Thanks
    ~Rya
    I see Now, says the blind man

  15. #15
    Join Date
    Mar 2007
    Posts
    478
    Mentioned
    4 Post(s)
    Quoted
    4 Post(s)

    Default

    Quote Originally Posted by rya View Post
    So i think i fail at setting up reflection or maybe simba, when i run this i get this.
    Code:
    [Hint] C:\Users\Ryan\Desktop\Auto\Simba\Includes\srl\srl\Reflection\Characters.simba(131:3): Variable 'TESTSTRING' never used at line 130
    [Hint] C:\Users\Ryan\Desktop\Auto\Simba\Includes\srl\srl\Reflection\Characters.simba(167:3): Variable 'TESTSTRING' never used at line 166
    [Hint] C:\Users\Ryan\Desktop\Auto\Simba\Includes\srl\srl\Reflection\Characters.simba(211:3): Variable 'I' never used at line 210
    [Error] C:\Users\Ryan\Desktop\Auto\Simba\Includes\srl\srl\Reflection\Objects.simba(90:21): Unknown identifier 'SmartGetFieldShort' at line 89
    Compiling failed.
    i think every things upto date
    Thanks
    ~Rya
    Something I believe is wrong with reflection's objects. Been waiting for a fix today ans hasn't been one.
    Back from the dead.....

  16. #16
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    I believe you need the newer SMART that's in Opendev "libsmart.dll" and place it into Simbas plugins folder.

    Also the hooks need to be updated so it won't work until then anyways.
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

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

    Default

    Now i get
    Code:
    [Hint] C:\Users\Ryan\Desktop\Auto\Simba\Includes\srl\srl\Reflection\Characters.simba(131:3): Variable 'TESTSTRING' never used at line 130
    [Hint] C:\Users\Ryan\Desktop\Auto\Simba\Includes\srl\srl\Reflection\Characters.simba(167:3): Variable 'TESTSTRING' never used at line 166
    [Hint] C:\Users\Ryan\Desktop\Auto\Simba\Includes\srl\srl\Reflection\Characters.simba(211:3): Variable 'I' never used at line 210
    [Hint] C:\Users\Ryan\Desktop\Auto\Simba\Includes\srl\srl\Reflection\Objects.simba(69:4): Variable 'THETYPE' never used at line 68
    [Hint] C:\Users\Ryan\Desktop\Auto\Simba\Includes\srl\srl\Reflection\Objects.simba(133:3): Variable 'IDX' never used at line 132
    [Hint] C:\Users\Ryan\Desktop\Auto\Simba\Includes\srl\srl\Reflection\Objects.simba(133:3): Variable 'I' never used at line 132
    [Hint] C:\Users\Ryan\Desktop\Auto\Simba\Includes\srl\srl\Reflection\Objects.simba(196:4): Variable 'NL' never used at line 195
    [Hint] C:\Users\Ryan\Desktop\Auto\Simba\Includes\srl\srl\Reflection\Objects.simba(244:4): Variable 'NL' never used at line 243
    [Error] (60:21): Closing parenthesis expected at line 59
    Compiling failed.
    Any idea's ?
    I see Now, says the blind man

  18. #18
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    your probably missing a ")" on line 59

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
  •