Results 1 to 7 of 7

Thread: Minkinos WillowCutandBank

  1. #1
    Join Date
    Jul 2008
    Posts
    49
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Minkinos WillowCutandBank

    This script cuts willows near draynor and banks them at draynor bank. I am hopefully going to submit it for members so give all types of constructive criticism and ideas for it.

    Here is the code and there is a .scar file down the bottom:
    SCAR Code:
    // Thanks to Rubix and TViYHU and OSMM could not be possible without them.

    {                                                                       }
    {         Place character near Willows in Draynor then log out          }
    {                                                                       }
    {                                                                       }
    {                                                                       }


    program MyFirstWoodCut;
    {.include SRL/SRL/misc/SMART.scar}
    {.include SRL\SRL.Scar}
    {.include SRL/SRL/Skill/WoodCutting.scar}


    const
    //<><><><><>Loads<><><><><>\\
      LoadsPerPlayer = 1; //Loads per player before switching

    //<><><><><>SRL Id<><><><><>\\
      YourSRLId = '';
      YourSRLPass = '';

    //<><><><><>Bank Pin<><><><><>\\
      YourPin = ''; //Make same for all players if none leave blank

    //<><><><><>Lamp Skill<><><><><>\\

    {<><><><><><><><><><><><><><><><><><><><>
                      Player Setup
     <><><><><><><><><><><><><><><><><><><><>}


    procedure DeclarePlayers;
    begin

      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0

      Players[0].Name := '';
      Players[0].Pass := '';
      Players[0].Nick := 'muff';
      Players[0].Pin := '';
      Players[0].Active := True;

    end;

    {<><><><><><><><><Do Not Edit Below this Line><><><><><><><><><><><>}


    var
      x, y, LoadsNum, LoadsNum2: integer;
      Banked: boolean;


    //<><><><><><><><><><>Anti Randoms<><><><><><><><><><>\\

    procedure AntiRandoms;
    begin
      if (FindFight) then
        RunAway('N', True, 1, 1500);
      FindNormalRandoms;
      FindLamp('');
    end;

    //<><><><><><><><><><>Anti Ban<><><><><><><><><><>\\

    procedure AntiBan;
    begin
      if not LoggedIn then Exit;
      case Random(30) of
        1: RandomRClick;
        2: HoverSkill(LampSkill, False);
        3: RandomMovement;
        4: BoredHuman;
        5: DoEmote(400 + Random(90));
      end;
    end;


    //<><><><><><><><><><>Chop Tree<><><><><><><><><><>\\


    procedure ChopTree;
    var CuttingTime: Integer;
      Tries: integer;
    begin
    if (not LoggedIn) then Exit;
      MarkTime(CuttingTime);
      MakeCompass('S')
        repeat
        if FindObjCustom(x, y, ['Wil', 'low'], [1989969, 3760987, 2844763], 7) then
        begin
          Mouse(x, y, 0, 0, false);
          if (IsUpText('Chop')) then
            wait(5000 + random(150));
          ChooseOption('hop')
            wait(10000 + random(3000));
          AntiBan;
          if (not FindObjCustom(x, y, ['Wil', 'low'], [1989969, 3760987, 2844763], 7)) then
            Wait(100 + random(100));
          Tries := Tries + 1;
          if (tries = 50) then
          begin
            Writeln('Willows dould not be found. Switching Players....');
            Logout;
            NextPlayer(False);
            Exit;
          end;
        end;
      until (invfull) or (TimeFromMark(CuttingTime) > 800000 + random(60000));
    end;


    //<><><><><><><><><><>Walk To Bank<><><><><><><><><><>\\


    procedure WalkToBank;
    begin
      if (not (LoggedIn)) then
        Exit;
      SymbolAccuracy := 0.2;
      MakeCompass('N');
      if (FindSymbol(x, y, 'bank')) then
      begin
        Mouse(x, y, 2, 2, true);
        FFlag(0);
        Writeln('Arrived At Bank');
      end;
    end;


    //<><><><><><><><><><>Banking<><><><><><><><><><>\\

    procedure Bank;
    begin
    if not LoggedIn then Exit;
      MakeCompass('W')
        Wait(300 + random(160));
      OpenBankQuiet('db');
      if (PinScreen) then
        InPin(YourPin);
      DepositAll;
      Banked := True;
      LoadsNum := LoadsNum + 1;
      LoadsNum2 := LoadsNum2 + 1;
      ReportVars[1] := ReportVars[1] + 1;
      SendSRLReport;
      CloseBank;
      writeln('Load Banked');
      Wait(150 + random(278));
      MakeCompass('S');
    end;

    //<><><><><><><><><><>Walk to Willows<><><><><><><><><><>\\

    procedure WalkToWillow;
    begin
    if not LoggedIn then Exit;
      if (FindSymbol(x, y, 'fish')) then
      begin
        Mouse(x, y, 2, 2, true);
        FFlag(0);
        Writeln('Arrived At Willows');
      end;
    end;

    //<><><><><><><><><><>Check Inventory<><><><><><><><><><>\\

    procedure CheckInventory;
    begin
      if (InvFull) then
      begin
        WalkToBank;
      end else
      begin
        ChopTree;
      end;
    end;


    //<><><><><><><><><><>Setup Script<><><><><><><><><><>\\

    procedure SetupScript;
    begin
      SRLId := YourSRLId;
      SRLPassword := YourSRLPass;
      ScriptID := '687';
      DeclarePlayers;
      if LoggedIn then
        exit;
    end;

    procedure MainProc;
    begin
      ChopTree;
      CheckInventory;
      AntiBan;
      WalkToBank;
      Bank;
      WalkToWillow;
      AntiBan;
    end;


    begin
      SMARTSetUpEX(55, False, True, False);
      SetTargetDC(SMARTGetDC);
      SetupSRL;
      ActivateClient;
      SetupScript;
      LoginPlayer;
      repeat
        MainProc;
        AntiBan;
      until (LoadsNum = LoadsPerPlayer) or (not LoggedIn);
      NextPlayer(true);
    end.
    Last edited by Minkino; 06-12-2009 at 02:57 PM.

  2. #2
    Join Date
    Jun 2007
    Posts
    124
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    it looks good but i dont think you used the anti-random procedure enough
    you should call it between every chop in case a random shows up when your cutting
    i might be wrong about that but it seems to work well in my wood cutter

  3. #3
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Use failsafes.
    Use DTMs.
    In your bank procedure you have:
    SCAR Code:
    if (PinScreen) then
        InPin(YourPin);
      DepositAll;
      Banked := True;
      LoadsNum := LoadsNum + 1;
      LoadsNum2 := LoadsNum2 + 1;
      ReportVars[1] := ReportVars[1] + 1;
      SendSRLReport;
      CloseBank;
      writeln('Load Banked');
      Wait(150 + random(278));
      MakeCompass('S');
    end;
    if you have:
    if Pin then
    InPin;
    DepositWillows;

    If im correct you need a 'else' in between InPin and DepositWillows otherwise if there isnt a pin it wont do anything I don't think
    I have no idea what i just said. Too tired. Got exams ciao

    T~M

  4. #4
    Join Date
    Jun 2009
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by The Man View Post
    Use failsafes.
    Use DTMs.
    In your bank procedure you have:
    SCAR Code:
    if (PinScreen) then
        InPin(YourPin);
      DepositAll;
      Banked := True;
      LoadsNum := LoadsNum + 1;
      LoadsNum2 := LoadsNum2 + 1;
      ReportVars[1] := ReportVars[1] + 1;
      SendSRLReport;
      CloseBank;
      writeln('Load Banked');
      Wait(150 + random(278));
      MakeCompass('S');
    end;
    if you have:
    if Pin then
    InPin;
    DepositWillows;

    If im correct you need a 'else' in between InPin and DepositWillows otherwise if there isnt a pin it wont do anything I don't think
    I have no idea what i just said. Too tired. Got exams ciao

    T~M
    If this does work as closely resembling java as I am suspecting, as I am not extremely familiar with Scar scripting yet, the IF statement that you were referring to is correct. If it does not have brackets enclosing the IF statements body then it will only execute one line beneath it when the statement is true. DepositAll and all following lines will be executed regardless of the IF statement being true or false.

  5. #5
    Join Date
    Jul 2007
    Posts
    1,055
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'm pretty sure that he doesn't need the Else. I think that it will continue to go to DepositAll;.

    But yeah, not 100% sure.

  6. #6
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    You left your name and pass in the attached script. I tried to change the pass for you, but looks like someone beat me to it. Hopefully not someone who's going to take your stuff.

    Anyway, just thought I'd let you know.

  7. #7
    Join Date
    Mar 2007
    Location
    Alberta, Canada
    Posts
    1,780
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    Looks really good. Try learning DTMs for walking, and then RadialWalk for backup, and then finally the symbol finding. This failsafe will make it so the walking almost never fails! (It also looks impressive for your applications). Other than that, work on your standards, and try to learn to make your own TPAs. Great first script!

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
  •