SRL Archive - RS3 Help

Setting up a drop procedure


Raiden702

2015-06-11 01:56:44

Having major problems setting up a drop procedure.

I want it to just simply use the action bar slot 1 and 2 to drop by press key '1' and '2'.

All it does is spam the first procedure, wether it be key 1 or key 2. So it sits there spamming to drop 1 of the action bar buttons, but never moving on to the next.

  procedure dropMethod();
begin
repeat
clickFishing();
until tabBackPack.isFull();
if conversationBox.continue(True,True) then
begin
print('Closed Box');
end else
repeat
while not (tabBackPack.isEmpty()) do
typeSend('2',false);
typeSend('1',false);
until tabBackPack.isEmpty();
end;

srlMW

2015-06-11 02:00:44

Paste your code into your post as it is a lot easier to work with for others, also make sure you wrap it in Simba tags.

E: Try this
repeat
actionbar.clickSlot(1); //use this when activating the action bar
actionbar.clickSlot(2); //the number is the slot
until tabBackPack.isEmpty()

EE: Are you bait or fly fishing? If so the you need to change the until from this
tabBackPack.isEmpty()
to this
tabBackpack.waitCount(1, 1000 + random(500)); //waits until backpack has only 1 item left 
//If you don't have the script collect/destroy tickets it will infinite loop unless you put a failsafe(timer) in

Raiden702

2015-06-11 02:07:47

There

fady

2015-06-11 02:14:18

From: Raiden702
Having major problems setting up a drop procedure.

I want it to just simply use the action bar slot 1 and 2 to drop by press key '1' and '2'.

All it does is spam the first procedure, wether it be key 1 or key 2. So it sits there spamming to drop 1 of the action bar buttons, but never moving on to the next.

  procedure dropMethod();
begin
repeat
clickFishing();
until tabBackPack.isFull();
if conversationBox.continue(True,True) then
begin
print('Closed Box');
end else
repeat
while not (tabBackPack.isEmpty()) do
typeSend('2',false);
typeSend('1',false);
until tabBackPack.isEmpty();
end;


Needs a begin..end block after the While..Do loop. That will only make it spam click 2, then 1 until the backpack is empty. and BTW you dont need the repeat..until loop, if you are going to use While..Do, they both do the same thing(kind of), one checks the condition BEFORE beginning (while..do) and the other checks the conditions AFTER finishing the loop (repeat..until).


repeat //either use repeat..until, or while..do, no need to do both.
while not (tabBackpack.isEmpty()) do
begin //the begin..end includes both of the procedures under the while..do loop.
typesend('1',false);
typesend('2',false);
end;
until tabBackpack.isEmpty();

Raiden702

2015-06-11 02:18:14

I am fly fishing, so I need it drop only drop what is on the action bar. I am currently reading what you both wrote. Thank you so much.

Raiden702

2015-06-11 02:19:48

From: indirectMW
Paste your code into your post as it is a lot easier to work with for others, also make sure you wrap it in Simba tags.

E: Try this
repeat
actionbar.clickSlot(1); //use this when activating the action bar
actionbar.clickSlot(2); //the number is the slot
until tabBackPack.isEmpty()

EE: Are you bait or fly fishing? If so the you need to change the until from this
tabBackPack.isEmpty()
to this
tabBackpack.waitCount(1, 1000 + random(500)); //waits until backpack has only 1 item left 
//If you don't have the script collect/destroy it will infinite loop unless you put a failsafe(timer) in



I was hoping to have it simulate key pressing, instead of clicking the action bars. Isn't
tabBackpack.waitCount(1, 1000 + random(500)); 
useless if I'm using action bar dropping?


———————————-


After using Fady's code, I am now receiving a mainLoop(); error with my dropMethod;

http://puu.sh/ikvKL/2794bc578f.png

procedure mainLoop();
begin
repeat
clickFishing;
changeCompass;
findSpot;
until
dropMethod;

end;

fady

2015-06-11 02:33:47

From: Raiden702
I was hoping to have it simulate key pressing, instead of clicking the action bars. Isn't
tabBackpack.waitCount(1, 1000 + random(500)); 
useless if I'm using action bar dropping?


———————————-


After using Fady's code, I am now receiving a mainLoop(); error with my dropMethod;

http://puu.sh/ikvKL/2794bc578f.png

procedure mainLoop();
begin
repeat
clickFishing;
changeCompass;
findSpot;
until
dropMethod;

end;


because you are repeating the loop until (dropMethod), Which is not a boolean function. Think, what condition needs to be met in order to stop the repeat loop. I suggest maybe something like until tabBackpack.isFull(); so that way it will click fishing and change compass and findspot until the backpack is full, then it calls dropMethod, to drop the items.


procedure mainLoop();
begin
repeat
clickFishing;
changeCompass;
findSpot;
until tabBackpack.isFull();
dropMethod;

end;

also I suggest always having failsafes when dealing with loops, so that you can avoid getting stuck in an infinite loop.

Raiden702

2015-06-11 02:36:29

From: fady
because you are repeating the loop until (dropMethod), Which is not a boolean function. Think, what condition needs to be met in order to stop the repeat loop. I suggest maybe something like until tabBackpack.isFull(); so that way it will click fishing and change compass and findspot until the backpack is full, then it calls dropMethod, to drop the items.


procedure mainLoop();
begin
repeat
clickFishing;
changeCompass;
findSpot;
until tabBackpack.isFull();
dropMethod;

end;

also I suggest always having failsafes when dealing with loops, so that you can avoid getting stuck in an infinite loop.


Wow, before all these problems I had it just like that. So obvious! Thanks a ton.

Citrus

2015-06-11 02:45:36

This is all you need to drop:

while (not tabBackPack.isEmpty()) do typesend('12', false);
unless you have something like feathers in your backpack, in which case you would just check the last backpack slot you'd expect a fish to be in.
I personally use DTMs of the fish in the actionbar to drop. That way they are dropped as soon as they are caught and you never have to stop fishing.

Your mainloop needs an evaluation after until. It should be

repeat
...
until tabBackPack.isFull();
drop();
or

while (not tabBackPack.isFull()) do
begin
...
end;
drop();
I prefer the while do loop in this situation because it will check the backpack before trying to fish. The repeat until loop will always run once, even if the backpack is already full.