Taking Bitmap while script running.
mrpickle
2010-06-29 10:49:17
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.
Cigue
2010-06-29 11:00:59
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 ?
weequ
2010-06-29 11:04:51
procedure CopyClientToBitmap(bitmap: Integer; xs, ys, xe, ye: Integer);
Press f1 in scar to wiew functions if you didn't know that ;)
Sabzi
2010-06-29 12:53:15
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.
i luffs yeww
2010-06-29 15:54:26
^ 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. ^^
From: i luffs yeww
There's also an IsMoving function in SRL.
IIRC IsMoving uses the Flag functions.
mrpickle
2010-06-29 18:53:46
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
i luffs yeww
2010-06-29 21:32:18
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.
mrpickle
2010-06-29 22:14:28
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) :).
i luffs yeww
2010-06-29 22:19:19
^ =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).
mrpickle
2010-06-30 10:00:09
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 :D.
i luffs yeww
2010-06-30 16:05:19
Well I still don't see how yours is any more reliable..
mrpickle
2010-07-01 09:51:18
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!