Results 1 to 11 of 11

Thread: Checking multiple items with the same colour.

  1. #1
    Join Date
    Jan 2012
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Checking multiple items with the same colour.

    Hey guys, I'm working on a chinchompa hunting script, its all going splendidly so far, but now I'm wondering what the best method would be to check each trap after its been placed.

    The traps won't always be in the same place, seeing as the script tries to place them in a specific pattern (like the number 5 on a dice), but if there is something like a plant in the way it moves one square to the left and places it there instead. I suppose I could try and use specific spots without any plants with more accurate DTMs but if it isn't necessary I'll try without.

    Basically I need my script to enter a trap checking loop, where it checks each trap, probably by hovering the mouse and checking up-text, then either dismantles failed traps, re-lays fallen traps or checks and re-lays successful traps.

    The problem I'm having is that I don't know how to check each trap, I though I could use FindColor first as there doesn't seem to be any similar colours to the traps, however I don't know how I would do this to check each trap in sequence? Surely every time I use FindColor it will just find the same single trap. So I guess what I'm asking is what would be the best way to check each trap I've laid (if they aren't in any specific pattern) in sequence from 1 through 5.

    Thanks in advance for any info.

    Willy Jenkins.

  2. #2
    Join Date
    Nov 2011
    Posts
    132
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    if the uptext of the traps change when they fall or fail then you could probably use

    if IsUpText('') then

    and perhaps make a dtm for the boxtraps in the inventory and make the script always click on them.

    If FindDTM(trap, X, Y, MIX1, MIY1, MIX2, MIY2) then
    begin


    mouse( x, y, 3, 3, true);
    FreeDTM(trap)
    end;

    these are just a few examples

  3. #3
    Join Date
    Jan 2012
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Sorry loser69 I might not have made it clear what my problem is. I'm fully aware of how I can check the traps themselves, however the problem I'm having is that I need to check 5 traps, that might not always be in the same place.

    If I used FindDTM or FindColour, would it not find the same single trap each time? I need to look at each 5 traps in sequence.

  4. #4
    Join Date
    Nov 2011
    Posts
    132
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    findcolour finds the colour your looking for so it would be finding the traps in a random order , I think.

  5. #5
    Join Date
    Jan 2012
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ahh I see, I thought it searched the screen in a particular way so would just find the same trap first every time. Does FindDTM do the same?

  6. #6
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    FindColors will put all the colors found into a TPA, FindDTMs etc will also do the same.


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  7. #7
    Join Date
    Jan 2012
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Does FindColors check the screen in a uniform way, like does it start at the top left then check right and down? So for example if I did FindColors once then did it again at the same spot, would each trap be in the same element within each of the arrays?

  8. #8
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    I think so. Use FindColorsSpiral (I think) will search from a point outwards.


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  9. #9
    Join Date
    Jan 2012
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Great, thanks for the help guys I'll give that a go.

    Edit: Actually one more quick question, is there a method to find the size of a TPA, I'm used to Java so I'd normally use TPA.length, is there something similar?
    Last edited by WillyJenkins; 01-11-2012 at 02:59 PM.

  10. #10
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Length(TPA);
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  11. #11
    Join Date
    Jan 2012
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Delish, cheers .

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
  •