SRL Archive - Reflection Development

Bank Withdrawing Functions


smurg

2011-01-27 19:10:40

Is the interface for banking that much different from the inventory? I know absolutely nothing about interfaces, but was fooling around a little.

How hard would it be to making withdrawing by ID's instead of a DTM for each object? It hasn't been done though? So I'd assume the interface is handled a little differently because of the tabs or what?

Would be much appreciated.

Sex

2011-01-27 19:19:04

I thought it has been done. I remember doing this before? :P

cycrosism

2011-01-27 19:24:48

Its easier to find the bitmap of the item then chooseoption('withdraw-all') or whatever it is. If you need help with bitmaps look at the tutorial in my sig

smurg

2011-01-27 19:29:46

From: Sex
I thought it has been done. I remember doing this before? :P


In Bank.simba under Reflection\Core, there aren't any functions for withdrawing at all. There's interface constants which I could fool around with, but no withdrawing, only depositing.

Sex

2011-01-27 19:34:33

Then they remade Reflection? :p

Bonfield

2011-01-27 23:16:12

im positive you could bank just using ids when reflection first came out pre runetek5 but im guessing the interfaces changed

Capricorn

2011-01-28 00:14:03

From: cycrosism
Its easier to find the bitmap of the item then chooseoption('withdraw-all') or whatever it is. If you need help with bitmaps look at the tutorial in my sig


The problem isn't choosing the right option, that can be done easily with R_ChooseOption('Derples')

What doesn't work is finding the position of the item in your bank I believe.

KingKong

2011-01-28 00:40:02

why don't you guys just use:

Withdraw(Col, Row, Amount: Integer);

Its loads easier and faster, doesn't require bitmaps, but the item should be in the mainbanktab, but its only good if you already know where your item is.

cycrosism

2011-01-28 00:42:00

From: Capricorn
The problem isn't choosing the right option, that can be done easily with R_ChooseOption('Derples')

What doesn't work is finding the position of the item in your bank I believe.


Well if you use a bitmap it will find the bitmap and you can make it right click it then choose the opnion? I don't see how that wont work

smurg

2011-01-28 01:01:12

From: KingKong
why don't you guys just use:
Simba Code:
[LEFT]Withdraw(Col, Row, Amount: Integer);
[/LEFT]


Its loads easier and faster, doesn't require bitmaps, but the item should be in the mainbanktab, but its only good if you already know where your item is.


I'm updating a multi-skill utility script, so that would be a disaster to use. Using all DTMs atm.

From: cycrosism
Well if you use a bitmap it will find the bitmap and you can make it right click it then choose the opnion? I don't see how that wont work


I think he misunderstood your post as saying you simply use ChooseOption or whatever without even finding the object first? Who knows.

Bonfield

2011-01-28 01:01:51

if you want it to be even quicker you can use blacklists

mormonman

2011-01-28 02:21:50

http://villavu.com/forum/showthread.php?t=60327

smurg

2011-01-29 03:13:49

From: mormonman
http://villavu.com/forum/showthread.php?t=60327


"R_NumberOfBankTabs, R_BankTab are gone.

InIntArrayEx changed."

Edit: http://villavu.com/forum/showthread.php?t=60628

Thread with all those functions, but none were committed? I'll just add to script and give credit if they still work.

Will try them out.

Capricorn

2011-01-29 03:47:23

If they work reply back to this thread :3

smurg

2011-01-29 03:52:27

From: Capricorn
If they work reply back to this thread :3


Actually the bigger thread didn't contain the Withdraw by ID, only by search, so I had to get that from the other thread.

Had to add some parenthesis here and there, some brackets to assigning a value to a item in an array, but it works great.

Impressed.

I don't know why it isn't committed? Besides not compiling and missing some parentheses'?

mormonman

2011-01-29 12:59:46

Cause I honestly forgot haha…

smurg

2011-01-29 21:34:09

From: mormonman
Cause I honestly forgot haha…


Might want to fix the compiling problems too before committing.

Bad Boy JH

2011-02-05 08:32:20

I had these functions created for AGES, I gave it PLENTY of bumps to get it commited, and when they WEREN'T I stopped bothering to create anything reflection related at all…
I have the basic framework there, someone else can fix them, I really can't be bothered right now, give me a few hours sleep to recover from the "forgot" comment, and I might work on it tomorrow.

Sex

2011-02-05 16:38:15

It's not like you're the only one that can do this.. ^

smurg

2011-02-05 16:40:30

From: Bad Boy JH
I had these functions created for AGES, I gave it PLENTY of bumps to get it commited, and when they WEREN'T I stopped bothering to create anything reflection related at all…
I have the basic framework there, someone else can fix them, I really can't be bothered right now, give me a few hours sleep to recover from the "forgot" comment, and I might work on it tomorrow.


If you need something to do it for, I'm releasing my big script soon to public Rev. 2 and it uses these functions, so (they are awesome).

**BANNED The Man

2011-02-05 16:44:03

Here is the function in my AK cooker, works 100%…

function R_WithdrawItemID(ID, Amount: Integer): Boolean;
var
I, WhichBankTab, ItemSlot: Integer;
BankTabItemIDs: TIntegerArray;
RelativePoint: TPoint;
TabBox, ItemBox: TBox;
begin
for ItemSlot := 0 to 515 do
if ID = GetChildComponentID(INTERFACE_BANK, 93, ItemSlot) then
Break;
if GetChildComponentID(INTERFACE_BANK, 93, ItemSlot) = -1 then
begin
Writeln('ItemID ' + IntToStr(ID) + ' not found.');
Exit;
end;
if ItemSlot = 515 then
begin
Writeln('ItemID ' + IntToStr(ID) + ' not found.');
Exit;
end;
RelativePoint.x := GetChildComponentRelativeX(INTERFACE_BANK, 93, ItemSlot);
RelativePoint.y := GetChildComponentRelativeY(INTERFACE_BANK, 93, ItemSlot);
if (RelativePoint.x = 0) then
begin
SetLength(BankTabItemIDs, 9);
for I := 1 to 9 do
BankTabItemIDs[I - 1] := GetInterfaceComponentID(INTERFACE_BANK, 47 + ((9 - I) * 2));
for I := ItemSlot downto 0 do
if InIntArrayEx(BankTabItemIds, WhichBankTab, GetChildComponentID(INTERFACE_BANK, 93, I)) then
Break;
TabBox.x1 := GetInterfaceComponentRelativeX(INTERFACE_BANK, 47 + ((8 - WhichBankTab) * 2)) + 4;
TabBox.y1 := GetInterfaceComponentRelativeY(INTERFACE_BANK, 47 + ((8 - WhichBankTab) * 2)) + 4;
TabBox.x2 := TabBox.x1 + GetInterfaceComponentWidth(INTERFACE_BANK, 47 + ((8 - WhichBankTab) * 2));
TabBox.y2 := TabBox.y1 + GetInterfaceComponentHeight(INTERFACE_BANK, 47 + ((8 - WhichBankTab) * 2));
MouseBox(TabBox.x1, TabBox.y1, TabBox.x2, TabBox.y2, 1);
RelativePoint.x := GetChildComponentRelativeX(INTERFACE_BANK, 93, ItemSlot);
RelativePoint.y := GetChildComponentRelativeY(INTERFACE_BANK, 93, ItemSlot);
end;
ItemBox.x1 := RelativePoint.x + GetInterfaceComponentRelativeX(INTERFACE_BANK, 93) + 4;
ItemBox.y1 := RelativePoint.y + GetInterfaceComponentRelativeY(INTERFACE_BANK, 93) + 4;
ItemBox.x2 := ItemBox.x1 + GetChildComponentWidth(INTERFACE_BANK, 93, ItemSlot)
ItemBox.y2 := ItemBox.y1 + GetChildComponentHeight(INTERFACE_BANK, 93, ItemSlot)
if Amount = 1 then
begin
MouseBox(ItemBox.x1, ItemBox.y1, ItemBox.x2, ItemBox.y2, 1);
Result := True;
Exit;
end;
MouseBox(ItemBox.x1, ItemBox.y1, ItemBox.x2, ItemBox.y2, 2);
if Amount = 0 then
Result := R_ChooseOption('ithdraw-All') else
if OptionExists('ithdraw-' + IntToStr(Amount)) then
Result := R_ChooseOption('ithdraw-' + IntToStr(Amount)) else
begin
if R_ChooseOption('ithdraw-X') then
begin
Wait(RandomRange(1200, 1500));
TypeSend(IntToStr(Amount));
Result := True;
end;
end;
end;

smurg

2011-02-05 17:17:53

From: Dynamite
Here is the function in my AK cooker, works 100%…

Simba Code:
[LEFT]function R_WithdrawItemID(ID, Amount: Integer): Boolean;
var
I, WhichBankTab, ItemSlot: Integer;
BankTabItemIDs: TIntegerArray;
RelativePoint: TPoint;
TabBox, ItemBox: TBox;
begin
for ItemSlot := 0 to 515 do
if ID = GetChildComponentID(INTERFACE_BANK, 93, ItemSlot) then
Break;
if GetChildComponentID(INTERFACE_BANK, 93, ItemSlot) = -1 then
begin
Writeln('ItemID ' + IntToStr(ID) + ' not found.');
Exit;
end;
if ItemSlot = 515 then
begin
Writeln('ItemID ' + IntToStr(ID) + ' not found.');
Exit;
end;
RelativePoint.x := GetChildComponentRelativeX(INTERFACE_BANK, 93, ItemSlot);
RelativePoint.y := GetChildComponentRelativeY(INTERFACE_BANK, 93, ItemSlot);
if (RelativePoint.x = 0) then
begin
SetLength(BankTabItemIDs, 9);
for I := 1 to 9 do
BankTabItemIDs[I - 1] := GetInterfaceComponentID(INTERFACE_BANK, 47 + ((9 - I) * 2));
for I := ItemSlot downto 0 do
if InIntArrayEx(BankTabItemIds, WhichBankTab, GetChildComponentID(INTERFACE_BANK, 93, I)) then
Break;
TabBox.x1 := GetInterfaceComponentRelativeX(INTERFACE_BANK, 47 + ((8 - WhichBankTab) * 2)) + 4;
TabBox.y1 := GetInterfaceComponentRelativeY(INTERFACE_BANK, 47 + ((8 - WhichBankTab) * 2)) + 4;
TabBox.x2 := TabBox.x1 + GetInterfaceComponentWidth(INTERFACE_BANK, 47 + ((8 - WhichBankTab) * 2));
TabBox.y2 := TabBox.y1 + GetInterfaceComponentHeight(INTERFACE_BANK, 47 + ((8 - WhichBankTab) * 2));
MouseBox(TabBox.x1, TabBox.y1, TabBox.x2, TabBox.y2, 1);
RelativePoint.x := GetChildComponentRelativeX(INTERFACE_BANK, 93, ItemSlot);
RelativePoint.y := GetChildComponentRelativeY(INTERFACE_BANK, 93, ItemSlot);
end;
ItemBox.x1 := RelativePoint.x + GetInterfaceComponentRelativeX(INTERFACE_BANK, 93) + 4;
ItemBox.y1 := RelativePoint.y + GetInterfaceComponentRelativeY(INTERFACE_BANK, 93) + 4;
ItemBox.x2 := ItemBox.x1 + GetChildComponentWidth(INTERFACE_BANK, 93, ItemSlot)
ItemBox.y2 := ItemBox.y1 + GetChildComponentHeight(INTERFACE_BANK, 93, ItemSlot)
if Amount = 1 then
begin
MouseBox(ItemBox.x1, ItemBox.y1, ItemBox.x2, ItemBox.y2, 1);
Result := True;
Exit;
end;
MouseBox(ItemBox.x1, ItemBox.y1, ItemBox.x2, ItemBox.y2, 2);
if Amount = 0 then
Result := R_ChooseOption('ithdraw-All') else
if OptionExists('ithdraw-' + IntToStr(Amount)) then
Result := R_ChooseOption('ithdraw-' + IntToStr(Amount)) else
begin
if R_ChooseOption('ithdraw-X') then
begin
Wait(RandomRange(1200, 1500));
TypeSend(IntToStr(Amount));
Result := True;
end;
end;
end;
[/LEFT]



Where'd you get that from?

Sex

2011-02-05 17:19:34

It is possible he made it?

smurg

2011-02-05 17:27:17

From: Sex
It is possible he made it?


No.

He took it from the first post in: http://villavu.com/forum/showthread.php?t=60327

I took mine from later down in the thread where they updated it a little (Credited appropriately). It's weird how the earlier ones works and the more updated one is broke.

Anyways, Dynamite, you might want to give credit when you take functions other people put a lot of time into.

**BANNED The Man

2011-02-05 17:41:58

From: smurg
No.

He took it from the first post in: http://villavu.com/forum/showthread.php?t=60327

I took mine from later down in the thread where they updated it a little (Credited appropriately). It's weird how the earlier ones works and the more updated one is broke.

Anyways, Dynamite, you might want to give credit when you take functions other people put a lot of time into.


I never said I made it, nor did I remember where I got it, I just edited it so that it worked.
Don't accuse me of something I didn't do :/

-Boom

smurg

2011-02-05 19:09:26

From: Dynamite
I never said I made it, nor did I remember where I got it, I just edited it so that it worked.
Don't accuse me of something I didn't do :/

-Boom


It was in your AK Cooker script word for word from the thread. There wasn't anything "edited" and when you release a script, any functions/procedures you declare in the script are assumed your work unless credited otherwise.

Look at the include files, just include a header over the function:


{*******************************************************************************
function R_WithdrawItemID(ID, Amount: Integer): Boolean;
By: Bad Boy JH
Description: Withdraws item ID.
*******************************************************************************}

**BANNED The Man

2011-02-05 19:13:19

From: smurg
It was in your AK Cooker script word for word from the thread. There wasn't anything "edited" and when you release a script, any functions/procedures you declare in the script are assumed your work unless credited otherwise.

Look at the include files, just include a header over the function:


{*******************************************************************************
function R_WithdrawItemID(ID, Amount: Integer): Boolean;
By: Bad Boy JH
Description: Withdraws item ID.
*******************************************************************************}


Well if it is in the include then there is no need to credit.
And I never said I made it.

Bad Boy JH

2011-02-05 19:18:55

Sex, its not the fact that I am the only one that CAN do this, its the fact that I am the only one who bothered to do this, but it went unnoticed.

smurg

2011-02-05 19:23:14

From: Dynamite
Well if it is in the include then there is no need to credit.
And I never said I made it.


It's not in the include and the whole original function is posted inside your script without credit.

You said you edited it, which the version in your script wasn't edited.

Saying you didn't create it doesn't mean anything if you include it in your script without crediting, its essentially saying that every function/procedure declared in the script is your work.

Imagine writing a paper for school and posting huge paragraphs of text copied from some thesis paper without referencing who wrote it or where you got it. It's blatant plagiarism.

People need to know who wrote it, not solely in the event of giving credit, but also if something is wrong, then they know who to contact.

mormonman

2011-02-07 18:46:14

From: Bad Boy JH
Sex, its not the fact that I am the only one that CAN do this, its the fact that I am the only one who bothered to do this, but it went unnoticed.


Not unnoticed. I will commit it and some other things in a couple of hours. I wasn't a dev when you made this.

Bad Boy JH

2011-02-07 19:15:43

I know, and none of the comments were made about you. I know you weren't deving at that stage.

pyroryan

2011-02-07 20:31:34

And I don't pay attention a good __ (high) percent of the time.

mormonman

2011-02-08 05:22:04

So its apparently impossible to find out which item is in which tab unless you start on the "View all" tab.

Bad Boy JH

2011-02-08 05:30:14

I had a procedure, I explained it in the page where i originally posted the withdraw function, check there.

mormonman

2011-02-08 05:38:12

From: Bad Boy JH
I had a procedure, I explained it in the page where i originally posted the withdraw function, check there.


It is impossible because of the way the bank tab interfaces work. Trust me, I have spent hours on it. The include is done, I just hate fucking git, and git hates me so I can't commit.

**BANNED The Man

2011-02-08 12:28:12

From: mormonman
It is impossible because of the way the bank tab interfaces work. Trust me, I have spent hours on it. The include is done, I just hate fucking git, and git hates me so I can't commit.


git add FILE
git commit -m "put commit message here"
git push

Not hard is it? :P

-Boom

Feroc1ty

2011-02-08 14:09:55

I've made a function that's fully color and withdraw items from any bank tab as long as the bot doesn't have to scroll down for each tab individually; I'll post it if anyones interested.

mormonman

2011-02-08 16:08:07

From: Feroc1ty
I've made a function that's fully color and withdraw items from any bank tab as long as the bot doesn't have to scroll down for each tab individually; I'll post it if anyones interested.


Mine finds what bank tab it is in and can search by name or id. It just has to start on the first tab.

smurg

2011-02-08 16:54:36

From: mormonman
Mine finds what bank tab it is in and can search by name or id. It just has to start on the first tab.


The withdraw function originally posted in:
http://villavu.com/forum/showthread.php?t=60327
using these functions:
http://villavu.com/forum/showthread.php?t=60628

would go in between tabs and withdraw the items, even if you started on some random tab. It's broken right now, but I don't know why.

mormonman

2011-02-08 17:12:33

From: smurg
The withdraw function originally posted in:
http://villavu.com/forum/showthread.php?t=60327
using these functions:
http://villavu.com/forum/showthread.php?t=60628

would go in between tabs and withdraw the items, even if you started on some random tab. It's broken right now, but I don't know why.


Probably because they changed how the interfaces worked. lordsaturn and I spent quite a bit of time last night finding every way not to do it.

IPwnz

2011-02-08 18:13:13

From: mormonman
Mine finds what bank tab it is in and can search by name or id. It just has to start on the first tab.


Isn't it possible just to include an SRL-dependent piece to account for the bank tabs? For example:

i := 1
repeat
BankTab(i);
Wait(600+random(500));
Inc(i);
until (i > 9) or R_WithdrawItemID(options)