Results 1 to 7 of 7

Thread: Tanner Help

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

    Question Tanner Help

    So I decided to try my hand at making a script that will tan green d'hides in al kharid. I felt that I finished but I noticed a few things I'd love some help with!

    Edited! New question!


    Keep in mind this is a 'rough' draft with a few features missing, randoms, antiban, fail safe. I just want to make sure I'm heading in the right direction before dealing with those!

    1. If this is brutally so far off from something you'd relatively even consider calling a script, please tell me. In that case I'll get rid of this and start from scratch.
    2. At the end of the script I get an error on the "end." Saying identifier expected at that line. I know this is usually from begin/end nests but it being the final end, it's throwing me off.
    3. Questions/Comments/Concerns


    Thanks everyone!
    Buck

    Oh yea you might need this...
    I used a default script that I learned from a tut here, thats why some things may seem advance while others seem awful (If awful is the case )

    Updated with some fixes (Hopefully) - 11/30
    Code:
    program Tanner;
    {//$DEFINE SMART}
    {$i srl/srl.scar}
    {$i sps/sps.simba}
    
    
    const
    {-----Breaking Settings-----}
      TakeBreaks = True; // Take breaks?
      HowOften = 90; // How often to break in minutes
      HowOftenRandom = 30; // Added randomness to how often you break
      HowLong = 20; // How long to break for
      HowLongRandom = 8; // Added randomness in break length
    {---------------------------}
    {---SMART Setup Constants---}
      WORLD = 121;// Set a world, if you'd like.
      MEMBERS = False;// Change accordingly.
      SIGNED = True; // True if running a single account, false otherwise.
    {---------------------------}
    {--------Script Info--------}
      Author = 'Username';
      Name = 'Base';
      Version = '1.00';
    {---------------------------}
    
    Var
    BreakOften, BreakLength, BreakTimes: Integer;
    
    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
    
      Players[0].Name := ''; // Username
      Players[0].Pass := ''; // Password
      Players[0].Nick := ''; // 3-4 lowercase letters from username
      Players[0].Active := True; // Set to true if you want to use this player
      Players[0].Pin := '0000'; // Leave blank if the player doesn't have a bank pin
    end;
    
    procedure AntiBan;
    begin
      case Random(6) of
      0: HoverSkill('Random', False);
      1: begin
           RandomMovement;
           HoverSkill('Random', False);
         end;
      2: BoredHuman;
      3: BoredHuman;
      4: ExamineInv;
      5: begin
           RandomAngle(1);
           HoverSkill('Random', False);
           ExamineInv;
         end;
      end;
    end;
    
    procedure BreakCheck;
    begin
      if not LoggedIn then
      begin
        Players[CurrentPlayer].Active := False;
        Exit;
      end;
      BreakOften := ((HowOften*60000)-(HowOftenRandom*60000)+Random(HowOftenRandom*120000));
      if GetTimeRunning >= BreakOften*BreakTimes then
      begin
        BreakLength := ((HowLong*60000)-(HowLongRandom*60000)+Random(HowLongRandom*120000));
        Logout;
        Wait(BreakLength);
        LoginPlayer;
      end;
    end;
    
    procedure ProgressReport;
    begin
      WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
      WriteLn(Name + 'by' + Author + 'V' + Version);
      WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
    end;
    function FindTanner: Boolean;
    var
      x, y : Integer;
    begin
      if not LoggedIn then Exit;
      if FindObjCustom(x, y, ['Elli', 'llis'], [16248055, 4616928], 5) then     //Colors/Name
      begin
        Mouse(x, y, 5, 5, false);
        Result := True;
          if ChooseOption('rade') and FindObjCustom(x, y, ['Green','athe'], [1006349,1274897], 3) then
          begin
        Mouse(x, y, 1, 1, false);
        WaitOptionMulti(['Tan', 'all'], (500 + Random(150)));
        Result := True;
      end;
        end else
        begin
        SPS_WalkToPos(Point(4936, 3897));
        FindTanner;
        Result := True;
        end;
    
    end;
    function MakeHides: Boolean;
    var x, y : Integer;
    begin
      if not LoggedIn then Exit;
      if FindObjCustom(x, y, ['Green','athe'], [1006349,1274897], 3) then    //colors/names
      begin
        Mouse(x, y, 1, 1, false);
        WaitOptionMulti(['Tan', 'all'], (500 + Random(150)));
        Result := True;
      end;
    end;
    procedure Bank;
    begin
      if not LoggedIn then Exit;
      if FindBank('akb') then
      begin
      Deposit(2, 28, True);
      Writeln('Banked the Leather!')
      Wait(250 + Random(50));
      WithdrawEx(1, 1, 0, ['hide']);
      end else
      begin
      SPS_WalkToPos(point(4909, 3988));
      Bank;
        end;
    end;
    function RepeatTanning: Boolean;         //FullLeather, NoLeather,
    begin
      repeat
        // if FullLeather then Bank;
        Bank; //Check
        FindTanner; //check
        MakeHides;  //check
        Wait(2011 + Random(150))
        AntiBan;    //check
        Wait(5051 + Random (250))
      {until ((NoLeather) or (FullLeather));
      wait(3014 + random(500));}
    
    
    
    begin
      Smart_Server := WORLD;
      Smart_Members := MEMBERS;
      Smart_Signed := SIGNED;
      Smart_SuperDetail := False; // These four lines, setup and run Smart, using the constants you made earlier.
      SetupSRL; // This is used to setup SRL's base features, and is almost always necessary.
    
      DeclarePlayers; // This runs your DeclarePlayers procedure, setting them up to run
      LoginPlayer; // This logs in your first player.
      repeat // This is the start of a loop, it will repeat until the conditions set after the until below are met.
      BreakCheck; // Runs the breaks
      RepeatTanning;
      until AllPlayersInactive; // This means that, once all characters have failed, the script will stop.
    end.
    Last edited by BuckWild; 11-30-2011 at 06:20 PM.

  2. #2
    Join Date
    Oct 2011
    Location
    Chicago
    Posts
    3,352
    Mentioned
    21 Post(s)
    Quoted
    437 Post(s)

    Default

    I did not put it into my simba to see what the errors were but

    3) You can just {code} to make it blue (just a comment) this way you can just press the play button and if it runs most of the time that means it works (You can try it in rs too if you want)

    4) FindNormalRandom, put it in.




    Anti-Leech Movement Prevent Leeching Spread the word
    Insanity 60 Days (Killer workout)
    XoL Blog (Workouts/RS/Misc)

  3. #3
    Join Date
    Nov 2011
    Posts
    72
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by R4nd0m View Post
    I did not put it into my simba to see what the errors were but

    3) You can just {code} to make it blue (just a comment) this way you can just press the play button and if it runs most of the time that means it works (You can try it in rs too if you want)

    4) FindNormalRandom, put it in.
    Thanks for the quick reply! After getting the first few compiling errors I'm starting to think I should just start from scratch. Although for some reason I'm getting unknown id for write1n command, I thought that was a perfectly fine thing to use but maybe not?

  4. #4
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    "Write1n" is not a real thing, you must mean "WriteLn", right?
    What is(are) the other error(s) you are having? Maybe we could help. It's never a good thing to get in the habit of "Starting from scratch" on anything unless you truly have to. But even then, I don't suggest it. It's just a bad habit for life, not just developing.

    Quote Originally Posted by BuckWild View Post
    Thanks for the quick reply! After getting the first few compiling errors I'm starting to think I should just start from scratch. Although for some reason I'm getting unknown id for write1n command, I thought that was a perfectly fine thing to use but maybe not?

  5. #5
    Join Date
    May 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by RISK View Post
    "Write1n" is not a real thing, you must mean "WriteLn", right?
    What is(are) the other error(s) you are having? Maybe we could help. It's never a good thing to get in the habit of "Starting from scratch" on anything unless you truly have to. But even then, I don't suggest it. It's just a bad habit for life, not just developing.
    Oh man, I'm embarrassed! Thanks for that. Another thing I'm noticing is something like identifier expected at line x. Thanks again!

  6. #6
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Hey, don't worry about it. We all make mistakes sometimes.
    The "Identifier expected at line X" is when you forgot to complete a begin end nest. Look at this example, please:
    Simba Code:
    procedure Skumesh;
    begin
      begin // See how there is no corresponding end for this begin? This would
              // give you an error like "Identifier expected".
    end;

    Simba Code:
    procedure Skumesh;
    begin
      begin // And here is the now fixed begin end nest, this will get rid of the
      end;  // error!
    end;

    So if you get this error, just double check the begin end nests you have before the line it gives you.

    Quote Originally Posted by skumesh View Post
    Oh man, I'm embarrassed! Thanks for that. Another thing I'm noticing is something like identifier expected at line x. Thanks again!

  7. #7
    Join Date
    May 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Edit:
    Updated with a new error after fixing those, op changed accordingly! Thanks for all the help thus far



    Oh! That makes perfect sense actually, I thought it might have been something to do with procedures.
    Also, sorry for possible confusions with usernames, I created this way back and wanted to start fresh on BuckWild and this happens to be saved on my phone.

    Once i get home I'll try to fix these things and come back with the results!

    Quote Originally Posted by RISK View Post
    Hey, don't worry about it. We all make mistakes sometimes.
    The "Identifier expected at line X" is when you forgot to complete a begin end nest. Look at this example, please:
    Simba Code:
    procedure Skumesh;
    begin
      begin // See how there is no corresponding end for this begin? This would
              // give you an error like "Identifier expected".
    end;

    Simba Code:
    procedure Skumesh;
    begin
      begin // And here is the now fixed begin end nest, this will get rid of the
      end;  // error!
    end;

    So if you get this error, just double check the begin end nests you have before the line it gives you.
    Last edited by skumesh; 11-30-2011 at 07:20 PM.

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
  •