SRL Archive - Help and Support

stuck!


new girl69

2006-06-02 04:15:38

I just started scripting tonight. I am just writing a script to find the 'runescape client' and rename it to whatever…
I am getting stuck on what to do after it finds the bmp of the little sword icon.
Here I declare the var sword as the bmp…


procedure findfile;

var sword;
begin
sword := BitmapFromString(15, 13, 'z78DA9D94D10E802008457F8' +
'98DC6C6B3FFFF4F45E44003D2AE9BF56007BCDC05B02ABC05872C' +
'7DA7447A66097A9F2442AC8921B3ACE27911DBEE327F05D01A5FC' +
'A2AFEBBBBD6D49D39E2C7CCA86FE971263377F2C8B76E65374706' +
'DAE156E2A4913B1FD1A6864E1BD30FF8E6CF7CCF7D294158444A9' +
'667E6FF1EB3FBE9935BCFB762FA84CC1E7ABED66D4D12FA4E4296' +
'BAE75C994C753C4ED8D7DF60A387059D71A9E6E3');
Color := 3368550;


Now I can't figure out the FindBitmap part.



procedure findfile;

var sword;
begin
sword := BitmapFromString(15, 13, 'z78DA9D94D10E802008457F8' +
'98DC6C6B3FFFF4F45E44003D2AE9BF56007BCDC05B02ABC05872C' +
'7DA7447A66097A9F2442AC8921B3ACE27911DBEE327F05D01A5FC' +
'A2AFEBBBBD6D49D39E2C7CCA86FE971263377F2C8B76E65374706' +
'DAE156E2A4913B1FD1A6864E1BD30FF8E6CF7CCF7D294158444A9' +
'667E6FF1EB3FBE9935BCFB762FA84CC1E7ABED66D4D12FA4E4296' +
'BAE75C994C753C4ED8D7DF60A387059D71A9E6E3');
Color := 3368550;
If (FindBitmap(bitmap: Integer; var x, y: Integer):


Obviously I want the script to find the bitmap, then move the mouse to a random place on the bitmap (randomosity is obviously useless for now, but will be helpful when I make a rs script)
I also wasnt sure if using symbol procedures would be more appropriate?

solemn wishes

2006-06-02 09:46:44

maybe i will eb able to help you out :)

ok the bitmap globals are

if(findbitmap(resulting cord x, resulting cord y, bitmap, cord1x, cord1y, cord2x, cord2y))

the resulting cords are most commonly known as x and y, but they can be any var specified for example's sake if you have a var called x1 and a var called y1 and you put…

if(findbitmap(x,y, bitmap, 5, 5, 315, 555))then

the resulting cords where the bitmap was found would be under you var x and var, so to move the mosue to this bitmap you would put.


Mouse(x,y,5,5,true)

Or whatever vars you specified in the bitmap finding. Just incase you dont know the 4 numbers after the bitmap is the area that you want to search in.

Also just incase you dont know ill explain how to use the mouse; function.

Mouse(x,y,5,5,true) bassicly tells scar to move the mouse to the x and y cords with a random x offset of 5 and a random y offset of 5, and you want to click it true which means left click not right. If the vars do not have any value then scar will move the mouse to the value of all vars which is 0.

I hope this helps you :) and if i went a bit off topic sry.

p.s i reccoment using tolerance in that bitmap….example??
if(findbitmapspiraltolerance(x,y,bitmap,x1,y1,x2,y2,tolerance))then

new girl69

2006-06-02 14:28:36

ohhhh haha ok thanks, that helped so much!

Is -findbitmapspiraltolerance- to pick up the bitmap even if the colors change a bit?

and the 315, 555 parts in
if(findbitmap(x,y, bitmap, 5, 5, 315, 555))then

are cord2x and 2y, but what do those do?
And "tolerance" in
if(findbitmapspiraltolerance(x,y,bitmap,x1,y1,x2,y2,tolerance))then

is a numeric value depending on what? Hmm, what I think I'm really trying to say is…does it work out to be a percent?

Thanks again!
~Sal

realrune

2006-06-02 14:36:55

From: new girl69
ohhhh haha ok thanks, that helped so much!

Is -findbitmapspiraltolerance- to pick up the bitmap even if the colors change a bit?

and the 315, 555 parts in

are cord2x and 2y, but what do those do?

Thanks again!
~Sal


Yep, findbitmapspiraltolerance will find it if the colors change. It works like this…

if(findbitmapspiraltolerance(resulting cord x, resulting cord y, bitmap, cord1x, cord1y, cord2x, cord2y, bitmap tolerance))

The bitmap tolerance is how much the colors can change and still have it find the bitmap.

new girl69

2006-06-02 14:56:33

ok great, i didnt get the cord2x etc. part, but i watched a vid tut on dtms just now and i realized my stupidity.
Just says where on the 'window' to look for the bmp or dtm or whichever.

Thanks you very much. Moving on!
~Sal

solemn wishes

2006-06-05 03:15:31

From: new girl69
ok great, i didnt get the cord2x etc. part, but i watched a vid tut on dtms just now and i realized my stupidity.
Just says where on the 'window' to look for the bmp or dtm or whichever.

Thanks you very much. Moving on!
~Sal


yes it is the area that you would like to searh in, mostly top right di your x1cord and y1xord and the bottom left hand corner is you x2cord and y2cord :)

phantombmx

2006-06-07 03:33:35

god solemn you noob :p top left is x1, y1.. bottom right is x2, y2..

also FindBitmap(bitmap, x, y).. the one you were thinkin of is FindBitmapIn(bitmap, x, y, x1, y1, x2, y2)
;)