SRL Archive - General

MSI TItem Record Generator!


Naum

2009-11-04 03:46:28

Hey, been working on this script for quite a while now.

NOTE: TO RUN THIS YOU NEED THE DTMLib PLUGIN THAT NIELSIE MADE: http://www.villavu.com/forum/showthread.php?t=36864

This grabs the info of a certain inventory slot specified by 'Inventory_Slot' and creates a TItem record out of it, for example:

With Broken_shield Do     
Begin
Name := 'Broken Shield';
UpText := ['oken shi'];
ItemP := Point(0, 0);
Colors := [7894130, 8354938, 9209990, 8025716, 8881025, 9670541];
Stackable := False;
DTM := DTMFromString('78DA6374626260D8C3C8800C020263194480344C94D101A86617AA9A'+
'B2BC5454354E986AAA8A3231CD41B3ABBA380B558D0B50CD3E54359E9E219876A1A9F1F78F46510300F5010D5C');

Bitmap := BitmapFromString(7, 7, 'beNpzD3K2NmRgYKwuzirKSoIgX99IoEhZXmpFQXpVUWZ'+
'AYGxQUHxGajKQDVQGRP7+0UBBIAIyICJABBcBIqBeCIIIQhDcfIgaT88QIIKwIYLu7kEgBADkkjPS');
End;

This would save us manually doing it :).

Big hand goes to the awesome, brilliant, leet Nielsie95, as without his help I wouldn't have got the DTM record part done. Also creds to Marpis (for the original idea) and RM.


Current Bugs:

  • The blacklist array mightn't be up to date. If not just post on this thread the colors you got and i'll add it in ;)
  • It uses a lot of filtration on the item, so only a few colors might be found.
  • This is very crude and basic. Just really gets the needed job done. Might spice up the GUI and code a bit later :).
  • The DTM and Bitmap might not be accurate as it uses the Middle of the Inventory slot to create it from. Creates a box of (7x7) and (5x5) for Bitmap and DTM respectively :).
  • Might not get the uptext or names of some items, as the UpText is mucked up :/
  • Other stuffs.




The script:

program ItemInfoGen;
{.Include SRL/SRL.Scar}
{.Include SRL/SRL/Misc/Debug.Scar}

Const Inventory_Slot = 25; //InvSlot to create the TItem from.

Var TmpStr, TmpStr2, TmpStr3 : TStringArray;
TempBool : Boolean;
TSA : Array [0..1] Of String;

Function GetDiverseColors(Var Stackable : Boolean) : String;
Var I, II : Integer;
TPA : TPointArray;
Box : TBox;
TIA : TIntegerArray;
Freq : Extended;
TB : TBox;
Result2 : TIntegerArray;
Begin
Box := InvBox(Inventory_Slot);
FindColorsTolerance(TPA, 3424328, Box.x1, Box.y1, Box.x2, Box.y2, 40);
TPA := ReturnPointsNotInTPA(TPA, Box);
TIA := GetColors(TPA);
ClearSameIntegersAndTPA(TIA, TPA);
//WriteLn(Length(TPA));

If InIntArrayEx(TIA, I, 2105392) Then //THE BLACK LIST
DeleteValueInIntArray(TIA, I);
If InIntArrayEx(TIA, I, 65535) Then //ARRAY
Begin
DeleteValueInIntArray(TIA, I);
TempBool := True;
Stackable := True;
End;
If InIntArrayEx(TIA, I, 65536) Then //COLORS WHICH MUCK UP!
DeleteValueInIntArray(TIA, I);

Try
TB := GetTPABounds(TPA);
Freq := (Length(TPA) / ((TB.x2 - TB.x1) * (TB.y2 - TB.y1) * 1.0)) + 0.1;
Except
Result := '[NONE FOUND!]';
Exit;
End;
If Freq < 0.12 Then
WriteLn('Small Area and small colors (un-reliable)');

SetLength(Result2, 6);
Try
For II := 0 To 5 Do
Result2[II] := TIA[II];
Except End;
//ClearSameIntegers(Result2);

Result := '['+IntToStr(Result2[0])+', '+IntToStr(Result2[1])+', '+
''+IntToStr(Result2[2])+', '+IntToStr(Result2[3])+', '+
''+IntToStr(Result2[4])+', '+IntToStr(Result2[5])+'];';
End;


Function GetTextProperties : Array [0..1] Of String; //[0] := name, [1] := uptext
Var Slot : TBox;
TxtOpt : TStringArray;
I : Integer;
Begin
TxtOpt := ['Use', 'Wear', 'Wield'];
Slot := InvBox(Inventory_Slot);
MouseBox(Slot.x1, Slot.y1, Slot.x2, Slot.y2, 3);

For I := 0 To High(TxtOpt) Do
If WaitUpText(TxtOpt[I], 900) Then
Result[0] := Trim(Between(TxtOpt[I], ' /', GetUpText));

//WriteLn(Result[0]);

If Length(Result[0]) < 5 Then
Result[1] := Copy(Result[0], 2, High(Result[0]))
Else
If InRange(Length(Result[0]), 5, 8) Then
Result[1] := Copy(Result[0], 2, 4)
Else
Result[1] := Copy(Result[0], 3, 8);

//WriteLn(Result[1]);
End;


Function BoxMiddle(Box : TBox) : TPoint;
Begin
Result := Point((Box.x1 + Box.x2) Shr 1, (Box.y1 + Box.y2) Shr 1);
End;


Function CreateBitmap : Array [0..1] Of String;
Var TP : TPoint;
TempBmp : Integer;
BMPStr : String;
Begin
TP := BoxMiddle(InvBox(Inventory_Slot));
CopyClientToBitmap(TempBMP, TP.x - 3, TP.y - 3, TP.x + 3, TP.y + 3);
BMPStr := BitmapToString(TempBMP);
If Length(BMPStr) > 44 Then
Begin
TSA[0] := Copy(BMPStr, 1, 44);
TSA[1] := Copy(BMPStr, 45, Length(BMPStr));
End;
Result[0] := 'BitmapFromString(7, 7, '''+TSA[0]+'''+';
Result[1] := TSA[1]+''');';
End;

Function CreateTheDTM : Array [0..1] Of String;
Var DDTM : TDDTMArray;
Color : Integer;
TP : TPoint;
Begin
SetLength(DDTM, 6);

TP := BoxMiddle(InvBox(Inventory_Slot));
Color := GetColor(TP.x, TP.y);

DDTM[0].x := TP.x;
DDTM[0].y := TP.y;
DDTM[0].AreaSize := 0;
DDTM[0].AreaShape := 0;
DDTM[0].Color := Color;
DDTM[0].Tolerance := 20;

Color := GetColor(TP.x - 2, TP.y - 2);

DDTM[1].x := TP.x - 2;
DDTM[1].y := TP.y - 2;
DDTM[1].AreaSize := 0;
DDTM[1].AreaShape := 0;
DDTM[1].Color := Color;
DDTM[1].Tolerance := 20;

Color := GetColor(TP.x, TP.y - 2);

DDTM[2].x := TP.x;
DDTM[2].y := Tp.y - 2;
DDTM[2].AreaSize := 0;
DDTM[2].AreaShape := 0;
DDTM[2].Color := Color;
DDTM[2].Tolerance := 20;

Color := GetColor(TP.x - 2, TP.y);

DDTM[3].x := TP.x - 2;
DDTM[3].y := Tp.y;
DDTM[3].AreaSize := 0;
DDTM[3].AreaShape := 0;
DDTM[3].Color := Color;
DDTM[3].Tolerance := 20;

Color := GetColor(TP.x + 2, TP.y + 2);

DDTM[4].x := TP.x + 2;
DDTM[4].y := Tp.y + 2;
DDTM[4].AreaSize := 0;
DDTM[4].AreaShape := 0;
DDTM[4].Color := Color;
DDTM[4].Tolerance := 20;

Color := GetColor(TP.x, TP.y + 2);

DDTM[5].x := TP.x;
DDTM[5].y := Tp.y + 2;
DDTM[5].AreaSize := 0;
DDTM[5].AreaShape := 0;
DDTM[5].Color := Color;
DDTM[5].Tolerance := 20;

Result[0] := DDTMtoDTM(DDTM);

If Length(Result[0]) > 44 Then
Begin
TSA[0] := Copy(Result[0], 1, 56);
TSA[1] := Copy(Result[0], 57, Length(Result[0]));
End;
Result[0] := 'DTMFromString('''+TSA[0]+'''+';
Result[1] := TSA[1]+''');';
End;


Begin
SetupSRL;
ClearDebug;
TmpStr2 := CreateBitmap;
wait(200);
TmpStr := GetTextProperties;
TmpStr3 := CreateTheDTM;
WriteLn('With '+Replace(TmpStr[0], ' ', '_')+' Do ');
WriteLn('Begin ');
WriteLn(' Name := '''+Capitalize(TmpStr[0])+''';');

WriteLn(' UpText := ['''+TmpStr[1]+'''];');

WriteLn(' ItemP := Point(0, 0); ');

WriteLn(' Colors := '+GetDiverseColors(TempBool));

WriteLn(' Stackable := '+BoolToStr(TempBool)+';');

WriteLn(' DTM := '+TmpStr3[0]);
WriteLn(' '''+TmpStr3[1]);
WriteLn('');
WriteLn(' Bitmap := '+TmpStr2[0]);
WriteLn(' '''+TmpStr2[1]);

WriteLn('End;');
End.
:cartman:


EDIT: Looping version for sexy Marpis:

program ItemInfoGen;
{.Include SRL/SRL.Scar}
{.Include SRL/SRL/Misc/Debug.Scar}

Const Inventory_Slot = 1; //inv slot to start the loop from

Var TmpStr, TmpStr2, TmpStr3 : TStringArray;
TempBool : Boolean;
TSA : Array [0..1] Of String;

Var InvSlot : Byte;

Function GetDiverseColors(Var Stackable : Boolean) : String;
Var I, II : Integer;
TPA : TPointArray;
Box : TBox;
TIA : TIntegerArray;
Freq : Extended;
TB : TBox;
Result2 : TIntegerArray;
Begin
Box := InvBox(InvSlot);
FindColorsTolerance(TPA, 3424328, Box.x1, Box.y1, Box.x2, Box.y2, 40);
TPA := ReturnPointsNotInTPA(TPA, Box);
TIA := GetColors(TPA);
ClearSameIntegersAndTPA(TIA, TPA);
//WriteLn(Length(TPA));

If InIntArrayEx(TIA, I, 2105392) Then //THE BLACK LIST
DeleteValueInIntArray(TIA, I);
If InIntArrayEx(TIA, I, 65535) Then //ARRAY
Begin
DeleteValueInIntArray(TIA, I);
TempBool := True;
Stackable := True;
End;
If InIntArrayEx(TIA, I, 65536) Then //COLORS WHICH MUCK UP!
DeleteValueInIntArray(TIA, I);

Try
TB := GetTPABounds(TPA);
Freq := (Length(TPA) / ((TB.x2 - TB.x1) * (TB.y2 - TB.y1) * 1.0)) + 0.1;
Except
Result := '[NONE FOUND!]';
Exit;
End;
If Freq < 0.12 Then
WriteLn('Small Area and small colors (un-reliable)');

SetLength(Result2, 6);
Try
For II := 0 To 5 Do
Result2[II] := TIA[II];
Except End;
//ClearSameIntegers(Result2);

Result := '['+IntToStr(Result2[0])+', '+IntToStr(Result2[1])+', '+
''+IntToStr(Result2[2])+', '+IntToStr(Result2[3])+', '+
''+IntToStr(Result2[4])+', '+IntToStr(Result2[5])+'];';
End;


Function GetTextProperties : Array [0..1] Of String; //[0] := name, [1] := uptext
Var Slot : TBox;
TxtOpt : TStringArray;
I : Integer;
Begin
TxtOpt := ['Use', 'Wear', 'Wield'];
Slot := InvBox(InvSlot);
MouseBox(Slot.x1, Slot.y1, Slot.x2, Slot.y2, 3);

For I := 0 To High(TxtOpt) Do
If WaitUpText(TxtOpt[I], 900) Then
Result[0] := Trim(Between(TxtOpt[I], ' /', GetUpText));

//WriteLn(Result[0]);

If Length(Result[0]) < 5 Then
Result[1] := Copy(Result[0], 2, High(Result[0]))
Else
If InRange(Length(Result[0]), 5, 8) Then
Result[1] := Copy(Result[0], 2, 4)
Else
Result[1] := Copy(Result[0], 3, 8);

//WriteLn(Result[1]);
End;


Function BoxMiddle(Box : TBox) : TPoint;
Begin
Result := Point((Box.x1 + Box.x2) Shr 1, (Box.y1 + Box.y2) Shr 1);
End;


Function CreateBitmap : Array [0..1] Of String;
Var TP : TPoint;
TempBmp : Integer;
BMPStr : String;
Begin
TP := BoxMiddle(InvBox(InvSlot));
CopyClientToBitmap(TempBMP, TP.x - 3, TP.y - 3, TP.x + 3, TP.y + 3);
BMPStr := BitmapToString(TempBMP);
If Length(BMPStr) > 44 Then
Begin
TSA[0] := Copy(BMPStr, 1, 44);
TSA[1] := Copy(BMPStr, 45, Length(BMPStr));
End;
Result[0] := 'BitmapFromString(7, 7, '''+TSA[0]+'''+';
Result[1] := TSA[1]+''');';
End;

Function CreateTheDTM : Array [0..1] Of String;
Var DDTM : TDDTMArray;
Color : Integer;
TP : TPoint;
Begin
SetLength(DDTM, 6);

TP := BoxMiddle(InvBox(InvSlot));
Color := GetColor(TP.x, TP.y);

DDTM[0].x := TP.x;
DDTM[0].y := TP.y;
DDTM[0].AreaSize := 0;
DDTM[0].AreaShape := 0;
DDTM[0].Color := Color;
DDTM[0].Tolerance := 20;

Color := GetColor(TP.x - 2, TP.y - 2);

DDTM[1].x := TP.x - 2;
DDTM[1].y := TP.y - 2;
DDTM[1].AreaSize := 0;
DDTM[1].AreaShape := 0;
DDTM[1].Color := Color;
DDTM[1].Tolerance := 20;

Color := GetColor(TP.x, TP.y - 2);

DDTM[2].x := TP.x;
DDTM[2].y := Tp.y - 2;
DDTM[2].AreaSize := 0;
DDTM[2].AreaShape := 0;
DDTM[2].Color := Color;
DDTM[2].Tolerance := 20;

Color := GetColor(TP.x - 2, TP.y);

DDTM[3].x := TP.x - 2;
DDTM[3].y := Tp.y;
DDTM[3].AreaSize := 0;
DDTM[3].AreaShape := 0;
DDTM[3].Color := Color;
DDTM[3].Tolerance := 20;

Color := GetColor(TP.x + 2, TP.y + 2);

DDTM[4].x := TP.x + 2;
DDTM[4].y := Tp.y + 2;
DDTM[4].AreaSize := 0;
DDTM[4].AreaShape := 0;
DDTM[4].Color := Color;
DDTM[4].Tolerance := 20;

Color := GetColor(TP.x, TP.y + 2);

DDTM[5].x := TP.x;
DDTM[5].y := Tp.y + 2;
DDTM[5].AreaSize := 0;
DDTM[5].AreaShape := 0;
DDTM[5].Color := Color;
DDTM[5].Tolerance := 20;

Result[0] := DDTMtoDTM(DDTM);

If Length(Result[0]) > 44 Then
Begin
TSA[0] := Copy(Result[0], 1, 56);
TSA[1] := Copy(Result[0], 57, Length(Result[0]));
End;
Result[0] := 'DTMFromString('''+TSA[0]+'''+';
Result[1] := TSA[1]+''');';
End;


Begin
SetupSRL;
ClearDebug;
InvSlot := Inventory_Slot;
Repeat
TmpStr2 := CreateBitmap;
wait(200);
TmpStr := GetTextProperties;
TmpStr3 := CreateTheDTM;
WriteLn('With '+Replace(TmpStr[0], ' ', '_')+' Do ');
WriteLn('Begin ');
WriteLn(' Name := '''+Capitalize(TmpStr[0])+''';');

WriteLn(' UpText := ['''+TmpStr[1]+'''];');

WriteLn(' ItemP := Point(0, 0); ');

WriteLn(' Colors := '+GetDiverseColors(TempBool));

WriteLn(' Stackable := '+BoolToStr(TempBool)+';');

WriteLn(' DTM := '+TmpStr3[0]);
WriteLn(' '''+TmpStr3[1]);
WriteLn('');
WriteLn(' Bitmap := '+TmpStr2[0]);
WriteLn(' '''+TmpStr2[1]);

WriteLn('End;');
WriteLn('// Next Record //');
InvSlot := InvSlot + 1;
Until(InvSlot >= 28);
End.



Debug Example:

With Air_rune Do     
Begin
Name := 'Air Rune';
UpText := ['ir r'];
ItemP := Point(0, 0);
Colors := [5526616, 6447975, 6316389, 6184803, 6053217, 5790045];
Stackable := True;
DTM := DTMFromString('78DA637462626078C28002EE5CBEC42002A419A17C4607A09A47A86A'+
'CA8B8A50D53861AAC16A0E9A5D853939A86A5C806A9EA1AA29CECBC3B4EB197EBB004CD112E9');

Bitmap := BitmapFromString(7, 7, 'beNpVzFEKgDAMA9DbjoGzzM1SShl6Rve7wxgICEI/0ld'+
'SET/7mg/ncr8jELRWa40YqsMMJ+QuQkSLjnyUQmSLD/eciah837aUiKjQuf78BXubW1Y=');
End;
// Next Record //
With Cadava_berries Do
Begin
Name := 'Cadava Berries';
UpText := ['dava ber'];
ItemP := Point(0, 0);
Colors := [10033858, 8984493, 7804054, 6558079, 12001255, 9705915];
Stackable := True;
DTM := DTMFromString('78DA63CC61626078C28002DC7439194480342394CF980554F308558D'+
'878309AA9A1C4C3520590C739E1050930754F30C55C551E93998763DC3EF6600235C0BA1');

Bitmap := BitmapFromString(7, 7, 'beNoTrfVwMIEgBgZGN11OFx0QQha01+AAknBBCNtIgQ3'+
'CAJJAZK7MDtQLYQMZ00TKO4RygGwPfS4g+Uph5yP5zbWCyVNFyiAKrsmuOio9Z6tkfy5/GEQX0KjdklPWinfOBQAw3B04');
End;
// Next Record //
With Cadava_berries Do
Begin
Name := 'Cadava Berries';
UpText := ['dava ber'];
ItemP := Point(0, 0);
Colors := [10033858, 8984493, 7804054, 6558079, 12001255, 9705915];
Stackable := True;
DTM := DTMFromString('78DA639CC6C4C0F0840105B8E9723288006946289F710A50CD235435'+
'CED686A86AA661AA01C96298F384809A194035CF50551C959E8369D733FC6E060096530C90');

Bitmap := BitmapFromString(7, 7, 'beNoTrXW2NoQgBgZGN11OFx0QQha01+AAknBBCNtIgQ3'+
'CAJJAZK7MDtQLYQMZ00TKO4RygGwPfS4g+Uph5yP5zbWCyVNFyiAKrsmuOio9Z6tkfy5/GEQX0KjdklPWinfOBQD+xRzQ');
End;
// Next Record //
With Cadava_berries Do
Begin
Name := 'Cadava Berries';
UpText := ['dava ber'];
ItemP := Point(0, 0);
Colors := [10033858, 8984493, 7804054, 6558079, 12001255, 9705915];
Stackable := True;
DTM := DTMFromString('78DA633CC0C4C0F0840105B8E9723288006946289F711F50CD235435'+
'8E967AA86A0E60AA01C96298F384809A434035CF50551C959E8369D733FC6E06000D160D85');

Bitmap := BitmapFromString(7, 7, 'beNoTrXW01IMgBgZGN11OFx0QQha01+AAknBBCNtIgQ3'+
'CAJJAZK7MDtQLYQMZ00TKO4RygGwPfS4g+Uph5yP5zbWCyVNFyiAKrsmuOio9Z6tkfy5/GEQX0KjdklPWinfOBQDj5RyY');
End;
// Next Record //
With Cadava_berries Do
Begin
Name := 'Cadava Berries';
UpText := ['dava ber'];
ItemP := Point(0, 0);
Colors := [10033858, 8984493, 7804054, 6558079, 12001255, 9705915];
Stackable := True;
DTM := DTMFromString('78DA6374626260E0606440066EBA9C0C22401A26CAE80054C386AAC6'+
'C3C104558D13A61A902C86391C04D4B800D570A1AA392A3D07D32E2EFC6E06003B0B0583');

Bitmap := BitmapFromString(7, 7, 'beNoTrfVwMIEgBgZGN11OFx0QQha01+AAknBBCNtIgQ3'+
'CAJJAZK7MDtQLYQMZ00TKO4RygGwPfS4g+Uph5yP5zbWCyVNFyiAKrsmuOio9Z6tkfy5/GEQX0KjdklPWinfOBQAw3B04');
End;
// Next Record //
With Cadava_berries Do
Begin
Name := 'Cadava Berries';
UpText := ['dava ber'];
ItemP := Point(0, 0);
Colors := [10033858, 8984493, 7804054, 6558079, 12001255, 9705915];
Stackable := True;
DTM := DTMFromString('78DA63CC616260E0606440066EBA9C0C22401A26CA980554C386A6C6'+
'C118554D0EA61A902C86391C04D4E401D570A1AA392A3D07D32E2EFC6E0600B439067C');

Bitmap := BitmapFromString(7, 7, 'beNoTrfVwMPGwM3G2NmRgYHTT5XTRASE3B2MIAgraa3A'+
'ASYggUDGEbaTABmEASSAyV2YH6oWwgYxpIuUdQjlAtoc+F5B8pbDzkfzmWsHkqSJlEAXXZFcdlZ6zVbI/lz8Mogto1G7JKWvFO+cCACNQHR0=');
End;
// Next Record //
With Do
Begin
Name := '';
UpText := [''];
ItemP := Point(0, 0);
Colors := [5526616, 6447975, 6316389, 6184803, 6053217, 5790045];
Stackable := True;
DTM := DTMFromString('78DA639CC6C4C0C0C1C8800C4A0B0A184480344C94710A500D1BAA9A'+
'F2A2225435D330D5549796629A836657614E0EAA9A1940355CA86A8AF3F230ED4253939F9585A2060055FC0C39');

Bitmap := BitmapFromString(7, 7, 'beNrLyzMxYQei2vLy+spKIIJwgai8qAhIVpeWQmSBZHF'+
'eHhChSeVnZRXm5AAZpQUFcKncjAwggkgBtUCkMlNTstPSkMUhFqGLAwB6MTEe');
End;
// Next Record //
With Magic_staff Do
Begin
Name := 'Magic Staff';
UpText := ['gic staf'];
ItemP := Point(0, 0);
Colors := [669517, 735567, 669259, 870243, 936551, 1003373];
Stackable := True;
DTM := DTMFromString('78DA633CC0C4C0C0C1C8800CCAC304184480344C94711F500D1BAA1A'+
'474B3D54350730D5789B71619A836697B3B521AA9A4340355CA86A0C141430ED42530392455603002AC20875');

Bitmap := BitmapFromString(7, 7, 'beNqzNnS2hiIGBsZ4F97aKMHiYH4g19FSDyjibcZVGiL'+
'QligERHBlqZ58DbGCQAYQwQXLwwSApIGCAhBBRDJ9+FrihSCCcGWV4SjKIIIdSUjKAOH/GXU=');
End;
// Next Record //
With Brass_key Do
Begin
Name := 'Brass Key';
UpText := ['ass key'];
ItemP := Point(0, 0);
Colors := [1137535, 1337745, 1471906, 1338261, 1471649, 1404826];
Stackable := True;
DTM := DTMFromString('78DA6374626260D06164400641D6DC0C22401A26CAE80054A385AAA6'+
'3E5A10558D13116A1C30EDC250E30254A387AAC6404101D32E026A005E8F0762');

Bitmap := BitmapFromString(7, 7, 'beNpzMGFgYASi+mhB/Cg/gB9TBFljkDV3rj9IxEBBASI'+
'SYsMNMRwoAkTzi8XsdTngXCBytjZEVgDkApEHAAP9HtA=');
End;
// Next Record //
With Earth_rune Do
Begin
Name := 'Earth Rune';
UpText := ['rth rune'];
ItemP := Point(0, 0);
Colors := [5526616, 6447975, 6316389, 6184803, 6053217, 5790045];
Stackable := True;
DTM := DTMFromString('78DA63CC616260D06164400611963C0C22401A26CA980554A345404D'+
'0E116AB288B02B0FA8460F554D715E1EA65D686AF2B3B250D40000A54F092B');

Bitmap := BitmapFromString(7, 7, 'beNqz5ImwpD7KzcgAovysrMKcnOK8vNKCgvKioszUlOy'+
'0NDRxLNoBHMEnUw==');
End;
// Next Record //
With Do
Begin
Name := '';
UpText := [''];
ItemP := Point(0, 0);
Colors := [6316389, 6447975, 5921631, 5790045, 5658194, 5134682];
Stackable := True;
DTM := DTMFromString('78DA639CC6C4C0A0C3C8800CEC1C1D194480344C94710A508D16AA1A'+
'570F0F5435D330D538B838639AA343C09C1940357AA86A6CECED30EDD2C3EF66005E3709CB');

Bitmap := BitmapFromString(7, 7, 'beNqzsXH39nL18HB2cwMiO0dHG3s7SxsbIAkRdHBxhgv'+
'CVcIF9Y0MgSJABBeBCEJMQxYEaoeIYAqaW1oamZggBAHP6iTM');
End;
// Next Record //
With Staff_of_water Do
Begin
Name := 'Staff Of Water';
UpText := ['aff of w'];
ItemP := Point(0, 0);
Colors := [669517, 735567, 669259, 870243, 936551, 1003373];
Stackable := True;
DTM := DTMFromString('78DA633CC0C4C0A0C3C8800CCAC304184480344C94711F508D16AA1A'+
'676B4354350730D5789B71619AA343C09C4340357AA86A0C141430ED425303924556030095320954');

Bitmap := BitmapFromString(7, 7, 'beNqz1HO01HO2NgSSDAyM8S68tVGCxcH8QBEgAop4m3G'+
'Vhgi0JQoBEVww1ZOvIVYQyAAiiHYgozxMAEgaKCgAEUQk04evJV4IIuhgpguxojIcoQwoAhHsSIIqA4kAANRUGTg=');
End;
// Next Record //
With Rope Do
Begin
Name := 'Rope';
UpText := ['ope'];
ItemP := Point(0, 0);
Colors := [468532, 468791, 535356, 601921, 602436, 402482];
Stackable := True;
DTM := DTMFromString('78DA637462626008606440060A927C0C22401A26CAE80054E387AAC6'+
'DF5E09558D13A61A477D4E4C73D0EC3251634755E302541384AAC65E9703D3AE20FCEE0100008606F6');

Bitmap := BitmapFromString(7, 7, 'beNrTEvO3V/K2UbDX5XDU5wQy3CzkXMxkw1xVgeIuhpx'+
'AQV9bRQ8reaB4lIc6UNzNiBMoDtEFFDdRYwciSz1JBUk+HQU2IxU2S02QUUA1QJVAvUCNQBEg8jDhgiCgXqBGoI022hwyIswK4izKkiwhzipAxUBBEwDn3xnk');
End;
// Next Record //
With Priest_gown Do
Begin
Name := 'Priest Gown';
UpText := ['iest gow'];
ItemP := Point(0, 0);
Colors := [789517, 0, 0, 0, 0, 0];
Stackable := True;
DTM := DTMFromString('78DA63CC6162600860644006BC3C3C0C22401A26CA980554E347404D'+
'0E116AB288B02B0FA8268808BB08A80100B5A405DB');

Bitmap := BitmapFromString(7, 7, '78DA637462626008606440060A927C0C22401A26CAE80054E387AAC6'+
'DF5E09558D13A61A477D4E4C73D0EC3251634755E302541384AAC65E9703D3AE20FCEE0100008606F6');
End;
// Next Record //
With Yellow_bead Do
Begin
Name := 'Yellow Bead';
UpText := ['llow bea'];
ItemP := Point(0, 0);
Colors := [2022108, 2021595, 1955030, 1752768, 1955288, 1953746];
Stackable := True;
DTM := DTMFromString('78DA639CC6C4C010C0C8800C766C93641001D23051C62940357EA86A'+
'2E5F944555330D530D5673D0ECBA741ECD9C19403541A86AA64E16C1B40B4DCD867512286A00C29B0F38');

Bitmap := BitmapFromString(7, 7, 'beNprFjp9UubsaZkL52R27ZBctkRs8kSRzAy+yxdlgej'+
'EMekd20CC06aKdHUI37gqe+2K7NHDUMFZM0R7e4Rv35C7dB4quHK5+Nw5ohP7Re7cQhGcMwukEqgdaNf+vVIb1kksWig2dbJIR5sQRNn2rQi9LQAy0UiE');
End;
// Next Record //
With Iron_hatchet Do
Begin
Name := 'Iron Hatchet';
UpText := ['on hatch'];
ItemP := Point(0, 0);
Colors := [668744, 669517, 736082, 802904, 869471, 870243];
Stackable := True;
DTM := DTMFromString('78DA633CC0C4C010C0C8800C9CAD0D194480344C94711F508D1FAA1A'+
'902C8A9A03986AB09A836697818202AA9A4340354104CC3940580D007E4C0A22');

Bitmap := BitmapFromString(7, 7, 'beNqzNiwM5GdgYDRQUAAiZ2tDCCoOhgrCRYCoPEwAIuh'+
'oqQcRATKQ9ULE4YLIeoEIzQq4IJwNNRYAxxsb9w==');
End;
// Next Record //
With Steel_dagger Do
Begin
Name := 'Steel Dagger';
UpText := ['eel dagg'];
ItemP := Point(0, 0);
Colors := [1146752, 1214088, 1281165, 1483170, 1416349, 1414808];
Stackable := True;
DTM := DTMFromString('78DA637462626028616440068539390C22401A26CAE800545384AAC6'+
'C3C104558D13A61AACE6A0D905924551E302545386AAC6404101D3AE32FC7601007D4C09E1');

Bitmap := BitmapFromString(7, 7, 'beNpjYPRwMAEiBgbG/s7OwpwcCHK2NoQIwkUggmjKgFw'+
'Igou4ODoAuXPniCILAtkGCgpTJ4vMnyu2Ypk4XASIerqEp02Fim/aIAEyDQBH3Cqp');
End;
// Next Record //
With Staff Do
Begin
Name := 'Staff';
UpText := ['taff'];
ItemP := Point(0, 0);
Colors := [535871, 669517, 669259, 869985, 870243, 736854];
Stackable := True;
DTM := DTMFromString('78DA63CC6162602861644006E561020C22401A26CA9805545384AAC6'+
'D9DA10554D0EA69A78175E4C73D0EC02C9A2A8C903AA29435563A0A0806957197E730041ED0883');

Bitmap := BitmapFromString(7, 7, 'beNqzNvSwM3G2NmRgYPQ248r04WuKE2qIFQSKQATjXXh'+
'LQwSADCCCiITZcRcG8gPVANkGCgoQQaDG8jABiAgQQZQBNdZHoygrDuavDEcoAwomu/MCNSIrcwYAadAZSw==');
End;
// Next Record //
With Rune_warhammer Do
Begin
Name := 'Rune Warhammer';
UpText := ['ne warha'];
ItemP := Point(0, 0);
Colors := [1003373, 936551, 869471, 735567, 936293, 736854];
Stackable := True;
DTM := DTMFromString('78DA639CC6C4C050C2C8800CDC8C38194480344C94710A504D11AA1A'+
'902C8A9A69986AFC2DB931CD41B32BD5930F55CD0CA09A325435060A0A987695E1770F003C7E0913');

Bitmap := BitmapFromString(7, 7, 'beNqzNnS2BiEGBsYwO25fcy4XQ04dU0uISJQjj78lt4c'+
'JF5ANRBDBEBtubzMuR31OINtAQQFIpnryAZW5GUFFIIJA04Aa7XU5IIIQvRDz4cqAgoluvMgaQY4BAP96FFQ=');
End;
// Next Record //
With Amulet_of_strength Do
Begin
Name := 'Amulet Of Strength';
UpText := ['ulet of '];
ItemP := Point(0, 0);
Colors := [11382197, 10724523, 9079697, 7368821, 7105649, 6974063];
Stackable := True;
DTM := DTMFromString('78DA633CC0C4C050C2C8800C9CAD0D194480344C94711F504D11AA1A'+
'0F3B1354350730D56035A784803987806ACAD0D43860B1AB0CBF5D0073320C0A');

Bitmap := BitmapFromString(7, 7, 'beNpjYHS2NsREbg7GHnYmWKWA4hBZuAJklXA2UA2yLgY'+
'GRmQRkHYHE6AgmslAEQYAaasfVQ==');
End;
// Next Record //
With Tile Do
Begin
Name := 'Tile';
UpText := ['ile'];
ItemP := Point(0, 0);
Colors := [3229809, 3427447, 3493755, 3625343, 3295859, 3427705];
Stackable := True;
DTM := DTMFromString('78DA637462626098C1C8800C62AD35184480344C94D101A8661AAA9A'+
'785B4D54354E986AA2ACD431CD41B32BD14E0B558D0B50CD2C543511166A9876CDC2EF660087530A30');

Bitmap := BitmapFromString(7, 7, 'beNozV02004q31Yy11oiyUo+wUAszVw0xU8EqmGyvDRf'+
'HKghXTJEgAHoKJGg=');
End;
// Next Record //

marpis

2009-11-04 07:29:05

Great job! You should make it record all items in inventory
for I := 1 to 28 do

Naum

2009-11-04 11:38:35

From: marpis
Great job! You should make it record all items in inventory
for I := 1 to 28 do


Thanks. Well, it's not that hard to make it loop :p. Just set Inventory_Slot to 1, make a repeat..until loop and increment Inventory_Slot :).

Would love any testers, btw :)

EDIT : Added a Looping version for your convenience ;)

Nava2

2009-11-04 12:04:17

Why not load all of this from an ini-file when needed.

You could create a structure for an INI or maybe an XML file if you are feeling 1337, load it as per needed.

That way, you don't have a massive bog on memory as you go.

For arrays, explode/implode :)

Coh3n

2009-11-09 13:43:16

From: Nava2
Why not load all of this from an ini-file when needed.

You could create a structure for an INI or maybe an XML file if you are feeling 1337, load it as per needed.

That way, you don't have a massive bog on memory as you go.

For arrays, explode/implode :)

Man, I wish I was as smart as some of your guys. I don't even know what you guys are talking about anymore. You've all become to leet for me. :crying:

@Naum - Your generator looks awesome, and I promise I'll test for you as soon as I can. :biggrin:

Also, whats:
shr
?

rogeruk

2009-11-09 13:54:23

shr shift right

Coh3n

2009-11-09 14:13:26

From: rogeruk
shr shift right

I don't get it. As in shift right one pixel?

mastaraymond

2009-11-09 14:18:50

From: Coh3n
I don't get it. As in shift right one pixel?

http://www.villavu.com/forum/showthread.php?t=18514


comes down to the fact that: shr 1 = div 2

Coh3n

2009-11-09 14:21:41

From: mastaraymond
http://www.villavu.com/forum/showthread.php?t=18514


comes down to the fact that: shr 1 = div 2


Oh wow, that looks confusing. Guess I have some reading to do. :p

Thanks raymond. :)

Alright, so I finally got to test it. It worked awesome. The only thing I would change is in the looping version - make it stop or skip the inventory slot if it doesn't find any colors. Right now, it will still make a DTM and BMP of the empty inventory slot, which takes a few extra seconds. Not really a big deal, but just an idea to improve it.

Here's what it debugged:

With Rune_hatchet Do
Begin
Name := 'Rune Hatchet';
UpText := ['ne hatch'];
ItemP := Point(0, 0);
Colors := [131072, 669002, 735566, 736339, 803162, 869984];
Stackable := False;
DTM := DTMFromString('78DA637462626078C280023C1C4C184480342394CFE80054F388010D'+
'30A1AA71C25483D51C34BB0C141450D5B800D53C4355E3E5628569D733FC760100C4960AE1');

Bitmap := BitmapFromString(7, 7, 'beNpzsSoKFmBgYDJQUAAiDwcTCCoJgQrCRYCoIlwQLuj'+
'lYgURxNQLF0QWASI0ZUATgAgu4mxtCBUHAEXfHd8=');
End;
// Next Record //
With Bronze_pickaxe Do
Begin
Name := 'Bronze Pickaxe';
UpText := ['onze pic'];
ItemP := Point(0, 0);
Colors := [131072, 3232880, 3430774, 3562876, 3826564, 3562618];
Stackable := False;
DTM := DTMFromString('78DA63CC61626078C280020C1414184480342394CF980554F308558D'+
'859604AA9A1C4C3558CD41B3CBCF5A09554D1E50CD3354351E0E269876115003003DB40BEC');

Bitmap := BitmapFromString(7, 7, 'beNpzMNFVEjHVEGdgYDJQUAAiDwcTIDJQEbXQkoAIQkS'+
'AyFhNzFpHCk3QyUjWz1oJIuhsbQgRdDWRQxhoB1XpbiqPphe7IAAW1RnL');
End;
// Next Record //
With Iron_pickaxe Do
Begin
Name := 'Iron Pickaxe';
UpText := ['on picka'];
ItemP := Point(0, 0);
Colors := [131072, 7434614, 7895422, 8289924, 8750475, 8158338];
Stackable := False;
DTM := DTMFromString('78DA639CC6C4C0F08401051828283088006946289F710A50CD235435'+
'165A12A86AA661AAC16A0E9A5D7ED64AA86A6600D53C4355E36C6D886917013500B5620CCE');

Bitmap := BitmapFromString(7, 7, 'beNqzNtRVEjHVEGdgYDJQUAAiZ2tDIDJQEbXQkoAIQkS'+
'AyFhNzFpHCk3QyUjWz1oJTdDVRA7NQCByN5VHU4ZdEADUPBi8');
End;
// Next Record //
With Steel_pickaxe Do
Begin
Name := 'Steel Pickaxe';
UpText := ['eel pick'];
ItemP := Point(0, 0);
Colors := [131072, 7303028, 7829372, 8158338, 8618889, 8026752];
Stackable := False;
DTM := DTMFromString('78DA633CC0C4C0F08401051828283088006946289F711F50CD235435'+
'165A12A86A0E60AAC16A0E9A5D7ED64AA86A0E01D53C4355E36C6D886917013500307D0DCA');

Bitmap := BitmapFromString(7, 7, 'beNqzNtRVEjHVEGdgYDJQUAAiZ2tDIDJQEbXQkoAIQkS'+
'AyFhNzFpHCk3QyUjWz1oJTdDVRA7NQEdLPXdTeTRlQIRFEADTFxi1');
End;
// Next Record //
With Mithril_pickaxe Do
Begin
Name := 'Mithril Pickaxe';
UpText := ['thril pi'];
ItemP := Point(0, 0);
Colors := [131072, 6178888, 3153952, 6573389, 6836304, 7230805];
Stackable := False;
DTM := DTMFromString('78DA6374626260E060644006060A0A0C22401A26CAE80054C386AAC6'+
'424B02558D13A61AACE6A0D9E567AD84AAC605A8860B558D878309A65D04D40000556305CE');

Bitmap := BitmapFromString(7, 7, 'beNpzMNFVEjHVEGdgYDJQUAAiDwcTIDJQEbXQkoAIArl'+
'uDsZA0lhNzFpHCi4IRF4uVk5Gsn7WSsiCQORqIodmIBC5m8qjKUMWdLTUgwoCAByqGc8=');
End;
// Next Record //
With Adamant_pickaxe Do
Begin
Name := 'Adamant Pickaxe';
UpText := ['amant pi'];
ItemP := Point(0, 0);
Colors := [131072, 5464147, 2238242, 5858904, 6056540, 6385761];
Stackable := False;
DTM := DTMFromString('78DA63CC616260E060644006060A0A0C22401A26CA980554C386AAC6'+
'424B02554D0EA61AACE6A0D9E567AD84AA260FA8860B558D878309A65D04D40000D06F06CA');

Bitmap := BitmapFromString(7, 7, 'beNpzMNFVEjHVEGdgYDJQUAAiDwcTIDJQEbXQkoAIujk'+
'YQwSN1cSsdaTQBJ2MZP2slSCCQK6ztSGQdDWRQzMQKO5uKg9XBkdYBAES2xm6');
End;
// Next Record //
With Rune_pickaxe Do
Begin
Name := 'Rune Pickaxe';
UpText := ['ne picka'];
ItemP := Point(0, 0);
Colors := [131072, 6051142, 3157029, 6314314, 6577485, 6972242];
Stackable := False;
DTM := DTMFromString('78DA639CC6C4C0C0C1C8800C0C1414184480344C94710A500D1BAA1A'+
'0B2D095435D330D5603507CD2E3F6B25543533806AB850D5385B1B62DA45400D00482C07AC');

Bitmap := BitmapFromString(7, 7, 'beNqzNtRVEjHVEGdgYDJQUAAiZ2tDIDJQEbXQkoAIArk'+
'ediZA0lhNzFpHCi4IQU5Gsn7WSnBBR0s9IOlqIodsIFAQiNxN5dH0YhV0BgDUJBir');
End;
// Next Record //
With Rune_full_helm Do
Begin
Name := 'Rune Full Helm';
UpText := ['ne full '];
ItemP := Point(0, 0);
Colors := [131072, 5919557, 6445899, 855309, 6577485, 6314314];
Stackable := False;
DTM := DTMFromString('78DA633CC0C4C0C0C1C8800CACDC7C184480344C94711F500D1BAA1A'+
'3BEF4054350730D5983BB9639A836697A37F28AA9A4340355CA86AF42D6D31EDE2C2EF1E007EAE0A0F');

Bitmap := BitmapFromString(7, 7, 'beNrTMXDwDbbx9LNw8TJ1cNXk9lPj8jLjy3D0D7XzDrR'+
'y8zF3cje2ddK3tNU2sXAODEdWbGjtoGlk6hochawYIugWGgNXDBf0i0/zCI8DigMVAwWBZqrrGwO1A5UB9QLNBFoEtEUVAK4OJWo=');
End;
// Next Record //
With Chisel Do
Begin
Name := 'Chisel';
UpText := ['hise'];
ItemP := Point(0, 0);
Colors := [131072, 734803, 800597, 801370, 667722, 734030];
Stackable := False;
DTM := DTMFromString('78DA6374626260D061644006BAB26C0C22401A26CAE80054A385AAC6'+
'D9DA10558D13A61A0606264C73D0EC3256644755E30254A347C01C274C35E8E60000493804E2');

Bitmap := BitmapFromString(7, 7, 'beNpTUHC2NoQgDwcTBgYmU2NjawsLNwdjoAiQC0QGenp'+
'AQSAJUaAry6YlzQbkAhFEgbEiu4E8G0QcpF5BAWSOMjtcHIiAItZqHBaqHHBxiEpbDQ5kcZAgAM7KEcw=');
End;
// Next Record //
With Willow_logs Do
Begin
Name := 'Willow Logs';
UpText := ['llow log'];
ItemP := Point(0, 0);
Colors := [131072, 1060661, 861482, 795175, 729124, 927789];
Stackable := False;
DTM := DTMFromString('78DA63CC616260D0616440061686820C22401A26CA980554A385AAC6'+
'D55614554D0EA61A272B114C73D0ECB235134655930754A387AAC6DA4408D32E3DFC6E060043D00747');

Bitmap := BitmapFromString(7, 7, 'beNqzEHayEsFErraiEAThOlgI25oJw9kQrrWJkIWhIDL'+
'bVF/AWJffQItPV4MPSAIRkAtEQHGILIQBRED1QATUiIwgJjsAAHapGRE=');
End;
// Next Record //
With Death_rune Do
Begin
Name := 'Death Rune';
UpText := ['ath rune'];
ItemP := Point(0, 0);
Colors := [131072, 5658202, 6579304, 6447718, 6316132, 6184546];
Stackable := True;
DTM := DTMFromString('78DA639CC6C4C0A0C3C8800CEE5EBECC2002A461A28C53806AB450D5'+
'541417A3AA9986A986979717D31C4276CD00AAD1435553929F8F69179A9A829C6C14350076CF0E45');

Bitmap := BitmapFromString(7, 7, 'beNq7fPnuZSji5eWFs8sKCyuKi+GCdZUVDVVVJfn5cAV'+
'AVFNeDhQvyMlGFgTqqiotzcvKAiKgVFFeLlAXxLSstLScjAw0cYguuDiICwBJWFYv');
End;
// Next Record //
With Fire_rune Do
Begin
Name := 'Fire Rune';
UpText := ['re rune'];
ItemP := Point(0, 0);
Colors := [131072, 5658202, 6579304, 6447718, 6316132, 6184546];
Stackable := True;
DTM := DTMFromString('78DA633CC0C4C0A0C3C8800C662B88318800699828E33EA01A2D5435'+
'15C5C5A86A0E60AAC16A0E9A5D4579B9A86A0E01D5E81130E70061350070E80C0C');

Bitmap := BitmapFromString(7, 7, 'beNpTEKsqLa0pL5+tIAZBTTU1LXV1QEZFcTFcsK6yAsI'+
'oyc+HC8J1FeXlwgWRdZGJAPwcLdQ=');
End;
I love this, will save a ton of time. :biggrin:

Sir R. M8gic1an

2009-11-14 13:03:09

Make AreaSize := 1; for DTMs, it'll avoid them breaking if jagex changes around a couple of pixels.

Also, isn't 20 tol too high?

GJ

~RM

Naum

2009-11-14 13:05:06

From: Rasta Magician
Make AreaSize := 1; for DTMs, it'll avoid them breaking if jagex changes around a couple of pixels.

Also, isn't 20 tol too high?

GJ

~RM


Yeah, I found this is virtually useless for all hatchets and axes. I'll try, if I get time, to re-vamp the whole damn thing. Will use your suggestions.

Thanks for the post :)

Coh3n

2009-11-14 13:15:40

From: Naum
Yeah, I found this is virtually useless for all hatchets and axes. I'll try, if I get time, to re-vamp the whole damn thing. Will use your suggestions.

Thanks for the post :)

:tongue: I had to get the colors, bitmaps and DTMs for pickaxes and hatchets. Even if you don't revamp it, this will still be very useful for basically every item in RS.