SRL Archive - Research & Development Lounge

DTM Database


Dervish

2009-01-03 19:39:03

I made a little DTM Database.

At a current state : nothing spectacular.

I need you to tell me about more dtms to make and add in the Database (if anyone actually uses it).

Instructions are inside the file.

Put the DTMLib.scar in your scar folder under includes.

You can include it with :

{.include DTMLib.scar}

in your script under other includes.

At the moment, since Attachements don't seem to work, you'll have to make a new scar file, copy and paste the code below into it, and save it as DTMLib.scar under includes.

V0.1.1
First Version.

  {===================================}
{ }
{ ======================== }
{ ||D T M L I B R A R Y|| }
{ ======================== }
{ }
{===================================}
{ }
{ How to use }
{ =========== }
{To call a DTM ,use the procedure : }
{ GetDTM(names of dtms). }
{ }
{ Example : GetDTMs('log','knife') }
{ }
{===================================}
{ }
{ Valid names : }
{ ============= }
{ }
{ axe }
{ pickaxe }
{ knife }
{ log }
{ ore }
{ bar }
{ clay }
{ softclay }
{ net }
{ rod }
{ ess }
{ vial }
{ lobpot }
{ feather }
{ harpoon }
{ }
{===================================}
{ }
{ Freeing DTMs }
{ ============ }
{ }
{ To free the DTMs you called from }
{ this library, use the procedure: }
{ }
{ FreeDTMs(names of called DTMs) }
{ Example : FreeDTMs('log','knife') }
{ }
{===================================}
{ }
{ Credits }
{ ======= }
{ }
{ [Dr D. Dervish] }
{ ~Created the library~ }
{ }
{ [N3ss3s] }
{ ~Helped me with Arrays~ }
{ }
{ [KillerDou] }
{ ~Even though I don't use~ }
{ ~them here, he helped me~ }
{ ~by explaining Sets~ }
{ }
{===================================}
{ }
{I will add DTMs to this Database if}
{ you post requests of DTMs on the }
{ thread. }
{ }
{===================================}


Procedure GetDTMs(DTMNames: TStringArray);

var
LoadedDTMs, AxeDTM, PickDTM, KnifeDTM, LogDTM, OreDTM, BarDTM, ClayDTM, SoftClayDTM,
NetDTM, RodDTM, EssDTM, VialDTM, CageDTM, FeatherDTM, HarpoonDTM, X, Y : Integer;

Begin
X:= High(DTMNames);
for Y:= 0 to X do
Case DTMNames[Y] of

'axe': AxeDTM := DTMFromString('78DA63B46364603809C44820DC4589E13F900' +
'689FE0702464B206B0FAA1A882C8C04D26E40D601026A8C81ACAB' +
'F8D50000EADF09D6');

'pickaxe': PickDTM := DTMFromString('78DA63B4626460E002622460A0C0C6F01F488' +
'344FF0301A31D90F597010D30229140DA0BC86267C4AFC60CC812' +
'21A0C610C862C4AF06003A0C07B5');

'knife': KnifeDTM := DTMFromString('78DA6374606460D805C448A0302B134CC3441' +
'99D81AC0DA86A60B270358E40D61E026A4C81AC1304D4980359A7' +
'08A8B105B276E2570300CE950740');

'log': LogDTM := DTMFromString('78DA6374606460B806C44860EAA42E86FF401' +
'A24FA1F08188D80AC73A86A20B23012485B01590F08A8F101B26E' +
'1050630F649DC6AF060025EC0C23');

'ore': OreDTM := DTMFromString('78DA63B46764603806C448C0CECF9EE13F900' +
'689FE0702464320EB10AA1A882C8C04D20640D645026AEC80AC73' +
'04D47803590709A8B101B2F61250E308641D26C29C6BF8D50000E' +
'15A0E0E');

'bar': BarDTM := DTMFromString('78DA63B4666460D808C448A034819FE13F900' +
'689FE07024613206B27AA1A882C8C04D2F640D66E026ABC80AC75' +
'04D4980359AB71AB6101D15640D60AFCE60000FF250B90');

'clay': ClayDTM := DTMFromString('78DA63FCC6C0C090C98002265405816946289' +
'FF13790486540038CA86ADE02892C026ABE00897C026A1881AC74' +
'026A3E3010540300C46608A7');

'softclay': SoftClayDTM := DTMFromString('78DA63FCCEC0C0D0CD80027283F8C0342394C' +
'FF811483431A0014654358C40562B0135FF81C464026A3E038969' +
'04D4BC05129DF8D50000729E08EC');

'net': NetDTM := DTMFromString('78DA63FCCAC0C090CDC8800CCC7595C0344C9' +
'4F12790484655039385ABF902245208A87905240A09A86104B22A' +
'09A86103B2B2F0AB0100049406F9');

'rod': RodDTM := DTMFromString('78DA63FCC6C0C0A0CEC8800C4A23F8C1344C9' +
'4F12B90504455039385AB6102B2A409A8F90124F408A8790F240C' +
'09A8790D2434F1AB0100620D069F');

'ess': EssDTM := DTMFromString('78DA63FCC1C0C0E0CDC8800C5AAAABC1344C9' +
'49115C8F24055039385AB0199634B40CD4B20E14740CD6F201181' +
'5F0D00FFAE06DE');

'feather': FeatherDTM := DTMFromString('78DA63FCC6C0C050C3C8800C0EEDDAC9F01F4' +
'88344FF0301E33B20A303550D44164602E91F40A290801A46202B' +
'97809A9F40A211BF1A00FD430D7E');

'vial': VialDTM := DTMFromString('78DA63FCC6C0C0A0C9C8800CCACB2B18FE036' +
'990E87F2060FC0D64C8A0AA81C8C248200D324782809AB740C280' +
'809AF740C298801A104B1FBF1A00C7660C2C');

'lobpot': CageDTM := DTMFromString('78DA63FCC6C0C0A0C9C8800CCACB2B18FE036' +
'990E87F2060FC0D64C8A0AA81C8C248200D324782809AB740C280' +
'809AF740C298801A104B1FBF1A00C7660C2C');

'harpoon': HarpoonDTM := DTMFromString('78DA63FCC6C0C0A0C9C8800CCACB2B18FE036' +
'990E87F2060FC0D64C8A0AA81C8C248200D324782809AB740C280' +
'809AF740C298801A104B1FBF1A00C7660C2C');

end;
end;

Procedure FreeDTMs(DTMNames: TStringArray);
var
AxeDTM, PickDTM, KnifeDTM, LogDTM, OreDTM, BarDTM, ClayDTM, SoftClayDTM,
NetDTM, RodDTM, EssDTM, VialDTM, CageDTM, FeatherDTM, HarpoonDTM, X, Y: Integer;

begin
X:= High(DTMNames)
for Y := 0 to X do
Case DTMNames[Y] of

'axe': FreeDTM(AxeDTM);

'pickaxe': FreeDTM(PickDTM);

'knife': FreeDTM(KnifeDTM);

'log': FreeDTM(LogDTM);

'ore': FreeDTM(OreDTM);

'bar': FreeDTM(BarDTM);

'clay': FreeDTM(ClayDTM);

'softclay': FreeDTM(SoftClayDTM);

'net': FreeDTM(NetDTM);

'rod': FreeDTM(RodDTM);

'ess': FreeDTM(EssDTM);

'feather': FreeDTM(FeatherDTM);

'vial': FreeDTM(VialDTM);

'lobpot': FreeDTM(CageDTM);

'harpoon': FreeDTM(HarpoonDTM);

end;
end;

V0.1.2
Added Benjaa's DTMs :
  {===================================}
{ }
{ ======================== }
{ ||D T M L I B R A R Y|| }
{ ======================== }
{ }
{===================================}
{ }
{ How to use }
{ =========== }
{To call a DTM ,use the procedure : }
{ GetDTM(names of dtms). }
{ }
{ Example : GetDTMs('log','knife') }
{ }
{===================================}
{ }
{ Valid names : }
{ ============= }
{ }
{ axe }
{ pickaxe }
{ knife }
{ log }
{ ore }
{ bar }
{ clay }
{ softclay }
{ net }
{ rod }
{ ess }
{ vial }
{ lobpot }
{ feather }
{ harpoon }
{ flax }
{ emptyjug }
{ winejug }
{ waterjug }
{ bucket }
{ }
{===================================}
{ }
{ Freeing DTMs }
{ ============ }
{ }
{ To free the DTMs you called from }
{ this library, use the procedure: }
{ }
{ FreeDTMs(names of called DTMs) }
{ Example : FreeDTMs('log','knife') }
{ }
{===================================}
{ }
{ Credits }
{ ======= }
{ }
{ [Dr D. Dervish] }
{ ~Created the library~ }
{ }
{ [N3ss3s] }
{ ~Helped me with Arrays~ }
{ }
{ [KillerDou] }
{ ~Even though I don't use~ }
{ ~them here, he helped me~ }
{ ~by explaining Sets~ }
{ }
{===================================}
{ }
{I will add DTMs to this Database if}
{ you post requests of DTMs on the }
{ thread. }
{ }
{===================================}


Procedure GetDTMs(DTMNames: TStringArray);

var
AxeDTM, PickDTM, KnifeDTM, LogDTM, OreDTM, BarDTM, ClayDTM, SoftClayDTM,
NetDTM, RodDTM, EssDTM, VialDTM, CageDTM, FeatherDTM, HarpoonDTM,FlaxDTM, WineJugDTM,
WaterJugDTM, BucketDTM, EmptyJugDTM, X, Y : Integer;

Begin
X:= High(DTMNames);
for Y:= 0 to X do
Case DTMNames[Y] of

'axe': AxeDTM := DTMFromString('78DA63B46364603809C44820DC4589E13F900' +
'689FE0702464B206B0FAA1A882C8C04D26E40D601026A8C81ACAB' +
'F8D50000EADF09D6');

'pickaxe': PickDTM := DTMFromString('78DA63B4626460E002622460A0C0C6F01F488' +
'344FF0301A31D90F597010D30229140DA0BC86267C4AFC60CC812' +
'21A0C610C862C4AF06003A0C07B5');

'knife': KnifeDTM := DTMFromString('78DA6374606460D805C448A0302B134CC3441' +
'99D81AC0DA86A60B270358E40D61E026A4C81AC1304D4980359A7' +
'08A8B105B276E2570300CE950740');

'log': LogDTM := DTMFromString('78DA6374606460B806C44860EAA42E86FF401' +
'A24FA1F08188D80AC73A86A20B23012485B01590F08A8F101B26E' +
'1050630F649DC6AF060025EC0C23');

'ore': OreDTM := DTMFromString('78DA63B46764603806C448C0CECF9EE13F900' +
'689FE0702464320EB10AA1A882C8C04D20640D645026AEC80AC73' +
'04D47803590709A8B101B2F61250E308641D26C29C6BF8D50000E' +
'15A0E0E');

'bar': BarDTM := DTMFromString('78DA63B4666460D808C448A034819FE13F900' +
'689FE07024613206B27AA1A882C8C04D2F640D66E026ABC80AC75' +
'04D4980359AB71AB6101D15640D60AFCE60000FF250B90');

'clay': ClayDTM := DTMFromString('78DA63FCC6C0C090C98002265405816946289' +
'FF13790486540038CA86ADE02892C026ABE00897C026A1881AC74' +
'026A3E3010540300C46608A7');

'softclay': SoftClayDTM := DTMFromString('78DA63FCCEC0C0D0CD80027283F8C0342394C' +
'FF811483431A0014654358C40562B0135FF81C464026A3E038969' +
'04D4BC05129DF8D50000729E08EC');

'net': NetDTM := DTMFromString('78DA63FCCAC0C090CDC8800CCC7595C0344C9' +
'4F12790484655039385ABF902245208A87905240A09A86104B22A' +
'09A86103B2B2F0AB0100049406F9');

'rod': RodDTM := DTMFromString('78DA63FCC6C0C0A0CEC8800C4A23F8C1344C9' +
'4F12B90504455039385AB6102B2A409A8F90124F408A8790F240C' +
'09A8790D2434F1AB0100620D069F');

'ess': EssDTM := DTMFromString('78DA63FCC1C0C0E0CDC8800C5AAAABC1344C9' +
'49115C8F24055039385AB0199634B40CD4B20E14740CD6F201181' +
'5F0D00FFAE06DE');

'feather': FeatherDTM := DTMFromString('78DA63FCC6C0C050C3C8800C0EEDDAC9F01F4' +
'88344FF0301E33B20A303550D44164602E91F40A290801A46202B' +
'97809A9F40A211BF1A00FD430D7E');

'vial': VialDTM := DTMFromString('78DA63FCC6C0C0A0C9C8800CCACB2B18FE036' +
'990E87F2060FC0D64C8A0AA81C8C248200D324782809AB740C280' +
'809AF740C298801A104B1FBF1A00C7660C2C');

'lobpot': CageDTM := DTMFromString('78DA63FCC6C0C0A0C9C8800CCACB2B18FE036' +
'990E87F2060FC0D64C8A0AA81C8C248200D324782809AB740C280' +
'809AF740C298801A104B1FBF1A00C7660C2C');

'harpoon': HarpoonDTM := DTMFromString('78DA63FCC6C0C0A0C9C8800CCACB2B18FE036' +
'990E87F2060FC0D64C8A0AA81C8C248200D324782809AB740C280' +
'809AF740C298801A104B1FBF1A00C7660C2C');

'flax': FlaxDTM := DTMFromString('78DA632C636460B8C78002F87205C1342394C' +
'F580564DD6040038CA86A9A81AC3B04D480CC7946404D1E90F592' +
'809A4C20EB017E35004DB608A9');

'winejug': WineJugDTM := DTMFromString('78DA632C616460A8066224D0565BC32002A44' +
'1A2FF8180B114C82A445533CFC112AE060418AB80AC1C54353059' +
'B89A2620AB8C809A7220AB85809A2C4C3763A801B9250FBF1A005' +
'80F0D49');

'emptyjug': EmptyJugDTM := DTMFromString('78DA632C616460A8026224D0565BC32002A44' +
'1A2FF818011A4A600554D5D69295C0D083096015959A86A60B270' +
'358D40562901354540562B0135394056197E3500A69E0CA9');

'waterjug': WaterJugDTM := DTMFromString('78DA632C616460380CC448A0ADB686410448C' +
'34419416A76A0AA292C3A86AAA61CC8DA84AA06260B57D308641D' +
'20A0A608C83A4B404D3611E6E402595BF0AB01006A980BCA');

'bucket': BucketDTM := DTMFromString('78DA632C636460380CC4486052B90B8308908' +
'68932960259BB51D5A4FA49A1AAA903B2B6A3AA81C9C2D5540259' +
'6709A8C905B20EE0570300CB09086B');

end;
end;

Procedure FreeDTMs(DTMNames: TStringArray);
var
AxeDTM, PickDTM, KnifeDTM, LogDTM, OreDTM, BarDTM, ClayDTM, SoftClayDTM,
NetDTM, RodDTM, EssDTM, VialDTM, CageDTM, FeatherDTM, HarpoonDTM,FlaxDTM, WineJugDTM,
WaterJugDTM, BucketDTM, EmptyJugDTM, X, Y : Integer;

begin
X:= High(DTMNames)
for Y := 0 to X do
Case DTMNames[Y] of

'axe': FreeDTM(AxeDTM);

'pickaxe': FreeDTM(PickDTM);

'knife': FreeDTM(KnifeDTM);

'log': FreeDTM(LogDTM);

'ore': FreeDTM(OreDTM);

'bar': FreeDTM(BarDTM);

'clay': FreeDTM(ClayDTM);

'softclay': FreeDTM(SoftClayDTM);

'net': FreeDTM(NetDTM);

'rod': FreeDTM(RodDTM);

'ess': FreeDTM(EssDTM);

'feather': FreeDTM(FeatherDTM);

'vial': FreeDTM(VialDTM);

'lobpot': FreeDTM(CageDTM);

'harpoon': FreeDTM(HarpoonDTM);

'flax': FreeDTM(FlaxDTM);

'winejug': FreeDTM(WineJugDTM);

'emptyjug': FreeDTM(EmptyJugDTM);

'waterjug': FreeDTM(WaterJugDTM);

'bucket': FreeDTM(BucketDTM);

end;
end;

V 0.1.4 :

Major bugfix, added N C D S 's DTMs.

  {===================================}
{ }
{ ======================== }
{ ||D T M L I B R A R Y|| }
{ ======================== }
{ }
{===================================}
{ }
{ How to use }
{ =========== }
{To call a DTM ,use the procedure : }
{ GetDTM(names of dtms). }
{ }
{Example : GetDTMs(['log','knife']) }
{ }
{===================================}
{ }
{ Valid names : }
{ ============= }
{ }
{ axe }
{ pickaxe }
{ knife }
{ log }
{ ore }
{ bar }
{ clay }
{ softclay }
{ net }
{ rod }
{ ess }
{ vial }
{ lobpot }
{ feather }
{ harpoon }
{ flax }
{ emptyjug }
{ winejug }
{ waterjug }
{ bucket }
{ cake }
{ chococake }
{ bread }
{ }
{===================================}
{ }
{ Freeing DTMs }
{ ============ }
{ }
{ To free the DTMs you called from }
{ this library, use the procedure: }
{ }
{ FreeDTMs(names of called DTMs) }
{Example : FreeDTMs(['log','knife'])}
{ }
{===================================}
{ }
{ Credits }
{ ======= }
{ }
{ [Dr D. Dervish] }
{ ~Created the library~ }
{ }
{ [N3ss3s] }
{ ~Helped me with Arrays~ }
{ }
{ [KillerDou] }
{ ~Even though I don't use~ }
{ ~them here, he helped me~ }
{ ~by explaining Sets~ }
{ }
{ [N C D S] }
{ ~Gave me a few DTMs~ }
{ ~From his thieving script~ }
{ }
{===================================}
{ }
{I will add DTMs to this Database if}
{ you post requests of DTMs on the }
{ thread. }
{ }
{===================================}
Program DTMLibrary;

var
AxeDTM, PickDTM, KnifeDTM, LogDTM, OreDTM, BarDTM, ClayDTM, SoftClayDTM,
NetDTM, RodDTM, EssDTM, VialDTM, CageDTM, FeatherDTM, HarpoonDTM,FlaxDTM, WineJugDTM,
WaterJugDTM, BucketDTM, EmptyJugDTM, CakeDTM, ChocolateCakeDTM, BreadDTM: Integer;

Procedure GetDTMs(DTMNames: TStringArray);

var
AxeDTM, PickDTM, KnifeDTM, LogDTM, OreDTM, BarDTM, ClayDTM, SoftClayDTM,
NetDTM, RodDTM, EssDTM, VialDTM, CageDTM, FeatherDTM, HarpoonDTM,FlaxDTM, WineJugDTM,
WaterJugDTM, BucketDTM, EmptyJugDTM, X, Y, CakeDTM, ChocolateCakeDTM, BreadDTM: Integer;

Begin
X:= High(DTMNames);
for Y:= 0 to X do
Case DTMNames[Y] of

'axe': AxeDTM := DTMFromString('78DA63B46364603809C44820DC4589E13F900' +
'689FE0702464B206B0FAA1A882C8C04D26E40D601026A8C81ACAB' +
'F8D50000EADF09D6');

'pickaxe': PickDTM := DTMFromString('78DA63B4626460E002622460A0C0C6F01F488' +
'344FF0301A31D90F597010D30229140DA0BC86267C4AFC60CC812' +
'21A0C610C862C4AF06003A0C07B5');

'knife': KnifeDTM := DTMFromString('78DA6374606460D805C448A0302B134CC3441' +
'99D81AC0DA86A60B270358E40D61E026A4C81AC1304D4980359A7' +
'08A8B105B276E2570300CE950740');

'log': LogDTM := DTMFromString('78DA6374606460B806C44860EAA42E86FF401' +
'A24FA1F08188D80AC73A86A20B23012485B01590F08A8F101B26E' +
'1050630F649DC6AF060025EC0C23');

'ore': OreDTM := DTMFromString('78DA63B46764603806C448C0CECF9EE13F900' +
'689FE0702464320EB10AA1A882C8C04D20640D645026AEC80AC73' +
'04D47803590709A8B101B2F61250E308641D26C29C6BF8D50000E' +
'15A0E0E');

'bar': BarDTM := DTMFromString('78DA63B4666460D808C448A034819FE13F900' +
'689FE07024613206B27AA1A882C8C04D2F640D66E026ABC80AC75' +
'04D4980359AB71AB6101D15640D60AFCE60000FF250B90');

'clay': ClayDTM := DTMFromString('78DA63FCC6C0C090C98002265405816946289' +
'FF13790486540038CA86ADE02892C026ABE00897C026A1881AC74' +
'026A3E3010540300C46608A7');

'softclay': SoftClayDTM := DTMFromString('78DA63FCCEC0C0D0CD80027283F8C0342394C' +
'FF811483431A0014654358C40562B0135FF81C464026A3E038969' +
'04D4BC05129DF8D50000729E08EC');

'net': NetDTM := DTMFromString('78DA63FCCAC0C090CDC8800CCC7595C0344C9' +
'4F12790484655039385ABF902245208A87905240A09A86104B22A' +
'09A86103B2B2F0AB0100049406F9');

'rod': RodDTM := DTMFromString('78DA63FCC6C0C0A0CEC8800C4A23F8C1344C9' +
'4F12B90504455039385AB6102B2A409A8F90124F408A8790F240C' +
'09A8790D2434F1AB0100620D069F');

'ess': EssDTM := DTMFromString('78DA63FCC1C0C0E0CDC8800C5AAAABC1344C9' +
'49115C8F24055039385AB0199634B40CD4B20E14740CD6F201181' +
'5F0D00FFAE06DE');

'feather': FeatherDTM := DTMFromString('78DA63FCC6C0C050C3C8800C0EEDDAC9F01F4' +
'88344FF0301E33B20A303550D44164602E91F40A290801A46202B' +
'97809A9F40A211BF1A00FD430D7E');

'vial': VialDTM := DTMFromString('78DA63FCC6C0C0A0C9C8800CCACB2B18FE036' +
'990E87F2060FC0D64C8A0AA81C8C248200D324782809AB740C280' +
'809AF740C298801A104B1FBF1A00C7660C2C');

'lobpot': CageDTM := DTMFromString('78DA63FCC6C0C0A0C9C8800CCACB2B18FE036' +
'990E87F2060FC0D64C8A0AA81C8C248200D324782809AB740C280' +
'809AF740C298801A104B1FBF1A00C7660C2C');

'harpoon': HarpoonDTM := DTMFromString('78DA63FCC6C0C0A0C9C8800CCACB2B18FE036' +
'990E87F2060FC0D64C8A0AA81C8C248200D324782809AB740C280' +
'809AF740C298801A104B1FBF1A00C7660C2C');

'flax': FlaxDTM := DTMFromString('78DA632C636460B8C78002F87205C1342394C' +
'F580564DD6040038CA86A9A81AC3B04D480CC7946404D1E90F592' +
'809A4C20EB017E35004DB608A9');

'winejug': WineJugDTM := DTMFromString('78DA632C616460A8066224D0565BC32002A44' +
'1A2FF8180B114C82A445533CFC112AE060418AB80AC1C54353059' +
'B89A2620AB8C809A7220AB85809A2C4C3763A801B9250FBF1A005' +
'80F0D49');

'emptyjug': EmptyJugDTM := DTMFromString('78DA632C616460A8026224D0565BC32002A44' +
'1A2FF818011A4A600554D5D69295C0D083096015959A86A60B270' +
'358D40562901354540562B0135394056197E3500A69E0CA9');

'waterjug': WaterJugDTM := DTMFromString('78DA632C616460380CC448A0ADB686410448C' +
'34419416A76A0AA292C3A86AAA61CC8DA84AA06260B57D308641D' +
'20A0A608C83A4B404D3611E6E402595BF0AB01006A980BCA');

'bucket': BucketDTM := DTMFromString('78DA632C636460380CC4486052B90B8308908' +
'68932960259BB51D5A4FA49A1AAA903B2B6A3AA81C9C2D5540259' +
'6709A8C905B20EE0570300CB09086B');

'cake': CakeDTM := DTMFromString('78DA63AC62646078C28002EEDEBCC1F01F480' +
'36518FE03012348CD0D0634C0C8C00F5503E6750259F709A80199' +
'F39E809A1C4CF7C064616A0058570E9B');

'bread': BreadDTM := DTMFromString('78DA63AC66646078CC800226950B31FC07D24' +
'01986FF40C0D80A64DD6240038C0CFC5035605E3E90F596809A52' +
'20EB3E01358D40D64B4C350C486A0072400D2E');

'chococake': ChocolateCakeDTM := DTMFromString('78DA63AC62646078CA8002729D7819FE0369A' +
'00CC37F206004A9B9C980061819F8A16AC0BC7620EB3901352073' +
'3E1050930F643DC254C380A406003B3F0CD3');


end;
end;

Procedure FreeDTMs(DTMNames: TStringArray);
var
AxeDTM, PickDTM, KnifeDTM, LogDTM, OreDTM, BarDTM, ClayDTM, SoftClayDTM,
NetDTM, RodDTM, EssDTM, VialDTM, CageDTM, FeatherDTM, HarpoonDTM,FlaxDTM, WineJugDTM,
WaterJugDTM, BucketDTM, EmptyJugDTM, X, Y, CakeDTM, ChocolateCakeDTM, BreadDTM : Integer;

begin
X:= High(DTMNames)
for Y := 0 to X do
Case DTMNames[Y] of

'axe': FreeDTM(AxeDTM);

'pickaxe': FreeDTM(PickDTM);

'knife': FreeDTM(KnifeDTM);

'log': FreeDTM(LogDTM);

'ore': FreeDTM(OreDTM);

'bar': FreeDTM(BarDTM);

'clay': FreeDTM(ClayDTM);

'softclay': FreeDTM(SoftClayDTM);

'net': FreeDTM(NetDTM);

'rod': FreeDTM(RodDTM);

'ess': FreeDTM(EssDTM);

'feather': FreeDTM(FeatherDTM);

'vial': FreeDTM(VialDTM);

'lobpot': FreeDTM(CageDTM);

'harpoon': FreeDTM(HarpoonDTM);

'flax': FreeDTM(FlaxDTM);

'winejug': FreeDTM(WineJugDTM);

'emptyjug': FreeDTM(EmptyJugDTM);

'waterjug': FreeDTM(WaterJugDTM);

'bucket': FreeDTM(BucketDTM);

'cake': FreeDTM(CakeDTM);

'chococake':FreeDTM(ChocolateCakeDTM);

'bread': FreeDTM(BreadDTM);
end;
end;

To request a DTM please post on the thread.

Hope you like it xD.

benjaa

2009-01-03 23:09:45

This is a very good idea, you should keep it up

Also include :full jug and empty jug, flax, bucket

there's heapps more, ill edit post soon

Kyle Undefined

2009-01-04 02:50:52

Nice work, very useful! Great idea ;)

~Camo

Naum

2009-01-04 06:09:21

A simpler way to cut down all that code would be to use arrays.

So when you free them all you do is this
To i := 0 to High({dtm}) Do
FreeDTM({dtm}[i]);

Nice job, btw ;)

Dervish

2009-01-04 08:05:11

Thanks for your good comments, adding Benjaa's DTMs…

Edit : Benjaa, for the full jug, what's it full of ? Theres , wine , water…

I'll make both :p.

benjaa

2009-01-04 08:23:07

i was thinking water, but yeah also water

do you need any help Dr? i could do a couple DTM's if you want
just need to know the tolerance's you're using, and ill be happy to contribute

Dervish

2009-01-04 08:32:33

I use 20 in tolerance ^^.

Yeah all help is welcome as its kind of tiring to do 10 DTM's streak xD (Lazynezz).

I'll give you good credits :) (if you care about that) and Rep if you help me ^^.

This way everyone can include their own Ideas for dtms and make it more complete :).

benjaa

2009-01-04 09:31:32

Alright sweet, I'll be on the lookout for useful dtm's and i'll post here

NCDS

2009-01-05 02:59:04


CakeDTM := DTMFromString('78DA63AC62646078C28002EEDEBCC1F01F480' +
'36518FE03012348CD0D0634C0C8C00F5503E6750259F709A80199' +
'F39E809A1C4CF7C064616A0058570E9B');
BreadDTM := DTMFromString('78DA63AC66646078CC800226950B31FC07D24' +
'01986FF40C0D80A64DD6240038C0CFC5035605E3E90F596809A52' +
'20EB3E01358D40D64B4C350C486A0072400D2E');
ChocolateCakeDTM := DTMFromString('78DA63AC62646078CA8002729D7819FE0369A' +
'00CC37F206004A9B9C980061819F8A16AC0BC7620EB3901352073' +
'3E1050930F643DC254C380A406003B3F0CD3');

I use them in my thieving script so I figured I would post :)

Quickmarch

2009-01-05 03:04:01

Is this for finding DTMs, if so wouldn't it be better to make it a function?

function GetDTMs(DTMNames: TStringArray): Integer;

And make the result the DTMs, i don't know if i'm right, just an idea :)

Good idea though ;)

Sandstorm

2009-01-05 08:54:46

No, because what happens if you need multiple dtms? Then you get a screwed up integer :). Array of Integer might work though.

/Ponders.

~Sandstorm

Shuttleu

2009-01-05 09:08:03

think this would work (firs time scripting in a long time
  {===================================}
{ }
{ ======================== }
{ ||D T M L I B R A R Y|| }
{ ======================== }
{ }
{===================================}
{ }
{ How to use }
{ =========== }
{To call a DTM ,use the procedure : }
{ GetDTM(names of dtms). }
{ }
{ Example : GetDTMs('log','knife') }
{ }
{===================================}
{ }
{ Valid names : }
{ ============= }
{ }
{ axe }
{ pickaxe }
{ knife }
{ log }
{ ore }
{ bar }
{ clay }
{ softclay }
{ net }
{ rod }
{ ess }
{ vial }
{ lobpot }
{ feather }
{ harpoon }
{ flax }
{ emptyjug }
{ winejug }
{ waterjug }
{ bucket }
{ }
{===================================}
{ }
{ Freeing DTMs }
{ ============ }
{ }
{ To free the DTMs you called from }
{ this library, use the procedure: }
{ }
{ FreeDTMs(names of called DTMs) }
{ Example : FreeDTMs('log','knife') }
{ }
{===================================}
{ }
{ Credits }
{ ======= }
{ }
{ [Dr D. Dervish] }
{ ~Created the library~ }
{ }
{ [N3ss3s] }
{ ~Helped me with Arrays~ }
{ }
{ [KillerDou] }
{ ~Even though I don't use~ }
{ ~them here, he helped me~ }
{ ~by explaining Sets~ }
{ }
{===================================}
{ }
{I will add DTMs to this Database if}
{ you post requests of DTMs on the }
{ thread. }
{ }
{===================================}


function GetDTMs(DTMNames: TStringArray) : TIntegerArray;

var
DTM, X, Y : Integer;

begin
X:= High(DTMNames);
for Y:= 0 to X do
begin
case DTMNames[Y] of

'axe': DTM := DTMFromString('78DA63B46364603809C44820DC4589E13F900' +
'689FE0702464B206B0FAA1A882C8C04D26E40D601026A8C81ACAB' +
'F8D50000EADF09D6');

'pickaxe': DTM := DTMFromString('78DA63B4626460E002622460A0C0C6F01F488' +
'344FF0301A31D90F597010D30229140DA0BC86267C4AFC60CC812' +
'21A0C610C862C4AF06003A0C07B5');

'knife': DTM := DTMFromString('78DA6374606460D805C448A0302B134CC3441' +
'99D81AC0DA86A60B270358E40D61E026A4C81AC1304D4980359A7' +
'08A8B105B276E2570300CE950740');

'log': DTM := DTMFromString('78DA6374606460B806C44860EAA42E86FF401' +
'A24FA1F08188D80AC73A86A20B23012485B01590F08A8F101B26E' +
'1050630F649DC6AF060025EC0C23');

'ore': DTM := DTMFromString('78DA63B46764603806C448C0CECF9EE13F900' +
'689FE0702464320EB10AA1A882C8C04D20640D645026AEC80AC73' +
'04D47803590709A8B101B2F61250E308641D26C29C6BF8D50000E' +
'15A0E0E');

'bar': DTM := DTMFromString('78DA63B4666460D808C448A034819FE13F900' +
'689FE07024613206B27AA1A882C8C04D2F640D66E026ABC80AC75' +
'04D4980359AB71AB6101D15640D60AFCE60000FF250B90');

'clay': DTM := DTMFromString('78DA63FCC6C0C090C98002265405816946289' +
'FF13790486540038CA86ADE02892C026ABE00897C026A1881AC74' +
'026A3E3010540300C46608A7');

'softclay': DTM := DTMFromString('78DA63FCCEC0C0D0CD80027283F8C0342394C' +
'FF811483431A0014654358C40562B0135FF81C464026A3E038969' +
'04D4BC05129DF8D50000729E08EC');

'net': DTM := DTMFromString('78DA63FCCAC0C090CDC8800CCC7595C0344C9' +
'4F12790484655039385ABF902245208A87905240A09A86104B22A' +
'09A86103B2B2F0AB0100049406F9');

'rod': DTM := DTMFromString('78DA63FCC6C0C0A0CEC8800C4A23F8C1344C9' +
'4F12B90504455039385AB6102B2A409A8F90124F408A8790F240C' +
'09A8790D2434F1AB0100620D069F');

'ess': DTM := DTMFromString('78DA63FCC1C0C0E0CDC8800C5AAAABC1344C9' +
'49115C8F24055039385AB0199634B40CD4B20E14740CD6F201181' +
'5F0D00FFAE06DE');

'feather': DTM := DTMFromString('78DA63FCC6C0C050C3C8800C0EEDDAC9F01F4' +
'88344FF0301E33B20A303550D44164602E91F40A290801A46202B' +
'97809A9F40A211BF1A00FD430D7E');

'vial': DTM := DTMFromString('78DA63FCC6C0C0A0C9C8800CCACB2B18FE036' +
'990E87F2060FC0D64C8A0AA81C8C248200D324782809AB740C280' +
'809AF740C298801A104B1FBF1A00C7660C2C');

'lobpot': DTM := DTMFromString('78DA63FCC6C0C0A0C9C8800CCACB2B18FE036' +
'990E87F2060FC0D64C8A0AA81C8C248200D324782809AB740C280' +
'809AF740C298801A104B1FBF1A00C7660C2C');

'harpoon': DTM := DTMFromString('78DA63FCC6C0C0A0C9C8800CCACB2B18FE036' +
'990E87F2060FC0D64C8A0AA81C8C248200D324782809AB740C280' +
'809AF740C298801A104B1FBF1A00C7660C2C');

'flax': DTM := DTMFromString('78DA632C636460B8C78002F87205C1342394C' +
'F580564DD6040038CA86A9A81AC3B04D480CC7946404D1E90F592' +
'809A4C20EB017E35004DB608A9');

'winejug': DTM := DTMFromString('78DA632C616460A8066224D0565BC32002A44' +
'1A2FF8180B114C82A445533CFC112AE060418AB80AC1C54353059' +
'B89A2620AB8C809A7220AB85809A2C4C3763A801B9250FBF1A005' +
'80F0D49');

'emptyjug': DTM := DTMFromString('78DA632C616460A8026224D0565BC32002A44' +
'1A2FF818011A4A600554D5D69295C0D083096015959A86A60B270' +
'358D40562901354540562B0135394056197E3500A69E0CA9');

'waterjug': DTM := DTMFromString('78DA632C616460380CC448A0ADB686410448C' +
'34419416A76A0AA292C3A86AAA61CC8DA84AA06260B57D308641D' +
'20A0A608C83A4B404D3611E6E402595BF0AB01006A980BCA');

'bucket': DTM := DTMFromString('78DA632C636460380CC4486052B90B8308908' +
'68932960259BB51D5A4FA49A1AAA903B2B6A3AA81C9C2D5540259' +
'6709A8C905B20EE0570300CB09086B');

end;
Result[y]:= DTM;
end;
end;

Procedure FreeDTMs(var DTMs: TIntegerArray);
var
X, Y : Integer;

begin
X:= High(DTMs)
for Y := 0 to X do
Case DTMs[Y] of
FreeDTM(DTMs);
end;
end;

~shut

Dervish

2009-01-05 10:52:33

Thanks for the dtms N C D S, :).

Shuttleu That works ! Thanks alot ^^.

No thanks for the Function suggestion ^^ I like it the way it is simple for use and easy :).

You just download it, Include it, then use (for example) :

GetDTMs(['ess', 'pickaxe']);

In the setup of like a rune ess miner.

Then put a new procedure called :

procedure ScriptTerminate;
begin
FreeDTMs(['ess','pickaxe']);
end;

Since ScriptTerminate is automatically called by SCAR when a script finishes, you won't have to make a new procedure and … Woooo…

So an example of the script useing this would be :

program New;
{.include SRL/SRL.scar}
{.include DTMLib.scar}

var
FoundPickaxe, FoundEss : Boolean;
X,y : Integer;

Procedure Setup;
begin
SetupSRL;
GetDTMs(['pickaxe','ess']);
ClearDebug;
end;

Procedure TestDTMs;
begin
If FindDTM(PickDTM,x,y,0,0,500,500) then
begin
Writeln('Found the Pickaxe.');
FoundPickaxe := True;
end else
begin
Writeln('Didnt find the Pickaxe.');
FoundPickaxe := False;
end;
If FindDTM(EssDTM,x,y,0,0,500,500) then
begin
Writeln('Found Essssss !!!');
FoundEss := True;
end else
begin
Writeln('Didnt find ess.');
FoundEss := False;
end;
end;

Procedure ScriptTerminate;
begin
FreeDTMs(['pick','ess']);
end;

begin
Setup;
TestDTMs;
end.

Just an example, pretty sure there's an error somewhere, dunno just wrote it quickly.

New Version out ! Includes N C D S's DTMs and new credits :).

Shuttleu

2009-01-05 12:24:57

but mines better
it wastes less memory

~shut

Dervish

2009-01-05 12:32:27

Your what ? DTMLibrary or FreeDTM function ?

Your version of FreeDTMs had an error, some colon (:) needed somewhere…

Shuttleu

2009-01-05 12:35:37

where?
i didnt test it i just quickly wrote it :)
also its easier to add a dtm

~shut

ShowerThoughts

2009-01-05 12:38:14

I think this isn't smart because u call all those global vars and costs memory.

Shuttleu

2009-01-05 12:39:37

From: Hermpie
I think this isn't smart because u call all those global vars and costs memory.


which is why i posted my version
more memory efficient :)

~shut

Dervish

2009-01-05 12:41:53

Lets not argue about amount of memory etc…

Shuttleu I'd love to use your version but I don't understand where the error is ^^.

Shuttleu

2009-01-05 12:43:46

From: Dr D. Dervish
Lets not argue about amount of memory etc…

Shuttleu I'd love to use your version but I don't understand where the error is ^^.


ugh… i will find out

~shut

boberman

2009-01-05 12:48:47

This introduces the possibility for a memory leak pretty easily, rather then send new DTMs out every time, how about keeping a hash of all the DTMs, initialize every element of that hash to 0, then when a DTM is called, if its value is 0 create the dtm, otherwise, just return the value stored in the hash.

Change the name of FreeDTMs to FreeDTMDB and pass no parameters, then just have it go through every DTM value, if it is 0, do nothing, if it is anything else free it up.

This should be fast, fairly memory efficient, and avoid the risk of a memory leak.

Dervish

2009-01-05 13:03:41

From: boberman
This introduces the possibility for a memory leak pretty easily, rather then send new DTMs out every time, how about keeping a hash of all the DTMs, initialize every element of that hash to 0, then when a DTM is called, if its value is 0 create the dtm, otherwise, just return the value stored in the hash.

Change the name of FreeDTMs to FreeDTMDB and pass no parameters, then just have it go through every DTM value, if it is 0, do nothing, if it is anything else free it up.

This should be fast, fairly memory efficient, and avoid the risk of a memory leak.


Or you could have a boolean for each DTM right ? So for example :

If (ClayDTMLoaded) then
begin
FreeDTM(ClayDTM);
end;

Assuming ClayDTMLoaded is the boolean ?

Shuttleu

2009-01-05 13:09:22

include:
 {===================================}
{ }
{ ======================== }
{ ||D T M L I B R A R Y|| }
{ ======================== }
{ }
{===================================}
{ }
{ How to use }
{ =========== }
{To call a DTM ,use the procedure : }
{ GetDTM(names of dtms). }
{ }
{ Example : GetDTMs('log','knife') }
{ }
{===================================}
{ }
{ Valid names : }
{ ============= }
{ }
{ axe }
{ pickaxe }
{ knife }
{ log }
{ ore }
{ bar }
{ clay }
{ softclay }
{ net }
{ rod }
{ ess }
{ vial }
{ lobpot }
{ feather }
{ harpoon }
{ flax }
{ emptyjug }
{ winejug }
{ waterjug }
{ bucket }
{ }
{===================================}
{ }
{ Freeing DTMs }
{ ============ }
{ }
{ To free the DTMs you called from }
{ this library, use the procedure: }
{ }
{ FreeDTMs(names of called DTMs) }
{ Example : FreeDTMs('log','knife') }
{ }
{===================================}
{ }
{ Credits }
{ ======= }
{ }
{ [Dr D. Dervish] }
{ ~Created the library~ }
{ }
{ [N3ss3s] }
{ ~Helped me with Arrays~ }
{ }
{ [KillerDou] }
{ ~Even though I don't use~ }
{ ~them here, he helped me~ }
{ ~by explaining Sets~ }
{ }
{===================================}
{ }
{I will add DTMs to this Database if}
{ you post requests of DTMs on the }
{ thread. }
{ }
{===================================}


function GetDTMsDB(DTMNames: TStringArray) : TIntegerArray;

var
DTM, X, Y : Integer;

begin
X:= High(DTMNames);
for Y:= 0 to X do
begin
case DTMNames[Y] of

'axe': DTM := DTMFromString('78DA63B46364603809C44820DC4589E13F900' +
'689FE0702464B206B0FAA1A882C8C04D26E40D601026A8C81ACAB' +
'F8D50000EADF09D6');

'pickaxe': DTM := DTMFromString('78DA63B4626460E002622460A0C0C6F01F488' +
'344FF0301A31D90F597010D30229140DA0BC86267C4AFC60CC812' +
'21A0C610C862C4AF06003A0C07B5');

'knife': DTM := DTMFromString('78DA6374606460D805C448A0302B134CC3441' +
'99D81AC0DA86A60B270358E40D61E026A4C81AC1304D4980359A7' +
'08A8B105B276E2570300CE950740');

'log': DTM := DTMFromString('78DA6374606460B806C44860EAA42E86FF401' +
'A24FA1F08188D80AC73A86A20B23012485B01590F08A8F101B26E' +
'1050630F649DC6AF060025EC0C23');

'ore': DTM := DTMFromString('78DA63B46764603806C448C0CECF9EE13F900' +
'689FE0702464320EB10AA1A882C8C04D20640D645026AEC80AC73' +
'04D47803590709A8B101B2F61250E308641D26C29C6BF8D50000E' +
'15A0E0E');

'bar': DTM := DTMFromString('78DA63B4666460D808C448A034819FE13F900' +
'689FE07024613206B27AA1A882C8C04D2F640D66E026ABC80AC75' +
'04D4980359AB71AB6101D15640D60AFCE60000FF250B90');

'clay': DTM := DTMFromString('78DA63FCC6C0C090C98002265405816946289' +
'FF13790486540038CA86ADE02892C026ABE00897C026A1881AC74' +
'026A3E3010540300C46608A7');

'softclay': DTM := DTMFromString('78DA63FCCEC0C0D0CD80027283F8C0342394C' +
'FF811483431A0014654358C40562B0135FF81C464026A3E038969' +
'04D4BC05129DF8D50000729E08EC');

'net': DTM := DTMFromString('78DA63FCCAC0C090CDC8800CCC7595C0344C9' +
'4F12790484655039385ABF902245208A87905240A09A86104B22A' +
'09A86103B2B2F0AB0100049406F9');

'rod': DTM := DTMFromString('78DA63FCC6C0C0A0CEC8800C4A23F8C1344C9' +
'4F12B90504455039385AB6102B2A409A8F90124F408A8790F240C' +
'09A8790D2434F1AB0100620D069F');

'ess': DTM := DTMFromString('78DA63FCC1C0C0E0CDC8800C5AAAABC1344C9' +
'49115C8F24055039385AB0199634B40CD4B20E14740CD6F201181' +
'5F0D00FFAE06DE');

'feather': DTM := DTMFromString('78DA63FCC6C0C050C3C8800C0EEDDAC9F01F4' +
'88344FF0301E33B20A303550D44164602E91F40A290801A46202B' +
'97809A9F40A211BF1A00FD430D7E');

'vial': DTM := DTMFromString('78DA63FCC6C0C0A0C9C8800CCACB2B18FE036' +
'990E87F2060FC0D64C8A0AA81C8C248200D324782809AB740C280' +
'809AF740C298801A104B1FBF1A00C7660C2C');

'lobpot': DTM := DTMFromString('78DA63FCC6C0C0A0C9C8800CCACB2B18FE036' +
'990E87F2060FC0D64C8A0AA81C8C248200D324782809AB740C280' +
'809AF740C298801A104B1FBF1A00C7660C2C');

'harpoon': DTM := DTMFromString('78DA63FCC6C0C0A0C9C8800CCACB2B18FE036' +
'990E87F2060FC0D64C8A0AA81C8C248200D324782809AB740C280' +
'809AF740C298801A104B1FBF1A00C7660C2C');

'flax': DTM := DTMFromString('78DA632C636460B8C78002F87205C1342394C' +
'F580564DD6040038CA86A9A81AC3B04D480CC7946404D1E90F592' +
'809A4C20EB017E35004DB608A9');

'winejug': DTM := DTMFromString('78DA632C616460A8066224D0565BC32002A44' +
'1A2FF8180B114C82A445533CFC112AE060418AB80AC1C54353059' +
'B89A2620AB8C809A7220AB85809A2C4C3763A801B9250FBF1A005' +
'80F0D49');

'emptyjug': DTM := DTMFromString('78DA632C616460A8026224D0565BC32002A44' +
'1A2FF818011A4A600554D5D69295C0D083096015959A86A60B270' +
'358D40562901354540562B0135394056197E3500A69E0CA9');

'waterjug': DTM := DTMFromString('78DA632C616460380CC448A0ADB686410448C' +
'34419416A76A0AA292C3A86AAA61CC8DA84AA06260B57D308641D' +
'20A0A608C83A4B404D3611E6E402595BF0AB01006A980BCA');

'bucket': DTM := DTMFromString('78DA632C636460380CC4486052B90B8308908' +
'68932960259BB51D5A4FA49A1AAA903B2B6A3AA81C9C2D5540259' +
'6709A8C905B20EE0570300CB09086B');

end;
Result[y]:= DTM;
end;
end;

Procedure FreeDTMsDB(var DTMs: TIntegerArray);
var
X, Y : Integer;

begin
X:= High(DTMs)
for Y := 0 to X do
FreeDTM(DTMs[y]);
end;
used to test
program New;
{.include SRL/SRL.scar}
{.include DTMLib.scar}

var
FoundPickaxe, FoundEss : Boolean;
X,y : Integer;
dtm : TIntegerArray;

Procedure Setup;
begin
SetLength(dtm, 2);
SetupSRL;
dtm:=GetDTMsDB(['pickaxe','ess']);
ClearDebug;
end;

Procedure TestDTMs;
begin
If FindDTM(DTM[0],x,y,0,0,500,500) then
begin
Writeln('Found the Pickaxe.');
FoundPickaxe := True;
end else
begin
Writeln('Didnt find the Pickaxe.');
FoundPickaxe := False;
end;
If FindDTM(DTM[1],x,y,0,0,500,500) then
begin
Writeln('Found Essssss !!!');
FoundEss := True;
end else
begin
Writeln('Didnt find ess.');
FoundEss := False;
end;
end;

Procedure ScriptTerminate;
begin
FreeDTMsDB(dtm);
end;

begin
Setup;
TestDTMs;
end.
to use:
include a TIntegerArray at the top of your script with all the other vars

var
DTMs : TIntegerArray
then after SetupSrl; declare the length of the Array

begin
SetupSrl;
SetLength(DTMs, 2);
then declare them like so

DTMs:= GetDTMsDB(['ess', 'rod']);
do DTMs[0] will be the ess DTM and DTMs[1] will be the rod DTM
then use them like normal and when your finished with the DTMs or at the end you just call

FreeDTMsDB(DTMs);
nice and simple
also it is much much easier to add more DTMs plus it is more memory efficient ;)

~shut

boberman

2009-01-05 13:59:32

Ok, here is how I would change the DB.

const HASH_SIZE = 44;

var
hash : array of integer;

procedure SetupDTMDB();
var
i : integer;
begin
SetLength(hash, HASH_SIZE);
for i := 0 to HASH_SIZE - 1 do
hash[i] := 0;
end;

function GetHashValue(key : string) : integer;
var
i, value : integer;
begin
value := 0;
for i := 1 to High(key) do
value := value + Ord(key[i]);
Result := value mod HASH_SIZE;
end;

Function GetDTM(DTMName : string) : integer;
Begin
if (hash[GetHashValue(DTMName)] <> 0) then
begin
Result := hash[GetHashValue(DTMName)];
end else
begin
Case DTMName of

'axe': Result := DTMFromString('78DA63B46364603809C44820DC4589E13F900' +
'689FE0702464B206B0FAA1A882C8C04D26E40D601026A8C81ACAB' +
'F8D50000EADF09D6');

'pickaxe': Result := DTMFromString('78DA63B4626460E002622460A0C0C6F01F488' +
'344FF0301A31D90F597010D30229140DA0BC86267C4AFC60CC812' +
'21A0C610C862C4AF06003A0C07B5');

'knife': Result := DTMFromString('78DA6374606460D805C448A0302B134CC3441' +
'99D81AC0DA86A60B270358E40D61E026A4C81AC1304D4980359A7' +
'08A8B105B276E2570300CE950740');

'log': Result := DTMFromString('78DA6374606460B806C44860EAA42E86FF401' +
'A24FA1F08188D80AC73A86A20B23012485B01590F08A8F101B26E' +
'1050630F649DC6AF060025EC0C23');

'ore': Result := DTMFromString('78DA63B46764603806C448C0CECF9EE13F900' +
'689FE0702464320EB10AA1A882C8C04D20640D645026AEC80AC73' +
'04D47803590709A8B101B2F61250E308641D26C29C6BF8D50000E' +
'15A0E0E');

'bar': Result := DTMFromString('78DA63B4666460D808C448A034819FE13F900' +
'689FE07024613206B27AA1A882C8C04D2F640D66E026ABC80AC75' +
'04D4980359AB71AB6101D15640D60AFCE60000FF250B90');

'clay': Result := DTMFromString('78DA63FCC6C0C090C98002265405816946289' +
'FF13790486540038CA86ADE02892C026ABE00897C026A1881AC74' +
'026A3E3010540300C46608A7');

'softclay': Result := DTMFromString('78DA63FCCEC0C0D0CD80027283F8C0342394C' +
'FF811483431A0014654358C40562B0135FF81C464026A3E038969' +
'04D4BC05129DF8D50000729E08EC');

'net': Result := DTMFromString('78DA63FCCAC0C090CDC8800CCC7595C0344C9' +
'4F12790484655039385ABF902245208A87905240A09A86104B22A' +
'09A86103B2B2F0AB0100049406F9');

'rod': Result := DTMFromString('78DA63FCC6C0C0A0CEC8800C4A23F8C1344C9' +
'4F12B90504455039385AB6102B2A409A8F90124F408A8790F240C' +
'09A8790D2434F1AB0100620D069F');

'ess': Result := DTMFromString('78DA63FCC1C0C0E0CDC8800C5AAAABC1344C9' +
'49115C8F24055039385AB0199634B40CD4B20E14740CD6F201181' +
'5F0D00FFAE06DE');

'feather': Result := DTMFromString('78DA63FCC6C0C050C3C8800C0EEDDAC9F01F4' +
'88344FF0301E33B20A303550D44164602E91F40A290801A46202B' +
'97809A9F40A211BF1A00FD430D7E');

'vial': Result := DTMFromString('78DA63FCC6C0C0A0C9C8800CCACB2B18FE036' +
'990E87F2060FC0D64C8A0AA81C8C248200D324782809AB740C280' +
'809AF740C298801A104B1FBF1A00C7660C2C');

'lobpot': Result := DTMFromString('78DA63FCC6C0C0A0C9C8800CCACB2B18FE036' +
'990E87F2060FC0D64C8A0AA81C8C248200D324782809AB740C280' +
'809AF740C298801A104B1FBF1A00C7660C2C');

'harpoon': Result := DTMFromString('78DA63FCC6C0C0A0C9C8800CCACB2B18FE036' +
'990E87F2060FC0D64C8A0AA81C8C248200D324782809AB740C280' +
'809AF740C298801A104B1FBF1A00C7660C2C');
end;
hash[GetHashValue(DTMName)] := Result;
end;
end;

Procedure FreeDTMDB();
var
i : integer;
begin
for i := 0 to HASH_SIZE - 1 do
if hash[i] <> 0 then
FreeDTM(hash[i]);
end;

Notice that SetupDTMDB needs to be called. Also, HASH_SIZE should be setup properly. To get a correct hash size, I've included a hash size calculator with its source. To use it simply type (in command prompt)

hashcalclator.exe < hashs.txt

where hashs.txt contains a file with all the DTM names on a line followed by a quit. (values.txt is a demo of what this file should look like).

That should keep memory leaks at a minimum and allow for quick DTM retrieval. Should be pretty memory efficient as well.

However, do note that this has NO collision detection built in. That means if your hash is too small you could easily get the wrong value for your hash (hence the reason to use the attached hash size calculator).

The benefit is that you can pretty much use GetDTM straight in a findDTM call with pretty much no overhead. DTMs are created automatically and managed in a way the a memory leak can't occur. Adding new DTMs is as easy as putting the keyword into the file, updating hash size (if needed), and then putting the DTM into the case statement.

Thinking about it, there is one problem that might not be so easily detectable. If a string has the same numerical value (ie 'ad' and 'da' are exactly the same numerical value) then the hash will fail and give the wrong value. This isn't very likely.

Sir R. M8gic1an

2009-01-05 17:08:53

tought i'd help the cause:


Procedure LoadDTMs;
begin

NetDTM := DTMFromString('78DA8DCDCD0A40601484E1735C83FBDF8ABE8' +
'5FC441F8A52DC156F3692326631B3796A7C4ACC2AB767DCD2ABCD' +
'0EE21193BDCDDDEC82C985593185303BA61466C374C2CC9851981' +
'E330853FFF80A9856980613BECD0916BF140B');
RodDTM := DTMFromString('78DA637CC6C4C0B08591011530229140FA0E5' +
'0CD66026A6E02D56C27A0E63650CD2E026AEE03D51C20A0E61150' +
'CD41026A9E02D5EC21A0E63950CD4E026ADE03D52C21C29CD504D' +
'43C00AAD9885F0D00D0A311CA');
FlyDTM := DTMFromString('78DA637CC2C4C03091910119D8E9733088006' +
'990E87F2060BC0954330D550D44164602E91B4035D309A8B90554' +
'338B809ADB40357308A87904543397809A1740359309A8790D54D' +
'34940CD5BA09A2E026A3E02D53412E16642E6DC07AAE9C7AF0600' +
'1897163C');
CageDTM := DTMFromString('78DA637CC6C4C0B089910119C43AF03088006' +
'990E87F20607C0C54B302550D44164602E9EB40355B08A8790854' +
'7380809AB740357B09A8F90454B39D0835ABF1AB01004D731022');
HarpoonDTM := DTMFromString('78DA63DCCDC4C070959101192479F13288006' +
'990E87F2060DC0354730E550D44164602E99D98E660A8D90854F3' +
'98809A4D40354F09A8D90F547389809AC34035E709A8390654739' +
'2809A434035C7F1AB0100542B130D');
end;

~RM

TViYH

2009-01-06 15:04:28

Looks pretty handy :)

Will be hell if JagSex makes large updates though :/

Baked0420

2009-01-13 16:20:58

wow I didn't even think of that TViYH, I was thinking this was a great idea, now I'm not as much incase they do have major updates ever but it'd still be very useful.

and if I make any DTM's I'll post them here for you guys.

Dervish

2009-01-13 16:28:27

Jagex could only destroy this by changing the shapes of the items or changing the color of the outer line which shouldn't happen right now ^^.

So we still have a moment of peace I think.

Smarter Child

2009-01-13 20:07:50

I have DTM's for logs?

Want them?

Edit: What about major banks etc. or would find symbol be better?>

Sandstorm

2009-01-13 21:58:17

Possible to make DDTMs? Or to inefficient? Because then you'd only have to change the DDTM completely if the shape of the item changed.

~Sandstorm

Boreas

2009-01-13 23:21:20

IMO there are two options, as the middle ground seems messy. Either you're going to have to do more work or not. So either use DTMs, or use a database system that can automatically create and update itself.

Da 0wner

2009-02-01 18:28:32

Better if you incorporated this with a website. Ability to add them. Although it would take a lot of bandwidth if many people used it, it'd be cool.

One downside is that you wouldn't be able to use it if you weren't connected to the internet, but since Runescape is on the internet, it wouldn't matter now, would it :p.

boberman

2009-02-02 01:23:58

From: Da 0wner
Better if you incorporated this with a website. Ability to add them. Although it would take a lot of bandwidth if many people used it, it'd be cool.

One downside is that you wouldn't be able to use it if you weren't connected to the internet, but since Runescape is on the internet, it wouldn't matter now, would it :p.


bad idea. Websites are slow compared to having the data directly on your computer. We are talking AT LEAST 100ms to get a dtm, when you have the data directly it is more like 1-2ms to load a dtm.

If you want it to update regularly, then that is what an SVN is for, which SRL already has.

Bixby Sayz

2009-09-09 05:37:16

Realize this is a old thread but it seemed the appropriate place to post this.

Anyone have a working water/empty jug since the update? I am struggling to come up with an empty jug that does not also pick up the water jug.

rogeruk

2009-09-09 23:13:26

Hell of a grave dig lol

Jug of water
DTM:= DTMFromString('78DA635CCCC4C0200EC44820267609032B906' + 
'604E2FF40C03817282F80AA06220B2381F43CA0BC0601351B80F2' +
'72F8D500006CAD0875');

Empty Jug
DTM := DTMFromString('78DA635CCCC4C0200EC448203D39998115483' + 
'302F17F20609C0B9417405503918591407A1E505E83809A0D4079' +
'39FC6A0055E90845');

Rich

2009-09-09 23:22:12

From: Bixby Sayz
Realize this is a old thread but it seemed the appropriate place to post this.


1) You're correct. This is an old thread.

2) Either "Scripting Help" or making your own would have been your best bet…Not posting in a 7 month old thread ;)

Richard.

Bixby Sayz

2009-09-10 03:42:21

Thanks so much. The reason I posted in here is I really like the idea of this thread and thought maybe it would be worth updating to make it current???

Next time I'll post in scripting help.

Edit: The water jug worked for me, which is what I already had. The empty jug failed to find either jug, compared to the one I came up with that found both. No wonder people love reflection. None of this dicking around trying to recreate all your dtms/bitmaps every time there is an update.

Edit: Before this gets closed, these work:

WaterJug := DTMFromString('78DA63E4616060606740010585C7195881342' +
'310FF0702464E280705302291409A0F48301150C30C24D808A801' +
'C9731350036288105003324396801A31202146408D2490E0C3AF0' +
'6000519069B');

EmptyJug := DTMFromString('78DA63E461606060674001C579790CAC409A1' +
'188FF0301232794830218914820CD07249808A86106126C04D480' +
'E4B909A801314408A80199214B408D18901023A0461248F0E1570' +
'3009C0F0642');

Smarter Child

2009-09-10 04:28:46

From: Bixby Sayz
Thanks so much. The reason I posted in here is I really like the idea of this thread and thought maybe it would be worth updating to make it current???

Next time I'll post in scripting help.

Edit: The water jug worked for me, which is what I already had. The empty jug failed to find either jug, compared to the one I came up with that found both. No wonder people love reflection. None of this dicking around trying to recreate all your dtms/bitmaps every time there is an update.


Ah, yes, well hooks aren't updating as fast as we expected :p….

well sorry for grave digging. a mod should close this ;)

Boreas

2009-09-10 07:29:52

Once FindTransparentBitmap is fixed we'll have self-updating bitmaps.

YoHoJo

2009-09-10 14:58:36

From: Boreas
Once FindTransparentBitmap is fixed we'll have self-updating bitmaps.


basically

[/thread]
haha

Rich

2009-09-10 19:46:40

From: YoHoJo
[/thread]
haha