Results 1 to 7 of 7

Thread: GE Vial Filler

  1. #1
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default GE Vial Filler

    Not actually my first script, but it is my first script posted here and my first for testing out walking methods. I've tried ODTM, SPS and have now resorted to TPA for walking. I am attempting to test all walking methods and find what works best for me in different situations for future script-releases (my current WIP - guild miner).

    - ODTM can't find it's way back to the bank due to lack of trees/ladders/etc
    - SPS simply doesn't want to work for me
    - TPA seems to be working quite well so far..

    Aside from the walking this script still has some issues and is far from functional.

    Main issues that I haven't been able to resolve are -

    - Mainloop doesn't wish to repeat despite looping it both in my mainloop procedure and in the scripts official loop. I can't understand why, if someone has an explanation/fix for this it would be greatly appreciated. RESOLVED - Slight alteration to 'WalkBank' function and a 'continue' added to mainloop.

    - I found the best method for finding the fountain was to use the FindObject function in ACA, and it is indeed quite successful in finding the fountain without looking bot-like, however it takes quite some time (don't have a great enough understanding of TPAs to make my own yet). RESOLVED - Using function posted by alevere4

    - OpenBankNPC has so much trouble especially when on a heavily populated/laggy server. But I can't seem to find another option for banking at the GE. EDITED - Input a different function for finding and opening bank, still quite slow and bot-like.

    - Also, despite my best attempts the script does not wait until 'dtm_Vial' is no longer visible in the inventory while filling and simply does the static wait then returns to the bank. RESOLVED - Changed repeat-until to a while-do statement.

    Begin at NW bank of the Grand Exchange.
    Have unfilled vials in first bank slot.
    Post Proggies, bugs, suggestions and criticisms.

    Simba Code:
    program Vi4lFi11er;
    {$DEFINE SMART}
    {$i srl/srl.simba}

    var
      dtm_Vial, dtm_Filled, FilledUp: integer;
      x, y, C: integer;

    const
      VIALTOTAL = 300;

    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      //   Start In GE North West Bank + Empty Vials In First Bank Slot   //
      Players[0].Name := '';  // Username                      
      Players[0].Pass := '';  // Password                      
      Players[0].Pin := '';   // PIN                            
      Players[0].Active :=True;                                    
    end;                                                          
                                                                 
    procedure SetupLogin;                                        
    begin                      
      ClearDebug;            
      Smart_Server := 0;      // Preferred World Or 0 For Random//
      Smart_Members := True;
      Smart_Signed := True;
      Smart_SuperDetail := False;
      SetupSRL;
      DeclarePlayers;
      if not LoggedIn then
      LoginPlayer;
      ActivateClient;
    end;

    //Antibanning
    procedure AntiBan;
    begin
      if not LoggedIn then
        Exit;
      if not FindNormalRandoms then
      begin
        Status('AntiBan');
        FindNormalRandoms;
        FindNonInventoryRandoms;
        LevelUpEx(false, true)
        FindMod;
        FindSpinTicket;
        case Random(1000) Of
          10:
          begin
            HoverSkill('random', False);
            Wait(RandomRange(2000,2500));
            GameTab(Tab_Inv);
          end;

          20:
          begin
            PickUpMouse;
          end;

          30:
          begin
            RandomMovement;
          end;

          40:
          begin
            RandomRClick;
          end;

          50:
          begin
            BoredHuman;
          end;

          60:
          begin
            ExamineInv;
          end;
        end;
      end;
    end;

    function FindGEBank(x, y: Integer): Boolean;
    var
      CTS, I: Integer;
      MyTPA: TPointArray;
      ATPA: array of TPointArray;
    begin
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.03, 0.45);
      FindColorsSpiralTolerance(MSCX, MSCY, MyTPA, 4085863, MSX1, MSY1, MSX2, MSY2, 11);
      ColorToleranceSpeed(CTS);
      ATPA := TPAToATPAEx(MyTPA, 20, 20);

      for I := 0 to High(ATPA) do
      begin
        MiddleTPAEx(ATPA[i], x, y);
        MMouse(x, y, 0, 0);
        if (WaitUpTextMulti(['ank','ker','Ban','anker'],800)) then
        begin
          Result := True;
          GetMousePos(x, y);
          Break;
        end;
      end;
    end;

    //  openbank
    function OpenGE: Boolean;
    begin
      Status('OpenGE');
      if not LoggedIn then
      Exit else
      if FindNormalRandoms then
      Exit else
      begin
        SetAngle(SRL_ANGLE_LOW);
        Wait(RandomRange(500,800));
        if IsUpText('anker') then
        ClickMouse2(mouse_left) else
        if FindGEBank(x, y) then
        begin
          repeat
          ClickMouse2(mouse_right);
          WaitOption('ank B',2000);
          FFlag(0);
          Wait(RandomRange(1000,1500));
          if BankScreen then
          begin
          Result := True;
          Exit;
          end else
          Result := False;
          if PinScreen then
          InPin(Players[CurrentPlayer].Pin);
          Result := True;
          Exit;
          until BankScreen;
        end else
        CompassMovement(10, 30, false);
      end;
    end;

    //  deposititall
    function DepositItAll: Boolean;
    begin
      Status('DepositItAll');
      if not LoggedIn then
        Exit else
      if FindNormalRandoms then
        Exit else
      if PinScreen then
        InPin(Players[CurrentPlayer].Pin);
      if BankScreen then
        if InvCount <> 0 then
          begin
            Deposit(1, 28, True);
            Result := True;
            Exit;
          end else
          Result := False;
        if InvCount = 0 then
          Result := True;
          Exit;
    end;

    //  withdraw empty vials
    function WithdVials: Boolean;
    var
      i: integer;
    begin
      Status('WithdVials');
      if not LoggedIn then
        Exit else
      if FindNormalRandoms then
        Exit else
      if BankScreen then
      begin
        repeat
        C := (GetBankItemAmount(0, 0))
        if C < 29 then
        TerminateScript else
        Inc(i);
        Withdraw(0, 0, 0);
        Wait(RandomRange(1000,1500));
        if InvFull then
        begin
          Result := True;
          CloseBank;
          Exit;
        end else
          Result := False;
          Continue;
      until(InvFull) or (i > 5);
      end;
    end;

    //  walkfountain
    function WalkFountain: Boolean;
    begin
      Status('WalkFountain');
      if not LoggedIn then
        Exit else
      if FindNormalRandoms then
        Exit else
      if BankScreen then
        CloseBank else
      MakeCompass('n');
      SetAngle(SRL_ANGLE_HIGH);
      if TPAWalk(9869214,10,0,0,point(MMX2, MMY2)) then
      begin
        FFlag(0);
        While IsMoving do
        Wait(RandomRange(50,100));
        SymbolAccuracy := 0.3;
        FindSymbolIn(x,y,'water',MMX1,MMY1,MMX2,MMY2);
        Result := True;
        Exit;
      end else
      SymbolAccuracy := 0.3;
      if FindSymbolIn(x,y,'water',MMX1,MMY1,MMX2,MMY2) then
      begin
        WriteLn('Couldnt TPA walk, using symbol');
        Mouse(x,y,2,2,true);
        FFLag(0);
        While IsMoving do
        Wait(RandomRange(50,100));
        Result := True;
      end else
      Result := False;
      Exit;
    end;

    //  walkbank
    function WalkBank: Boolean;
    begin
      Status('WalkBank');
      if not LoggedIn then
        Exit else
      if FindNormalRandoms then
        Exit else
      MakeCompass('n');
      SetAngle(SRL_ANGLE_HIGH);
      if TPAWalk(9869214,10,2,2,point(MMX1, MMY1)) then
      begin
        FFlag(0);
        While IsMoving do
          Wait(RandomRange(50,100));
        SymbolAccuracy := 0.3;
        FindSymbolIn(x,y,'bank',MMX1,MMY1,MMX2,MMY2);
        Result := True;
        Exit;
      end else
      SymbolAccuracy := 0.3;
      if FindSymbolIn(x,y,'herbalist',MMX1,MMY1,MMX2,MMY2) then
      begin
        WriteLn('Couldnt TPA walk, using symbol');
        Mouse(x,y,2,2,true);
        FFLag(0);
        While IsMoving do
        Wait(RandomRange(50,100));
        SymbolAccuracy := 0.3;
        FindSymbolIn(x,y,'bank',MMX1,MMY1,MMX2,MMY2);
        FFlag(0);
        Result := True;
        Exit;
      end else
      Result := False;
    end;

    //  proggy
    procedure Proggy;
    begin
      ClearDebug;
      Writeln('|------>P1ngs Vi4l Fi11er<------|');
      WriteLn('# Of Vials Filled: ' + IntToStr(FilledUp));
      Writeln('Vials Per Hr: ' + IntToStr(round(3600000 * 1.0 / GetTimeRunning * FilledUp)));
      WriteLn('Time runn1ng: ' + TimeRunning);
      Writeln('|-------------------------------|');
    end;

    //  loadDTMS
    procedure LoadDTMs;
    begin
      dtm_Vial := DTMFromString('mggAAAHicY2NgYOAAYn4gFgZiXiBmBGImIBaBiosDsRwQS0HVJCWlQVWgYiMG7IARB4YAALUaAjI=');
      dtm_Filled := DTMFromString('mggAAAHicY2NgYOAAYl4gFgBiISifEYj5gJgdiPmBWAKIpYFYHIjr2vYDSSYMbMSAHTDiwBAAANx8Aro=');
    end;

    //  freeDTMS
    procedure EndDTM;
    begin
      FreeDTM(dtm_Vial);
      FreeDTM(dtm_Filled);
      FreeSRL;
    end;

    function FindFountain(x, y: Integer): Boolean;

    var
    CTS, I: Integer;
    MyTPA: TPointArray;
    ATPA: array of TPointArray;

    begin
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.21, 0.56);
      FindColorsSpiralTolerance(MSCX, MSCY, MyTPA, 11310978, MSX1, MSY1, MSX2, MSY2, 9);
      ColorToleranceSpeed(CTS);
      ATPA := TPAToATPAEx(MyTPA, 30, 30);

      for I := 0 to High(ATPA) do
      begin
        MiddleTPAEx(ATPA[i], x, y);
        MMouse(x, y, 0, 0);
        if (WaitUpText('ountain',800)) then
        begin
          Result := True;
          GetMousePos(x, y);
          Break;
        end else
        WriteLn('Fountain was not found');
      end;
    end;

    function IsFilling: Boolean;
    begin
      Result := PixelShift(IntToBox(MSCX-30, MSCY-30, MSCX+30, MSCY+30), 500) > 300;
    end;

    procedure FillVials;
    var
      T: integer;
    begin
      Status('FillVials');
      if not LoggedIn then
        Exit else
      if FindNormalRandoms then
        Exit else
      MakeCompass('n');
      SetAngle(SRL_ANGLE_HIGH);
      MarkTime(T);
      Wait(RandomRange(500,700));
      InvMouse(1,1);
      Wait(RandomRange(300,500));
      FindFountain(x, y);
      ClickMouse2(mouse_left);
      Wait(RandomRange(350,875));
      while FindDTM(dtm_Vial,x,y,MIX1,MIY1,MIX2,MIY2) do
      AntiBan;
      Wait(RandomRange(2267,3294));
      if (not(FindDTM(dtm_Vial,x,y,MIX1,MIY1,MIX2,MIY2))) then
      begin
        IncEx(FilledUp,28);
        Exit;
      end else
      if (T > 25000 + Random(3000)) then
        Exit;
    end;

    //  mainloop
    procedure MainLoop;
    begin
      repeat
      if OpenGE then
      begin
        Wait(RandomRange(500,1000));
        if DepositItAll then
        begin
          Wait(RandomRange(500,1000));
          if WithdVials then
          begin
            Wait(RandomRange(500,1000));
            if WalkFountain then
            begin
              Wait(RandomRange(500,1000));
              FillVials;
              Wait(RandomRange(500,1000));
              if WalkBank then
              begin
                Wait(RandomRange(500,1000));
                Proggy;
                Continue;
              end else
              WriteLn('Couldnt Walk To Bank');
              TerminateScript;
            end else
            WriteLn('Couldnt Walk To Fountain');
            TerminateScript;
          end else
          WriteLn('Couldnt Withdraw Vials');
          TerminateScript;
        end else
        WriteLn('Couldnt Deposit Items');
        TerminateScript;
      end else
      WriteLn('Couldnt Open Bank');
      TerminateScript;
      until(not(LoggedIn)) or (FilledUp >= VIALTOTAL);
    end;

    begin
      SetupLogin;
      AddOnTerminate('EndDTM');
      ActivateClient;
      LoadDTMs;
      Wait(RandomRange(1500,2000));
      ExitSquealOfFortune;
        if not LoggedIn then
        Exit else
      if FindNormalRandoms then
        Exit else
      MainLoop;
    end.
    Last edited by P1ng; 05-22-2012 at 11:36 AM.

  2. #2
    Join Date
    Mar 2012
    Posts
    426
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default

    Quote Originally Posted by p1ng View Post
    Not actually my first script, but it is my first script posted here and my first for testing out walking methods. I've tried ODTM, SPS and have now resorted to TPA for walking. I am attempting to test all walking methods and find what works best for me in different situations for future script-releases (my current WIP - guild miner).

    - ODTM can't find it's way back to the bank due to lack of trees/ladders/etc
    - SPS simply doesn't want to work for me
    - TPA seems to be working quite well so far..

    Aside from the walking this script still has some issues and is far from functional.

    Main issues that I haven't been able to resolve are -

    - Mainloop doesn't wish to repeat despite looping it both in my mainloop procedure and in the scripts official loop. I can't understand why, if someone has an explanation/fix for this it would be greatly appreciated.

    - I found the best method for finding the fountain was to use the FindObject function in ACA, and it is indeed quite successful in finding the fountain without looking bot-like, however it takes quite some time (don't have a great enough understanding of TPAs to make my own yet).

    - OpenBankNPC has so much trouble especially when on a heavily populated/laggy server. But I can't seem to find another option for banking at the GE.

    - Also, despite my best attempts the script does not wait until 'dtm_Vial' is no longer visible in the inventory while filling and simply does the static wait then returns to the bank.

    Simba Code:
    program Vi4lFi11er;
    {$DEFINE SMART}
    {$i srl/srl.simba}

    var
      dtm_Vial, dtm_Filled: integer;
      x, y: integer;
    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
     
      // Start In GE North West Bank - Empty Vials In First Bank Slot //
      Players[0].Name := '';       // Username                       //
      Players[0].Pass := '';      // Password                       //
      Players[0].Pin := '';      // PIN                            //
      Players[0].Active :=True; //                                //
    end;                       //                                //
                              //                                //
    procedure SetupLogin;    //                                //
    begin                   //                                //
      ClearDebug;          //                                //
      Smart_Server := 0;  // Preferred World Or 0 For Random//
      Smart_Members := True;
      Smart_Signed := True;
      Smart_SuperDetail := False;
      SetupSRL;
      DeclarePlayers;
      if not LoggedIn then
      LoginPlayer;
      ActivateClient;
    end;

    //Antibanning
    procedure AntiBan;
    begin
      if not LoggedIn then
        Exit;
      if not FindNormalRandoms then
      begin
        FindNormalRandoms;
        FindNonInventoryRandoms;
        Status('AntiBan');
        case Random(50) Of
          10:
          begin
            HoverSkill('random', False);
            Wait(RandomRange(2000,2500));
            GameTab(Tab_Inv);
          end;

          20:
          begin
            PickUpMouse;
          end;

          30:
          begin
            RandomMovement;
          end;

          40:
          begin
            RandomRClick;
          end;
        end;
      end;
    end;

    //  openbank
    function OpenGE: Boolean;
    begin
      Status('OpenGE');
      if not LoggedIn then
      Exit else
      if FindNormalRandoms then
      Exit else
      begin
        repeat
        SetAngle(SRL_ANGLE_LOW);
        Wait(RandomRange(500,800));
        OpenBankNPC;
        FFlag(0);
        Wait(RandomRange(1000,1500));
        if BankScreen then
        Result := True else
        Result := False;
        if PinScreen then
        InPin(Players[CurrentPlayer].Pin);
        Result := True;
        until BankScreen;
      end;
    end;

    //  deposititall
    function DepositItAll: Boolean;
    begin
      Status('DepositItAll');
      if not LoggedIn then
        Exit else
      if FindNormalRandoms then
        Exit else
      if PinScreen then
        InPin(Players[CurrentPlayer].Pin);
      if BankScreen then
        if InvCount <> 0 then
          begin
            Deposit(1, 28, True);
            Result := True;
          end else
          Result := False;
        if InvCount = 0 then
          Result := True;
          Exit;
    end;

    //  withdraw empty vials
    function WithdVials: Boolean;
    var
      i: integer;
    begin
      Status('WithdVials');
      if not LoggedIn then
        Exit else
      if FindNormalRandoms then
        Exit else
      if BankScreen then
      begin
        repeat
        Inc(i);
        Withdraw(0, 0, 0);
        Wait(RandomRange(1000,1500));
        if InvFull then
        begin
          Result := True;
          CloseBank;
          Exit;
        end else
          Result := False;
          Continue;
      until(InvFull) or (i > 5);
      end;
    end;

    //  walkfountain
    function WalkFountain: Boolean;
    begin
      Status('WalkFountain');
      if not LoggedIn then
        Exit else
      if FindNormalRandoms then
        Exit else
      if BankScreen then
        CloseBank else
      MakeCompass('n');
      SetAngle(SRL_ANGLE_HIGH);
      if TPAWalk(9869214,10,0,0,point(MMX2, MMY2)) then
      begin
        FFlag(0);
        While IsMoving do
        Wait(RandomRange(50,100));
        SymbolAccuracy := 0.3;
        FindSymbolIn(x,y,'water',MMX1,MMY1,MMX2,MMY2);
        Result := True;
        Exit;
      end else
      SymbolAccuracy := 0.3;
      if FindSymbolIn(x,y,'water',MMX1,MMY1,MMX2,MMY2) then
      begin
        WriteLn('Couldnt TPA walk, using symbol');
        Mouse(x,y,2,2,true);
        FFLag(0);
        While IsMoving do
        Wait(RandomRange(50,100));
        Result := True;
      end else
      Result := False;
      Exit;
    end;

    //  walkbank
    function WalkBank: Boolean;
    begin
      Status('WalkBank');
      if not LoggedIn then
        Exit else
      if FindNormalRandoms then
        Exit else
      MakeCompass('n');
      SetAngle(SRL_ANGLE_HIGH);
      if TPAWalk(9869214,10,2,2,point(MMX1, MMY1)) then
      begin
        FFlag(0);
        While IsMoving do
        Wait(RandomRange(50,100));
        SymbolAccuracy := 0.3;
        FindSymbolIn(x,y,'bank',MMX1,MMY1,MMX2,MMY2);
        Result := True;
        Exit;
      end else
      SymbolAccuracy := 0.3;
      if FindSymbolIn(x,y,'herbalist',MMX1,MMY1,MMX2,MMY2) then
      begin
        WriteLn('Couldnt TPA walk, using symbol');
        Mouse(x,y,2,2,true);
        FFLag(0);
        While IsMoving do
        Wait(RandomRange(50,100));
        FindSymbolIn(x,y,'bank',MMX1,MMY1,MMX2,MMY2);
        FFlag(0);
        Result := True;
      end else
      Result := False;
    end;

    //  proggy

    //  loadDTMS
    procedure LoadDTMs;
    begin
      dtm_Vial := DTMFromString('mggAAAHicY2NgYOAAYn4gFgZiXiBmBGImIBaBiosDsRwQS0HVJCWlQVWgYiMG7IARB4YAALUaAjI=');
      dtm_Filled := DTMFromString('mggAAAHicY2NgYOAAYl4gFgBiISifEYj5gJgdiPmBWAKIpYFYHIjr2vYDSSYMbMSAHTDiwBAAANx8Aro=');
    end;

    //  freeDTMS
    procedure EndDTM;
    begin
      FreeDTM(dtm_Vial);
      FreeDTM(dtm_Filled);
      FreeSRL;
    end;

    function FindFountain(var fx, fy: Integer): Boolean;
    var
      arP, arAP: TPointArray;
      arC, arUC: TIntegerArray;
      ararP: T2DPointArray;
      tmpCTS, i, j, arL, arL2: Integer;
      P: TPoint;
      X, Y, Z: Extended;
    begin
        if not LoggedIn then
        Exit else
      if FindNormalRandoms then
        Exit else
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.21, 0.56);

      if not(FindColorsTolerance(arP, 11310978, MSX1, MSY1, MSX2, MSY2, 9)) then
      begin
        Writeln('Failed to find the color, no fountain nearby.');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      arC := GetColors(arP);
      arUC := arC;
      ClearSameIntegers(arUC);
      arL := High(arUC);
      arL2 := High(arC);

      for i := 0 to arL do
      begin
        ColorToXYZ(arC[i], X, Y, Z);

        if (X >= 19.68) and (X <= 38.08) and (Y >= 21.16) and (Y <= 41.60) and (Z >= 31.46) and (Z <= 55.32) then
        begin
          for j := 0 to arL2 do
          begin
            if (arUC[i] = arC[j]) then
            begin
              SetLength(arAP, Length(arAP) + 1);
              arAP[High(arAP)] := arP[j];
            end;
          end;
        end;
      end;

      SortTPAFrom(arAP, Point(MSCX, MSCY));
      ararP := SplitTPAEx(arAP, 10, 10);
      arL := High(ararP);

      for i := 0 to arL do
      begin
        if (Length(ararP[i]) < 10) then Continue;
        P := MiddleTPA(ararP[i]);
        MMouse(P.x, P.y, 5, 5);
        Wait(100 + Random(100));
        if (IsUpText('ountain')) then
        begin;
          Result := True;
          Break;
        end;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      if (i = arL + 1) then
      begin
        Writeln('Could not find fountain.');
        Exit;
      end;

      GetMousePos(fx, fy);
    end;

    function IsFilling: Boolean;
    begin
      Result := PixelShift(IntToBox(MSCX-30, MSCY-30, MSCX+30, MSCY+30), 500) > 300;
    end;

    procedure FillVials;
    var
      T: integer;
    begin
      Status('FillVials');
      if not LoggedIn then
        Exit else
      if FindNormalRandoms then
        Exit else
      MakeCompass('n');
      SetAngle(SRL_ANGLE_HIGH);
      MarkTime(T);
      Wait(RandomRange(500,700));
      InvMouse(1,1);
      Wait(RandomRange(300,500));
      FindFountain(x, y);
      ClickMouse2(mouse_left);
      Wait(RandomRange(350,875));
      repeat
      AntiBan;
      Wait(RandomRange(500,1000));
      if (T > 25000) then
        Exit;
      until(not(FindDTM(dtm_Vial,x,y,MIX1,MIY1,MIX2,MIY2)));
      Wait(RandomRange(20,50));
    end;

    //  mainloop
    procedure MainLoop;
    begin
      repeat
      if OpenGE then
      begin
        Wait(RandomRange(500,1000));
        if DepositItAll then
        begin
          Wait(RandomRange(500,1000));
          if WithdVials then
          begin
            Wait(RandomRange(500,1000));
            if WalkFountain then
            begin
              Wait(RandomRange(500,1000));
              FillVials;
              Wait(RandomRange(500,1000));
              if WalkBank then
              Wait(RandomRange(500,1000));
            end else
            WriteLn('Couldnt Walk To Fountain');
            TerminateScript;
          end else
          WriteLn('Couldnt Withdraw Vials');
          TerminateScript;
        end else
        WriteLn('Couldnt Deposit Items');
        TerminateScript;
      end else
      WriteLn('Couldnt Open Bank');
      TerminateScript;
      until(not(LoggedIn));
    end;

    begin
      SetupLogin;
      AddOnTerminate('EndDTM');
      ActivateClient;
      LoadDTMs;
      Wait(RandomRange(1500,2000));
      ExitSquealOfFortune;
        if not LoggedIn then
        Exit else
      if FindNormalRandoms then
        Exit else
      repeat
      MainLoop;
      until(not(LoggedIn));
    end.
    Alright, I looked over your script briefly and I will do it more in depth here in a few minutes. I think that your "looping" issue is actually one of your functions failing and resulting in a termination of the script and not a looping error. That could be wrong, but that is the impression I got.

    Instead of using the ACA print out function try something like below to speed up the locating of the fountain. Obviously, you need to fill in the uptext and ACA info with what you need.

    Simba Code:
    Function FindMonster(x, y: Integer): Boolean;

    Var
    CTS, I: Integer;
    TPA: TPointArray;
    ATPA: Array of TPointArray;

    Begin
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.12, 0.72);
      FindColorsSpiralTolerance(MSCX, MSCY, TPA, 6263962, MSX1, MSY1, MSX2, MSY2, 15);
      ColorToleranceSpeed(CTS);
      ATPA := TPAToATPAEx(TPA, 30, 30);

      For I := 0 To High(ATPA) Do
      Begin
        MiddleTPAEx(ATPA[i], x, y);
        MMouse(x, y, 0, 0);
        If(WaitUpTextMulti(['Bloo','ood','od ess','wrai','aith'],800)) Then
        Begin
          Result := True;
          GetMousePos(x, y);
          Break;
        End;
      End;
    End;

    Procedure AttackMonster;
    Begin
      If FindMonster(x,y) then...
    End;

    Don't really know a solution for the banking issue other than writing your own function to open the banker.

    And I since I haven't run it I can't know what the issue is with not detecting the empty vials no longer existing, other than the maybe your empty vial dtm tolerance is too high and it also detects full vials as being empty.

    Hope this helps!
    - My Scripts (Beginning to Update to SRL 6) -

  3. #3
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    Resolved the character leaving too quickly by replacing the repeat-until with a while-do statement. Seems to be working so far, not 100% sure what the problem was previously but the DTM tolerances don't appear to be too high.

    Just tested the 'findmonster' function and that works much more quickly, do you mind if I input the edited method into the script?

  4. #4
    Join Date
    Mar 2012
    Posts
    426
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default

    Quote Originally Posted by p1ng View Post
    Resolved the character leaving too quickly by replacing the repeat-until with a while-do statement. Seems to be working so far, not 100% sure what the problem was previously but the DTM tolerances don't appear to be too high.

    Just tested the 'findmonster' function and that works much more quickly, do you mind if I input the edited method into the script?
    You are more than welcome to use it. I picked it up somewhere along the way myself haha. If the DTM tolerance isn't causing the issue then I would suggest doing something like below.

    Simba Code:
    FillVials;
    MarkTime(T);
    Repeat
      Antiban;
      Wait(250+Random(250));
    Until (TimeFromMark(T) >= 20000+Random(1000));

    You need to see how long it takes to fill all the vials then input that time. Also, take into account laggy computers/internet for some people.
    - My Scripts (Beginning to Update to SRL 6) -

  5. #5
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    It's currently working with
    Simba Code:
    while FindDTM(dtm_Vial,x,y,MIX1,MIY1,MIX2,MIY2) do
      AntiBan;
      Wait(RandomRange(500,1000));
      if (not(FindDTM(dtm_Vial,x,y,MIX1,MIY1,MIX2,MIY2))) then
        Exit else
      if (T > 25000) then
        Exit;

    So I'm just going to stick with that at the moment, 25sec is roughly the amount of time it takes with a little bit extra

  6. #6
    Join Date
    Mar 2012
    Posts
    426
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default

    Quote Originally Posted by p1ng View Post
    It's currently working with
    Simba Code:
    while FindDTM(dtm_Vial,x,y,MIX1,MIY1,MIX2,MIY2) do
      AntiBan;
      Wait(RandomRange(500,1000));
      if (not(FindDTM(dtm_Vial,x,y,MIX1,MIY1,MIX2,MIY2))) then
        Exit else
      if (T > 25000) then
        Exit;

    So I'm just going to stick with that at the moment, 25sec is roughly the amount of time it takes with a little bit extra
    Yea, that looks good. I would maybe do (T > 25000+Random(3000)) just so if it does fall back on that fail safe it does not have the exact time consistently.
    - My Scripts (Beginning to Update to SRL 6) -

  7. #7
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    Thanks for all the help, going to look into making my own function for finding the banker's at the GE and see how I go as that is now the only unresolved issue.

    Much appreciated.

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
  •