SRL Archive - RS3 Help

How could I activate action bar then click same slot for every item in backpack?


Antonio

2015-02-10 14:47:28

So I'm looking to activate the action bar then click slot 28 until slots 2 to 28 have changed state. I want to make this script look more human like and usually when doing this method you click the last slot everytime leaving the mouse in the same position rather than clicking each slot consecutively.


OR: Would it be easier to activate the action bar slot then left click the last slot then activate the action bar and repeat 27 times?

3Garrett3

2015-02-10 15:04:29

From: Nice Balance Bro
So I'm looking to activate the action bar then click slot 28 until slots 2 to 28 have changed state. I want to make this script look more human like and usually when doing this method you click the last slot everytime leaving the mouse in the same position rather than clicking each slot consecutively.


OR: Would it be easier to activate the action bar slot then left click the last slot then activate the action bar and repeat 27 times?


Is this for something like superheating?

I know in Cohen's superheater it does the following:

Press action bar number (with the keyboard)
Click the last ore in the inventory
Repeat above until the last ore is gone.

It never moves the mouse, it just presses '1' or whatever number you want and clicks the mouse in the same spot.

I don't know of a method that lets you activate the action bar and then click a bunch of times without re-activating it again, so if I were going to do it I would do the second option that you said.

If there is a way to have the action bar stay active, definitely I would suggest not re-activating it every time

Antonio

2015-02-11 14:32:07

From: 3Garrett3
Is this for something like superheating?

I know in Cohen's superheater it does the following:

Press action bar number (with the keyboard)
Click the last ore in the inventory
Repeat above until the last ore is gone.

It never moves the mouse, it just presses '1' or whatever number you want and clicks the mouse in the same spot.

I don't know of a method that lets you activate the action bar and then click a bunch of times without re-activating it again, so if I were going to do it I would do the second option that you said.

If there is a way to have the action bar stay active, definitely I would suggest not re-activating it every time


Yeah I think that's what I'm getting at. So what's an easier way of writing the code for that rather than writing out my CastSuperheat procedure 27 times?

3Garrett3

2015-02-11 16:37:19

From: Nice Balance Bro
Yeah I think that's what I'm getting at. So what's an easier way of writing the code for that rather than writing out my CastSuperheat procedure 27 times?


Probably something like the following:


Procedure Superheat();
var
i : Integer;
begin
Mouse({Last Slot}, Mouse_MOVE); //I can't remember the function for slot coordinates
for i := 0 to 26 do
begin
TypeSend('1', False); //Presses the 1 key (false means don't press enter)
Wait(randomRange(100,200)); //Pick a suitable wait time
FastClick(MOUSE_LEFT); //Can't remember what parameter goes here
wait(randomRange(100,200)); //Again, pick a better wait time
if not tabBackpack.FindDTM(oreDTM) then Break; // Or something like this so that you break out of the loop if there's no ore left
end;
end;

That's incredibly bare bones and might not work exactly how I've written it since I don't have Simba on this computer and can't remember some function parameters. That's the method I'm getting at though. Just one function which loops through 27 times (0->26 gives 27 iterations) and breaks out of the loop if there is no ore left.

That function will simply press 1 and click the same spot after moving to the slot before starting the loop.

KeepBotting

2015-02-11 16:44:02

From: Nice Balance Bro
Yeah I think that's what I'm getting at. So what's an easier way of writing the code for that rather than writing out my CastSuperheat procedure 27 times?


Use a DTM with a center point tolerance of 255 (so it will recognize all ores). Then use a while..do or repeat..until loop

e.g.


while (tabBackpack.countDtm(genericOreDtm) <> 0) do
begin
castSuperheat();
end;

or

repeat
castSuperheat();
until (tabBackpack.countDtm(genericOreDtm) = 0);

If you know what type of bars you're making, you could even do it with tabBackpack.count() as iirc all ore combinations will smelt into a unique number of thier respective bars

OR you could even set your script to use presets and withdraw a set number of nature runes (that'd have to be set dynamically based on what you're smelting) and loop until the slot they're in is empty, or the DTM of them is no longer found.

Lots of ways to do it but the first is probably the easiest

For a dynamic wait in your castSuperheat() function you could use something like tabBackpack.waitForShift(30000) for a 30-second timeout failsafe

Antonio

2015-02-11 18:36:41

Awesome thanks to both of you for helping me out! Definitely going to play with both methods and try and understand them better.

3Garrett3

2015-02-11 19:07:18

From: Nice Balance Bro
Awesome thanks to both of you for helping me out! Definitely going to play with both methods and try and understand them better.


By combining both (the DTM check I mentioned is a simpler version of what KB said) you'll be well on your way to having a working function.