SRL Archive - SRL Archives

withdraw item with only uptext


Phran6

2009-05-06 05:12:53

this will check the uptext you putted in array for slot 1 to 40 in the 'view all' screen (i think) and will withdraw it. so no need to use alot of dtm and lag the script. i made this because i had a lot of item to withdraw. plz post comment about it:) and if you want use it , credit me.

exemple(i use it for my current project , look at my sign):
if Withdraws(['Mith grapple','Prayer potion',FoodName,'Nature rune','Fire rune','Bones to','Falador','Law rune' ] , ['1','1','21','50','252','50','1','2' ], true) then result:= true;


 
Function Withdraws(Name, Amount: array of string; deposit:boolean): boolean;
var
I, XX, YY, c: integer;
P: TPoint;
begin
if not LoggedIn then exit;
if not BankScreen then
begin
if not R_OpenBankBooth('fwb') then exit; //can be changed for what you want
while not (BankScreen) do wait(112+random(50));
end;
if deposit then DepositAll;
wait(random(300));
FixBankTab;
wait(200+random(300));
FixBank;
wait(200+random(300));
for i:=1 to 40 do
begin
P := BankIndexToMSPoint(i);
mmouse(P.x+12, P.y+12 ,6 ,6);
wait(300+random(300));
for c := 0 to high(name) do
begin
wait(10+random(10));
if IsUpText(name[c]) then
begin
if Amount[c] = '1' then
begin
GetMousePos(xx,yy)
mouse(xx ,yy, 2, 2, true);
break;
end else
if (Amount[c] = '5') or (Amount[c] = '10') then
begin
GetMousePos(xx,yy);
mouse(xx, yy, 2, 2, false)
ChooseOption('Withdraw-' +Amount[c])
break;
end else
begin
GetMousePos(xx,yy);
mouse(xx, yy, 2, 2, false)
if ChooseOption('Withdraw-X') then
begin
Wait(1000 + Random(100));
TypeSend(Amount[c]);
break;
end;
end;
end;
end;
if i= 40 then
begin
result:= false
writeln('we didnt got able to withdraw item');
end;
if c = high(name) then
begin
result:= true;
exit;
end;
end;
end;

mormonman

2009-05-06 05:15:20

array of string = TStringArray?

Phran6

2009-05-06 05:21:39

same ?

mormonman

2009-05-06 05:48:32

yes, that is what i was saying -.-

Phran6

2009-05-06 05:52:48

lol okay … any other comment ?

marpis

2009-05-06 08:30:50

 for i:=0 to 40 do
begin
P := BankIndexToMSPoint(i + 1);

you could do this like this too:

for i:=1 to 41 do
begin
P := BankIndexToMSPoint(i);

And now if you have the items somewhere on the bottom of the bank, it first hovers all items till it comes to the one we're looking for? not good. And if the correct uptext is missed because of a lagspike, this function checks every item in bank slots 1-41? not good. Make it use colors, or it's kinda unusable.

Edit: don't make this function open the bank, but to withdraw when bank is already open.

And why the fuck do we have to ask you before using it, when you post it here? You could just say 'please credit if you use it', dont get greedy. we are all here supposed to help each others by sharing stuff.

Floor66

2009-05-06 12:07:09

Make the Amount a TIntegerArray?

Phran6

2009-05-07 01:35:01

marpie: plz be polite, its my first post in this section im sorry, ill change it.
i made it to open bank if it not already opened so its a failsafe, its only a function i made for my script and wanted to share. it shear for 40 slot but you can change it for the number you want, but it mainly for the first row.

Floor66: i made it string because i found it more simple because i use TypeSend with and use string.

Sir R. M8gic1an

2009-05-07 18:39:43

I think it's too bottish to hover over each item looking for the right one…

~RM

footballjds

2009-05-07 18:44:27

agreed!!!
also who on earth said dtms are slow
?!?!?!?!?

btw just use CTS2 if u don't like dtms… or make a SMALL dtm and itl be just as fast… omg///

HyperSecret

2009-05-07 21:04:13

From: Rasta Magician
I think it's too bottish to hover over each item looking for the right one…

~RM


Took the words right out of my mouth. If you want you could help with the bitmap.scar (i believe is what it is) and make bitmaps of items that don't already have them so that you can eliminate the process of hovering over every item.

footballjds

2009-05-07 21:05:00

or help with CST2 project ;)
that's what EVERYTHING will become soon ;)

Phran6

2009-05-07 23:53:20

what is CTS2 ?

footballjds

2009-05-08 00:00:30

CST is color Speed Tolerance ;)
go into includes/srl/scriptingTools and there is something called ACA2 mess around with it!!!

Smartzkid

2009-05-08 01:31:31

I agree with the others about this being bottish, but it would be pretty neat if you could give it an array of items to scan for and an array of rows to scan in

Miitchyy

2009-05-08 01:36:18

Well, If you know the names of the items just use the search button and it'll narrow down the number of items you'll need to check

Sir R. M8gic1an

2009-05-08 19:10:02

From: Kevin Wolf aka Miitchyy
Well, If you know the names of the items just use the search button and it'll narrow down the number of items you'll need to check


now this, is a neat suggestion indeed.

// * procedure SearchBank(Item: string); // * by ZephyrsFury

~RM

Phran6

2009-05-08 22:04:11

thanx all for the idea ill change few thing and repost my new function later. :)