SRL Archive - Help and Support

bmp help


BraK

2006-03-13 06:31:11

if i take a screen shot and crop it down to just what it needs to click on. How do I change that bmp to string.

trying to make a set for a fletcher i'm working on.

cuz i need the knife, logs, and (u) bows. bows mainly to get the script to choose long or short. i could always use mouse movements, but these are detectable right??:confused:

Jagex_Fagex

2006-03-13 06:39:56

ok, to make bitmaps into strings, go to Script -> Picture to string, click open and locate the bitmap and hit ok, it is then a bunch of code like:

 35 := BitmapFromString(14, 16, 'z78DA3330183EC00D0910234E7F' + 
'332931CD8D4A60288621ADFD3E7862999E668E02CA010082F518F' +
'0');

BraK

2006-03-13 08:51:14

could you write that out you just confused the hell out of me. i got general idea but still kinda lost. :confused:

i could always whip something up using coordinates with the new SRL methods. kinda like my other script in the non SRL scripts area. but would like to try to make with bmp's

i just about always on msn messenger if someone could do a little bit of talking me through

The Un-Named

2006-03-13 09:44:16

Click Script and then Picture to string…:



Then click open, choose your bitmap then click ok in the "bitmap loader" box:


You should get somthing like this in the debug box:



Then put the name of the bitmap in your var section as bitmapname : integer and then somthing like "if(FindBitmap(bitmapname, x, y, 0, 0, 1023, 767))then".

BraK

2006-03-13 10:31:34

oooohhh me thinks its becoming clearer thanks *sticks sticky note to un-named's forehead:

+——————–+
|—–Thanks——-|
|——for-all——–|
|—-the–help—–|
|———————|
|——BraK—:D–|
|———————|
+——————–+

whats that saying about pics being worth a bunch of words:confused:

BraK

2006-03-13 11:48:44

program New;
{.include srl.scar}
var willowlongbow:integer;

procedure loadbmpx;
begin
willowlongbow := BitmapFromString(92, 80, 'z78DAED5DD98EEB2' +
'00CFDA5EA2AAAF26A1DF5FF7FE96A9AE9040A063B40CBE23E5855' +
'26CD621F8E17C0F3B8D16DBFDD6FFF6EB7DBE3F9FD90DBF348789' +
'C3B13CE1124AFE09E83E07C307FF52504E7B867CACF371997AEAD' +
'43CB6E62FC705676CF77EFA2C1092E21A45C1ABA5298919FF3106' +
'BF521BEFE6856C3C268C1207A5BCD4658E6ED60DEA4F17BB58EC7' +
'208800D3DF91BDDA4F14BC657FD51BAE5A20B085355BE304C5EF2' +
'B41179E283970526EF13EB3182CCC6C52AE905CE1C0C9EC683159' +
'8AB4184E7069C4D53A6EB25FCCF068497B5839A7A1D89F9AECC57' +
'FB96839AA6C1ACC5CC38FC9DE3247DDE87631B3FF62466E777904' +
'05CBA09B45AD2D227C08D1B24778269D03CAB90816097F1027B5B' +
'0842086D99EB342EF98F19113BF0289DEC510D23F4EA08A450FCC' +
'F868B9FF49595483C56C87A1E2136DAD35E541368F614E7967315' +
'3FE2EF8927D515C531A9D975005692FCC6C6F68F1336E5266DC98' +
'CE0B60529EBC523D73792694E4452C24F64D3D236756AF5A92434' +
'9F3EB032D1C66FC5C7B740EC1B0916ABB3B4A3CC5FB39FEDABCED' +
'4F923A82B28CA6379DC8FD0E545ECC8D648EEF56E19FBD269C621' +
'5621075B2CAF62BE7F2F2B6A2AFE69A19D7FBEC91550D363734C7' +
'0AC96B188BD5784F56B1D9C3957195B7FEE6B14AF92C83F99DD16' +
'398788CBAB1DE07DD47FB73CFEFF4831604118B7605A6CD2AD6E5' +
'B17EF496C2801FAB68D7F91BDBCC8DF6B8272A43C867306398FC6' +
'4BD85584FB4A96ABF23CEE39BD42284D899E8F8CE9192E8658EE8' +
'71AC2CAF7CA56B9E0D3667C5829E6146D48FC5D8D767EADD39687' +
'EA56E6B9BC2FC54C733E688A265F3E69DE55992C524B3EE8A8DD7' +
'FC7398E9279231C668F70C7966F03DD1B95E4EBF0BDBE20734AB8' +
'1F7D0D3E3DD13D1C5AC7CCD1E38DFAA27B46695FC7CE2C1323F68' +
'D9CC9B58D5C539026F86C8454B8D1E20267B8B76B4337AF16AFFB' +
'9F276B37DF18BA3EEE4106EFDEDE97D56D943615217DF9EEB1352' +
'DEC72AA5B3AEA291F3C0B903FA7B510A6C1477BF13F37DA73C093' +
'A2AD4E616E3A85AAB4D4AD60648FAFCBC77E118B9BBA9F14F79A6' +
'93EBF3939F31346CACB976E5BD3F2179FD7C2CEB31BEE27A6E735' +
'18AAD8D5CB9421BEF91EBA345BBCBDBBCD5E8BB4BF2D7DCD93E84' +
'D7BB76D4E89768B24794CABB0EEA59CB7CD03CF22E621528B1617' +
'69F33AAD923B9CFB59A8FC5B4AB791F5CC8B8F5E832FD8FC527A1' +
'F721F33526990C886395925E97B3FED7837573739F55EE0256C16' +
'2B5CA75E7BB4980963DF3FFAAD0205336396ACF84BD61DF7593B3' +
'EE249AC30719FB7D72C75339C211F46C5FD976B0A7356976FC784' +
'F8CFCD568AADE9830AC56EC7CC8C9E3933ED2B386DDCF3A7C187E' +
'6AA1F18743683BF632B99FE3F888DAE610FE3A8E2497CE860D99E' +
'D7061DC8DC924233D67DDF77547F46BD4CB35239D6392A0627C9C' +
'60B22C29E4C6B48D341684308E75AF49EC5DA08C7BDBF60DF69F1' +
'0C5D5AD315691A5BD0092B6ABE5CD256894444DDAABE922AB1ADA' +
'90BF05F7913380C4CBEB3C4EEE88446FF277E7BC9EEBFB4A6CDDD' +
'ABB85BFCDD72171E37CBA6E6C42C8F967DF83BAD901E705203A0E' +
'95054F54F8C88CC54888DE5DFEB49FC18916ABE97111EA8AF7CB8' +
'85A90C47791A08218CD93927FAE8E747F9485CFF0D24F5E93FCBB' +
'C87DAB3CAF4FE7BC1A6442A5C3D0E224D0B01C27943C420934E6B' +
'024B12092BC94C2C9FE3B17AED3A42607FF169FE8B85773772D6B' +
'95E6C8B9115A8293D07621F6D2F5AB124B51D52A9326DA4CBD854' +
'457248E37F8E7C105BFC3DD9DFBA4F1C33D3F3177D4FAC7F46F49' +
'C096735444AF719DC457CAAF4C0D744805B69BD59AF4F1FA30C75' +
'DF4A5A7FD96966849CCA4A3024A4608F2514995BC439FFAA46566' +
'5ED2D11709E249D3E7AC5E469E89A4FD4E89DF6FF75EFF0151CD1' +
'B86');
end;

begin
setupsrl;
loadbmpx;
if(FindBitmap(willowlongbow, x, y, 0, 0, 1023, 767))then
begin
writeln('bam');
end.


need a lil bit more help trying to test bmps but can't get it to work:confused:

The Un-Named

2006-03-13 12:19:00

You need to crop the image to only show what you need.

For example, this picture of scar could be this . (A part of the icon.)

On loading the bitmap, use this: "if(FindBitmap(willowlongbow, x, y))then", sorry my mistake on the first. You can use if(FindBitmapIn(willowlongbow, x, y, x1, y1, x2, y2)) to find the bitmap in the spesified coords.

You don't need the loadbitmapx in the main procedure, you don't need it anywhere. You just need the bitmap in a procedure because scar will load it anyway, if it's in the main procedure, scar will use it as a command. Also, you got 2 begin's but 1 end in the main procedure.

begin
setupsrl;
if(FindBitmap(willowlongbow, x, y))then
begin
writeln('bam');
end;
end.

BraK

2006-03-13 13:00:07

You need to crop the image to only show what you need.

For example, this picture of scar could be this . (A part of the icon.)


most are 6 x 6 bit right??
what bmp should it be used as 16 bit, 24 bit, or 256 bit??? I think 24 bit look the most like the original pic

x,y,x1,y1,x2,x2 six coordinates??

i was trying to figure out what was going on with it being so long lol guess i still got a bit to learn about the bmps proceds.

you wanna another sticky note:D

The Un-Named

2006-03-14 05:47:45

if(FindBitmapIn(Bitmap, x, y, x1, y1, x2, y2))then

All it dose is search for the bitmap, if it finds it x and y are the coords it is at, x1, y1, x2, y2 is the box it is in:

x1——-y1
—-bit—–
—-map—
x2——-y2

It will search for the bitmap in that box, if it finds it the coords are stored in x, y. Just crop the bitmap, too small and it could find somthing else being mistaken, too big and it won't find it.

Example, this willow longbow: could be . As scar dosen't search for black, it should just search for the bow. I'm not fully tutored on bitmaps but this should work.

BraK

2006-03-14 05:48:07

the six coordinates is still bugging me but i got the bitmap down to 8 x 7 and i'm pretty sure that i need 24 bit

but as far as how to get it to click on the bitmap i'm still at a loss. Was kinda hoping someone had a smelter up that used bitmaps but alas no good.

EDIT: so anything that is not the bows i should black out ??? hmmm


so could i change it to like

if(findbitmapin(willowshort,a,b,123,245,125,354)) then

after this i could put something like

begin
movemousesmooth(a,b)
wait(random(300)+150)
holdmouse(a,b,false)
wait(random(20)+15)
releasemouse(a,b,false)
end;

Jagex_Fagex

2006-03-14 06:18:49

look at my bitmap tutorial in the tut plce, might be some help?

The Un-Named

2006-03-14 07:18:31


EDIT: so anything that is not the bows i should black out ??? hmmm


so could i change it to like

if(findbitmapin(willowshort,a,b,123,245,125,354)) then

after this i could put something like

begin
movemousesmooth(a,b)
wait(random(300)+150)
holdmouse(a,b,false)
wait(random(20)+15)
releasemouse(a,b,false)
end;


You could do this:

if(FindBitmap(willowshort, a, b))then
begin
MoveMouseSmooth(a, b)
Wait(150+random(300))
HoldMouse(a, b, false)
wait(15+random(20))
ReleaseMouse(a, b, false)
end;

BraK

2006-03-14 09:47:19

i kinda figured i had something wrong in there somewhere. guess movemovents are still my strong suit. thank for the help again here another sticky note:D

+——————–+
|—–Thanks——-|
|——for-all——–|
|—-the–help—–|
|———————|
|——BraK—:D–|
|———————|
+——————–+

so would it be better to put it as

if(findbitmapin(willowshort,x,y,x1,y1,x2,y2)) then

or

if(FindBitmap(willowshort, a, b))then

The Un-Named

2006-03-14 12:32:57

It dosen't matter, FindBitmapIn searches for a bitmap in the spesified area, example you can use it to find the flag in the minimap, where as FindBitmap would search the whole screen.

Wizzup?

2006-03-14 15:12:32

The standards are Low-Detail, 32 Bits. (Since everyone will be using this, it might be a idea to stick to these standards.) :p

I bet you know how to use crop in photoshop, so that shouldn't be a problem, also, try to keep the bitmaps within 8 x 8 , otherwhise RuneScape will start laggin'.

Choose your BitMaps wisely, also, you could use DTM's for Inventory Items, since they don't Rotate. :D


Wizzup?

The Un-Named

2006-03-14 16:11:25

I prefer DTM's for most things, map walking and item clicking, because they take up less space than a bmp, but bmp's can be more acurate.

BraK

2006-03-14 19:52:01

but the hard thing is findind a way to get my comp to make it into 32 bit

BraK

2006-03-14 21:02:52

tell me how this looks to you people

program New;
{.include srl.scar}

var
willowshort,az,ax : integer

procedure declarebmp;
begin
willowshort := BitmapFromString(10, 10, 'z78DAB5904B6E8' +
'4310883AF4480606719F2B8FF91CA7457E9AF66BA28AB28C2F687' +
'45FE36A393B678D8AC7FAEE242FAE4A6980F272C3F5161A1690E6' +
'1B7CB89AC5C41337D4328385D38708CB8703D58B1F5BC2104B609' +
'15D464C734AD9F658E1DD3FD5755F1B833AB0D2F55EA6114A7819' +
'5F8A31FB278A41A30EBB52F96748C5235B8ADE2549B88086F0F29' +
'2F7F2BE755FE2FB6FECD56C490BA71C5AD77467A3C74987175D76' +
'6D35B0EE3C9FF3FE60B16E07853');

end;

procedure startfletch;
begin
if(findbitmap(willowshort,az,ax)then
begin
movemousesmooth(az,ax);
wait(100+random(200));
holdmouse(az,ax,false);
wait(15+random(20));
releasemouse(az,ax,false);
end;
end;
end;

begin
setupsrl;
declarebmp;
startfletch;
end.


EDIT: ok here's the error i get for it

Line 22: [Error] (9022:33): Close round expected in script


begin
if(findbitmap(willowshort,az,ax)then
begin

right after the ax before the ) is the error supposedly

devilion

2006-03-15 01:37:57

i dont have the time to check every bmp

Jagex_Fagex

2006-03-15 02:09:43

yep, what you need to do is add ) after ax, there needs to be a closing for all opening brackets, so it should look like this
  if(findbitmap(willowshort,az,ax))then

see there is the opening before find, then another opening before willow, that means you need to closes :)

BraK

2006-03-15 05:22:16

From: jagex_fagex
yep, what you need to do is add ) after ax, there needs to be a closing for all opening brackets, so it should look like this
  if(findbitmap(willowshort,az,ax))then

see there is the opening before find, then another opening before willow, that means you need to closes :)



:eek: man i'm dumb:o can't believe i missed that.

you get a sticky note *sticks sticky note to jagex_fagex head*:D


EDIT: Alright i fixed all the programming errors it compiles but still goes ca-put. guess i still need to work on the bitmap a little more.



+——————–+
|—–Thanks——-|
|——for-all——–|
|—-the–help—–|
|———————|
|——BraK—:D–|
|———————|
+——————–+

maxzzz

2006-03-16 11:58:52

That's true. The x and y are just remembered by scar and you can use them by just leave it x, y in the procedure/function and then type Mouse(x, y, true);. It would move the mouse to the stored x, y.

It's the as you do this:

program New;

procedure MoveMouseToPosRand;
var
x, y : Integer;
begin
ItemCoords(2);
GetMousePos(x, y);
MMouse(x, y, 10, 10);
Mouse(x, y, true);
end;

begin
MoveMouseToPosRand;
end.

It stores the x, y value (that is returned by ItemCoords and GetMousePos and later stored by MMouse, and finally it clicks at x, y with a random of 10) lol.