SRL Archive - OSR Help

First runescape script ever help :P


wolffang92

2012-09-01 04:42:48

So, here is my current script, I know it's probably sloppy as hell and not the best way to do what I'm trying to do, but my current goal is to get it to do a full inventory of potions(I'm making a herblore script)

So far it can open the bank, empty inventory, withdraw 14 vials of water and 14 herbs, close bank, then use the vial of water on herb. What's the best way of clicking the make all button? And maybe a better way of withdrawing from the bank?

program New;
{$DEFINE SMART}
{$i srl/srl.simba}

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;

Procedure BankChest;
var
x, y: Integer;
begin
begin
OpenBankChest(SRL_BANK_SW);
Wait(1000+random(200));
DepositAll;
Wait(1000+random(200));
if FindObj(x, y, 'ithdraw-1', 11763319, 5) then
Mouse(x, y, 3, 3, false);
ChooseOption('ithdraw-14');
Wait(500+random(100));
if FindObj(x, y, 'ithdraw-1', 607786, 1) then
Mouse(x, y, 3, 3, false);
ChooseOption('ithdraw-14')
CloseBank;
Wait(1000+random(200));
InvMouse(1, 1);
Wait(20+random(200));
InvMouse(15, 1);
end;
end;


begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
BankChest;
end.

Chris

2012-09-01 05:14:15

To click on one of the items in your inventory, you could use:
InvMouse(1, LeftClick);
To combine them, you could use this:
InvMouse(1, LeftClick); // Clicks on the first item in your inventory
Wait(20 + random(200)); // Little antiban
InvMouse(15, LeftClick); // Clicks on the 15th item

To adjust the camera and to face south, this is what you can do:
SetAngle(SRL_ANGLE_HIGH); // Adjusts the camera all the way up 
MakeCompass('S'); // Makes you face south

Edit:
if OpenBankChest(SRL_BANK_SW) then 

wolffang92

2012-09-01 05:25:07

Thank you for the help, I actually found the OpenBankChest option from searching around a bit, so I might not even need the camera angle change anymore. :) This script is getting better and better by the second. I'm assuming there's a better way to withdraw items from the bank, any help with that?

EDIT: Updated my script up top with more improvements. :)

Chris

2012-09-01 05:32:55

Yup, we have this: "function Withdraw(col, row, amount): Boolean;" which you can use like:
Withdraw(0, 0, 14); // Withdraws 14 of the item in the top left corner of your bankscreen

Solar

2012-09-01 06:10:40

Looks good. Maybe you could look at a tutorial that goes over standards though to make it a little easier to read. :thumbsup:

wolffang92

2012-09-01 10:05:11

Thanks for the advice! :) I want to learn how to do walking paths, and see if I can get this script to make runs to the GE to buy more mats when it runs out. :)

Itankbots

2012-09-01 11:03:17

You can also withdraw via bank slots if you are having problems with it mixing items up in a pretty full bank (often happens)

MouseBankSlot(1, mouse_Right); //Moves the Slot, then right clicks
if(WaitOption('ithdraw-1', 500)) then //Clicks which uptext you want.

NKN

2012-09-01 11:05:11

To click the box, search for the color of the little cork on top of the bottle in the chatbox. :)

wolffang92

2012-09-01 14:24:44

From: NKN
To click the box, search for the color of the little cork on top of the bottle in the chatbox. :)


Thanks, I needed that, the script is pretty much flawless now, awesome! Now all I need to do is make it look more organized, and maybe add on some new features and antiban. :D

Syntax

2012-09-02 03:14:31

A more accurate way of finding items in the bank is using SRL's search bank function, apart from that most of the others have posted most of my suggestions. WaitOption is a better failsafe than ChooseOption by the way.

P1ng

2012-09-02 05:30:08

If you end up making it run to the GE and back to purchase more supplies you should check out my OpenGE function ;)