Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program new;
- {$DEFINE SRL_USE_REMOTEINPUT}
- {$I SRL-T/osr.simba}
- function TRSInventory.CleanItemBitmap(slot: Int32): TMufasaBitmap;
- var
- bounds,area: TBox;
- x,y: Int32;
- tmp: TMufasaBitmap;
- shade,TPA,Black,Text1: TPointArray;
- ATPA: T2DPointArray;
- i: Int32;
- begin
- area := Self.GetSlotBox(slot);
- bounds := [area.x1-2,area.y1-1,area.x2+2,area.y2+1]; //36x34
- tmp.FromClient(bounds);
- tmp.FindColors(Black, 65536);
- tmp.FindColors(Text1, 65535); //add other text colors
- tmp.FindColors(shade, 3355443); //add other shade colors
- TPA += Black+Text1;
- TPA := TPA.Invert([0,0,tmp.GetHeight()-1,tmp.GetWidth()-1]);
- ATPA := NRSplitTPA(TPA, 1);
- for i:=High(ATPA) downto 0 do
- if Length(ATPA[i].Intersection(shade)) <> 0 then
- ATPA.Del(i,1);
- Result.Init();
- Result.SetSize(bounds.Width-1, bounds.Height-1);
- TPA := ATPA.Merge() + black;
- for i:=0 to High(TPA) do
- Result.SetPixel(TPA[i].x-2,TPA[i].y-1, tmp.GetPixel(TPA[i].x,TPA[i].y));
- end;
- var
- i: Int32;
- muf: TMufasaBitmap;
- begin
- for i:=0 to 27 do
- begin
- muf := Inventory.CleanItemBitmap(i);
- muf.Debug();
- Sleep(1000);
- end;
- muf.FromClient(Inventory.GetSlotBox(11));
- muf.Debug();
- Sleep(1000);
- WriteLn ItemFinder.CleanItemBitmap(muf);
- muf.Debug();
- Sleep(10000);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement