Results 1 to 4 of 4

Thread: Why cant it recognise a full invy?

  1. #1
    Join Date
    Jan 2012
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default Why cant it recognise a full invy?

    Simba Code:
    Program B3astchopper;

    {$DEFINE SMART}
    {$i SRL\SRL.simba}
    {$i sps/sps.simba}

    Const
     SRLStats_Username = '';// Your SRL Stats Username
     SRLStats_Password = ''; // Your SRL Stats Password
     BreakEvery        = 120;     //How Many Minutes To break After
     BreakFor          = 5;      //How long to Break For
     Version           = '1.0';
     TREES_TO_CUT = 'willow';
     PLAYER_BANK_PIN = '9251';

    Var
    Logs_Chopped: Integer;

    Procedure StatsGuise(wat:String);
    Begin
      Status(wat);
      Disguise(wat);
    End;

    Function CheckAndClick(UpText, Option:string; X,Y:Integer; RClick:Boolean):Boolean;
    Begin
      MMouse(x, y, 5, 5);
      If WaitUpText(UpText, 1500+random(500)) Then
      Begin
        Result:=True;
        GetMousePos(x, y);
        If RClick Then
        Begin
          Mouse(x, y, 0, 0, False);
          Result:=WaitOption(Option, 2000);
          If Result Then FFlag(0);
        End Else;
        Begin
        Mouse(x, y, 0, 0, True);
        Wait(100+Random(50));
        FFlag(0);
        End;
      End;
    End;

    Procedure Antiban;
    Begin
      Case Random(5000) Of
        0: Begin StatsGuise('AntiBan') GameTab(tab_Stats) HoverSkill('Woodcutting', False) GameTab(28) End;
        1: Begin StatsGuise('AntiBan') SleepAndMoveMouse(8000 + Random(380)); End;
        2: Begin StatsGuise('AntiBan') RandomAngle(1); End;
        3: Begin StatsGuise('AntiBan') GameTab(Tab_Stats) HoverSkill('random', False); GameTab(28) End;
        4: Begin StatsGuise('AntiBan') GameTab(Tab_Stats); Wait(4000 + Random(400)); GameTab(28) End;
        5: Begin Wait(3000) End;
      End;
    End;

    Procedure FailSafe(Reason:String);
    Begin
      Logout;
      Stats_Commit;
      //ProgressReport;
      TerminateScript;
    End;

    Procedure WalkToTree;

        Var
          ToTrees:TPointArray;

            Begin
              if(not(LoggedIn))then
              Exit;
              FindNormalRandoms;

                Writeln('Attempting To Walk To Trees...')
                SetupSRL;
                SPS_Areas := ['10_9'];
                ToTrees:=  [Point(4209, 3686), Point(4190, 3735)];
                SPS_WalkPath(ToTrees);

                Writeln('Found the trees');
                Wait(5354+random(254));
    End;

    Function ChopDown:Boolean;
    Var
      X, Y, PlusOne, TreeCounter: Integer;
    Begin
      PlusOne:= InvCount +1;
      If FindObjCustom(X, Y, ['Chop', 'down', 'willow'], [2107945, 922899, 723723, 1384477], 30) Then
      Begin;
        WriteLn('Aww yea! A tree woot@!');
        StatsGuise('Aww Yea! A tree woot@!');
        GetMousePos(x, y)
        StatsGuise('Aww yea! A tree Woot@!');


      Case Random(2) Of
          0: Mouse (x, y, 5, 5, True);
          1: Begin
               Mouse(x, y, 5, 5, False);
               WaitOption('Chop', 400);
             End;
        End;

        Repeat
          MarkTime(TreeCounter);
          Antiban;
          Wait(100);
          If InvCount=Plusone Then
            Writeln('We got a log baby');
        Until (InvCount=Plusone)

      End;
    End;


    Procedure WalkToWillows;
          Var
          walkTree:TPointArray;

          begin
            SPS_Setup(RUNESCAPE_SURFACE,['10_9','11_9','11_8','9_8','9_9']);
            walkTree := [Point(4186, 3668), Point(4184, 3645), Point(4151, 3721)];
            SPS_WalkPath(walkTree);
          end;

        Procedure WalkToBank;
        Var
          walkBank:TPointArray;

        begin
          SetupSRL;
          SPS_Setup(RUNESCAPE_SURFACE,['10_9','11_9','11_8','9_8','9_9']);
          walkBank := [Point(4152, 3698), Point(4202, 3685)];
          SPS_WalkPath(walkBank);
        end;

        Procedure bankLogs;
        Var
        Logs_Chopped: Integer;
        EXP_GAINED: Integer;
          begin
          if(InvFull) then
          begin

            WriteLn('Inventory full, Banking');

            OpenBankFast('db');
              WriteLn('Depositing ' + TREES_TO_CUT + ' logs.');

            if(PinScreen) then
              WriteLn('Entering Bank PIN: ' + PLAYER_BANK_PIN + '.');
              InPin(PLAYER_BANK_PIN);

            if(BankScreen) then
              DepositAll;
              Logs_Chopped := Logs_Chopped + 28;
              EXP_Gained  := EXP_Gained + 1890;
              WriteLn('Deposited ' + TREES_TO_CUT + ' logs.');
              WriteLn('Closing Bank');
              WriteLn('Logs Chopped: ' + IntToStr(Logs_Chopped));
              WriteLn('Gained EXP: ' + IntToStr(EXP_Gained));

            CloseBank;
              WriteLn('Getting Walk Path');
              Wait(2000 + Random(1500));
              WriteLn('Found Walk Path');
              Wait(1000 + Random(300));
              WriteLn('Walking to Willows');

              end;
            end;

        Procedure checkFullInv;
        begin
          if(InvFull) then
            begin
              WriteLn('Inventory Full, finding bank path...');
              WalkToBank;
              Wait(1000 + Random(1500));
              WriteLn('Found Bank, Walking to bank...');
              bankLogs;
              WalkToWillows;
            end;
        end;

        Procedure treeChop;
        var x, y: integer;
        begin
        if not LoggedIn then Exit;

        if(InvFull) then exit;
            repeat
              if FindObj(x, y, 'hop', 3491141, 10) then
                Mouse(x, y, 1, 1, false);
                ChooseOption('hop');

              repeat
                wait(1200+random(450));
                AntiBan;
                CheckFullInv;
                Until not(IsUpText('illow')or(InvFull))
              until(InvFull);
        end;





    {------------------------------------------------------------------------------}
    begin
      ClearDebug;
      SetUpSRL;
        repeat
          WalkToBank;
          bankLogs;
          WalkToWillows;
          ChopDown;


      until (Logs_Chopped >= 10000);

    end.

    This is my first, script, followed mostly Yohojo(thanks so much), but i wanted it to also bank, so i followed another person's guide on walking/banking, but it will never recognise the inv is full.. Help is greatly welcomed, along with any little updates that can improve the script in general!

  2. #2
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    You have way to many InvFulls and such. Try to only add one where it's needed.

    It's late here, so I'll look at it tomorrow if you haven't figured it out.

  3. #3
    Join Date
    Jan 2012
    Location
    Calgary, AB, Canada
    Posts
    1,819
    Mentioned
    5 Post(s)
    Quoted
    120 Post(s)

    Default

    You need to add:

    Simba Code:
    if InvFull then
    begin

    at the beginning of the chopping procedure in this procedure:

    Simba Code:
    Procedure treeChop;
        var x, y: integer;
        begin
        if not LoggedIn then Exit;

        if(InvFull) then exit; // If inv is full it will exit and not do anything else but you don't actually use this procedure
            repeat
              if FindObj(x, y, 'hop', 3491141, 10) then
                Mouse(x, y, 1, 1, false);
                ChooseOption('hop');

              repeat
                wait(1200+random(450));
                AntiBan;
                CheckFullInv;
                Until not(IsUpText('illow')or(InvFull))
              until(InvFull);
        end;

    But in the function you use (ChopDown) you never use a if invfull then command

    Simba Code:
    Function ChopDown:Boolean;
    Var
      X, Y, PlusOne, TreeCounter: Integer;
    Begin
      If InvFull then // Added this to the function to call on WalkToBank; when inv is full
      WalkToBank;

      PlusOne:= InvCount +1;
      If FindObjCustom(X, Y, ['Chop', 'down', 'willow'], [2107945, 922899, 723723, 1384477], 30) Then
      Begin;
        WriteLn('Aww yea! A tree woot@!');
        StatsGuise('Aww Yea! A tree woot@!');
        GetMousePos(x, y)
        StatsGuise('Aww yea! A tree Woot@!');


      Case Random(2) Of
          0: Mouse (x, y, 5, 5, True);
          1: Begin
               Mouse(x, y, 5, 5, False);
               WaitOption('Chop', 400);
             End;
        End;

        Repeat
          MarkTime(TreeCounter);
          Antiban;
          Wait(100);
          If InvCount=Plusone Then
            Writeln('We got a log baby');
        Until (InvCount=Plusone)

      End;
    End;
    Current Project: Retired

  4. #4
    Join Date
    Feb 2012
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ohhh k ty

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
  •