Page 2 of 2 FirstFirst 12
Results 26 to 29 of 29

Thread: [AeroLib] Jug of Wine Cooker [400k+ Exp/Hr]

  1. #26
    Join Date
    Jan 2012
    Location
    Sydney, Australia
    Posts
    877
    Mentioned
    12 Post(s)
    Quoted
    368 Post(s)

    Default

    Quote Originally Posted by Helvetin16 View Post
    Seems like a really nice script. Could you perhaps add a failsafe to the script where it would open bank if it hasn't made any wines in a minute or if it accidently levels up it would click 'continue' or open bank and start again?
    Thanks!
    You could add a global fail safe timer to the mix that would reset at the end of the banking procedure. See the example below:

    Simba Code:
    program WineMaker;
    {$DEFINE SMART}
    {$I AEROLIB/AEROLIB.SIMBA}


    var
    JOW, grape, x, y, failed: Integer;
    WinesMade, xp, XPGained, expHour, winesHour: Integer;
    FailSafeTimer: Timer;


    const
      Username = '';
      Password = '';
      Pin      = '';


    Procedure DeclarePlayer;
    begin
    Me.Name := Username;
    Me.Pass := Password;
    Me.Pin := Pin;
    Me.Member := True;
    Me.Active := True;
    end;

    Procedure levelCheck();
    begin
    if continueChat(False) then Exit;
    end;

    Procedure DTMz;
    begin
    JOW := DTMFromString('mlwAAAHicY2dgYOACYj4gFgNiISDmYIAAFqg4A1SNOBBLA7EAEDMCcVtNDZSFidkZcAPsOiAYCgDeDwJB');
    grape := DTMFromString('mggAAAHicY2NgYGABYnYg5gJibiBmZoAAHigNEhcAYiEg5gTibM5AIMmIgdkZsANMlRAMAQBpNwFC');

    addOnTerminate('FreeIt');
    end;

    Procedure FreeIt;
    begin
    freeDTM(JOW);
    freeDTM(grape);
    end;


    Procedure Antiban;
    begin
      case Random(310) of
      0..150:
        if pointInBox(getMousePnt(), intToBox(1, 1, 766, 505)) then
        begin
        MMouseOffClient('random');
        end else
        exit;


      201..210:
                if pointInBox(getMousePnt(), intToBox(1, 1, 766, 505)) then
                begin
                HoverSkill(SKILL_COOKING, false);
                FTab(TAB_INV);
                MMouseOffClient('Random');
                end else
                exit;

      211..300:
                if pointInBox(getMousePnt(), intToBox(1, 1, 766, 505)) then
                begin
                Wait(RandomRange(2000, 4000));
                PickUpMouse;
                HumanRandomMouse();
                end else
                exit;

      301..310:
                if pointInBox(getMousePnt(), intToBox(1, 1, 766, 505)) then
                begin
                CheckMovingObjs(True);
                end else
                exit;

      end;
    end;

    Procedure mouseBoxHover(x1, y1, x2, y2: Integer; Dist: Integer);
    var
      PT : TPoint;
    begin
      getMousePos(pt.x,pt.y);
      PT := randomPointBoxEx(pt,inttobox(x1,y1,x2,y2),Dist);
      brakeMMouse(PT, 0, 0, True);
      wait(randomRange(50,150));

    end;

    //Creds to Hoodz
    procedure openBank();
    var
      TPA: TPointArray;
      ATPA: T2DPointArray;
      I: Integer;
      spot: TPoint;
      t: Timer;
      tCol : TColEx;
    begin

      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]);
        HumanMMouse(spot, 1,1);
        if (waitUptextMulti(['ank', 'est'], 300)) then
        begin
          fastClick(MOUSE_LEFT);
          break;
        end else
        if WaitUpTextMulti(['Use', '->', ' Bank'], 300) then
          begin
          HumanMMouse(Point(633, 362), 50, 50);
          FastClick(MOUSE_LEFT);
          exit;
          end;
      end;
      t.start();
      while ((not isBankOpen()) and (not Interfaces[PINSCREEN].isVisible())) and (t.TimeElapsed() < 3000) do
        sleep(random(150, 250));

    end;


    Procedure banking;
    var
      g: Timer;
    begin
    if Interfaces[PINSCREEN].isVisible() then
        inPin(Pin);
    if isBankOpen() then
      if getCurrentBankTab() <> 0 then
      SwitchBankTab(0);
      begin
      QuickDeposit('inv');
      if FindDTM(Grape, x, y, msx1, msy1, msx2, msy2) then
        begin
        HumanMMouse(Point(x, y), 5, 2);
        if WaitUpTextMulti(['Withdraw', 'Grapes'], 400) then
        fastClick(Mouse_Right);
        waitOption('Withdraw-14 ', 250);
        end else
        begin
        WriteLn('Ran out of supplies, logging off.');
        CloseInterface();
        LogoutPlayer();
        TerminateScript;
        end;

      if FindDTM(JOW, x, y, msx1, msy1, msx2, msy2) then
        begin
        HumanMMouse(Point(x, y), 5, 2);
        if WaitUpTextMulti(['Withdraw', 'Jug of ', 'Water'], 400) then
        fastClick(Mouse_Right);
        waitOption('Withdraw-14 ', 250);
        end else
        begin
        WriteLn('Ran out of supplies, logging off.');
        CloseInterface();
        LogoutPlayer();
        TerminateScript;
        end;
      end;
    CloseInterface();
    FailSafeTimer.start();
    end;

    Procedure MakeWines;
    begin
    if isBankOpen() then
      exit;
    if not GameTab(TAB_INV) then
      fTab(Tab_inv);

    Wait(RandomRange(100, 400));
    if FindDTM(Grape, x, y, mix1, miy1, mix2, miy2) then
      begin
      HumanMMouse(Point(x, y), 3, 3);
      if waitUpTextMulti(['Use', ' Grapes', 'apes', 'Use Grapes'], 500) then
        FastClick(Mouse_LEFT);
      if FindDTM(JOW, x, y, mix1, miy1, mix2, miy2) then
        begin
        HumanMMouse(Point(x, y), 4, 5);
        If WaitUpTextMulti(['Use', 'Grapes', ' Jug', 'water'], 500) then
          FastClick(Mouse_LEFT);
        end;
      end else
      exit;
    end;


    Procedure doInterface;
    begin
    MouseBoxHover(32, 390, 293, 445, randomrange(5, 10));
    Wait(RandomRange(100, 250));
    if WaitUpText('ake', 400) then
      begin
      FastClick(Mouse_RIGHT);
      WaitOption('Make All', 200);
      end else
      begin
        inc(Failed);
        if (Failed > 5) then
        Failed := 0;
        exit;
        end;

    While (getInvCount > 14) do
      begin
      if ContinueChat(False) then
        begin
        exit;
        end else;
      antiban;
      end;
      WinesMade := WinesMade + 14;
      xp := 200;
      wait(randomrange(250, 500));
      exit;
    end;

    Procedure Progress;
    begin
    XPGained := (xp * WinesMade);
    expHour := Round((XPGained) / (GetTimeRunning / 3600000.0));
    winesHour := Round((WinesMade) / (GetTimeRunning / 3600000.0));

    ClearDebug;
    WriteLn('Running for: ' + MsToTime(GetTimeRunning, 3));
    WriteLn('Wines made: ' + toStr(WinesMade));
    WriteLn('Exp gained: ' + toStr(XPGained));
    WriteLn('Exp p/hr: ' + toStr(expHour));
    WriteLn('Wines p/hr: ' + toStr(winesHour));
    WriteLn('*Note* Exp rates may be inaccurate if you dont have 68 cooking.');
    end;

    Procedure MainLoop;
    begin
    if isLoggedIn then
      setAngle(ANGLE_HIGH);
    repeat
    MouseSpeed := RandomRange(15, 22);

    if getInvCount <= 14 then
    openBank;

    if isBankOpen() then
    Banking;

    if isInvFull then
      MakeWines;

    if (FailSafeTimer.timeElapsed > 90000) then
      openBank;

    doInterface;
    Progress;
    until not isLoggedIn;
    end;

    begin
    InitAL();
    DTMz;
    DeclarePlayer;
    LoginPlayer(false);

    while isLoggedIn() do
    MainLoop;

    end.

    All I have done is declared a global timer var named FailSafeTimer (line 9). I then have the timer start at the end of the banking procedure (line 182). Finally, I have added a check towards the bottom of the main loop to check the timers elapsed time, and if it exceeds 90 seconds, it starts the banking procedure (line 270).

  2. #27
    Join Date
    Sep 2017
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by Dan the man View Post
    You could add a global fail safe timer to the mix that would reset at the end of the banking procedure. See the example below:

    Simba Code:
    program WineMaker;
    {$DEFINE SMART}
    {$I AEROLIB/AEROLIB.SIMBA}


    var
    JOW, grape, x, y, failed: Integer;
    WinesMade, xp, XPGained, expHour, winesHour: Integer;
    FailSafeTimer: Timer;


    const
      Username = '';
      Password = '';
      Pin      = '';


    Procedure DeclarePlayer;
    begin
    Me.Name := Username;
    Me.Pass := Password;
    Me.Pin := Pin;
    Me.Member := True;
    Me.Active := True;
    end;

    Procedure levelCheck();
    begin
    if continueChat(False) then Exit;
    end;

    Procedure DTMz;
    begin
    JOW := DTMFromString('mlwAAAHicY2dgYOACYj4gFgNiISDmYIAAFqg4A1SNOBBLA7EAEDMCcVtNDZSFidkZcAPsOiAYCgDeDwJB');
    grape := DTMFromString('mggAAAHicY2NgYGABYnYg5gJibiBmZoAAHigNEhcAYiEg5gTibM5AIMmIgdkZsANMlRAMAQBpNwFC');

    addOnTerminate('FreeIt');
    end;

    Procedure FreeIt;
    begin
    freeDTM(JOW);
    freeDTM(grape);
    end;


    Procedure Antiban;
    begin
      case Random(310) of
      0..150:
        if pointInBox(getMousePnt(), intToBox(1, 1, 766, 505)) then
        begin
        MMouseOffClient('random');
        end else
        exit;


      201..210:
                if pointInBox(getMousePnt(), intToBox(1, 1, 766, 505)) then
                begin
                HoverSkill(SKILL_COOKING, false);
                FTab(TAB_INV);
                MMouseOffClient('Random');
                end else
                exit;

      211..300:
                if pointInBox(getMousePnt(), intToBox(1, 1, 766, 505)) then
                begin
                Wait(RandomRange(2000, 4000));
                PickUpMouse;
                HumanRandomMouse();
                end else
                exit;

      301..310:
                if pointInBox(getMousePnt(), intToBox(1, 1, 766, 505)) then
                begin
                CheckMovingObjs(True);
                end else
                exit;

      end;
    end;

    Procedure mouseBoxHover(x1, y1, x2, y2: Integer; Dist: Integer);
    var
      PT : TPoint;
    begin
      getMousePos(pt.x,pt.y);
      PT := randomPointBoxEx(pt,inttobox(x1,y1,x2,y2),Dist);
      brakeMMouse(PT, 0, 0, True);
      wait(randomRange(50,150));

    end;

    //Creds to Hoodz
    procedure openBank();
    var
      TPA: TPointArray;
      ATPA: T2DPointArray;
      I: Integer;
      spot: TPoint;
      t: Timer;
      tCol : TColEx;
    begin

      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]);
        HumanMMouse(spot, 1,1);
        if (waitUptextMulti(['ank', 'est'], 300)) then
        begin
          fastClick(MOUSE_LEFT);
          break;
        end else
        if WaitUpTextMulti(['Use', '->', ' Bank'], 300) then
          begin
          HumanMMouse(Point(633, 362), 50, 50);
          FastClick(MOUSE_LEFT);
          exit;
          end;
      end;
      t.start();
      while ((not isBankOpen()) and (not Interfaces[PINSCREEN].isVisible())) and (t.TimeElapsed() < 3000) do
        sleep(random(150, 250));

    end;


    Procedure banking;
    var
      g: Timer;
    begin
    if Interfaces[PINSCREEN].isVisible() then
        inPin(Pin);
    if isBankOpen() then
      if getCurrentBankTab() <> 0 then
      SwitchBankTab(0);
      begin
      QuickDeposit('inv');
      if FindDTM(Grape, x, y, msx1, msy1, msx2, msy2) then
        begin
        HumanMMouse(Point(x, y), 5, 2);
        if WaitUpTextMulti(['Withdraw', 'Grapes'], 400) then
        fastClick(Mouse_Right);
        waitOption('Withdraw-14 ', 250);
        end else
        begin
        WriteLn('Ran out of supplies, logging off.');
        CloseInterface();
        LogoutPlayer();
        TerminateScript;
        end;

      if FindDTM(JOW, x, y, msx1, msy1, msx2, msy2) then
        begin
        HumanMMouse(Point(x, y), 5, 2);
        if WaitUpTextMulti(['Withdraw', 'Jug of ', 'Water'], 400) then
        fastClick(Mouse_Right);
        waitOption('Withdraw-14 ', 250);
        end else
        begin
        WriteLn('Ran out of supplies, logging off.');
        CloseInterface();
        LogoutPlayer();
        TerminateScript;
        end;
      end;
    CloseInterface();
    FailSafeTimer.start();
    end;

    Procedure MakeWines;
    begin
    if isBankOpen() then
      exit;
    if not GameTab(TAB_INV) then
      fTab(Tab_inv);

    Wait(RandomRange(100, 400));
    if FindDTM(Grape, x, y, mix1, miy1, mix2, miy2) then
      begin
      HumanMMouse(Point(x, y), 3, 3);
      if waitUpTextMulti(['Use', ' Grapes', 'apes', 'Use Grapes'], 500) then
        FastClick(Mouse_LEFT);
      if FindDTM(JOW, x, y, mix1, miy1, mix2, miy2) then
        begin
        HumanMMouse(Point(x, y), 4, 5);
        If WaitUpTextMulti(['Use', 'Grapes', ' Jug', 'water'], 500) then
          FastClick(Mouse_LEFT);
        end;
      end else
      exit;
    end;


    Procedure doInterface;
    begin
    MouseBoxHover(32, 390, 293, 445, randomrange(5, 10));
    Wait(RandomRange(100, 250));
    if WaitUpText('ake', 400) then
      begin
      FastClick(Mouse_RIGHT);
      WaitOption('Make All', 200);
      end else
      begin
        inc(Failed);
        if (Failed > 5) then
        Failed := 0;
        exit;
        end;

    While (getInvCount > 14) do
      begin
      if ContinueChat(False) then
        begin
        exit;
        end else;
      antiban;
      end;
      WinesMade := WinesMade + 14;
      xp := 200;
      wait(randomrange(250, 500));
      exit;
    end;

    Procedure Progress;
    begin
    XPGained := (xp * WinesMade);
    expHour := Round((XPGained) / (GetTimeRunning / 3600000.0));
    winesHour := Round((WinesMade) / (GetTimeRunning / 3600000.0));

    ClearDebug;
    WriteLn('Running for: ' + MsToTime(GetTimeRunning, 3));
    WriteLn('Wines made: ' + toStr(WinesMade));
    WriteLn('Exp gained: ' + toStr(XPGained));
    WriteLn('Exp p/hr: ' + toStr(expHour));
    WriteLn('Wines p/hr: ' + toStr(winesHour));
    WriteLn('*Note* Exp rates may be inaccurate if you dont have 68 cooking.');
    end;

    Procedure MainLoop;
    begin
    if isLoggedIn then
      setAngle(ANGLE_HIGH);
    repeat
    MouseSpeed := RandomRange(15, 22);

    if getInvCount <= 14 then
    openBank;

    if isBankOpen() then
    Banking;

    if isInvFull then
      MakeWines;

    if (FailSafeTimer.timeElapsed > 90000) then
      openBank;

    doInterface;
    Progress;
    until not isLoggedIn;
    end;

    begin
    InitAL();
    DTMz;
    DeclarePlayer;
    LoginPlayer(false);

    while isLoggedIn() do
    MainLoop;

    end.

    All I have done is declared a global timer var named FailSafeTimer (line 9). I then have the timer start at the end of the banking procedure (line 182). Finally, I have added a check towards the bottom of the main loop to check the timers elapsed time, and if it exceeds 90 seconds, it starts the banking procedure (line 270).
    Thank you for the fast reply!

  3. #28
    Join Date
    Sep 2017
    Posts
    7
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by Dan the man View Post
    You could add a global fail safe timer to the mix that would reset at the end of the banking procedure. See the example below:

    Simba Code:
    program WineMaker;
    {$DEFINE SMART}
    {$I AEROLIB/AEROLIB.SIMBA}


    var
    JOW, grape, x, y, failed: Integer;
    WinesMade, xp, XPGained, expHour, winesHour: Integer;
    FailSafeTimer: Timer;


    const
      Username = '';
      Password = '';
      Pin      = '';


    Procedure DeclarePlayer;
    begin
    Me.Name := Username;
    Me.Pass := Password;
    Me.Pin := Pin;
    Me.Member := True;
    Me.Active := True;
    end;

    Procedure levelCheck();
    begin
    if continueChat(False) then Exit;
    end;

    Procedure DTMz;
    begin
    JOW := DTMFromString('mlwAAAHicY2dgYOACYj4gFgNiISDmYIAAFqg4A1SNOBBLA7EAEDMCcVtNDZSFidkZcAPsOiAYCgDeDwJB');
    grape := DTMFromString('mggAAAHicY2NgYGABYnYg5gJibiBmZoAAHigNEhcAYiEg5gTibM5AIMmIgdkZsANMlRAMAQBpNwFC');

    addOnTerminate('FreeIt');
    end;

    Procedure FreeIt;
    begin
    freeDTM(JOW);
    freeDTM(grape);
    end;


    Procedure Antiban;
    begin
      case Random(310) of
      0..150:
        if pointInBox(getMousePnt(), intToBox(1, 1, 766, 505)) then
        begin
        MMouseOffClient('random');
        end else
        exit;


      201..210:
                if pointInBox(getMousePnt(), intToBox(1, 1, 766, 505)) then
                begin
                HoverSkill(SKILL_COOKING, false);
                FTab(TAB_INV);
                MMouseOffClient('Random');
                end else
                exit;

      211..300:
                if pointInBox(getMousePnt(), intToBox(1, 1, 766, 505)) then
                begin
                Wait(RandomRange(2000, 4000));
                PickUpMouse;
                HumanRandomMouse();
                end else
                exit;

      301..310:
                if pointInBox(getMousePnt(), intToBox(1, 1, 766, 505)) then
                begin
                CheckMovingObjs(True);
                end else
                exit;

      end;
    end;

    Procedure mouseBoxHover(x1, y1, x2, y2: Integer; Dist: Integer);
    var
      PT : TPoint;
    begin
      getMousePos(pt.x,pt.y);
      PT := randomPointBoxEx(pt,inttobox(x1,y1,x2,y2),Dist);
      brakeMMouse(PT, 0, 0, True);
      wait(randomRange(50,150));

    end;

    //Creds to Hoodz
    procedure openBank();
    var
      TPA: TPointArray;
      ATPA: T2DPointArray;
      I: Integer;
      spot: TPoint;
      t: Timer;
      tCol : TColEx;
    begin

      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]);
        HumanMMouse(spot, 1,1);
        if (waitUptextMulti(['ank', 'est'], 300)) then
        begin
          fastClick(MOUSE_LEFT);
          break;
        end else
        if WaitUpTextMulti(['Use', '->', ' Bank'], 300) then
          begin
          HumanMMouse(Point(633, 362), 50, 50);
          FastClick(MOUSE_LEFT);
          exit;
          end;
      end;
      t.start();
      while ((not isBankOpen()) and (not Interfaces[PINSCREEN].isVisible())) and (t.TimeElapsed() < 3000) do
        sleep(random(150, 250));

    end;


    Procedure banking;
    var
      g: Timer;
    begin
    if Interfaces[PINSCREEN].isVisible() then
        inPin(Pin);
    if isBankOpen() then
      if getCurrentBankTab() <> 0 then
      SwitchBankTab(0);
      begin
      QuickDeposit('inv');
      if FindDTM(Grape, x, y, msx1, msy1, msx2, msy2) then
        begin
        HumanMMouse(Point(x, y), 5, 2);
        if WaitUpTextMulti(['Withdraw', 'Grapes'], 400) then
        fastClick(Mouse_Right);
        waitOption('Withdraw-14 ', 250);
        end else
        begin
        WriteLn('Ran out of supplies, logging off.');
        CloseInterface();
        LogoutPlayer();
        TerminateScript;
        end;

      if FindDTM(JOW, x, y, msx1, msy1, msx2, msy2) then
        begin
        HumanMMouse(Point(x, y), 5, 2);
        if WaitUpTextMulti(['Withdraw', 'Jug of ', 'Water'], 400) then
        fastClick(Mouse_Right);
        waitOption('Withdraw-14 ', 250);
        end else
        begin
        WriteLn('Ran out of supplies, logging off.');
        CloseInterface();
        LogoutPlayer();
        TerminateScript;
        end;
      end;
    CloseInterface();
    FailSafeTimer.start();
    end;

    Procedure MakeWines;
    begin
    if isBankOpen() then
      exit;
    if not GameTab(TAB_INV) then
      fTab(Tab_inv);

    Wait(RandomRange(100, 400));
    if FindDTM(Grape, x, y, mix1, miy1, mix2, miy2) then
      begin
      HumanMMouse(Point(x, y), 3, 3);
      if waitUpTextMulti(['Use', ' Grapes', 'apes', 'Use Grapes'], 500) then
        FastClick(Mouse_LEFT);
      if FindDTM(JOW, x, y, mix1, miy1, mix2, miy2) then
        begin
        HumanMMouse(Point(x, y), 4, 5);
        If WaitUpTextMulti(['Use', 'Grapes', ' Jug', 'water'], 500) then
          FastClick(Mouse_LEFT);
        end;
      end else
      exit;
    end;


    Procedure doInterface;
    begin
    MouseBoxHover(32, 390, 293, 445, randomrange(5, 10));
    Wait(RandomRange(100, 250));
    if WaitUpText('ake', 400) then
      begin
      FastClick(Mouse_RIGHT);
      WaitOption('Make All', 200);
      end else
      begin
        inc(Failed);
        if (Failed > 5) then
        Failed := 0;
        exit;
        end;

    While (getInvCount > 14) do
      begin
      if ContinueChat(False) then
        begin
        exit;
        end else;
      antiban;
      end;
      WinesMade := WinesMade + 14;
      xp := 200;
      wait(randomrange(250, 500));
      exit;
    end;

    Procedure Progress;
    begin
    XPGained := (xp * WinesMade);
    expHour := Round((XPGained) / (GetTimeRunning / 3600000.0));
    winesHour := Round((WinesMade) / (GetTimeRunning / 3600000.0));

    ClearDebug;
    WriteLn('Running for: ' + MsToTime(GetTimeRunning, 3));
    WriteLn('Wines made: ' + toStr(WinesMade));
    WriteLn('Exp gained: ' + toStr(XPGained));
    WriteLn('Exp p/hr: ' + toStr(expHour));
    WriteLn('Wines p/hr: ' + toStr(winesHour));
    WriteLn('*Note* Exp rates may be inaccurate if you dont have 68 cooking.');
    end;

    Procedure MainLoop;
    begin
    if isLoggedIn then
      setAngle(ANGLE_HIGH);
    repeat
    MouseSpeed := RandomRange(15, 22);

    if getInvCount <= 14 then
    openBank;

    if isBankOpen() then
    Banking;

    if isInvFull then
      MakeWines;

    if (FailSafeTimer.timeElapsed > 90000) then
      openBank;

    doInterface;
    Progress;
    until not isLoggedIn;
    end;

    begin
    InitAL();
    DTMz;
    DeclarePlayer;
    LoginPlayer(false);

    while isLoggedIn() do
    MainLoop;

    end.

    All I have done is declared a global timer var named FailSafeTimer (line 9). I then have the timer start at the end of the banking procedure (line 182). Finally, I have added a check towards the bottom of the main loop to check the timers elapsed time, and if it exceeds 90 seconds, it starts the banking procedure (line 270).
    Hi again,
    I'm having problems with, when the script tries to "Make All" and sometimes it fails that and the bot just stands still for 5 minutes staring the interface and then it gets force logged out. I tried to use the same failsafe you provided above but it doesn't seem to open bank at all...

    Also tried to move the timeElapsed here:

    Code:
    Procedure MainLoop;
    begin
    if isLoggedIn then
      setAngle(ANGLE_HIGH);
    repeat
    MouseSpeed := RandomRange(15, 22);
    
    if getInvCount <= 14 then
    openBank;
    
    if isBankOpen() then
    Banking;
    
    if isInvFull then
      MakeWines;
    
    
    doInterface;
    
    if (FailSafeTimer.timeElapsed > 90000) then
      openBank;
    
    Progress;
    until not isLoggedIn;
    end;
    Because the íssue happens after it tried to make all "doInterface".
    Any ideas?
    Last edited by Helvetin16; 09-10-2017 at 03:16 PM.

  4. #29
    Join Date
    Jan 2012
    Location
    Sydney, Australia
    Posts
    877
    Mentioned
    12 Post(s)
    Quoted
    368 Post(s)

    Default

    Quote Originally Posted by Helvetin16 View Post
    Hi again,
    I'm having problems with, when the script tries to "Make All" and sometimes it fails that and the bot just stands still for 5 minutes staring the interface and then it gets force logged out. I tried to use the same failsafe you provided above but it doesn't seem to open bank at all...

    Also tried to move the timeElapsed here:

    Code:
    Procedure MainLoop;
    begin
    if isLoggedIn then
      setAngle(ANGLE_HIGH);
    repeat
    MouseSpeed := RandomRange(15, 22);
    
    if getInvCount <= 14 then
    openBank;
    
    if isBankOpen() then
    Banking;
    
    if isInvFull then
      MakeWines;
    
    
    doInterface;
    
    if (FailSafeTimer.timeElapsed > 90000) then
      openBank;
    
    Progress;
    until not isLoggedIn;
    end;
    Because the íssue happens after it tried to make all "doInterface".
    Any ideas?
    You have an infinite loop here.

    Simba Code:
    Procedure doInterface;
    begin
    MouseBoxHover(32, 390, 293, 445, randomrange(5, 10));
    Wait(RandomRange(100, 250));
    if WaitUpText('ake', 400) then
      begin
      FastClick(Mouse_RIGHT);
      WaitOption('Make All', 200);
      end else
      begin
        inc(Failed);
        if (Failed > 5) then
        Failed := 0;
        exit;
        end;

    While (getInvCount > 14) do //if the script does not click Make-All, then the inventory count will not make it to 14 or less, creating an infinite loop.
      begin
      if ContinueChat(False) then
        begin
        exit;
        end else;
      antiban;
      end;
      WinesMade := WinesMade + 14;
      xp := 200;
      wait(randomrange(250, 500));
      exit;
    end;

    The reason this may be happening is that it is not identifying the the interface when it appears, as there is no fail safe for this.

    Simba Code:
    Procedure doInterface;
    begin
    MouseBoxHover(32, 390, 293, 445, randomrange(5, 10));
    Wait(RandomRange(100, 250));
    if WaitUpText('ake', 400) then
      begin
      FastClick(Mouse_RIGHT);
      WaitOption('Make All', 200);
      end else
      begin
        inc(Failed);
        if (Failed > 5) then
        Failed := 0;
        exit;
        end;

    As you can see, if it doesn't see the WaitUptext, it will simply continue on to the infinite loop I mentioned above.

    I also don't understand what the Failed variable is meant to achieve.

    The best way to combat this would be to use a better detection method for the interface (I use DTMs or look for the text in the box), and add fail safe timers to your loops to stop them being infinite.

    Something like this should work better.
    Simba Code:
    Procedure doInterface;
    var
      FS:Timer;
    begin
      MouseBoxHover(32, 390, 293, 445, randomrange(5, 10));
      Wait(RandomRange(100, 250));
      if WaitUpText('ake', 400) then
      begin
        FastClick(Mouse_RIGHT);
        WaitOption('Make All', 200);
        Failed := 0;
      end else
      begin
        if (Failed > 5) then
        begin
          writeln('Cant see the interface after 5 attempts');
          TerminateScript;
        end;
        inc(Failed);
        exit;
      end;
      if (Failed = 0) then
      FS.Start;
      While (getInvCount > 14) do
      begin
        if ContinueChat(False) then
        begin
          exit;
        end else;
          antiban;
        if (FS.TimeElapsed > 30000) then
          exit;
      end;
      WinesMade := WinesMade + 14;
      xp := 200;
      wait(randomrange(250, 500));
    end;

    Basically added a fail safe timer that ends the while do loop after 30 seconds if the condition isnt met.

    Also made use of the Failed variable by allowing 5 loops to identify the interface before the script terminates, but again, I would recommend using a DTM.

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 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
  •