sjesper Posted June 27, 2012 Share Posted June 27, 2012 (edited) Hello. I felt boring so i made this little function: [sCAR]program New; {$DEFINE RS2} {$DEFINE OSI_Color_Anti_Randoms} {$DEFINE SMART} {$I OSI\OSI.scar} procedure ScriptTerminate; begin FreeOSI; end; function CompareInvSlots(Slot_1, Slot_2, Tolerance: Integer): Boolean; var TBA: TBoxArray; Bmp: Integer; x, y: Integer; begin TBA[0] := GetItemBounds(Slot_1); TBA[1] := GetItemBounds(Slot_2); Bmp := BitmapFromString(35, 31, ''); CopyClientToBitmap(Bmp, TBA[0].X1, TBA[0].Y1, TBA[0].X2, TBA[0].Y2) Result := FindBitmapToleranceIn(Bmp, x, y, TBA[1].X1, TBA[1].Y1, TBA[1].X2, TBA[1].Y2, Tolerance); FreeBitmap(Bmp); end; begin SetUpOSI; writeln(CompareInvSlots(1, 0, 22)); end. [/sCAR] What it does is that it take a picture of 2 invslots and see if they are almost the same. If you need to compare teleporttabs or other items that are very identical then use a tolerance of ~ >18, but 22 works with the most items :-) Edited June 30, 2012 by sjesper Quote Link to comment Share on other sites More sharing options...
LordJashin Posted June 30, 2012 Share Posted June 30, 2012 The main problem with inventory items, is every once in a while they are Chopped up a little lol. Like for me Rune essence looks different sometimes (IDK why its weird). This is good might add it to the Inventory functions in GMRL's RS2 include. Quote Link to comment Share on other sites More sharing options...
sjesper Posted June 30, 2012 Author Share Posted June 30, 2012 The main problem with inventory items, is every once in a while they are Chopped up a little lol. Like for me Rune essence looks different sometimes (IDK why its weird). This is good might add it to the Inventory functions in GMRL's RS2 include. Meaby it would help to set the 35 * 31 bounds to something like 20 * 16. Is it only the outside of the rune essence that looks difrence something? Then this would help =) Quote Link to comment Share on other sites More sharing options...