Results 1 to 5 of 5

Thread: Ivy Chopper

  1. #1
    Join Date
    Jan 2012
    Location
    I live in Australia.
    Posts
    137
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Ivy Chopper

    Hey guys, this is my first script, its an extremely basic ivy chopper, just thought i'd get some practice and would appreciate any feedback.

    Whilst it is basic it still does a decent job and contains sufficient(to my knowledge) antiban, Progress reports are appreciated so if you could swing one my way would be good. This was only my first practice script so i don't plan on changing much to it unless someone requests.. e.g. perhaps an option to avoid the 6 hour logout.

    Instructions for running
    - place your character right next to an ivy spot, preferably one north of your character, though other ones may also work though they are untested, I used the Ivy on the south castle wars wall, so duel rung to castle wars and run south a little.
    - in the code replace username and password
    - in the code replace nickname with 4 consecutive letters out of your runescape characters name
    - press run and wait for smart to start up and it should
    Cheers

    Simba Code:
    program New;
    {$i srl/srl/misc/smart.simba}
    {$i srl/srl.simba}
    var
      AntibanUsed, startexp, currentexp: integer;
      stop: boolean;


    Procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
      Players[0].Name :='username';
      Players[0].Pass :='password';
      Players[0].Nick :='jnickname';
      Players[0].Active:=True;
      Smart_Server := 0;
      Smart_Members := False;
      Smart_Signed := True;
      Smart_SuperDetail := False;
      loginplayer;
      stop:= false
      startexp:= GetXPBarTotal

    end;

    Procedure ChopIvy;
    var
      x, y: Integer;
    Begin;

       x:=MSCx
       y:=MSCy

      If FindObjTPA(x, y, 5477747, 5, 1, 10, 10, 10, ['hop']) Then
    Begin
            Writeln('Colour found, chopping ivy.....')
        Case Random(8) of
        0: Begin
              Mouse(x, y, 5, 5, False);
              WaitOption('Chop', 200);
           End;
        Else
          Mouse(x, y, 5, 5, true);

        End;
           End
           else
           begin
             Writeln('Colour not found.');
             Writeln('Logging out.');
             logout;
             stop:= true
           End;
        End;

    Function Chopping: integer;
      var
        cutting: TBox;
      Begin
      cutting := IntToBox(245, 130, 285, 195);
        Result := AveragePixelShift(cutting, 250, 750)
      End;
    Procedure AntiBan;
    Begin
      If(not(LoggedIn))Then
      Exit;
      case Random(300) of
       0:
       begin
         HoverSkill('Woodcutting', false);
         wait(Random(1000));
         inc(AntibanUsed);
       end;
       1:
       begin
       PickUpMouse;
       inc(AntibanUsed);
       end;
       2:
       begin
         MakeCompass('N');
         wait(100+random(133));
         MakeCompass('S');
         wait(50+random(133));
         MakeCompass('N');
         inc(AntibanUsed);
       end;
        3: Begin PickUpMouse; SleepAndMoveMouse(3000 + Random(500));
        inc(AntibanUsed);
        End;
        4: Begin GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(Tab_Inv);
        inc(AntibanUsed);
        End;

      end;
    end;

    procedure Report;
    begin
      ClearDebug;
      currentexp:= GetXPBarTotal
      WriteLn('++++++++++++++++++++++++++++++++++++');
      WriteLn(Padr('AntiBans: ' + IntToStr(AntiBanUsed), 67));
      WriteLn(Padr('EXP Gained: ' + IntToStr((currentexp - startexp)), 67));
      Writeln('Ran for: '+ TimeRunning);
      WriteLn('++++++++++++++++++++++++++++++++++++');
    end;

    begin
      SetUpSRL;
      ActivateClient;
      DeclarePlayers;
      repeat
        if Chopping <300 then
    begin
        ChopIvy;
        Report
        wait(750+random(250))
    end else
    begin
     wait(50);
     Antiban
    end;
      until(stop= true)
    end.
    Last edited by farmer jack; 01-20-2012 at 08:28 AM. Reason: fixed proggie

  2. #2
    Join Date
    Dec 2011
    Posts
    193
    Mentioned
    5 Post(s)
    Quoted
    51 Post(s)

    Default

    Exp gained:

    Record the exp bar, or skill exp at the start of the script, then everytime you want to check exp gained you subtract the starting exp from the current exp.

    ExpGained = GetXPBarTotal - Starting Exp

    -
    Script is a decent starting point, needs more failsafes and standards could be improved. Make sure there's white space between functions & procedures, little things like that, the rest you'll pick up naturally.

    Good luck.

    OSRS Color Scripts: Borland_Salamanders | Borland_Iron_Ores
    Utilities & Snippets: [Color] OSBuddy Item Looting

  3. #3
    Join Date
    Jan 2012
    Location
    I live in Australia.
    Posts
    137
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks for the help, worked well, however another question.. do you know the code to exit the script?

    I actually reckon that one fail-safe might be the only one it needs.

  4. #4
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Looks nice bud, congratulations on you first script. I don't see anything about birds nest searching, have you considered adding that? It might prove to be a bit more challenging but if you can pull it off then you'll have that much more knowledge on scripting. Best of luck to you!

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  5. #5
    Join Date
    Dec 2011
    Posts
    193
    Mentioned
    5 Post(s)
    Quoted
    51 Post(s)

    Default

    To stop the script use
    TerminateScript;

    Just make sure that if you wish to log the player out you have to call 'Logout;' before terminating, the script can't log the player out AFTER it's terminated now can it

    And yeah, try your hand at finding & looting nests. I'll be pretty interested to see what method you come up with.

    For the simple things like reports/proggies & logout procedures it's perfectly fine to look at other scripts for reference, as long as the main part of the script (such as finding the ivy, chopping it) was your own original idea, no one will complain.

    Keep going

    OSRS Color Scripts: Borland_Salamanders | Borland_Iron_Ores
    Utilities & Snippets: [Color] OSBuddy Item Looting

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
  •