Results 1 to 13 of 13

Thread: Taking Bitmap while script running.

  1. #1
    Join Date
    May 2008
    Location
    Canada
    Posts
    665
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default Taking Bitmap while script running.

    Is it possible to take a bitmap of a certain part of a screen and use it temporarily in your script?

    Like, if there is a way to find that the minimap in RS is not moving, that would be like a wayy more reliable way to find that we have reached out destination. Instead of using Flag, which disappears before we get there.

  2. #2
    Join Date
    Sep 2009
    Posts
    580
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    PICKLE! What's up my man !

    For your minimap woes, there are functions that check out if the screen is moving, check out things like PixelShift in the library.

    I think a bitmap wouldn't be the best way, maybe you should just use getcolor(x,y) then countcolor ?
    I don't check this place often, sorry.

    Currently working on - Software Engineering degree. Thank you SRL for showing me the one true path

  3. #3
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default

    procedure CopyClientToBitmap(bitmap: Integer; xs, ys, xe, ye: Integer);

    Press f1 in scar to wiew functions if you didn't know that

  4. #4
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    With bitmap you have to do it very carefully. You know there are others. Npcs, stupid legit players(they just make things harder for us :S) and whatnot. They will continue moving even if you stopped. But I think there are functions that can avoid certain colors.

  5. #5
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    ^ You can simply exclude yellow, white, and red (get the actual color of them).

    There's also an IsMoving function in SRL. I always found things like that interesting. The way I do it without SRL is to GetColor a couple small boxes throughout the MS/MM and then check them 600-800ms after I get them, and if too many have changed (depending on how many pixels per box, how many boxes, etc.), then you're still moving. They need to be relatively small boxes, by the way. I just did 3x3s.

    Hope that helps. ^^

  6. #6
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    There's also an IsMoving function in SRL.
    IIRC IsMoving uses the Flag functions.

  7. #7
    Join Date
    May 2008
    Location
    Canada
    Posts
    665
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    I was hoping to find a way to 2 bitmap images. Before and after. T
    The program will find the spots of players, npc, items, etc on both maps, and ignore that entire area for both bitmaps. Then both those areas will be combined and ignored on both bitmaps... therefore completely eliminating that variable minimap bitmap comparison.

    and hey Cigue, nice enthusiastic greeting =D

  8. #8
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    The only thing is that taking a bitmap and then comparing it might take a little bit of time, so anything that moves could possibly cause it to give false positive (or negatives). I believe you would have to save the bitmap each time you compare it, as well, but I'm not sure.

    Why not do what I posted? It's the same thing you're thinking of just without taking a snapshot, to put it simply.

  9. #9
    Join Date
    May 2008
    Location
    Canada
    Posts
    665
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    because I want 100% reliability. Its the difference between a bot that runs for 30 min, and a bot that goes for 6 hours. Your way has a small chance of detecting a "non map" movement by players, npc, or just random items dropped each time it runs.

    But I will use the basics of your idea. Get colour a larger area, and removing certain colours (somehow) .

  10. #10
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    ^ =X I'd have to disagree. As I said before, they're virtually the same thing. Like I said, I have it check both the MS and MM, and check a few different places. You could make it work just the same if you wanted every point to be the same color, which a bitmap would do (unless you added tolerance; then it's exactly the same (basically) as what I use).

  11. #11
    Join Date
    May 2008
    Location
    Canada
    Posts
    665
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    again, there're still unknown probabilites there. Thus the need to check multiple areas for it to work more consistently .

    Don't worry i understand what your proposal is, i'm just looking for 100% reliability.I'm removing that variability by comparing 2 different colour areas (your suggestion), and removing certain colours from both of them. Then the remaining holes where the colours are "removed", will be added thogether, then subtracted from both colour areas. The no need to worry about npc and stuff.

    An idea to improve the reliability of your method there .

  12. #12
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    Well I still don't see how yours is any more reliable..

  13. #13
    Join Date
    May 2008
    Location
    Canada
    Posts
    665
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    lol its ok, we both rambling on.

    Use IsMoving (a whole easier)

    Or we can just check the pixel shifts that's been discussed. which has more coding!

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
  •