SRL Archive - SRL Suggestions

WithDrawBankS (WithDrawBankSearch)


Mat

2012-07-07 04:24:32

e:Slight Change added separate upText.
This Function is used to search for items and return to the original Bank tab after and returns true, if it finds it.
Thanks to Mike (Main) for giving me the idea <3
Function WithDrawBankS(s,uT:String):boolean;
var
bT:integer;
begin
if(not bankScreen)then
Exit;
bT := currentBankTab;
searchBank(s);
MouseBankSlot(1,2);
if(waitUptext(uT,800))then
begin
clickMouse2(true);
result := true;
end;
bankTab(bT);
end;

Mat

Imanoobbot

2012-07-07 05:06:47

I like the idea. Thats clever ;)
Never came to it on my own. Good job.

Daniel

2012-07-07 08:52:12

Intrinsic documentation please!

Runaway

2012-07-07 11:02:57

Slight suggestion for ya, just in case multiple items come up in the search:


function ExistsBankItem(Slot: Integer): Boolean;
var
x, y: Integer;
sBox: TBox;
begin
if not BankScreen then
Exit;
sBox := BankIndexToMSBox(Slot);
Result := FindColor(x, y, srl_outline_black, sBox.x1, sBox.y1, sBox.x2, sBox.y2);
end;

function WithdrawBankSearch(Search, Uptext: String): Boolean;
var
Tab, i: Integer;
begin
if not BankScreen then
Exit;
Result := False;
Tab := CurrentBankTab;
SearchBank(Search);
for i := 1 to 40 do
begin
if not ExistsBankItem(i) then
Break;
MouseBankSlot(i, mouse_move);
if WaitUptext(Uptext, 500) then
begin
ClickMouse2(mouse_left);
Result := True;
Break;
end;
end;
BankTab(Tab);
end;

PS. Sorry for editing all of your stuff, me = ocd about that kind of thing >.<

Mat

2012-07-07 11:05:41

Run why the for loop? The idea is you search for a specific item, with a specific name.
So is there a need to for loop?
Mat
e:If i searched Cannon base I don't expect more that 1 item to show, if you show, Pure Ess you'd only find pure ess, 1 Items.

Runaway

2012-07-07 11:07:43

From: Mat
Run why the for loop? The idea is you search for a specific item, with a specific name.
So is there a need to for loop?
Mat
e:If i searched Cannon base I don't expect more that 1 item to show, if you show, Pure Ess you'd only find pure ess, 1 Items.


Well yes, I understand. But you never know what people would want to use this for. Mine as well include it, right? If there is only 1 item then it won't decrease speed, but it still allows for more :)

Mat

2012-07-07 11:09:30

But doesn't that Bonus on all the items that it find? Which is bot like?

Runaway

2012-07-07 11:19:23

From: Mat
But doesn't that Bonus on all the items that it find? Which is bot like?


Eh not for just a few items. Anyways, I check the uptext of bank items all the time when I'm playing legit! Just a suggestion though, man. Static coordinates with dynamic input screams "failsafe me!" :p

Mat

2012-07-07 11:21:22

I'll give it you on that, but I still see no point, but thats just me :), I see the point on Item not exist, thats good and useful :), but the for loop? Meh :)
Mat

Sin

2012-07-07 11:41:21

What about Rune Kiteshield? And the person has a Rune kiteshield (t) or Rune Kiteshield (h5).
It all depends on where the item is ;)

Mat

2012-07-07 11:47:26

I'll give in to that, as that is one of those things that Might happen, but if the Uptext was set to Kite it'll take the first one regardless.
Mat

Runaway

2012-07-07 11:48:27

From: Mat
I'll give it you on that, but I still see no point, but thats just me :), I see the point on Item not exist, thats good and useful :), but the for loop? Meh :)
Mat


Well, I can only find a few ways that would make the for loop useful, but it would require a whole new function:


function WithdrawBankSearchMulti(Search: String; Uptext: TStringArray): Boolean;
var
lUptext, Res, i: Integer;
begin
if not BankScreen then
Exit;
lUptext := Length(Uptext);
SetLength(Result, lUptext);
Result := False;
for i := 1 to 40 do
begin
if not ExistsBankItem(i) then
Break;
MouseBankSlot(i, mouse_move);
if WaitUptextMulti(Uptext, 500) then
begin
ClickMouse2(mouse_left);
Inc(Res);
end;
if (Res >= lUptext) then
begin
Result := True;
Break;
end;
end;
BankTab(Tab);
end;

You used cannon as an example before; with this you could call:

 WithdrawBankSearchMulti('cannon', ['base', 'barr', 'furn', 'stan', 'ball']); 

And it would search for cannon and withdraw those 5 pieces. Can't think of many other things this would apply to though…

Brandon

2012-07-07 11:51:07

1. It would help for users reading this to understand it by just looking at it -_-


Function WithDrawBankS(ItemName, UpText: string): Boolean;
var
Tab: Integer;
begin
If (Not BankScreen) then
Exit;

Tab := CurrentBankTab;
SearchBank(ItemName);
MouseBankSlot(1, Mouse_Move);
If (WaitUptext(UpText, 800)) then
begin
ClickMouse2(Mouse_Left);
Result := True;
end;
BankTab(Tab);
end;

2. I dislike the fact that it always goes to the first slot.

3. Your MouseBankSlot Parameters are wrong. 1 = Left Click, 2 = RightClick, 3 = Move. You right clicked then wait for uptext then left click? :S For this reason we have Constants like Mouse_Left, Mouse_Right, Mouse_Move.

For all the above, specifically point #2. I don't know if such a function is worth it.. I don't understand the point of it perhaps.

Mat

2012-07-07 11:57:11

@Brandon number 2 never right clicks for me 0 does, and the idea say if your making a script AcS and you want to see if the user has a certain Item instead of scrolling through the bank do a simple search to see if the item is available RunAways is a lot more human like in that it checks if the items is there.

Brandon

2012-07-07 12:04:26

From: Mat
@Brandon number 2 never right clicks for me 0 does, and the idea say if your making a script AcS and you want to see if the user has a certain Item instead of scrolling through the bank do a simple search to see if the item is available RunAways is a lot more human like in that it checks if the items is there.


Hmm but why slot 1? If it can find items in more than one slot after a search, I'd support.

I guess you're right. My values in the last post is wrong.


{$I SRL/SRL.Simba}

begin
writeln('Mouse_Left: ' + ToStr(MOUSE_LEFT));
writeln('Mouse_Right: ' + ToStr(MOUSE_RIGHT));
writeln('Mouse_Move: ' + ToStr(MOUSE_MOVE));
end.

Prints:
[BANANA]
Mouse_Left: 1
Mouse_Right: 0
Mouse_Move: 3
Successfully executed.
[/BANANA]

I guess 2 has no effect then :S

Mat

2012-07-07 12:10:57

Reason, for slot one is the idea if in my acs, i need a spade, i'd make it search 'Spade' then it'll find a spade, and I'll take it. But as Shay Pointed there are items with same names, so RunAways is best for that :).
Mat