Eat Food
- Have food in your inventory
- Take a screenshot (Print screen, Prt Scr)
- In SCAR top menu, go to Tools -> Picture to String
- Hit the 'Paste' button. Search your food there, and select the area you want to be searched. Take only a small area to save memory and prevent lag
- Hit OK
- Look at SCAR debug box. Its full of strange code. It is the bitmap we just took in a text format. Now we have the bitmap to look for, lets do the procedure!
SCAR Code:
procedure EatFood;
var
FoodBMP: integer; // Declare a variable for the food. Must be integer!
x, y: integer; // We need these too
begin
// Copy this from Debug box
FoodBMP := BitmapFromString(12, 10, 'beNoBaAGX/jg0e2lbeWNWf' +
'2pZeWRTfGlabl5OY1hGWVE+ZFlHZVpIXFBAUEQ0eGhZemdZd2RTcF' +
'tKaVhIdGRUbmFQbGFPbWJQZltJW1A+UEQ0d2FWf2NYgmRZjG5jdVt' +
'KfmlWc2dRdGlVaVxLc2ZWZVhIVUg4eWJUknZqfWBQhmtagmhZgWxb' +
'ZFQ9Z1tFYVZAHxcEMicVRzstzKadv5SNjmZcd1FGf11TdVdMalVCb' +
'FtJZllIXVFBXU9CW01ArIZ9vpOMzKCXzaKZvJaLclJFdlxLb1xLYV' +
'FCYVNGXU9EWEo/tIeCr356w5CMk2JdkmdgtpGIeFpPYko+aFdNXU9' +
'GZ1lQV0lArYJ8vo2JqXhzu4qFjF9ZkWtiqYl+d1xRY1FDZlVLUUU5' +
'XlFJrIeBoXVyrIB9q398tI2IsZCJrpOMlYF6WklBWElCXE9HSz42r' +
'ISCrYGAq3+ApHh5qoF/soyLooWBZ05KWUdDV0hDTEE9Q/bVkzs=');
GameTab(tab_Inv); // Obviously go to inventory tab
wait(100+random(20)); // Wait, just in case of a lagspike
// It will search FoodBMP in area [MIX1, MIY1, MIX2, MIY2] with bitmaptolerance of 20.
// If found, it will save the cords to x, y. Tolerance 20 is ok, don't care about that. :)
if FindBitmapToleranceIn(FoodBMP, x, y, MIX1, MIY1, MIX2, MIY2, 20) then
begin
Mouse(x, y, 2, 2, true); // leftclick food
writeln('Ate food successfully!');
wait(1500+random(200));
end;
FreeBitmap(FoodBMP); // Remember to free your bitmaps, or they consume your RAM!
end;
EDIT: Sorry guys, i forgot FreeBitmap lawl how did i get the scripters cup