SRL Archive - Test corner

Cooking Procedure - Use Range


Jagex_Fagex

2006-04-14 20:18:59

Hey, I dunno if the devs have made this for version 1, but here is my thing, could possibly be made shorter,but anyway, it works for me, here ya go, Just finds and uses range,

i need some more testing on it please, btw
Procedure UsePot(bitmap, ammount:Integer);
you need to get the bitmap yourself and it is the item you are cooking, in your inventory, thanks.



{.Include SRL\SRL.scar}

var a, b, raw, cookx, rangetop: Integer;

Procedure LoadCookBitmaps;
begin
raw := BitmapFromString(31, 10, 'z78DABD95510E80200C43AFA42' +
'644F8DCEE7F2813E2C708143A40FD688C1BF82C5DD424219EBA4B' +
'45348AEEDD73410F70FD4A72A5748742695AD433F0DFEAC7E4354' +
'F9FB051E599090F99CE396F61D54B6EA9D0BD9361322D2B49A053' +
'DDCFB6373FD4A4649EC1CE8679CEA5FE570CCEC212023F1967E03' +
'4F124B99F77A0F01CE4B9AEC227CE3FC8BBCAF610FCF6ED050998' +
'BBC6C9A2B5591F6E7F98B8');

cookx := BitmapFromString(46, 8, 'z78DA33301805C402370C30B0' +
'6EA0AE09A49A8CA97EA042663084C9C0A60ADAB9C70D07A0A71B4' +
'6C384541B89574FDD5C4CB9EF68915B2911A75668D03A9D60AA37' +
'753135313127DEEFC4ABA756494B8C6900DD40CAC2');

rangetop := BitmapFromString(10, 9, 'z78DA7DD04B12C4200804D' +
'02BD1908CB254A3F73FD230E0C294C948D55BA88D1F1AD4A92323' +
'59B9C27CF11572E76AF5224E1C56614341914388FBF46F87D83F1' +
'DA8A8B7ECD261F7968D7393C06A75CF7ACF35D54C6A2D23531395' +
'DF08F79BB8B173B5100ED2709EFB96FD78CAD5134CBABAFE7FA8C' +
'D57DD5C014ABB0F29D8BCAA7AD68D97A6418352B8A7727AEEFF05' +
'690C738F');
end;

Function FindRange:boolean;
begin
if(FindSymbol(a, b, 'cook'))then
result:=true;
Mouse(a, b, 3, 3, true);
end;

Procedure UsePot(bitmap, ammount:Integer);
begin
if(FindRange)then
begin
if(FindBitmapToleranceIn(RangeTop, x, y, MSX1, MSY1, MSX2, MSY2, 3))then
begin
GetMousePos(a, b);
if(FindBitmapToleranceIn(bitmap, x, y, 661, 376, 879, 706, 3))then
begin
wait(50+random(100))
Mouse(x, y, 2, 2, true);
wait(150+random(100))
Mouse(a, b, 2, 2, true);
repeat
wait(50+random(100))
until(FindBitmapToleranceIn(raw, x, y, 126, 550, 630, 671, 2))
end;
GetMousePos(x, y)
Mouse(x, y, 1, 5, false)
repeat
wait(50+random(100))
until(FindBitmapToleranceIn(cookx, x, y, 126, 550, 630, 671, 2))
GetMousePos(x, y)
Mouse(x, y, 1, 1, true);
wait(50+random(100))
TypeSend(InttoStr(ammount))
end;
end;

post Suggestions, flaws, errors, pretty much whatever

Wizzup?

2006-04-15 03:06:59

Cool, but try using bitmaps ( 8 x 8 )

But nice work.:)

Jagex_Fagex

2006-04-15 03:27:11

lol, yup, ill try it, i just made it fairly quick, im going to improve it ;) or some1 else can