Results 1 to 14 of 14

Thread: Color picking a bank chest problem

  1. #1
    Join Date
    Sep 2009
    Posts
    27
    Mentioned
    0 Post(s)
    Quoted
    12 Post(s)

    Default Color picking a bank chest problem

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


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

    2- Added 2 colors for inner and metal colors of ports chest - see attachment - inside( TRSBankScreen.__openChest ) :
    Simba Code:
    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 :
    t2.jpg

    it doesn't open the bank
    ,will someone explain whats wrong ?
    Last edited by ququ; 02-03-2014 at 01:49 PM.

  2. #2
    Join Date
    Jan 2012
    Posts
    1,596
    Mentioned
    78 Post(s)
    Quoted
    826 Post(s)

    Default

    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

  3. #3
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

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

  4. #4
    Join Date
    Sep 2009
    Posts
    27
    Mentioned
    0 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by Turpinator View Post
    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.

    Quote Originally Posted by Ashaman88 View Post
    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 ?

  5. #5
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by ququ View Post
    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?

  6. #6
    Join Date
    Sep 2009
    Posts
    27
    Mentioned
    0 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by The Mayor View Post
    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
    Last edited by ququ; 02-01-2014 at 11:45 PM.

  7. #7
    Join Date
    Sep 2009
    Posts
    27
    Mentioned
    0 Post(s)
    Quoted
    12 Post(s)

    Default

    Solved ...
    /close

  8. #8
    Join Date
    Sep 2012
    Location
    Netherlands
    Posts
    2,752
    Mentioned
    193 Post(s)
    Quoted
    1468 Post(s)

    Default

    you can delete the thread yourself

  9. #9
    Join Date
    Feb 2014
    Posts
    43
    Mentioned
    0 Post(s)
    Quoted
    28 Post(s)

    Default

    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;

  10. #10
    Join Date
    Jan 2012
    Posts
    1,596
    Mentioned
    78 Post(s)
    Quoted
    826 Post(s)

    Default

    Quote Originally Posted by Yuskie View Post
    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.

  11. #11
    Join Date
    Feb 2014
    Posts
    43
    Mentioned
    0 Post(s)
    Quoted
    28 Post(s)

    Default

    Quote Originally Posted by Turpinator View Post
    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 :|

  12. #12
    Join Date
    Oct 2013
    Location
    East Coast USA
    Posts
    770
    Mentioned
    61 Post(s)
    Quoted
    364 Post(s)

    Default

    Quote Originally Posted by ququ View Post
    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

    Simba Code:
    {$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...

    Simba Code:
    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.

  13. #13
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    Quote Originally Posted by Yuskie View Post
    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:

    Simba Code:
    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
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Badâ„¢ before everyone gets laser pistols

  14. #14
    Join Date
    Oct 2013
    Location
    East Coast USA
    Posts
    770
    Mentioned
    61 Post(s)
    Quoted
    364 Post(s)

    Default

    Quote Originally Posted by KeepBotting View Post
    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:

    Simba Code:
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •