SRL Archive - First Scripts

Quick Inventory Herlore


Gunner

2014-04-09 04:26:08

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.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
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. :spot:

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.



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

Gunner

2014-04-11 10:10:35

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.

Olly

2014-04-11 12:16:07

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.

Gunner

2014-04-11 12:51:04

From: Olly
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. :frusty: 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.

Rich

2014-04-11 12:53:47

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!

Brotein

2014-04-11 12:54:25

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.
  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.
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…
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.
repeat
Wait(GaussRangeInt(500,650));
until(isMouseOverText(['Use Clean']));
So you can replace makeItems with something like this…
//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…
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…
refreshSupplies();
clearDebug();
progressReport();
WriteLn('Got fresh supplies...');
You can just have
refreshSupplies();
and you would add in
progressReport('Got fresh supplies...');
to the bottom of refreshSupplies().


Another thing is your Timer does nothing in this procedure.
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!

Rlp

2014-04-11 13:08:16

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.

Gunner

2014-04-11 13:46:30

From: Brotein

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.
  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.
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…
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.
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


From: Rich
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.

From: Rlp
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!

Rich

2014-04-11 14:00:14

From: Gunner
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?

Rlp

2014-04-11 14:50:11

From: Gunner
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 :D
will test any new versions when you add them :)

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

Gunner

2014-04-11 19:36:25

From: Rich
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.

From: Rlp
Yeah I've also been repeating until failsafe also :D
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!

Gunner

2014-04-16 12:17:51

From: Rlp
Yeah I've also been repeating until failsafe also :D
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!

The Mayor

2014-04-25 02:29:50

Wow 1.9m per hour :D

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.

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:

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):

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:

if bankScreen.isOpen then
begin
bankTimer.start()
inc(LoadsDone);
exit;
end;

Let's take a look at makeItems:

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:

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.

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:

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.

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.

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);

Ilya

2014-04-26 06:45:50

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

Gunner

2014-04-27 17:45:09

From: The Mayor


Let's take a look at makeItems:


//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!

The Mayor

2014-04-27 22:49:59

From: Gunner
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.

Gunner

2014-04-28 09:00:37

From: The Mayor
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.

Hazzah

2014-04-28 16:42:06

From: Gunner
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.

Thanatos

2014-05-01 11:01:45

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.

Gunner

2014-05-04 21:54:59

From: Thanatos
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.

Gunner

2014-05-05 03:49:43

Script is updated! Please grab the newest version!

The Mayor

2014-05-05 06:29:43

This isn't really major, more of an efficiency thing. There is a few places where you do this:

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:

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:

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:

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:

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;

Gunner

2014-05-06 10:18:34

From: The Mayor
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!

Nerrultheretard

2014-05-08 03:38:30

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

Bulbasaur

2014-05-08 09:23:11

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

Gunner

2014-05-09 21:38:04

From: Nerrultheretard
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


Is it winding up south of the bank or east of it? I'm having that problem as well if I lag at all. Sometimes it takes me 2 or 3 worlds to find a good one. If it's south, it does have to do with the new spacebar option. I have updated the script now to utilize the new productionscreen.clickStart;. Thanks for reporting.

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


@Bulbasaur Grab the new version for the updated productionscreen.clickStart;. However I am concerned about the 10 second delay after opening the bank. That doesn't sound like a script issue, it sounds like a (bankScreen.isOpen()) issue. Either your interfaces are slightly off, or your graphics settings are off. If it is a fresh account, it could also be levelling up. On my fresh accounts it levels up nearly every openBank, and it will wait until the popup is gone before moving. If memory serves, it's looking for "Bank of Runescape", which is covered up by the level up icon.

If none of these solve the issue, please let me know.

Bulbasaur

2014-05-10 10:37:50

From: Gunner
@Bulbasaur Grab the new version for the updated productionscreen.clickStart;. However I am concerned about the 10 second delay after opening the bank. That doesn't sound like a script issue, it sounds like a (bankScreen.isOpen()) issue. Either your interfaces are slightly off, or your graphics settings are off. If it is a fresh account, it could also be levelling up. On my fresh accounts it levels up nearly every openBank, and it will wait until the popup is gone before moving. If memory serves, it's looking for "Bank of Runescape", which is covered up by the level up icon.

If none of these solve the issue, please let me know.



I've grabbed the new productionscreen. It was working alright for a while, when it called minimap.setAngle(): Set the angle @ 288.434948822922 degrees, the camera and mouse started spazzing all over the place. I also keep getting out of vials, then it logs me out. When I have 20k vials.. Seems to be because it's returning backscreen=false for some reason.

Gunner

2014-05-11 11:34:09

From: Bulbasaur
I've grabbed the new productionscreen. It was working alright for a while, when it called minimap.setAngle(): Set the angle @ 288.434948822922 degrees, the camera and mouse started spazzing all over the place. I also keep getting out of vials, then it logs me out. When I have 20k vials.. Seems to be because it's returning backscreen=false for some reason.


There is something wrong with your settings. Either your interface headers are the wrong type, or transparency is wrong, graphics are wrong, etc. When the camera does that, you have a setting wrong.

tlance

2014-12-17 23:52:08

finally after some searching I think I'm gonna give this one a shot. how safe do you think it would be if I started making lvl 3s to run this script?

Thomas

2015-03-04 03:21:45

From: Gunner
Is it winding up south of the bank or east of it? I'm having that problem as well if I lag at all. Sometimes it takes me 2 or 3 worlds to find a good one. If it's south, it does have to do with the new spacebar option. I have updated the script now to utilize the new productionscreen.clickStart;. Thanks for reporting.



@Bulbasaur Grab the new version for the updated productionscreen.clickStart;. However I am concerned about the 10 second delay after opening the bank. That doesn't sound like a script issue, it sounds like a (bankScreen.isOpen()) issue. Either your interfaces are slightly off, or your graphics settings are off. If it is a fresh account, it could also be levelling up. On my fresh accounts it levels up nearly every openBank, and it will wait until the popup is gone before moving. If memory serves, it's looking for "Bank of Runescape", which is covered up by the level up icon.

If none of these solve the issue, please let me know.



It also looks gets blocked when server is about to update.
Have you added the hover npc while making the items like you requested here;
https://villavu.com/forum/showthread.php?t=108926&highlight=hover+over+bank