Results 1 to 9 of 9

Thread: Chocolateduster

  1. #1
    Join Date
    Mar 2015
    Posts
    12
    Mentioned
    1 Post(s)
    Quoted
    7 Post(s)

    Default Chocolateduster

    I read some tutorials here on the forum and decided I want to make a chocolate duster. It dusts chocolate bars in your inventory to chocolate dust with a knife. A chocolate bar is about 75 gp and chocolate dust is worth 95gp so you make 20gp profit per bar.

    So far it works pretty good, but now I'd like to add banking to it. Any ideas how I can do this? I'd prefer to do this in the GE, but since it's such a crowded area I don't think color bots work so good over there. Any suggestions on how I should add banking? Any other suggestions for this script or my code?

    Here's the code:
    Code:
    program Chocolateduster;
    {$i AeroLib/AeroLib.Simba}
    
    var
      Knife:TItem;
      Chocolate:TItem;
      ChocolateDust:TItem;
    
    Procedure LoadItem;
    begin
      Knife.DTM := DTMFromString('mrAAAAHic42BgYOCCYl4gFgJiASBmZYAAZqg4BxAzQcXYgFgCiKWBWASIy/NygSQjTizJgB/g1gnBMAAA9FYCMg==');
      Chocolate.DTM := DTMFromString('mwQAAAHic42RgYOAFYm4gFgJiCSjNA8SsDBDABsQcUDYzlM8DVccP1QsSy3FWB5KMeLEkA2GA3wQIhgMA5+sBxA==');
      ChocolateDust.DTM := DTMFromString('mAAEAAHic42FgYGAHYlYgZmSAADYg5gJiXiDmB2JhIBaCsjmgmBWqjhOqjgfKZoNiZigGgTR7VajpxGFJBtIA8SYj/AgDADogAcw=');
    end
    
    Procedure UseItem;
    var
      pnt: TPoint;
    begin
      while Chocolate.getAmount(True) <> 0 do
      begin
        if Knife.interact(MOUSE_LEFT) then
          Chocolate.interact(MOUSE_LEFT);
      end;
    end;
    
    begin
      initAL;
      LoadItem();
      UseItem();
    end.
    Last edited by Scornical; 03-18-2017 at 09:27 PM.

  2. #2
    Join Date
    Jan 2013
    Posts
    86
    Mentioned
    0 Post(s)
    Quoted
    25 Post(s)

    Default

    When declaring multiple of the same variable, for example TItem, you can separate them by a comma. So instead of;

    Code:
    Knife:TItem;
    Chocolate:TItem;
    ChocolateDust:TItem;
    You could just do;

    Code:
    Knife, Chocolate, ChocolateDust: TItem;
    Also if you are getting errors like "failed to free DTM" when you stop the script, you should add a method to Free the DTM's when the script ends, for example;

    Code:
    program Chocolateduster;
    {$i AeroLib/AeroLib.Simba}
    
    var
      Knife, Chocolate, ChocolateDust: TItem;
    
    Procedure LoadItem;
    begin
      Knife.DTM := DTMFromString('mrAAAAHic42BgYOCCYl4gFgJiASBmZYAAZqg4BxAzQcXYgFgCiKWBWASIy/NygSQjTizJgB/g1gnBMAAA9FYCMg==');
      Chocolate.DTM := DTMFromString('mwQAAAHic42RgYOAFYm4gFgJiCSjNA8SsDBDABsQcUDYzlM8DVccP1QsSy3FWB5KMeLEkA2GA3wQIhgMA5+sBxA==');
      ChocolateDust.DTM := DTMFromString('mAAEAAHic42FgYGAHYlYgZmSAADYg5gJiXiDmB2JhIBaCsjmgmBWqjhOqjgfKZoNiZigGgTR7VajpxGFJBtIA8SYj/AgDADogAcw=');
    end
    
    Procedure UseItem;
    var
      pnt: TPoint;
    begin
      while Chocolate.getAmount(True) <> 0 do
      begin
        if Knife.interact(MOUSE_LEFT) then
          Chocolate.interact(MOUSE_LEFT);
      end;
    end;
    
    procedure FreeDTMS;
    begin
      FreeDTM(Knife.DTM);
      FreeDTM(Chocolate.DTM);
      FreeDTM(ChocolateDust.DTM);
    end;
    
    begin
      initAL;
      AddOnTerminate('FreeDTMS');//When the script terminates, it calls the 'FreeDTMS' procedure
      LoadItem();
      UseItem();
    end.
    I'm pretty new here also, so if I am saying anything incorrectly please forgive me. :P

  3. #3
    Join Date
    Mar 2015
    Posts
    12
    Mentioned
    1 Post(s)
    Quoted
    7 Post(s)

    Default

    Thanks, I did indeed get the error of not having freed the DTMs, but did not really know what that meant or how to solve it.

    Do you know any tutorials for Oldschool Runescape, which explains how to bank items?

  4. #4
    Join Date
    Jan 2013
    Posts
    86
    Mentioned
    0 Post(s)
    Quoted
    25 Post(s)

    Default

    Quote Originally Posted by Scornical View Post
    Thanks, I did indeed get the error of not having freed the DTMs, but did not really know what that meant or how to solve it.

    Do you know any tutorials for Oldschool Runescape, which explains how to bank items?
    Not that I know of, you can take a look at the bank functions for aerolib here though;

    https://github.com/J-Flight/AeroLib/...ore/Bank.simba

  5. #5
    Join Date
    Mar 2015
    Posts
    12
    Mentioned
    1 Post(s)
    Quoted
    7 Post(s)

    Default

    So I tried adding baning but it doesn't really work. It can't seem to find the bank. I'm standing at the grand exchange and he needs to click on the "bank grand exchange booth". How can I fix this?

    Code:
    program Chocolateduster;
    {$i AeroLib/AeroLib.Simba}
    
    var
      Knife, Chocolate, ChocolateDust: TItem;
      Bank: TMSObject;
    
    Procedure PlayerSetup;
    begin
      Me.Active := True;
      Me.Name := '';
      Me.Pass := '';
      Me.Member := True;
    
      Bank.create('Bank Grand Exchange booth', ['ank Gran', 'ran exchang', 'xchange boot'], [createCol(5994375, 25, 0.14, 0.07)], 50, 0, 0, 0);
    end;
    
    Procedure LoadItem;
    begin
      Knife.DTM := DTMFromString('mrAAAAHic42BgYOCCYl4gFgJiASBmZYAAZqg4BxAzQcXYgFgCiKWBWASIy/NygSQjTizJgB/g1gnBMAAA9FYCMg==');
      Chocolate.DTM := DTMFromString('mwQAAAHic42RgYOAFYm4gFgJiCSjNA8SsDBDABsQcUDYzlM8DVccP1QsSy3FWB5KMeLEkA2GA3wQIhgMA5+sBxA==');
      ChocolateDust.DTM := DTMFromString('mAAEAAHic42FgYGAHYlYgZmSAADYg5gJiXiDmB2JhIBaCsjmgmBWqjhOqjgfKZoNiZigGgTR7VajpxGFJBtIA8SYj/AgDADogAcw=');
    end
    
    Procedure UseItem;
    var
      pnt: TPoint;
    begin
      while Chocolate.getAmount(True) <> 0 do
      begin
        if Knife.interact(MOUSE_LEFT) then
          Chocolate.interact(MOUSE_LEFT);
      end;
        if Bank.Find(pnt) then
          begin
            FastClick(Mouse_left);
          end
        else
          begin
            WriteLn('No bank found');
          end
    end;
    
    procedure FreeDTMS;
    begin
      FreeDTM(Knife.DTM);
      FreeDTM(Chocolate.DTM);
      FreeDTM(ChocolateDust.DTM);
    end;
    
    begin
      initAL;
      AddOnTerminate('FreeDTMS');
      LoadItem();
      UseItem();
    end.

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

    Default

    Quote Originally Posted by Scornical View Post
    So I tried adding baning but it doesn't really work. It can't seem to find the bank. I'm standing at the grand exchange and he needs to click on the "bank grand exchange booth". How can I fix this?
    You are setting up the Bank information (Bank.create) in the PlayerSetup procedure but then you never call PlayerSetup in the main, so Bank.create is never ran, so Bank.find attempts to find nothing. Just tested the main below and it works, although there's some false results at times, the function loops through these till it finds your uptext.

    Simba Code:
    begin
      initAL;
      PlayerSetup;
      AddOnTerminate('FreeDTMS');
      LoadItem();
      UseItem();
    end.

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

  7. #7
    Join Date
    Feb 2017
    Location
    The Netherlands
    Posts
    43
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    Here you go mate

    Make sure the choclate is visible in your bank, first slot would be best.
    The banking only works on bank chests, so I would advice castle wars or clan wars.
    You could change the bank color to use it elswhere though...

    Code:
    program Chocolateduster;
    {$DEFINE SMART}
    {$i AeroLib/AeroLib.Simba}
    
    var
      Knife, Chocolate, ChocolateDust: TItem;
      DTM_2, DTM_1st: Integer;
      Bank: TMSObject;
      x, y, xp: Integer;
    
      const
      P_USERNAME = '';
      P_PASSWORD = '';
      P_PIN = '';
    
    procedure declarePlayer();
    begin
      Me.Name := P_USERNAME;
      Me.Pass := P_PASSWORD;
      Me.Pin := P_PIN;
      Me.Nick := '';
      Me.Active := True;
      Me.Member := True;
    end;
    
    procedure customMouse(point: TPoint);
    begin
      case random(0, 6) of
        0..2: BrakeMMouse(point, random(5), random(5), true);
        3: BrakeMMouse(point, random(5), random(5), false);
        4..5: MissMouse(point, random(5), random(5));
        6: HumanMMouse(point, random(5), random(5));
      end;
    end;
    
    Procedure LoadItem;
    begin
      Knife.DTM := DTMFromString('mrAAAAHic42BgYOCCYl4gFgJiASBmZYAAZqg4BxAzQcXYgFgCiKWBWASIy/NygSQjTizJgB/g1gnBMAAA9FYCMg==');
      Chocolate.DTM := DTMFromString('mwQAAAHic42RgYOAFYm4gFgJiCSjNA8SsDBDABsQcUDYzlM8DVccP1QsSy3FWB5KMeLEkA2GA3wQIhgMA5+sBxA==');
      ChocolateDust.DTM := DTMFromString('mAAEAAHic42FgYGAHYlYgZmSAADYg5gJiXiDmB2JhIBaCsjmgmBWqjhOqjgfKZoNiZigGgTR7VajpxGFJBtIA8SYj/AgDADogAcw=');
      DTM_1st := DTMFromString('mwQAAAHic42RgYOAFYm4gFgJiCSjNA8SsDBDABsQcUDYzlM8DVccP1QsSy3FWB5KMeLEkA2GA3wQIhgMA5+sBxA==');
      DTM_2 := DTMFromString('mAAEAAHic42FgYGAHYlYgZmSAADYg5gJiXiDmB2JhIBaCsjmgmBWqjhOqjgfKZoNiZigGgTR7VajpxGFJBtIA8SYj/AgDADogAcw=');
    end
    
    Procedure UseItem;
    var
      pnt: TPoint;
    begin
      while Chocolate.getAmount(True) <> 0 do
      begin
        if Knife.interact(MOUSE_LEFT) then
          Chocolate.interact(MOUSE_LEFT);
      end;
    end;
    
    procedure FreeDTMS;
    begin
      FreeDTM(Knife.DTM);
      FreeDTM(Chocolate.DTM);
      FreeDTM(ChocolateDust.DTM);
      freeDTM(DTM_1st);
      freeDTM(DTM_2);
    end;
    
    function waitForPixelShift(amount, timeOut: Integer; box: TBox): Boolean;
    var
      x1, y1, BMP, BMP2, tempShift: Integer;
      t: Timer;
    begin
      result := false;
      t.start();
      BMP := bitmapFromClient(box.x1, box.y1, box.x2, box.y2);
      repeat
        if (t.timeElapsed() >= timeOut) then
          break;
        sleep(250);
        BMP2 := bitmapFromClient(box.x1, box.y1, box.x2, box.y2);
        tempShift := calculatePixelShift(BMP, BMP2, IntToBox(0,0,(box.x2 - box.x1),(box.y2-box.y1)));
        if (calculatePixelShift(BMP, BMP2, IntToBox(0,0,(box.x2 - box.x1),(box.y2-box.y1))) >= amount) then
          result := true;
        freeBitmap(BMP2);
      until (Result);
    {  if (Result) then
        writeln(toStr(tempShift) + ' pixels (amount: ' + toStr(amount) + ') changed after: ' + toString(t.timeElapsed()) + '  result: true')
      else
        writeln('less than ' + toString(amount) + ' pixels changed after: ' + toStr(timeOut) + ' (timeout)    result: false');
    }  freeBitmap(BMP);
    end;
    
    procedure openBank();
    var
      TPA: TPointArray;
      ATPA: T2DPointArray;
      I: Integer;
      spot, firstInv: TPoint;
      t: Timer;
      tCol : TColEx;
    begin
      if (anySlotActivated()) then
      begin
        firstInv := invBox(1).MidPoint;
        customMouse(Point(firstInv.x + RandomRange(-5, 5), firstInv.y + RandomRange(-5, 5)));
        fastClick(MOUSE_LEFT);
        sleep(random(150, 350));
        exit;
      end;
      if (Interfaces[PINSCREEN].isVisible()) then
        inPin(P_PIN);
      if (isBankOpen()) then
        exit;
      tCol.create(3425887, 21, 0.04, 0.09);
      if (not tCol.findAllIn(AREA_MS, TPA)) then
        exit;
      ATPA := FloodFillTPA(TPA);
      if (length(ATPA) <= 0) then
        exit;
      SortATPAfromFirstPoint(ATPA, Point(275, 155));
      for I := 0 to high(ATPA) do
      begin
        if (length(ATPA[I]) < 36) then
          continue;
        spot := middleTPA(ATPA[I]);
        customMouse(spot);
        if (waitUptextMulti(['ank', 'ast'], 300)) then
        begin
          fastClick(MOUSE_LEFT);
          break;
        end;
      end;
      t.start();
      while ((not isBankOpen()) and (not Interfaces[PINSCREEN].isVisible())) and (t.TimeElapsed() < 3000) do
        sleep(random(150, 250));
    end;
    
    function getLocations(DTM, slots: Integer): TIntegerArray;
    var
      I: Integer;
      tempArray: TIntegerArray;
    begin
      setLength(tempArray, 0);
      for I := 1 to slots do
      begin
       if (FindDTM(DTM, x, y, invBox(I).x1, invBox(I).y1, invBox(I).x2, invBox(I).y2)) then
       begin
        SetLength(tempArray, Length(tempArray) + 1);
        tempArray[High(tempArray)] := I;
       end;
      end;
      result := tempArray;
    end;
    
    procedure bankHandler();
    var
      locs, ARRAY_DTMs: TIntegerArray;
      I, randomNumb, count: Integer;
    begin
      if (not isBankOpen()) and (not Interfaces[PINSCREEN].isVisible() ) then
        exit;
      if (Interfaces[PINSCREEN].isVisible()) then
        inPin(P_PIN);
      begin
       locs := getLocations(DTM_2, 14);
       if (length(locs) < 1) then
        begin
         SetLength(locs, Length(locs) + 1);
         locs[High(locs)] := 1;
        end;
       I := random(locs[0], locs[high(locs)]);
       if (findDTM(DTM_2, x, y, invBox(I).X1, invBox(I).Y1, invBox(I).X2, invBox(I).Y2)) then
       begin
        customMouse(point(x, y));
        sleep(random(20, 100));
        fastClick(MOUSE_RIGHT);
        waitOption('Deposit-All', 300);
       end;
      end
      begin
        if (findDTM(DTM_1st, x, y, MSX1, MSY1, MSX2, MSY2)) then
        begin
          customMouse(point(x, y));
          sleep(random(20, 100));
          fastClick(MOUSE_RIGHT);
          if (random(0, 1) = 0) then
            waitOption('Withdraw-All ', 300)
          else
            waitOption('Withdraw-All-but-1', 300);
        end;
      end;
      closeInterface();
    end;
    
    procedure setupPlayer();
    begin
      writeln('player setup...');
      if (not isLoggedIn()) then
        loginPlayer(false);
      if (isLoggedIn()) then
      begin
        toggleRunning(true);
        setAngle(ANGLE_HIGH);
      end;
    end;
    
    function getState(): Integer;
    begin
      if (not isLoggedIn()) then
        exit(0);
      if ((getCurrentTab <> TAB_INV) and (not isBankOpen())) then
        exit(1);
      if ((not FindDTM(DTM_1st, x, y, MIX1, MIY1, MIX2, MIY2)) and (not isBankOpen())) then
        exit(5);
      if ((not FindDTM(DTM_1st, x, y, MIX1, MIY1, MIX2, MIY2)) and (isBankOpen())) then
        exit(6);
      if (FindDTM(DTM_1st, x, y, MIX1, MIY1, MIX2, MIY2) and (isBankOpen())) then
        exit(2);
      if (FindDTM(DTM_1st, x, y, MIX1, MIY1, MIX2, MIY2) and (not isBankOpen()) and (not waitForPixelShift(10, 2500, intToBox(MIX1, MIY1, MIX2, MIY2)))) then
        exit(3);
    end;
    
    procedure executeState(State: Integer);
    begin
      case (State) of
        0: setupPlayer();
        1: gameTab(TAB_INV);
        2: closeInterface();
        3: UseItem;
        5: openBank();
        6: bankHandler();
      end;
      sleep(random(50, 100));
    end;
    
    begin
      initAL;
      declarePlayer();
      AddOnTerminate('FreeDTMS');
      LoadItem();
      repeat
        executeState(getState());
      until (false)
    end.

  8. #8
    Join Date
    Mar 2015
    Posts
    12
    Mentioned
    1 Post(s)
    Quoted
    7 Post(s)

    Default

    Quote Originally Posted by uvlees View Post
    Here you go mate

    Make sure the choclate is visible in your bank, first slot would be best.
    The banking only works on bank chests, so I would advice castle wars or clan wars.
    You could change the bank color to use it elswhere though...

    Code:
    program Chocolateduster;
    {$DEFINE SMART}
    {$i AeroLib/AeroLib.Simba}
    
    var
      Knife, Chocolate, ChocolateDust: TItem;
      DTM_2, DTM_1st: Integer;
      Bank: TMSObject;
      x, y, xp: Integer;
    
      const
      P_USERNAME = '';
      P_PASSWORD = '';
      P_PIN = '';
    
    procedure declarePlayer();
    begin
      Me.Name := P_USERNAME;
      Me.Pass := P_PASSWORD;
      Me.Pin := P_PIN;
      Me.Nick := '';
      Me.Active := True;
      Me.Member := True;
    end;
    
    procedure customMouse(point: TPoint);
    begin
      case random(0, 6) of
        0..2: BrakeMMouse(point, random(5), random(5), true);
        3: BrakeMMouse(point, random(5), random(5), false);
        4..5: MissMouse(point, random(5), random(5));
        6: HumanMMouse(point, random(5), random(5));
      end;
    end;
    
    Procedure LoadItem;
    begin
      Knife.DTM := DTMFromString('mrAAAAHic42BgYOCCYl4gFgJiASBmZYAAZqg4BxAzQcXYgFgCiKWBWASIy/NygSQjTizJgB/g1gnBMAAA9FYCMg==');
      Chocolate.DTM := DTMFromString('mwQAAAHic42RgYOAFYm4gFgJiCSjNA8SsDBDABsQcUDYzlM8DVccP1QsSy3FWB5KMeLEkA2GA3wQIhgMA5+sBxA==');
      ChocolateDust.DTM := DTMFromString('mAAEAAHic42FgYGAHYlYgZmSAADYg5gJiXiDmB2JhIBaCsjmgmBWqjhOqjgfKZoNiZigGgTR7VajpxGFJBtIA8SYj/AgDADogAcw=');
      DTM_1st := DTMFromString('mwQAAAHic42RgYOAFYm4gFgJiCSjNA8SsDBDABsQcUDYzlM8DVccP1QsSy3FWB5KMeLEkA2GA3wQIhgMA5+sBxA==');
      DTM_2 := DTMFromString('mAAEAAHic42FgYGAHYlYgZmSAADYg5gJiXiDmB2JhIBaCsjmgmBWqjhOqjgfKZoNiZigGgTR7VajpxGFJBtIA8SYj/AgDADogAcw=');
    end
    
    Procedure UseItem;
    var
      pnt: TPoint;
    begin
      while Chocolate.getAmount(True) <> 0 do
      begin
        if Knife.interact(MOUSE_LEFT) then
          Chocolate.interact(MOUSE_LEFT);
      end;
    end;
    
    procedure FreeDTMS;
    begin
      FreeDTM(Knife.DTM);
      FreeDTM(Chocolate.DTM);
      FreeDTM(ChocolateDust.DTM);
      freeDTM(DTM_1st);
      freeDTM(DTM_2);
    end;
    
    function waitForPixelShift(amount, timeOut: Integer; box: TBox): Boolean;
    var
      x1, y1, BMP, BMP2, tempShift: Integer;
      t: Timer;
    begin
      result := false;
      t.start();
      BMP := bitmapFromClient(box.x1, box.y1, box.x2, box.y2);
      repeat
        if (t.timeElapsed() >= timeOut) then
          break;
        sleep(250);
        BMP2 := bitmapFromClient(box.x1, box.y1, box.x2, box.y2);
        tempShift := calculatePixelShift(BMP, BMP2, IntToBox(0,0,(box.x2 - box.x1),(box.y2-box.y1)));
        if (calculatePixelShift(BMP, BMP2, IntToBox(0,0,(box.x2 - box.x1),(box.y2-box.y1))) >= amount) then
          result := true;
        freeBitmap(BMP2);
      until (Result);
    {  if (Result) then
        writeln(toStr(tempShift) + ' pixels (amount: ' + toStr(amount) + ') changed after: ' + toString(t.timeElapsed()) + '  result: true')
      else
        writeln('less than ' + toString(amount) + ' pixels changed after: ' + toStr(timeOut) + ' (timeout)    result: false');
    }  freeBitmap(BMP);
    end;
    
    procedure openBank();
    var
      TPA: TPointArray;
      ATPA: T2DPointArray;
      I: Integer;
      spot, firstInv: TPoint;
      t: Timer;
      tCol : TColEx;
    begin
      if (anySlotActivated()) then
      begin
        firstInv := invBox(1).MidPoint;
        customMouse(Point(firstInv.x + RandomRange(-5, 5), firstInv.y + RandomRange(-5, 5)));
        fastClick(MOUSE_LEFT);
        sleep(random(150, 350));
        exit;
      end;
      if (Interfaces[PINSCREEN].isVisible()) then
        inPin(P_PIN);
      if (isBankOpen()) then
        exit;
      tCol.create(3425887, 21, 0.04, 0.09);
      if (not tCol.findAllIn(AREA_MS, TPA)) then
        exit;
      ATPA := FloodFillTPA(TPA);
      if (length(ATPA) <= 0) then
        exit;
      SortATPAfromFirstPoint(ATPA, Point(275, 155));
      for I := 0 to high(ATPA) do
      begin
        if (length(ATPA[I]) < 36) then
          continue;
        spot := middleTPA(ATPA[I]);
        customMouse(spot);
        if (waitUptextMulti(['ank', 'ast'], 300)) then
        begin
          fastClick(MOUSE_LEFT);
          break;
        end;
      end;
      t.start();
      while ((not isBankOpen()) and (not Interfaces[PINSCREEN].isVisible())) and (t.TimeElapsed() < 3000) do
        sleep(random(150, 250));
    end;
    
    function getLocations(DTM, slots: Integer): TIntegerArray;
    var
      I: Integer;
      tempArray: TIntegerArray;
    begin
      setLength(tempArray, 0);
      for I := 1 to slots do
      begin
       if (FindDTM(DTM, x, y, invBox(I).x1, invBox(I).y1, invBox(I).x2, invBox(I).y2)) then
       begin
        SetLength(tempArray, Length(tempArray) + 1);
        tempArray[High(tempArray)] := I;
       end;
      end;
      result := tempArray;
    end;
    
    procedure bankHandler();
    var
      locs, ARRAY_DTMs: TIntegerArray;
      I, randomNumb, count: Integer;
    begin
      if (not isBankOpen()) and (not Interfaces[PINSCREEN].isVisible() ) then
        exit;
      if (Interfaces[PINSCREEN].isVisible()) then
        inPin(P_PIN);
      begin
       locs := getLocations(DTM_2, 14);
       if (length(locs) < 1) then
        begin
         SetLength(locs, Length(locs) + 1);
         locs[High(locs)] := 1;
        end;
       I := random(locs[0], locs[high(locs)]);
       if (findDTM(DTM_2, x, y, invBox(I).X1, invBox(I).Y1, invBox(I).X2, invBox(I).Y2)) then
       begin
        customMouse(point(x, y));
        sleep(random(20, 100));
        fastClick(MOUSE_RIGHT);
        waitOption('Deposit-All', 300);
       end;
      end
      begin
        if (findDTM(DTM_1st, x, y, MSX1, MSY1, MSX2, MSY2)) then
        begin
          customMouse(point(x, y));
          sleep(random(20, 100));
          fastClick(MOUSE_RIGHT);
          if (random(0, 1) = 0) then
            waitOption('Withdraw-All ', 300)
          else
            waitOption('Withdraw-All-but-1', 300);
        end;
      end;
      closeInterface();
    end;
    
    procedure setupPlayer();
    begin
      writeln('player setup...');
      if (not isLoggedIn()) then
        loginPlayer(false);
      if (isLoggedIn()) then
      begin
        toggleRunning(true);
        setAngle(ANGLE_HIGH);
      end;
    end;
    
    function getState(): Integer;
    begin
      if (not isLoggedIn()) then
        exit(0);
      if ((getCurrentTab <> TAB_INV) and (not isBankOpen())) then
        exit(1);
      if ((not FindDTM(DTM_1st, x, y, MIX1, MIY1, MIX2, MIY2)) and (not isBankOpen())) then
        exit(5);
      if ((not FindDTM(DTM_1st, x, y, MIX1, MIY1, MIX2, MIY2)) and (isBankOpen())) then
        exit(6);
      if (FindDTM(DTM_1st, x, y, MIX1, MIY1, MIX2, MIY2) and (isBankOpen())) then
        exit(2);
      if (FindDTM(DTM_1st, x, y, MIX1, MIY1, MIX2, MIY2) and (not isBankOpen()) and (not waitForPixelShift(10, 2500, intToBox(MIX1, MIY1, MIX2, MIY2)))) then
        exit(3);
    end;
    
    procedure executeState(State: Integer);
    begin
      case (State) of
        0: setupPlayer();
        1: gameTab(TAB_INV);
        2: closeInterface();
        3: UseItem;
        5: openBank();
        6: bankHandler();
      end;
      sleep(random(50, 100));
    end;
    
    begin
      initAL;
      declarePlayer();
      AddOnTerminate('FreeDTMS');
      LoadItem();
      repeat
        executeState(getState());
      until (false)
    end.
    Thank you very much for this script, Ireally appreciate it. It's a bit too much though and I don't really have a clue what's going on, would you mind explaining how the script works?

  9. #9
    Join Date
    Feb 2017
    Location
    The Netherlands
    Posts
    43
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    Quote Originally Posted by Scornical View Post
    Thank you very much for this script, Ireally appreciate it. It's a bit too much though and I don't really have a clue what's going on, would you mind explaining how the script works?
    Of course, but it would take a lot of time to type it out

    Do you use discord or any form of that kind of communication ?

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
  •