Results 1 to 12 of 12

Thread: Superheater Request Part 2

  1. #1
    Join Date
    Sep 2014
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Talking Superheater Request Part 2

    Hey guys!

    Earlier I requested a superheater script on a different thread: https://villavu.com/forum/showthread.php?t=110517

    And a lot of people seemed interested. Knowing that this would be a popular script, I decided to do some digging, and actually found something on this thread: https://villavu.com/forum/showthread.php?t=108760

    Voilaa superheater script


    Code:
    program new;
    {$DEFINE SMART8}
    {$I SRL-OSR/SRL.Simba}
    {$I SRL-OSR\SRL\misc\SmartGraphics.simba}
    {$I SRL-OSR/SRL/Reflection/Reflection.simba}
    
    function F_OpenBank: Boolean;
    var
      Booth: TPoint;
    begin
      if (not LoggedIn) or (BankScreen) then
        Exit;
    
      Booth := R_TileToMS(Point(3186, 3436));
      MMouse(Booth.X, Booth.Y, 2, 2);
      Sleep(100 + Random(100));
      if (R_IsUpText('Bank Ba')) then begin
        ClickMouse2(Mouse_Left);
      end else begin
        ClickMouse2(Mouse_Right);
        Sleep(250 + Random(250));
        R_ChooseOption('Bank Ba');
      end;
      Sleep(500 + Random(250));
    
      if (PinScreen) then
        InPin(Players[CurrentPlayer].Pin);
    
      Result := WaitFunc(@BankScreen, 250, 2500);
      Sleep(1000 + Random(250));
    end;
    
    procedure F_CloseBank;
    begin
      if (not LoggedIn) or (not BankScreen) then
        Exit;
    
      MMouse(486, 42, 2, 2);
      ClickMouse2(Mouse_Left);
      Sleep(250 + Random(250));
    end;
    
    function F_WithdrawEx(Col, Row, Amount: Integer; Uptexts: TStringArray): Boolean;
    var
      BBox: TBox;
      X, Y: Integer;
    begin
      Result := False;
      FixBank;
      if not bankscreen then
        exit;
    
      BBox := BankIndexToMSBox(BankPointToBankIndex(Point(Col, Row)));
      BBox := IntToBox(BBox.X1 - 2, BBox.Y1 + 10, BBox.X2 - 2, BBox.Y2 + 3);
      GetMousePos(X, Y);
      if (not PointInBox(Point(X, Y), BBox)) then
        MouseBox(BBox.X1 - 2, BBox.Y1 + 10, BBox.X2 - 2, BBox.Y2 + 3, mouse_move);
    
      if (Length(Uptexts) > 0) then
        if (not R_WaitUpTextMulti(Uptexts, 500)) then
          Exit;
    
      if (Amount = 1) then
        ClickMouse2(mouse_left)
      else
        ClickMouse2(mouse_right);
      if (Amount = 1) then
      begin
        Result := True;
        Wait(RandomRange(250, 550));
        Exit;
      end;
    
      if (Amount = -1) then
      begin
        if (WaitOptionMultiEx(['Withdraw-All-but', 'l-b'], 'All', Nothing, 300)) then
          Result := R_ChooseOption('Withdraw-All-but');
      end else
        if (Amount = 0) then
        begin
          if (WaitOptionMultiEx(['Withdraw-All', 'w-A'], 'All', Nothing, 300)) then
            Result := R_ChooseOption('Withdraw-All');
        end else
          if (WaitOptionMultiEx(['Withdraw-' + IntToStr(Amount) + ' ', 'w-' + IntToStr(Amount) + ' '], 'All', Nothing, 300)) then
            Result := R_ChooseOption('Withdraw-' + IntToStr(Amount) + ' ');
    
      if (not (Result)) and (Amount > 0) then
      begin
        if (not OptionsExist(['Withdraw', 'ithdraw', 'draw'], False)) then
          MouseBox(BBox.X1 + 5, BBox.Y1 + 5, BBox.X2 - 5, BBox.Y2 - 5, mouse_right);
    
        if WaitOptionMulti(['Withdraw-X', 'w-X', 'X'], 500) then
        begin
           X := GetSystemTime + 10000;
           while (X >= GetSystemTime) and (not (InRange(CountColor(0, 211, 394, 308, 411), 200, 300))) do
             Wait(50);
           Wait(RandomRange(75, 400));
           TypeSend(IntToStr(Amount));
           Result := True;
        end;
      end;
    end;
    
    procedure WithdrawOres;
    begin
      F_OpenBank;
      F_WithdrawEx(2, 0, 9, ['Iron ore']);
      F_WithdrawEx(1, 0, 0, ['Coal']);
      F_CloseBank;
    end;
    
    procedure SuperheatBar;
    begin
      GameTab(tab_Magic);
      MMouse(666 + RandomRange(-3, 3), 313 + RandomRange(-3, 3), 2, 2);
      Sleep(100 + Random(100));
      ClickMouse2(Mouse_Left);
      Sleep(100 + Random(100));
      InvMouse(10, 1);
      Sleep(1000 + Random(250));
    end;
    
    procedure Superheat;
    var
      I: Integer;
    begin
      for I := 0 to 8 do begin
        SuperheatBar;
      end;
    end;
    
    procedure DepositBars;
    begin
      F_OpenBank;
      Deposit(2, 28, True);
    end;
    
    begin
      SetupSRL;
      SetupReflection;
      repeat
        WithdrawOres;
        Superheat;
        DepositBars;
      until(False);
    end.
    I was really excited to find what I had been looking for, but unfortunately the script is quite old, and won't even run. Now that we have a basic script, could a script writer maybe fix this one? Or even better make a new and better script?

    I'm sure it would be a great addition to the script library, and with color I see this script running forever. Heck, maybe someone could code this in Aerolib, and make it amazing

    Thanks to whomever decides to take this on

    Credit:
    All credit goes to Frement for making the superheating script attached.

    ~Dog

  2. #2
    Join Date
    Mar 2013
    Posts
    1,010
    Mentioned
    35 Post(s)
    Quoted
    620 Post(s)

    Default

    Compiled successfully in 484 ms.
    How doesn't this work?
    #slack4admin2016
    <slacky> I will build a wall
    <slacky> I will ban reflection and OGL hooking until we know what the hell is going on

  3. #3
    Join Date
    Oct 2006
    Posts
    6,752
    Mentioned
    95 Post(s)
    Quoted
    532 Post(s)

    Default

    Quote Originally Posted by Dog View Post
    ....
    Well atm reflection hooks are outdated as of a couple hours ago, I'm not home atm to run our updater, so if that is the only problem just remove R_ChooseOption and replace with ChooseOption, and just use srl's banking function it should work.

    But @Frement; literally made that in a couple hours, so I wouldn't be surprised if it doesn't work anymore. If you just wait a couple days i'll make you one...
    “The long-lived and those who will die soonest lose the same thing. The present is all that they can give up, since that is all you have, and what you do not have, you cannot lose.” - Marcus Aurelius

  4. #4
    Join Date
    Jul 2012
    Posts
    181
    Mentioned
    4 Post(s)
    Quoted
    67 Post(s)

    Default

    Rather than having a part 2 and two threads why didn't you just add this to your first request?

  5. #5
    Join Date
    Sep 2014
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by Harrier View Post
    How doesn't this work?
    If you actually run it in game, it has issues removing bars from the bank. But yes, it does compile.

  6. #6
    Join Date
    Sep 2014
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by elfyyy View Post
    Well atm reflection hooks are outdated as of a couple hours ago, I'm not home atm to run our updater, so if that is the only problem just remove R_ChooseOption and replace with ChooseOption, and just use srl's banking function it should work.

    But @Frement; literally made that in a couple hours, so I wouldn't be surprised if it doesn't work anymore. If you just wait a couple days i'll make you one...
    I'd appreciate it if you did

  7. #7
    Join Date
    Mar 2013
    Posts
    1,010
    Mentioned
    35 Post(s)
    Quoted
    620 Post(s)

    Default

    Quote Originally Posted by Dog View Post
    If you actually run it in game, it has issues removing bars from the bank. But yes, it does compile.
    Set it to hide tab bar
    #slack4admin2016
    <slacky> I will build a wall
    <slacky> I will ban reflection and OGL hooking until we know what the hell is going on

  8. #8
    Join Date
    Sep 2014
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by Harrier View Post
    Set it to hide tab bar
    I would have to collapse all of my tabs then :/
    I'll just wait for @elfyyy to make a new one

  9. #9
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by Dog View Post
    I would have to collapse all of my tabs then :/
    I'll just wait for @elfyyy to make a new one
    Progress Report:
    Runtime: 3 Minutes and 34 Seconds
    Bars made: 81


    Simba Code:
    program new;
    {$DEFINE SMART8}
    {$I SRL-OSR/SRL.Simba}
    {$I SRL-OSR\SRL\misc\SmartGraphics.simba}
    {$I SRL-OSR/SRL/Reflection/Reflection.simba}

    var bars: integer;

    function F_BankScreen: Boolean;
    begin
      Result := (CountColor(2070783, 176, 7, 350, 38) > 200);
    end;

    function F_OpenBank: Boolean;
    var
      Booth: TPoint;
    begin
      if (not LoggedIn) or (F_BankScreen) then
        Exit;

      Booth := R_TileToMS(Point(3186, 3436));
      MMouse(Booth.X, Booth.Y, 2, 2);
      Sleep(100 + Random(100));
      if (R_IsUpText('Bank Ba')) then begin
        ClickMouse2(Mouse_Left);
      end else begin
        ClickMouse2(Mouse_Right);
        Sleep(250 + Random(250));
        R_ChooseOption('Bank Ba');
      end;
      Sleep(500 + Random(250));

      if (PinScreen) then
        InPin(Players[CurrentPlayer].Pin);

      Result := WaitFunc(@F_BankScreen, 250, 2500);
      Sleep(1000 + Random(250));
    end;

    procedure F_CloseBank;
    begin
      if (not LoggedIn) or (not F_BankScreen) then
        Exit;

      MMouse(486+randomrange(-2, 2), 25+randomrange(-2, 2), 2, 2);
      ClickMouse2(Mouse_Left);
      Sleep(250 + Random(250));
    end;

    function F_WithdrawEx(Col, Row, Amount: Integer; Uptexts: TStringArray): Boolean;
    var
      BBox: TBox;
      X, Y: Integer;
    begin
      Result := False;
      FixBank;
      if (not LoggedIn) or (not F_BankScreen) then
        exit;

      BBox := BankIndexToMSBox(BankPointToBankIndex(Point(Col, Row)));
      BBox := IntToBox(BBox.X1 - 2, BBox.Y1 + 30, BBox.X2 - 2, BBox.Y2 + 23);
      GetMousePos(X, Y);
      if (not PointInBox(Point(X, Y), BBox)) then
        MouseBox(BBox.X1 - 2, BBox.Y1 + 10, BBox.X2 - 2, BBox.Y2 + 3, mouse_move);

      if (Length(Uptexts) > 0) then
        if (not R_WaitUpTextMulti(Uptexts, 500)) then
          Exit;

      if (Amount = 1) then
        ClickMouse2(mouse_left)
      else
        ClickMouse2(mouse_right);
      if (Amount = 1) then
      begin
        Result := True;
        Wait(RandomRange(250, 550));
        Exit;
      end;

      if (Amount = -1) then
      begin
        if (WaitOptionMultiEx(['Withdraw-All-but', 'l-b'], 'All', Nothing, 300)) then
          Result := R_ChooseOption('Withdraw-All-but');
      end else
        if (Amount = 0) then
        begin
          if (WaitOptionMultiEx(['Withdraw-All', 'w-A'], 'All', Nothing, 300)) then
            Result := R_ChooseOption('Withdraw-All');
        end else
          if (WaitOptionMultiEx(['Withdraw-' + IntToStr(Amount) + ' ', 'w-' + IntToStr(Amount) + ' '], 'All', Nothing, 300)) then
            Result := R_ChooseOption('Withdraw-' + IntToStr(Amount) + ' ');

      if (not (Result)) and (Amount > 0) then
      begin
        if (not OptionsExist(['Withdraw', 'ithdraw', 'draw'], False)) then
          MouseBox(BBox.X1 + 5, BBox.Y1 + 5, BBox.X2 - 5, BBox.Y2 - 5, mouse_right);

        if WaitOptionMulti(['Withdraw-X', 'w-X', 'X'], 500) then
        begin
           X := GetSystemTime + 10000;
           while (X >= GetSystemTime) and (not (InRange(CountColor(0, 211, 394, 308, 411), 200, 300))) do
             Wait(50);
           Wait(RandomRange(75, 400));
           TypeSend(IntToStr(Amount));
           Result := True;
        end;
      end;
    end;

    procedure WithdrawOres;
    begin
      F_OpenBank;
      F_WithdrawEx(3, 0, 9, ['Iron ore']);
      F_WithdrawEx(1, 0, 0, ['Coal']);
      F_CloseBank;
    end;

    procedure SuperheatBar;
    begin
      GameTab(tab_Magic);
      MMouse(666 + RandomRange(-3, 3), 313 + RandomRange(-3, 3), 2, 2);
      Sleep(100 + Random(100));
      ClickMouse2(Mouse_Left);
      Sleep(100 + Random(100));
      InvMouse(10, 1);
      Sleep(1000 + Random(250));
      Inc(bars);
    end;

    procedure Superheat;
    var
      I: Integer;
    begin
      for I := 0 to 26 do begin
        SuperheatBar;
      end;
    end;

    procedure DepositBars;
    var i: integer;
    begin
      F_OpenBank;
      //Deposit(2, 28, True); SRL-5 Deposit() function doesn't work?
      for i := 2 to 28 do begin
        if (InvCount > 1) then begin
          InvMouse(i, mouse_Right);
          sleep(200+random(50));
          R_ChooseOption('Deposit-All');
        end;
      end;
    end;

    procedure proggy;
    begin
      writeln('Runtime: ' + timerunning);
      writeln('Bars made: ' + tostr(bars));
    end;

    begin
      SetupSRL;
      SetupReflection;
      repeat
        WithdrawOres;
        Superheat;
        DepositBars;
        proggy;
      until(False);
    end.
    There used to be something meaningful here.

  10. #10
    Join Date
    Sep 2014
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by Frement View Post
    Progress Report:
    Runtime: 3 Minutes and 34 Seconds
    Bars made: 81


    Simba Code:
    program new;
    {$DEFINE SMART8}
    {$I SRL-OSR/SRL.Simba}
    {$I SRL-OSR\SRL\misc\SmartGraphics.simba}
    {$I SRL-OSR/SRL/Reflection/Reflection.simba}

    var bars: integer;

    function F_BankScreen: Boolean;
    begin
      Result := (CountColor(2070783, 176, 7, 350, 38) > 200);
    end;

    function F_OpenBank: Boolean;
    var
      Booth: TPoint;
    begin
      if (not LoggedIn) or (F_BankScreen) then
        Exit;

      Booth := R_TileToMS(Point(3186, 3436));
      MMouse(Booth.X, Booth.Y, 2, 2);
      Sleep(100 + Random(100));
      if (R_IsUpText('Bank Ba')) then begin
        ClickMouse2(Mouse_Left);
      end else begin
        ClickMouse2(Mouse_Right);
        Sleep(250 + Random(250));
        R_ChooseOption('Bank Ba');
      end;
      Sleep(500 + Random(250));

      if (PinScreen) then
        InPin(Players[CurrentPlayer].Pin);

      Result := WaitFunc(@F_BankScreen, 250, 2500);
      Sleep(1000 + Random(250));
    end;

    procedure F_CloseBank;
    begin
      if (not LoggedIn) or (not F_BankScreen) then
        Exit;

      MMouse(486+randomrange(-2, 2), 25+randomrange(-2, 2), 2, 2);
      ClickMouse2(Mouse_Left);
      Sleep(250 + Random(250));
    end;

    function F_WithdrawEx(Col, Row, Amount: Integer; Uptexts: TStringArray): Boolean;
    var
      BBox: TBox;
      X, Y: Integer;
    begin
      Result := False;
      FixBank;
      if (not LoggedIn) or (not F_BankScreen) then
        exit;

      BBox := BankIndexToMSBox(BankPointToBankIndex(Point(Col, Row)));
      BBox := IntToBox(BBox.X1 - 2, BBox.Y1 + 30, BBox.X2 - 2, BBox.Y2 + 23);
      GetMousePos(X, Y);
      if (not PointInBox(Point(X, Y), BBox)) then
        MouseBox(BBox.X1 - 2, BBox.Y1 + 10, BBox.X2 - 2, BBox.Y2 + 3, mouse_move);

      if (Length(Uptexts) > 0) then
        if (not R_WaitUpTextMulti(Uptexts, 500)) then
          Exit;

      if (Amount = 1) then
        ClickMouse2(mouse_left)
      else
        ClickMouse2(mouse_right);
      if (Amount = 1) then
      begin
        Result := True;
        Wait(RandomRange(250, 550));
        Exit;
      end;

      if (Amount = -1) then
      begin
        if (WaitOptionMultiEx(['Withdraw-All-but', 'l-b'], 'All', Nothing, 300)) then
          Result := R_ChooseOption('Withdraw-All-but');
      end else
        if (Amount = 0) then
        begin
          if (WaitOptionMultiEx(['Withdraw-All', 'w-A'], 'All', Nothing, 300)) then
            Result := R_ChooseOption('Withdraw-All');
        end else
          if (WaitOptionMultiEx(['Withdraw-' + IntToStr(Amount) + ' ', 'w-' + IntToStr(Amount) + ' '], 'All', Nothing, 300)) then
            Result := R_ChooseOption('Withdraw-' + IntToStr(Amount) + ' ');

      if (not (Result)) and (Amount > 0) then
      begin
        if (not OptionsExist(['Withdraw', 'ithdraw', 'draw'], False)) then
          MouseBox(BBox.X1 + 5, BBox.Y1 + 5, BBox.X2 - 5, BBox.Y2 - 5, mouse_right);

        if WaitOptionMulti(['Withdraw-X', 'w-X', 'X'], 500) then
        begin
           X := GetSystemTime + 10000;
           while (X >= GetSystemTime) and (not (InRange(CountColor(0, 211, 394, 308, 411), 200, 300))) do
             Wait(50);
           Wait(RandomRange(75, 400));
           TypeSend(IntToStr(Amount));
           Result := True;
        end;
      end;
    end;

    procedure WithdrawOres;
    begin
      F_OpenBank;
      F_WithdrawEx(3, 0, 9, ['Iron ore']);
      F_WithdrawEx(1, 0, 0, ['Coal']);
      F_CloseBank;
    end;

    procedure SuperheatBar;
    begin
      GameTab(tab_Magic);
      MMouse(666 + RandomRange(-3, 3), 313 + RandomRange(-3, 3), 2, 2);
      Sleep(100 + Random(100));
      ClickMouse2(Mouse_Left);
      Sleep(100 + Random(100));
      InvMouse(10, 1);
      Sleep(1000 + Random(250));
      Inc(bars);
    end;

    procedure Superheat;
    var
      I: Integer;
    begin
      for I := 0 to 26 do begin
        SuperheatBar;
      end;
    end;

    procedure DepositBars;
    var i: integer;
    begin
      F_OpenBank;
      //Deposit(2, 28, True); SRL-5 Deposit() function doesn't work?
      for i := 2 to 28 do begin
        if (InvCount > 1) then begin
          InvMouse(i, mouse_Right);
          sleep(200+random(50));
          R_ChooseOption('Deposit-All');
        end;
      end;
    end;

    procedure proggy;
    begin
      writeln('Runtime: ' + timerunning);
      writeln('Bars made: ' + tostr(bars));
    end;

    begin
      SetupSRL;
      SetupReflection;
      repeat
        WithdrawOres;
        Superheat;
        DepositBars;
        proggy;
      until(False);
    end.
    I keep getting this error when I go to compile. I just reinstalled reflection, so I'm not quite sure what's not letting it compile.

    The error reads:
    Code:
    Exception in Script: Operator expected at line 446, column 3 in file "C:\Simba\Includes\SRL-OSR\SRL\Reflection\Core\Tiles.simba"
    Exception in Script: Operator expected at line 446, column 3 in file "C:\Simba\Includes\SRL-OSR\SRL\Reflection\Core\Tiles.simba"

  11. #11
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by Dog View Post
    I keep getting this error when I go to compile. I just reinstalled reflection, so I'm not quite sure what's not letting it compile.

    The error reads:
    Code:
    Exception in Script: Operator expected at line 446, column 3 in file "C:\Simba\Includes\SRL-OSR\SRL\Reflection\Core\Tiles.simba"
    Exception in Script: Operator expected at line 446, column 3 in file "C:\Simba\Includes\SRL-OSR\SRL\Reflection\Core\Tiles.simba"
    Because you are using a wrong interpreter. Script > Interpreter > PascalScript
    There used to be something meaningful here.

  12. #12
    Join Date
    Sep 2014
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by Frement View Post
    Because you are using a wrong interpreter. Script > Interpreter > PascalScript
    You just made my day.
    Last edited by Dog; 10-14-2014 at 04:34 AM.

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
  •