SRL Archive - General Botting Help

Color picking a bank chest problem


ququ

2014-02-01 14:08:35

hey so Im trying to add a bank chest to bankscreen.simba


Added this to bankscreen.simba :
1- Defined a const :
  BANK_CHEST_PORTS=10;

2- Added 2 colors for inner and metal colors of ports chest - see attachment - inside( TRSBankScreen.__openChest ) :
 
BANK_CHEST_PORTS: begin col1:= [3094603, 13, [2, [0.08, 0.09, 0.00]]]; col2:= [6842207, 19, [2, [0.10, 0.9, 0.00]]]; avelen:= 90; end;


picture included for the colors i picked by ACA :
[ATTACH=CONFIG]22843[/ATTACH]

it doesn't open the bank
,will someone explain whats wrong ?

Turpinator

2014-02-01 14:20:31

Id mess around avelen. So…
do a getColorsTolerance(col2 stuff)
then writeln(length(TPAOUT)) to determine the value of avelen.

(i think that is how avelen is used) (and you could try switching col1 and col2

Ashaman88

2014-02-01 15:53:24

1st of all doesn't the ports chest change with each upgrade? So that would only work for 1 level right?

ququ

2014-02-01 17:52:20

From: Turpinator
Id mess around avelen. So…
do a getColorsTolerance(col2 stuff)
then writeln(length(TPAOUT)) to determine the value of avelen.

(i think that is how avelen is used) (and you could try switching col1 and col2


ugh , can you show me code sorry im kinda noob.

From: Ashaman88
1st of all doesn't the ports chest change with each upgrade? So that would only work for 1 level right?


yea its only gonna work for 1 upgrade but i dont think am gonna upgrade the workshop anymore ;p
and only doing this for myself not gonna add it for everyone, people will get confused why it wouldn't work.
could you look at the picture and code to tell me whats wrong please ?

The Mayor

2014-02-01 18:05:14

From: ququ
ugh , can you show me code sorry im kinda noob.



yea its only gonna work for 1 upgrade but i dont think am gonna upgrade the workshop anymore ;p
and only doing this for myself not gonna add it for everyone, people will get confused why it wouldn't work.
could you look at the picture and code to tell me whats wrong please ?


So, what exactly are you trying to do? Click the chest?

ququ

2014-02-01 18:20:18

From: The Mayor
So, what exactly are you trying to do? Click the chest?


acutally i want srl to recognize it as a chest
adding it to bankscreen.simba will make the chest accessible to any script just using Bankscreen.Open(10)

i mean i could just us Tpa or dtm for banking ,but thats gonna make me rewrite same code in many scripts and when some color change i have to rewrite it for all scripts

ququ

2014-02-06 17:18:00

Solved … :p
/close

Hoodz

2014-02-06 17:39:53

you can delete the thread yourself

Yuskie

2015-03-04 23:33:33

I'm gonna mouche off this thread if you don't mind, since my question is similar to this. So, I was having issues detecting any of the chests in the first place. Can someone explain to me how exactly that line of code works? What's the purpose of having col1 and col2? and what's the reason behind having this?
if (len < 5) or (length(col2Edges) < 5) then
begin
print('Failed to find enough chest colors [1 '+toStr(len)+', 2 '+toStr(length(col2Edges))+' ]', TDebug.ERROR);
print('TRSBankscreen.__openChest(): result = false', TDebug.FOOTER);
exit(false);
end;

Turpinator

2015-03-05 00:57:09

From: Yuskie
I'm gonna mouche off this thread if you don't mind, since my question is similar to this. So, I was having issues detecting any of the chests in the first place. Can someone explain to me how exactly that line of code works? What's the purpose of having col1 and col2? and what's the reason behind having this?


well most chests are brown… and there are often brown things near the chests… most brown things dont also have another color specific to them (ie the gold on a chest)…
so using multiple criteria increases the odds that it is a chest.

Yuskie

2015-03-05 03:14:31

From: Turpinator
well most chests are brown… and there are often brown things near the chests… most brown things dont also have another color specific to them (ie the gold on a chest)…
so using multiple criteria increases the odds that it is a chest.

Yea, I understand that. But why should it fail if the len is less than 5? like what is this magic number? and what exactly does the 2 color columns look like if you were to visualize it? is it 2 edges on a box? or is it like 2 points on the corners of the box?

Just looking for clarity. Sorry if I'm asking too much :|

bonsai

2015-03-05 04:58:35

From: ququ
acutally i want srl to recognize it as a chest
adding it to bankscreen.simba will make the chest accessible to any script just using Bankscreen.Open(10)

i mean i could just us Tpa or dtm for banking ,but thats gonna make me rewrite same code in many scripts and when some color change i have to rewrite it for all scripts


Create your own include file and put your functions in there. Let's say you make ququ.simba in SIMBADIR\includes

In all your scripts you can include these common functions just like you include SRL

{$include_once ququ.simba}

If you want to customize an SRL function, include your personal file after SRL and in your file override the SRL function…

function TRSBankScreen.isOpen(waitTime: integer = 0): boolean; override;
begin
{put your stuff here}
end

That way when SRL updates you won't lose your customization.

KeepBotting

2015-03-05 07:53:32

From: Yuskie
Yea, I understand that. But why should it fail if the len is less than 5? like what is this magic number? and what exactly does the 2 color columns look like if you were to visualize it? is it 2 edges on a box? or is it like 2 points on the corners of the box?

Just looking for clarity. Sorry if I'm asking too much :|

Length in this particular instance refers to how many points have been found. Five points isn't a whole lot, so we can safely say if we only pick up about that many, we're not going to end up finding much.

I can't tell you what the colors would look like as they're different for every chest:


case bankType of
BANK_CHEST_SW: begin col1:= [8946555, 15, [2, [0.18, 0.18, 0.00]]]; col2:= [5863053, 10, [2, [0.13, 0.10, 0.00]]]; avelen:= 90; end;
BANK_CHEST_SHANTAY: begin col1:= [4335674, 6, [2, [0.38, 1.96, 0.00]]]; col2:= [7247287, 6, [2, [0.16, 1.41, 0.00]]]; avelen:= 90; end;
BANK_CHEST_DUEL: begin col1:= [11512192, 18, [2, [0.39, 0.57, 0.00]]]; col2:= [6586289, 10, [2, [0.21, 1.00, 0.00]]]; avelen:= 90; end;
BANK_CHEST_CW: begin col1:= [8088922, 16, [2, [0.06, 0.17, 0.00]]]; col2:= [4808312, 17, [2, [0.03, 0.17, 0.00]]]; avelen:= 90; end;
BANK_CHEST_GROTTO: begin col1:= [6842737, 6, [2, [0.31, 0.08, 0.00]]]; col2:= [2570316, 4, [2, [0.15, 1.35, 0.00]]]; avelen:= 90; end;
BANK_CHEST_LUMBRIDGE: begin col1:= [5599380, 7, [2, [0.10, 0.43, 0.00]]]; col2:= [10786444, 6, [2, [0.24, 0.53, 0.00]]]; avelen:= 90; end;
BANK_TABLE_BURTHORPE: begin col1:= [14609385, 5, [2, [1.07, 1.41, 0.00]]]; col2:= [6457502, 5, [2, [0.15, 0.56, 0.00]]]; avelen:= 90; end;
BANK_CHEST_PRIFDDINAS: begin col1:= [2729983, 12, [1, [0.07, 0.00, 0.00]]]; col2:= [7528447, 16, [2, [0.24, 0.00, 0.00]]]; avelen:= 90; end;
end;

And if you're looking for @Clarity;, you'll never find him, he's hiding

bonsai

2015-03-05 10:14:03

From: KeepBotting
Length in this particular instance refers to how many points have been found. Five points isn't a whole lot, so we can safely say if we only pick up about that many, we're not going to end up finding much.

I can't tell you what the colors would look like as they're different for every chest:


case bankType of
BANK_CHEST_SW: begin col1:= [8946555, 15, [2, [0.18, 0.18, 0.00]]]; col2:= [5863053, 10, [2, [0.13, 0.10, 0.00]]]; avelen:= 90; end;
BANK_CHEST_SHANTAY: begin col1:= [4335674, 6, [2, [0.38, 1.96, 0.00]]]; col2:= [7247287, 6, [2, [0.16, 1.41, 0.00]]]; avelen:= 90; end;
BANK_CHEST_DUEL: begin col1:= [11512192, 18, [2, [0.39, 0.57, 0.00]]]; col2:= [6586289, 10, [2, [0.21, 1.00, 0.00]]]; avelen:= 90; end;
BANK_CHEST_CW: begin col1:= [8088922, 16, [2, [0.06, 0.17, 0.00]]]; col2:= [4808312, 17, [2, [0.03, 0.17, 0.00]]]; avelen:= 90; end;
BANK_CHEST_GROTTO: begin col1:= [6842737, 6, [2, [0.31, 0.08, 0.00]]]; col2:= [2570316, 4, [2, [0.15, 1.35, 0.00]]]; avelen:= 90; end;
BANK_CHEST_LUMBRIDGE: begin col1:= [5599380, 7, [2, [0.10, 0.43, 0.00]]]; col2:= [10786444, 6, [2, [0.24, 0.53, 0.00]]]; avelen:= 90; end;
BANK_TABLE_BURTHORPE: begin col1:= [14609385, 5, [2, [1.07, 1.41, 0.00]]]; col2:= [6457502, 5, [2, [0.15, 0.56, 0.00]]]; avelen:= 90; end;
BANK_CHEST_PRIFDDINAS: begin col1:= [2729983, 12, [1, [0.07, 0.00, 0.00]]]; col2:= [7528447, 16, [2, [0.24, 0.00, 0.00]]]; avelen:= 90; end;
end;

And if you're looking for @Clarity;, you'll never find him, he's hiding


Ultimately, his question is about findTPAedges(). I didn't see anything without digging into source.