Page 1 of 2 12 LastLast
Results 1 to 25 of 30

Thread: Quick Inventory Herlore

  1. #1
    Join Date
    Dec 2011
    Posts
    266
    Mentioned
    16 Post(s)
    Quoted
    185 Post(s)

    Default Quick Inventory Herlore

    Latest Update: 5-6-2014 - Script has bee updated, be sure to grab the newest version! Newest version (1.4) is DirectX and OpenGL compatible! Please make sure to grab the correct version for your application. As always, post bugs and suggestions!

    Minor update V1.41: Updated to utilize the new productionscreen.clickStart; include.

    So I finally finished my first REAL script. This is a full script with failsafes, antiban and login ability. This is an AIO Herblore script that uses the quick inventory buttons to deposit/withdrawal your inventory. The max human pots/hr prior to the bank update was round about 2200/hr. This script runs about 2200 pots/hr, and it is doubtful that it could be much faster.

    Start at the supported bank of your choice (be sure to update the bankscreen.Open(yourbankhere), DX line 121, OGL line 118). Your interface should be setup on Old School, slim headers, locked, smashed chatbox with action bar directly on top of it.

    Cleaning Herbs: Setup your bank to use Quick Inventory Button 1 with the herb of your choice.
    Unfinished Potions: Setup your bank to use Quick Inventory Button 2. Herbs must be inventory slots 1-14, and the vials need to be slots 15-28.
    Finished Potions: Setup your bank to use Quick Inventory Button 2. Potions must be inventory slots 1-14, and the secondaries need to be slots 15-28.

    See the screenshots below to verify you are setup correctly. You MUST have your buttons setup exactly like this. This script handles edible secondaries, but ONLY if you are setup correctly.

    Code:
    * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    Gunner"s Quick Inventory Herblore
    Time Run: 5 Hours, 9 Minutes and 37 Seconds
    Pots Made: 11298
    Pots Made/hr: 2189
    Loads Done: 807
    Profit Made: 10168200
    Profit Made/hr: 1970445
    * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    My thank-you's and propz are in the script. I stole several things for the sake getting a working script and all of the thefts are acknowledged in the script. If I missed anyone, please don't hesitate to speak up and I'll be sure to give you a shoutout. However, I used two tutorials and one script for all my ideas, so I believe everyone has been properly credited.

    Anyway, please test this script. Put it through it's paces and stress it. If there are any issues I'll be sure to get someone to help me fix it LOL.

    Provide me with feedback and criticisms as needed. It's my first script so there is no doubt I stepped out of standards somewhere, or I am slightly less efficient than I could be.

    Thanks guys, happy botting!


    Current Version 1.4 (5/6/2014)
    -Code is back out of standards with the Case/Of updates. Will be fixed soon.
    -OpenGL supported version added. Now supports both DirectX and OpenGL.
    -Script now supports Cleaning Herbs and Finished Potions. Now fully AIO!

    Planned Updates:
    -The ability to switch herb types
    -The ability to collect pre-ordered supplies from bankers
    -The ability to reorder supplies at the G.E

    5-5-2014 - Special thanks to The Mayor for his suggestions listed below. I've implemented nearly everything posted. As always, please let me know if there are any issues with the script, and any further suggestions for improvement are certainly welcome!

    Once I have the standards back in order I will be moving this to Version 2.0.


    Code:
    Previous Version: 1.3 (5/5/14)
    -Code should now be fully within standards (please let me know what I've missed!)
    -DirectX Supported
    -6 Hour Login Supported
    -Simpler code due to logic improvements
    -Better Failsafes - there should be no more idle logouts 
    
    Planned Updates:
    -The ability to switch herb types
    -The ability to clean herbs
    -The ability to collect pre-ordered supplies from bankers 
    -The ability to reorder supplies at the G.E
    
    Previous Version: 1.2 (4/16/14)
    -Updated Progress Report
    -Better Logic
    -More Human Action (mouse misses, better hovering)
    -Better Failsafes
    -Slightly Cleaner Code
    
    Planned Updates:
    -Code fully within standards
    -The ability to switch herb types
    -The ability to clean herbs
    -The ability to collect pre-ordered supplies from bankers 
    -The ability to reorder supplies at the G.E[/B]
    
    Previous Version: 1.1 (4/9/14)
    -Added Progress Report
    -Fixed Login
    -Fixed some logic, and failsafes
    
    Planned Updates:
    -Further logic improvement
    -Cleaner code
    -The ability to switch herb types
    -Better hovering and speed improvements
    
    Previous Version: 1.0
    1.0 - initial release
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by Gunner; 05-06-2014 at 05:51 PM. Reason: Updated Script to AIO

  2. #2
    Join Date
    Dec 2011
    Posts
    266
    Mentioned
    16 Post(s)
    Quoted
    185 Post(s)

    Default

    After 3 days, I want to assume that no news is good news, but being a first script I have to think there is at least one thing that could be improved or critiqued.

    Can I get some kind of feedback on this? Good bad or ugly. Tell me how bad it sucks, I don't really care what kind of feedback it is, but if left to my own devices I'm not gonna get any better.

    Somebody help a noob out! Thanks in advance.

  3. #3
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Try and replace your mouseboxes with srl functions, just as tabBackpack.mouseSlot() and bankScreen.clickButton(BANK_BUTTON_PRESET_1) and such!

    Also you could try making it more human like, from what i can tell you always click the same slots in the backpack, you could have like a 80% chance of clicking slot 1, and a 20% chance of clicking slot 2..14.

  4. #4
    Join Date
    Dec 2011
    Posts
    266
    Mentioned
    16 Post(s)
    Quoted
    185 Post(s)

    Default

    Quote Originally Posted by Olly View Post
    Try and replace your mouseboxes with srl functions, just as tabBackpack.mouseSlot() and bankScreen.clickButton(BANK_BUTTON_PRESET_1) and such!

    Also you could try making it more human like, from what i can tell you always click the same slots in the backpack, you could have like a 80% chance of clicking slot 1, and a 20% chance of clicking slot 2..14.
    Wait...? What!? Hell I hadn't checked the v6.0 Doc in a couple days, didn't know the presets had been added. That's what I've been waiting on! Those presets will make it 100 times easier and I can ditch a couple mousebox clicks. I even tried to make a DTM for the presets, but it kicked my ass. I still may use a few mouseboxes for hovering, but I think that would only apply to the production screen now. Thanks for adding that bro! I'll definitely be using it.

    As for the 80/20, I agree that's a more human approach. I only click the same slot each time to ensure every herb gets used. If you're down to only 2 herbs and you land on a 20% and look in slot 14 it's gonna fail. I reckon leaving 2 or 3 herbs behind each run is better than being banned, right? LOL

    But now that you got me pondering that, I could just have it check the uptext and if it fails, move to slot 1.

    Thanks a lot for the suggestions Olly, gonna go read up on tabBackpack.mouseSlot() and get that implemented.

  5. #5
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Building on what Olly said about making it more human like, you could look in the backpack for DTMs of the item you want to click and have the script click on any one of the DTMs found. Little things like that make it just that little bit more human like

    Grats on the script BTW, very nice for a first one!
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  6. #6
    Join Date
    Jan 2012
    Location
    Long Island, NY
    Posts
    413
    Mentioned
    5 Post(s)
    Quoted
    95 Post(s)

    Default

    This is a pretty good start. You know you don't need to explain yourself so in-depth in your scripts Also, you are aren't ripping off Ashaman by using productionScreen.clickStart and GaussRangeInt, these are apart of SRL6 include. You can look into that more at http://docs.villavu.com/srl-6/ for a list of all the functions and what they do also how to use them.

    I haven't run the script to see how it works, but I can give you a few tips looking at your code. First is you need to work on your formatting and standards. Your indents are wild, and make the code hard to follow. I also can't tell what your intentions are with certain statements like the following.
    Simba Code:
    if not isMouseOverText(['water'],) then
        WriteLn('Looking for vials, maybe lag?...');
        Wait(GaussRangeInt(300,450));
    You put in 2 lines indented, but the only thing that will get executed in that statement is the WriteLn and the Wait will always be executed regardless of the statement being true or false. If you want both to happen when the condition is met you need to change that to the following.
    Simba Code:
    if not isMouseOverText(['water'],) then
    begin
      WriteLn('Looking for vials, maybe lag?...');
      Wait(GaussRangeInt(300,450));
    end;



    You can also replace some of your code such as...
    Simba Code:
    if not isMouseOverText(['Use Clean'],) then
        WriteLn('Waiting for the bankscreen to close...*whistles*...');
        Wait(GaussRangeInt(500,650));
      if isMouseOverText(['Use Clean'],) then
        fastclick(MOUSE_LEFT)
    With something like this, though I would add in Timers as a failsafe to make sure you can exit this loop.
    Simba Code:
    repeat
      Wait(GaussRangeInt(500,650));
    until(isMouseOverText(['Use Clean']));
    So you can replace makeItems with something like this...
    Simba Code:
    //Set FailTime to time in ms to wait for isMouseOvertext(['Use Clean'])
    procedure makeItems(FailTime : Integer);
    var
      T : TTimeMarker;
    begin
      mouseBox(intToBox(595, 334, 610, 345), MOUSE_MOVE, MOUSE_HUMAN);
      T.reset;
      T.start;
      writeLn('Waiting for the bankscreen to close...*whistles*...');
      repeat
        if T.getTime > FailTime then
        begin
          players[currentPlayer].logout;
          writeLn('Out of herbs boss, takin a break!');
          terminateScript;
        end;
        wait(gaussRangeInt(500,650));
      until(isMouseOverText(['Use Clean']));
      fastclick(MOUSE_LEFT);
    end;



    You can make your main loop simpler to look at, and less redundant by changing your progress report to be something like this...
    Simba Code:
    procedure progressReport(OurStatus : String);
    var
      itemsMade, itemsMadehr, profit, profithr, potsmadehr: integer;
    begin
      itemsMade := LoadsDone * 14;
      itemsMadehr := (itemsMade * 60);
      profit := (itemsMade * 900);
      profithr := round((profit * 60) / (getTimeRunning() / 60000));
      potsmadehr := round((itemsMade * 60) / (getTimeRunning() / 60000));

      clearDebug();
      writeLn('* * * * * * * * * * * * * * * * * * * * * * * * * * * * *');
      writeLn('Gunner"s Quick Inventory Herblore');
      writeLn('Time Run: ' + timeRunning);
      writeLn('Current Status: ' + OurStatus);
      writeLn('Pots Made: ' + intToStr(itemsMade));
      writeLn('Pots Made/hr: ' + intToStr(potsmadehr));
      writeLn('Loads Done: ' + intToStr(loadsDone));
      writeLn('Profit Made: ' + intToStr(profit));
      writeLn('Profit Made/hr: ' + intToStr(profithr));
      writeLn('* * * * * * * * * * * * * * * * * * * * * * * * * * * * *');
    end;
    This way you can get rid of all those extra clearDebugs and writeLns and you can just add the progress report to the bottom of all your procedures altogether. So instead of say...
    Simba Code:
    refreshSupplies();
    clearDebug();
    progressReport();
    WriteLn('Got fresh supplies...');
    You can just have
    Simba Code:
    refreshSupplies();
    and you would add in
    Simba Code:
    progressReport('Got fresh supplies...');
    to the bottom of refreshSupplies().


    Another thing is your Timer does nothing in this procedure.
    Simba Code:
    procedure depositPots(); //opens bank and updates progress report
    var
      bankTimer: TTimeMarker;
    begin
      bankScreen.open(BANK_NPC_BLUE);
        bankTimer.start();
          inc(LoadsDone);
    end;


    Not a bad start but you should look into improving your format of your code, get into the habit of following standards. Also you should learn to use TPAs for finding the banker and use some other SRL functions for doing things in your script. Just look through the documentation and figure out what function you are looking for, it's VERY straight forward if you know what your script needs to do(I need to bank my inventory, so I should look at the BankScreen interface for a function that deposits my inventory).

    Now by no means are your methods for doing x,y,z wrong I was just sharing some things that might help you become a better script writer. I typed this out on the forum but I'm sure most of that should compile into your script. Good luck with furthering yourself here!

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

    Default

    gunnar I have been using your script, I also use ashaman88's herblore script and I'm having a little bit of a problem.
    I know this is a problem that you may have had yourself previous when using ashaman88's script, it's where sometimes it fails to click properly on the items to open the production screen.
    I will try and adjust the wait times later.

    You could also try using the spacebar instead of having to move the mouse and click mix.

  8. #8
    Join Date
    Dec 2011
    Posts
    266
    Mentioned
    16 Post(s)
    Quoted
    185 Post(s)

    Default

    Quote Originally Posted by Brotein View Post
    I haven't run the script to see how it works, but I can give you a few tips looking at your code. First is you need to work on your formatting and standards. Your indents are wild, and make the code hard to follow. I also can't tell what your intentions are with certain statements like the following.
    Simba Code:
    if not isMouseOverText(['water'],) then
        WriteLn('Looking for vials, maybe lag?...');
        Wait(GaussRangeInt(300,450));

    Yeah I know the standards are quite a ways off. For the moment it makes it much easier for me to read to separate my begins and if not's, etc. I plan on cleaning it up once I'm 100% confident in the script. I do so many writeLns so I can know exactly on which procedure it failed. Most of them are gone on the version I'm working on now because I got a lot of bugs ironed out. I just wanted to make sure I wasn't making any serious violations at the moment, so thanks for the tips.

    If you want both to happen when the condition is met you need to change that to the following.
    Simba Code:
    if not isMouseOverText(['water'],) then
    begin
      WriteLn('Looking for vials, maybe lag?...');
      Wait(GaussRangeInt(300,450));
    end;

    Well yeah, you could do it that way if you wanted it to be like, correct and all. LOL

    You can also replace some of your code such as...
    Simba Code:
    if not isMouseOverText(['Use Clean'],) then
        WriteLn('Waiting for the bankscreen to close...*whistles*...');
        Wait(GaussRangeInt(500,650));
      if isMouseOverText(['Use Clean'],) then
        fastclick(MOUSE_LEFT)
    With something like this, though I would add in Timers as a failsafe to make sure you can exit this loop.

    Damn, the T.reset; must have been what was flubbing up my timers yesterday. If it failed 2 or 3 times each run then it would shut down in just a few runs and I couldn't figure out why. Thanks for that.

    You can make your main loop simpler to look at, and less redundant by changing your progress report to be something like this...to the bottom of refreshSupplies().

    Much better, thanks man.

    Another thing is your Timer does nothing in this procedure.
    Simba Code:
    procedure depositPots(); //opens bank and updates progress report
    var
      bankTimer: TTimeMarker;
    begin
      bankScreen.open(BANK_NPC_BLUE);
        bankTimer.start();
          inc(LoadsDone);
    end;

    That bankTimer had a function yesterday, it was part of a "until =". Thanks for the catch, I'll get it out of there.

    Not a bad start but you should look into improving your format of your code.

    I plan on it. It's just much simpler for me to look at at the moment with everything separated. I'll button it all up when I get more comfortable reading code.

    Good luck with furthering yourself here!

    Thanks a lot man, you've been a massive help
    Quote Originally Posted by Rich View Post
    Building on what Olly said about making it more human like, you could look in the backpack for DTMs of the item you want to click and have the script click on any one of the DTMs found. Little things like that make it just that little bit more human like

    Grats on the script BTW, very nice for a first one!
    Thank you! The DTMs kicked my ass yesterday. I haven't given up on them, I've just gone around them for the time being LOL.

    Quote Originally Posted by Rlp View Post
    gunnar I have been using your script, I also use ashaman88's herblore script and I'm having a little bit of a problem.
    I know this is a problem that you may have had yourself previous when using ashaman88's script, it's where sometimes it fails to click properly on the items to open the production screen.
    I will try and adjust the wait times later.

    You could also try using the spacebar instead of having to move the mouse and click mix.
    Yeah, I was having that problem as well. I figured it was just me because I'm running 4 clients and was causing lag. I was also getting that problem with my script, so I've been repeat/until failsafing all morning LOL. Thanks for letting me know it's not just me!

    I totally forgot about the spacebar. Good call.

    Thanks to all for the suggestions. I got a lot of good info here. Some of the mistakes you all pointed out made me feel really dumb, but that's how we learn, right?

    Kudos to all, and I'll definitely be implementing these suggestions. Thanks again!

  9. #9
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Quote Originally Posted by Gunner View Post
    Thank you! The DTMs kicked my ass yesterday. I haven't given up on them, I've just gone around them for the time being LOL.
    No worries. DTMs are incredibly simple once you know what you've got to do. What part of it is it that you're not a fan of?
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

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

    Default

    Quote Originally Posted by Gunner View Post
    Thank you! The DTMs kicked my ass yesterday. I haven't given up on them, I've just gone around them for the time being LOL.



    Yeah, I was having that problem as well. I figured it was just me because I'm running 4 clients and was causing lag. I was also getting that problem with my script, so I've been repeat/until failsafing all morning LOL. Thanks for letting me know it's not just me!

    I totally forgot about the spacebar. Good call.

    Thanks to all for the suggestions. I got a lot of good info here. Some of the mistakes you all pointed out made me feel really dumb, but that's how we learn, right?

    Kudos to all, and I'll definitely be implementing these suggestions. Thanks again!
    Yeah I've also been repeating until failsafe also
    will test any new versions when you add them

    I'm going to read up and try and make my first script soon too.

  11. #11
    Join Date
    Dec 2011
    Posts
    266
    Mentioned
    16 Post(s)
    Quoted
    185 Post(s)

    Default

    Quote Originally Posted by Rich View Post
    No worries. DTMs are incredibly simple once you know what you've got to do. What part of it is it that you're not a fan of?
    I created it no problem, it found it just fine in the editor, I just couldn't get it to call. I was going off the Mayor's tut, but a clan vexillum and a bank button are so different that I just couldn't get the code transposed. It'll come in time.

    I've created simple coordinate clickers before, (waitX, clickX, waitX, clickX) but I've only really been scripting this week. I think I'm off to a good start, there's just a mountain of stuff to learn.

    Quote Originally Posted by Rlp View Post
    Yeah I've also been repeating until failsafe also
    will test any new versions when you add them

    I'm going to read up and try and make my first script soon too.
    What really helped me understand it was starting off solely with coordinates and wait times, then slowly replacing each action one at a time with a procedure. It helped me to really understand what a block of code meant, and how it applied itself. While a block of efficient code can be 10 times as long to write as a waitX, moveX, clickX, it's also 100 times more stable and reliable.

    Read C0h3n's tut first, even if you just skim the obviously important parts, because it will make the Mayor's tut so much simpler to understand. You not only want to understand that a block of code does something, you want to understand why and C0h3n does a really good job at that.

    I may get yelled at for giving blatantly bad advice, but it's exactly how I learned LOL. Good luck to you!

  12. #12
    Join Date
    Dec 2011
    Posts
    266
    Mentioned
    16 Post(s)
    Quoted
    185 Post(s)

    Default

    Quote Originally Posted by Rlp View Post
    Yeah I've also been repeating until failsafe also
    will test any new versions when you add them

    I'm going to read up and try and make my first script soon too.
    Script has been updated. Feel free to give it a run, and report any bugs you see. Thanks!

  13. #13
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Wow 1.9m per hour

    I've just taken a look through, pretty awesome for a first script I'm sure if you continue to learn and refine your skills you will be sumbmitting a SRL Member application in no time! I've got a few suggestions, I hope you find them useful! From top to bottom:

    In the openBank procedure, it looks like it needs a begin/end here.
    Simba Code:
    if (pinscreen.isOpen()) then
      writeln('Pinscreen is open!'); // the if..then statement ends here
      if (pinScreen.enter('1234')) then
       writeln('Entered our bank pin!');
    You don't want to even try and enter the pin when the pinScreen isn't even open:
    Simba Code:
    if (pinscreen.isOpen()) then
    begin
      writeln('Pinscreen is open!');
      if (pinScreen.enter('1234')) then // now this will only execute if pinScreen is open
        writeln('Entered our bank pin!');
    end;
    Can you see a major problem with this snippet (in your openBank() procedure):
    Simba Code:
    if bankScreen.isOpen then
        bankTimer.start();
        inc(LoadsDone);
        exit;
    It will increase the LoadsDone and exit the procedure even if the bankScreen is not open. You need a begin and end here too:
    Simba Code:
    if bankScreen.isOpen then
    begin
      bankTimer.start()
      inc(LoadsDone);
      exit;
    end;

    Let's take a look at makeItems:
    Simba Code:
    procedure makeItems();

    begin

      if (bankScreen.isOpen()) then
        begin                                 // eek watch those indents :p
          bankScreen.clickButton(BANK_BUTTON_PRESET_2);
          mouseBox(IntToBox(568, 309, 655, 385), MOUSE_MOVE, MOUSE_HUMAN); //bankScreen.Close() ??
          tabBackpack.waitWhileLocked();
          Wait (GaussRangeInt(150,350));
          if isMouseOverText(['Use Clean'],) then //wouldn't the mouse be where the close button is?
            begin                                 // if so, isn't this unnecessary?
              fastclick(MOUSE_LEFT);    // (will always result false)
              exit;
            end;

        tabBackpack.mouseSlot(1, MOUSE_MOVE);

        if isMouseOverText(['Use Clean'],) then
          begin
            Wait (GaussRangeInt(150,350));
            fastclick(MOUSE_LEFT);
            exit;
          end; // this here could easily be an else statement (since you have the opposite condition below)

        if not isMouseOverText(['Use Clean'],) then
          begin
            Wait (GaussRangeInt(650,950));
          end;

        if isMouseOverText(['Use Clean'],) then  // I see you repeat the same code twice
          begin                                  // Maybe put it in a loop and repeat it twice?
            Wait (GaussRangeInt(150,350));
            fastclick(MOUSE_LEFT);
            exit;
          end;

        if not isMouseOverText(['Use Clean'],) then
          begin
            WriteLn('Out of herbs boss, takin a break!');
            Players[CurrentPlayer].Logout;
            TerminateScript;
          end;
      end;
    end;

    Maybe something like this:
    Simba Code:
    procedure makeItems();
    var
      i: integer;
    begin

      if bankScreen.isOpen() then
      begin
        bankScreen.clickButton(BANK_BUTTON_PRESET_2);
        bankScreen.close()
        tabBackpack.waitWhileLocked();

        tabBackpack.mouseSlot(1, MOUSE_MOVE);

        for i := 0 to 1 do  // goes through this up to 2 times
          if isMouseOverText(['Use Clean'],) then
          begin
            wait(gaussRangeInt(150,350));
            fastclick(MOUSE_LEFT);
            exit;
          end else
            wait (GaussRangeInt(650,950));
               // if it looped twice and didn't exit, it will end up here (and terminate)
        WriteLn('Out of herbs boss, takin a break!');
        Players[CurrentPlayer].Logout;
        TerminateScript;

      end;
    end;


    And similar begin/end issues in this procedure too. It will fastClick and exit even if the overText isn't water.
    Simba Code:
    procedure onVial;

    begin

      tabBackpack.mouseSlot(16, MOUSE_MOVE);


      if isMouseOverText(['water'],) then
        Wait (GaussRangeInt(150,350)); //the if..then statement ends here
        fastclick(MOUSE_LEFT);
        exit;

        begin
        if not isMouseOverText(['water'],) then
          tabBackpack.mouseSlot(15, MOUSE_MOVE); //the if...then statement ends here
          if isMouseOverText(['water'],) then
          fastclick(MOUSE_LEFT);
          wait(6500);
          WriteLn('Used the very last vial boss, takin a break!');
          Players[CurrentPlayer].Logout;
          TerminateScript;
          exit;

      end;
    end;
    Actually, in this procedure, because the second part is if the overText doesn't match, you could just use an else statement:
    Simba Code:
    procedure onVial();
    begin
      tabBackpack.mouseSlot(16, MOUSE_MOVE);

      if isMouseOverText(['water'],) then
      begin
        wait(gaussRangeInt(150,350));
        fastClick(MOUSE_LEFT);
        exit;
      end else
      begin
        tabBackpack.mouseSlot(15, MOUSE_MOVE);
        if isMouseOverText(['water'],) then
        begin
          fastclick(MOUSE_LEFT);
          wait(6500);
          WriteLn('Used the very last vial boss, takin a break!');
          Players[CurrentPlayer].Logout;
          TerminateScript;
          exit; // no real need to exit if the script it terminated :p
        end;
      end;
    end;

    Also, you gotta watch out for infinite loops like this. What happens if the production screen isn't gonna open. I know you have told it to break if you aren't logged in, but some sort or timer failsafe would also be useful.
    Simba Code:
    repeat
            If Productionscreen.IsOpen Then
              Break;
            Wait(GaussRangeInt(0, 500));
            If (Not IsLoggedIn) Then
              Exit;
        until Productionscreen.IsOpen


    Last thing is, if you want it to log back in after the 6 hours (or if you lag out etc.), you can just put the login bit inside the repeat..until in your main loop. If you do this, it would be wise to put if not isLoggedIn then exit at the beginning of each procedure, so it quickly exits everything in your mainloop and ends up back at the top, at which point it will log in again.
    Simba Code:
    repeat

      if not isLoggedIn() then
      begin
       //that login stuff, messages etc
        minimap.setAngle(MM_DIRECTION_NORTH);
        mainScreen.setAngle(MS_ANGLE_HIGH);
      end;

      clearDebug();
      progressReport();
      openBank();
      itemsMade();
      makeItems();
      onVial();
      mixIngredients();
      Wait (7500);
      Antiban;
      Wait(GaussRangeInt(7500,10000)); //necessary?
      FindNormalRandoms;

    until(false);

  14. #14
    Join Date
    Jan 2012
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    Great job for sticking throught with this Gunner.
    Use all of the feedback and learn for fun!!!
    =D

  15. #15
    Join Date
    Dec 2011
    Posts
    266
    Mentioned
    16 Post(s)
    Quoted
    185 Post(s)

    Default

    Quote Originally Posted by The Mayor View Post

    Let's take a look at makeItems:
    Simba Code:
    //See comments at the bottom of the code

    procedure makeItems();

    begin

      if (bankScreen.isOpen()) then
        begin                                 // eek watch those indents :p
          bankScreen.clickButton(BANK_BUTTON_PRESET_2);
          mouseBox(IntToBox(568, 309, 655, 385), MOUSE_MOVE, MOUSE_HUMAN); //bankScreen.Close() ?? - See 1 Below
          tabBackpack.waitWhileLocked();
          Wait (GaussRangeInt(150,350));
          if isMouseOverText(['Use Clean'],) then //wouldn't the mouse be where the close button is? - See 2 Below
            begin                                 // if so, isn't this unnecessary? - See 3 Below
              fastclick(MOUSE_LEFT);    // (will always result false) -See 4 Below
              exit;
            end;

    //1. PRESET_2 closes the bankscreen automatically.

    //2. No, The mouseBox above moves the mouse to the vicinity of InvSlot1 while the bank screen is closing. It's more human //to move while waiting on game ticks/lag. It may also land on one of 4 different inv slots randomly. Sometimes it even
    //lands in between slots, and then has to move to slot 1, which is why I have so many checks for UpText later.

    //3. No, the odds are pretty high that it will land on one of those 4 inv slots, then it can immediately fastclick and //exit the procedure.

    //4. Only if it lands between inv slots. If it does return false, then it moves to Slot 1 as a failsafe.
    Everything else you brought up was spot on. You solved several issues that I hadn't had the time to fiddle with, and gave some very good tips for improving my logic.

    I really appreciate your feedback, and thanks for the compliments!

  16. #16
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by Gunner View Post
    Everything else you brought up was spot on. You solved several issues that I hadn't had the time to fiddle with, and gave some very good tips for improving my logic.

    I really appreciate your feedback, and thanks for the compliments!
    Ahh yea, now I see what you were doing! Never used the preset button thing before.

  17. #17
    Join Date
    Dec 2011
    Posts
    266
    Mentioned
    16 Post(s)
    Quoted
    185 Post(s)

    Default

    Quote Originally Posted by The Mayor View Post
    Ahh yea, now I see what you were doing! Never used the preset button thing before.
    You should look into implementing it. It may be the single greatest update Jagex has ever done. Deposit, Withdrawal, and Close all in one click lol.

  18. #18
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    1,199
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

    Default

    Quote Originally Posted by Gunner View Post
    You should look into implementing it. It may be the single greatest update Jagex has ever done. Deposit, Withdrawal, and Close all in one click lol.
    It really probably is one of the best updates Jagex has ever implemented.

  19. #19
    Join Date
    Jan 2012
    Posts
    550
    Mentioned
    2 Post(s)
    Quoted
    177 Post(s)

    Default

    I'm not sure if it's something I set up wrong, but the script does one inventory and then just has the mouse hover over the bankscreen and fails to withdraw again.

  20. #20
    Join Date
    Dec 2011
    Posts
    266
    Mentioned
    16 Post(s)
    Quoted
    185 Post(s)

    Default

    Quote Originally Posted by Thanatos View Post
    I'm not sure if it's something I set up wrong, but the script does one inventory and then just has the mouse hover over the bankscreen and fails to withdraw again.
    Sorry for the late response, it's been a busy weekend. So it opens the bank and stops there? Or it hovers over the banker and doesn't open the bank? Make sure you've followed the Simba setup guide for the interfaces and XP popups and such, as well as the instructions at the top of the script.

    It's odd that it can navigate the bank once but stops the second time. Can you post a screenshot of where it's failing as well? Thanks.

  21. #21
    Join Date
    Dec 2011
    Posts
    266
    Mentioned
    16 Post(s)
    Quoted
    185 Post(s)

    Default

    Script is updated! Please grab the newest version!

  22. #22
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    This isn't really major, more of an efficiency thing. There is a few places where you do this:
    Simba Code:
    if isMouseOverText(['Use Clean'],) then
    begin
      Wait (GaussRangeInt(150,350));
      fastclick(MOUSE_LEFT);
      exit;
    end;
      // this line is redundant - since you exit you'll only end up here
      // if the text didn't match.
    if not isMouseOverText(['Use Clean'],) then
    begin
      WriteLn('Out of herbs boss, takin a break!');
      Players[CurrentPlayer].Logout;
      TerminateScript;
    end;
    So you could just make it an else statement:
    Simba Code:
    if isMouseOverText(['Use Clean'],) then
    begin
      Wait (GaussRangeInt(150,350));
      fastclick(MOUSE_LEFT);
      exit;
    end else
    begin
      WriteLn('Out of herbs boss, takin a break!');
      Players[CurrentPlayer].Logout;
      TerminateScript;
    end;
    Of you could even just have it like:
    Simba Code:
    if isMouseOverText(['Use Clean'],) then
      begin
        Wait (GaussRangeInt(150,350));
        fastclick(MOUSE_LEFT);
        exit;
      end;

      WriteLn('Out of herbs boss, takin a break!');
      Players[CurrentPlayer].Logout;
      TerminateScript;
    And this here too:
    Simba Code:
    tabBackpack.mouseSlot(15, MOUSE_MOVE);

        begin // not necessary since there is no condition before it
          if isMouseOverText(['water'],) then
          begin
            fastclick(MOUSE_LEFT);
            wait(6500);
            WriteLn('Used the very last vial boss, takin a break!');
            Players[CurrentPlayer].Logout;
            TerminateScript;
          end else
          begin  //overText check not necessary, obviously this is true if we end up here
            if not isMouseOverText(['water'],) then
            begin
              WriteLn('Out of vials boss, takin a break!');
              Players[CurrentPlayer].Logout;
              TerminateScript;
            end;
        end;
      end;
    Could be:
    Simba Code:
    tabBackpack.mouseSlot(15, MOUSE_MOVE);

    if isMouseOverText(['water'],) then
    begin
      fastclick(MOUSE_LEFT);
      wait(6500);
      WriteLn('Used the very last vial boss, takin a break!');
      Players[CurrentPlayer].Logout;
      TerminateScript;
    end else
    begin
      WriteLn('Out of vials boss, takin a break!');
      Players[CurrentPlayer].Logout;
      TerminateScript;
    end;
    Last edited by The Mayor; 05-05-2014 at 10:31 AM.

  23. #23
    Join Date
    Dec 2011
    Posts
    266
    Mentioned
    16 Post(s)
    Quoted
    185 Post(s)

    Default

    Quote Originally Posted by The Mayor View Post
    This isn't really major, more of an efficiency thing. There is a few places where you do this:
    I tried implementing those suggestions on my last update. The problem I run into with that kind of code in this particular script is I get a lot of improper exits and logouts because it thinks it's out of supplies. I think to really utilize this code setup I need to boost some wait times, but that will decrease overall efficiency. So know that I'm not ignoring your suggestions. I'm working on getting them implemented, but I'm placing script efficiency over code efficiency at the moment, and I do appreciate your support and suggestions.

    OpenGL_V1.4 is now up! If you use OpenGL make sure you grab the most recent version to take advantage of the latest updates!
    As always, please post bugs and suggestions.

    I'm currently working on adding Herb Cleaning and Finished Pots to the script. I HOPE to have that finished by the end of today, so check back often.


    EDIT: Well, that wasn't as painful as I thought. 2 hrs of coding and this script now also supports cleaning herbs, as well as finished potions. I can now proudly claim this script to be AIO, yay me!

  24. #24
    Join Date
    Jan 2014
    Posts
    30
    Mentioned
    1 Post(s)
    Quoted
    16 Post(s)

    Default

    Seems to mis-click every so often, not sure if on the minimap or otherwise, but it leads to my character running outside of the bank and the script subsequently terminating. I've tested this at multiple banks/castle wars. Longest I've had this run so far is about 58 minutes. I think it has something to do with both using spacebar and clicking on the production screen.
    * Happens on both directx and opengl
    * Finished potions option
    Last edited by Nerrultheretard; 05-08-2014 at 07:48 AM.

  25. #25
    Join Date
    Feb 2014
    Location
    UDFj-39546284
    Posts
    76
    Mentioned
    1 Post(s)
    Quoted
    43 Post(s)

    Default

    Same problem as @Nerrultheretard, as well as a 10 second delay after opening the bank. But I'm doing unfinished potions.

Page 1 of 2 12 LastLast

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
  •