View Full Version : Is it possible to take a screenie
crapkiller
04-13-2007, 08:18 PM
Is it possible to make a script that takes a screenie of the RS screen and crops it? I was wondering because i was making a thing to find the road color because findroadcolor wasnt working. I was using AutoColorThis. Even with 50 tolerance within a few loads it couldnt find the color. I was thinking maybe it could take a screenie of a few pixels of the road and make it into a string and use that as the bmp for AutoColorThis. Is this possible?
nielsie95
04-13-2007, 08:40 PM
I think it was CopyCanvas
This is from Boreas GetLadderColor :
TmpBmp:= BitmapFromString(100,90,''); //Makes a clean (White?) bmp
MyCanvas:=GetBitmapCanvas(TmpBmp)
CopyCanvas(GetClientCanvas,MyCanvas,598,39,698,129 ,0,0,100,90) //Copy's the bitmap from the client to Scar
//CopyCanvas(Source , Destination, x1, y1, x2, y2, xx1, yy1, xx2, yy2)
//I think it's like this:
//Source = From where?
//Destination = In which bmp to store?
//x1 till y2 = Positions of what you want to take a screen of
//xx1 till yy2 = Position of where you want to place it
crapkiller
04-13-2007, 08:55 PM
Well even though imn very confused about how this works, i tried it and got a mismatch error and it put the blinking line thing right after TmpBmp and before );
NOTE: the place of the * is where the line was
MyCanvas:=GetBitmapCanvas(TmpBmp*);
EDIT: Do you maybe know of any other methods of finding a roadcolor? lol
Ramage
04-13-2007, 09:24 PM
You could use FindRoadColor; or get a small bitmap of the road and go: RoadColor := AutoColorThis(bmpRoad,20,MMX1,MMY1,MMX2,MMY2); The 20 is the tolerance, set that to anything you like I guess.
Boreas
04-13-2007, 09:31 PM
procedure CopyClientToBitmap(bitmap: Integer; xs, ys, xe, ye: Integer); - Copy client screen part to bitmap specified.
procedure SaveBitmap(bitmap: Integer; path: string) - Saves a bitmap as a file.
That's to get a piece to a file, so that you can then use the Picture to string feature of SCAR. However, if you are doing it during script development, just take a screen shot by press the print screen key on your keyboard, go in to paint, press ctrl + v, crop what you want, ctrl+c, go into scar, click picture to string, click paste.
crapkiller
04-14-2007, 12:56 AM
You could use FindRoadColor; or get a small bitmap of the road and go: RoadColor := AutoColorThis(bmpRoad,20,MMX1,MMY1,MMX2,MMY2); The 20 is the tolerance, set that to anything you like I guess.
I said i already tried this even with 50 tolerance but after just a few loads the bitmap needed to be updated. Thats why i want the script to get a screenie.
Boreas: I mean i want the script to take a screen shot of the road and use that bitmap to AutoColorThis.
I geuss this is too hard if its even possible. Anyone know a way OTHER THAN Findroadcolor or AutoColorThis to get the color of the road? Or any1 know a way to get FindRoadColor to work? It always says it cant find the road color :(
Boreas
04-14-2007, 01:10 AM
procedure CopyClientToBitmap(bitmap: Integer; xs, ys, xe, ye: Integer); - Copy client screen part to bitmap specified.
that will get a bitmap to use with AutoColorThis
crapkiller
04-14-2007, 02:56 AM
I give up on this. I geuss its just out of my league. Well you can't say i didn't try. Thanks Boreas.
Anyway, heres the error i got. Its prolly something stupid like "u just gotta add this declaration stuff" But im no brain surgeon. Thanks for your help Boreas and all who helped me. Maybe someone can explain why FindRoadColor can NEVER find the road color. BTW: What include is FindRoadColor in?
EDIT: Anyone got any ideas on how to get a RoadColor? Other than FindRoadColor and AutoColorThis.
nielsie95
04-14-2007, 07:05 AM
Which road are you trying to find?
crapkiller
04-14-2007, 01:50 PM
Which road are you trying to find?
The road in falador. (The fally road seems to be ok with AutoColotThis FOR NOW.) And the road color south of fally. The path that leads to the mage shop. (Even though i have 50 tol on the AutoColorThis, after just 1 loading it cant find the colors. Even though right before the loading i picked the bitmap)
Any ideas?
Thanks
nielsie95
04-14-2007, 01:59 PM
Try using FindFallyRoadColor for the first part of the Road. The Road beneath just try FindRoadColor or FindMMLimeRoadColor or FindMMRoadColor :)
crapkiller
04-14-2007, 04:05 PM
Try using FindFallyRoadColor for the first part of the Road. The Road beneath just try FindRoadColor or FindMMLimeRoadColor or FindMMRoadColor :)
FindFallyRoadColor worked =D. Thanks a bunch Nielsie. Il add a comment thanking you in my script. And somehow FindRoadColor started working lolz
nielsie95
04-14-2007, 09:24 PM
Great it started working :). Np :D
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.