SRL Archive - Senior News and General

Any Drawing Scripts?


YoHoJo

2008-01-23 21:41:55

Iv posted this here because a lot of you have been around for a while and seen a lot.

Does anyone know if there was ever a 'drawing' script created that could copy images onto paint or anything of that sort?

Thanks,
Yohojo

The Claw

2008-01-23 22:32:49

How do you mean? Saving images from RS, from a website, saving screenshots or what? It would be possible to save an image from somewhere, then use keypresses to open up the command line and open the paint.exe from there if you know the proper commands

Town

2008-01-23 22:54:58

procedure SaveScreenshot(FileName: string);

Eh?

YoHoJo

2008-01-23 23:39:55

Sorry for being unclear.
I dont mean save/take pictures/screenshots.

I meancan i show a script a bitmap, and then make it draw that bitmap on paint?

Probably not possible…

ZephyrsFury

2008-01-24 01:05:15

I don't think you can make it draw all the colours. I was bored and managed it to copy a paragraph of text though. Something like FindColorsTolerance then for each point make it move and click the mouse with the pencil or paintbrush tool. Its pretty slow and stupid though. :p

Hobbit

2008-01-24 02:29:29

Oh Oh Oh yes

I forget who made it but someone made a smilie face drawer… it was pretty cool cause it did tons of them.

nielsie95

2008-01-24 04:20:14

You could also copy the canvas on the client canvas. I don't think paint refreshes fast.

Bobarkinator

2008-01-24 08:11:56

I half made one a couple months ago, I could finish it. It wouldn't be to hard.

Smartzkid

2008-01-24 19:37:58

I made a black and white one; it was too slow to do color changes w/ paint - all that double clicking and junk.

Isn't hard to make; just make it load a bitmap, then loop through each pixel and do a saturation check (more or less than half saturation = black or white), then do all the paintclicking.

Bobarkinator

2008-01-24 20:41:00

program New;
//{.include SRL\SRL.scar}

type
CColor = record
x,y: Integer;
Color: TColor;
end;

var
tmpBitmap,Width,Height: Integer;
CBitmap: Array of CColor;


procedure SetBitmap;
begin
tmpBitmap := BitmapFromString2(False, 'aD5C5A78DAED9D5B92AB' +
'201086B7A446137D54A0F7BFA4836026E4101D541A21F36B4D976' +
'51C2E1F2D423797AA7A1E82B4784CED2C6F72968FF9767B6FB4BC' +
'D3F0DFAFF747FDF3CCD87455D588AE211CDE313EC6FB38F65DFFE' +
'88525AD26352809E94A5002A52FA77453956A853E5525F4292BA1' +
'0F4E296B39C7528B4AC76C62CF9F92BCC946DEA9A3967A92FAA44' +
'4B2A51B3D6CECF95312722E5F1234E9945B39D1488A510EBA3C84' +
'66D4D0DDC61E8B121FD585D2A8D32E97F4F3C99E1E9A94E1A3848' +
'E9F382885FCD7DE90174A36FDDC727EB307AAA9A2568DAFD853EA' +
'5238C90F946CFADBB976B221D89ACA0DD3BFB3FDAB7B67A9F74C5' +
'D449522BAA95E3DD41497D236B733A16D533A2F5352F29F5F0BE1' +
'A02EB54B2E2A7A6A82B93E2FDF42AB4C8D542949B5969D1AB8752' +
'972EDED94F54FBEE6723F2DDF42B3F5B654BA13ACEE3129717F0D' +
'7F74C9BC0B732E6C5E5864A36BEE6EA1D4E9D6647F9ED2197D0BF' +
'F5F9FD252FA91C8BC85169552ACF731249C1229F95FF3EDEFFBF6' +
'F3216D8385D23317332F931716695B4AA63DA919DDD4E3AA6FDCC' +
'1DADBA1B4947E24326FA125A414F7FBB850B2B9A81C4AF5EB7AED' +
'CEF6AFEE1D7BBDB49426DDEE567C9438DA0F0BA5672E4CAB66CE0' +
'B87D46CE696D2B8586C1A555A6FF72B28B1B72AD9C87CA034E8DE' +
'892891D2F275B63586AD5DE34A1BB2E5636A244952A9A6144AC6B' +
'EDAEA72AD55B758592B493A1FB5B1B5C692264CA9A353B51C64AF' +
'0BE72E3B7D6563CFDFEE6D72211B9DDE4E4B9DE69FEBF8D230919' +
'520791324946C1686A5F850E6F40EB32EE973103DABBCE9BFD6F7' +
'0BC0D3047F1C28811228A5911CFD260EEFC05E3B495C3E762C4D9' +
'E945E297CA6D3BF8E6BC75BB362B9E38E6295512C9BC08BC9BB8C' +
'A55155D031D1444FE9DE399B8633DE81359D71F9F8E93E4FC9B43' +
'23F92F1659C1AE0987720259FDF28F93AF33B1F3E4ABFF379128A' +
'CB67BB2E7AFF3584CFEB99B894DC12DC3EFDB4727CDFD729EDABB' +
'5AEA5C4F1DD0F795F38F8F051E26E2BEEA17496CFB17A296EADC8' +
'D1AEE64855893D94F4E9446F17944009944009944009944009944' +
'0294DFF280DA5B879F12D72DC76096E4AEBD6C52371D9FFEACDE9' +
'CF417659D96762E5888F1287F5C0F792A4B1E4A4F4C79DA1E4EA6' +
'4089FB8AC3828F9BEB0589E2671E8CC99925B33C40AB9744A6B7C' +
'386667849089EB073F4F699B0FC717D3C6B2CDC74D89BDBED603E' +
'EFBE553B6247D4A2F3ED623F094E9297DE273D64F11F3AB3AD1AB' +
'468AC16A8F0F651C46B9EEDFB6C7FC4C2E3D179BDABE7A4997D81' +
'8DD1F67F9ACF9973F8F64C8ABAFE76BD7C8A44BDBA33BACCC4597' +
'D6581D7BEF603901255002A552288946D4A2D375713F8ABEE96BF' +
'D049B1C9BB11E3B318A411443C9A676BA4FDD34D85963DC2BF8D9' +
'D96A36C63C59F9946CC9DA94A73C6C8C4BECD9531A9AA11EBAAB5' +
'686B4B183121F253E4F0A1FA50FB3FB9350E218FBCA41A9FAD017' +
'0F65F51728BDF7813FDBC041C99D938237EE774A44AE653E65ED5' +
'DAE2E71535AB373F179078E5172F91CD3A26394C2E735E546E998' +
'169DA1C43D56FF3CA5585AF417281DFBA2C5A21492C2DC28A5ECA' +
'1F83E537FDC4E6E94D2F7E3CAA294BEB7CB370A089613504A4A49' +
'0CD340CB2A88290F13A38DBD00BB77275AD15F66F736B1C387F21' +
'D3E1478DF40099440A92C4AEEF81F7F2CD0DED153A5CCA0DFB7EA' +
'C2FB88B2CF6317D3AEDFC5ED89DBB782873F46D1CA31B85755F2F' +
'CAF704AAEE684F63D89FE973C73A6D2FB76C3DFB82D4A4469586D' +
'EF6E909B2EA56715B20AD355BA74C4E6B3C68A9F52CA7928E1BA1' +
'4CA8A670DB46B2985EB529A92CD73FDA5336D458E5A62EFBE7529' +
'29E5D0AE8EB1865EBA553DD18F031350022550022550022550820' +
'4A5BF4C2917EF405A9B7FCEB375AEF5567CD3AE31577994AE7AFB' +
'62AD99930FAB9C57CFCB81553EF5526EABB8E7F68DCB59A34A5CD' +
'533FD3E5FDC71A559AFB2F49D1AD2AC7D9A663799EFE8A194CB0A' +
'FD38D8044009944009944009944009944009944029E54E19E77B7' +
'9E17BA4C63D38F65BB976DF81333B23F0ED51B2BD627CDC7D764A' +
'A794CFAE31B9514AC90794BE95527A3EDF47E9DA51F165E91247E' +
'CA5B4976295D477CFB0B8B68CD08F032550022550022550022550' +
'02255002255002A59C7BBEE967EBA4F42E85784CC22D277BD3B37' +
'7E657B9F6B7332929C556094AA0044AA084DABBC496405C1F01DA' +
'DE687B8312288112284182122881122895420947C8F10F68F');
end;

procedure GetColorsOnBitmap;
var
i,a,Number: Integer;
begin
GetBitmapSize(tmpBitmap,Width,Height);
SetArrayLength(CBitmap,Width * Height);
for i:= 1 to Height do
for a:= 1 to Width do
begin
CBitmap[Number].Color:= FastGetPixel(tmpBitmap,a,i);
CBitmap[Number].X:= a;
CBitmap[Number].Y:= i;
Inc(Number);
end;
end;


procedure ChangeColor(Color: Integer);
var
R,G,B,ColorMark: Integer;
begin
ColorMark:= GetSystemTime;
ClickMouse(100,-9,True);
ClickMouse(97,5,True);
//Wait(150);
ClickMouse(586,453,True);
ColorToRGB(Color,R,G,B);
ClickMouse(888,413,True);
ClickMouse(888,413,True);
SendKeys(IntToStr(R));
ClickMouse(888,434,True);
ClickMouse(888,434,True);
SendKeys(IntToStr(G));
ClickMouse(888,457,True);
ClickMouse(888,457,True);
SendKeys(IntToStr(B));
ClickMouse(514,482,True);
WriteLn('Color changed to ' + IntToStr(Color) + ' in ' + IntToStr(GetSystemTime - ColorMark) + 'ms.');
end;

procedure DrawColor;
var
i,a: Integer;
begin
for i:= 0 to GetArrayLength(CBitmap) -1 do
begin
ChangeColor(CBitmap[i].Color);
ClickMouse(CBitmap[i].X+10,CBitmap[i].Y+10,True);
end;
end;

var
c: Integer;

begin
//SetupSRL;
ClearDebug;
ActivateClient;
SetBitmap;
GetColorsOnBitmap;
DrawColor;
end.

Here is the one I made a long time ago, I could update it and make it better.