SRL Archive - Help and Support

Problem with Multiple DTMs


JAD

2007-03-22 21:22:01

OK, heres the problem. I'm making a smither for varrock west bank that you can smith bars into anything you want. There are a LOT of DTM's because you need one for Plate Body, Plate Legs, Plate Skirt….etc. and heres what I want to do. for this function, I want it to click on the DTM which the user sets in the constants. so if they set the constant WhatItem=dagger it would look for the DTM That I already called dagger, or you'd change it to WhatItem=platebody…etc. So Heres what I have:

{/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
in the constant WhatItem, Put one of the following choices, Type it right||
FullHelm Dagger WCAxe ChainBody MediumHelm PlateLegs Mace Sword Scimitar ||
WarHammer PlateSkirt SquareShield LongSword BattleAxe TwoHandSword ||
KiteShield PlateBody .....Type them EXACTLY like that in the setup. ||
No spaces or anything. Thanks :) ||
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/}
program JADPounder;
{.include SRL/SRL.scar}
const

WhatItem ='Dagger';//What Item you want to smelt. read above for choices.
thats the setup so far. Heres the DTMs:

Procedure LoadDTMs;
begin

FullHelm := DTMFromString('78DA639CC8C8C0100CC4288091E13F986460F' +
'80F048CB380AC684C350812482FC06E0E869A70026AE60359F604' +
'D42C02B25C88B0CB07BF1A00F29E0B92');

Dagger := DTMFromString('78DA635CCEC0C0F098010D3032FC07930C0CF' +
'F8180713A90F111530D8204D28B81C46B026AA60089BF04D42CC4' +
'EE1E64350010190CC0');

WCAxe := DTMFromString('78DA63FCC2C0C0F09A010D3032FC07930C0CF' +
'F8180F10590F104530D8204D220F90F04D43C0212DF08A8F90424' +
'1E1350F31C483CC7AF0600E9481008');

ChainBody := DTMFromString('78DA63B4666460F8C480061819FE83490686F' +
'F40C0A80D64BDC35483208134C89CE704D4980059BF09A801D9F5' +
'93801A2320EB0901353A40D633FC6A00B3270CFB');

MediumHelm := DTMFromString('78DA63EC63646078C780061819FE83490686F' +
'F40C03813C87A8CA9064102E965D8CD4151331BC8FA4B84399F08' +
'A85902643DC7AF0600082F0E5B');

PlateLegs := DTMFromString('78DA63B460646050006214C0C8F01F4C3230F' +
'C0702463D204B1E530D8204D22073F408A83104B28C09A80199A1' +
'45408D2990254E408D31613500B34E077C');

Mace := DTMFromString('78DA63FCC6C0C0A0C8C8800A1819FE8349068' +
'6FF40C0F81AC890C554832081F45B20214940CD6720214E40CD0B' +
'20A1815F0D001C1E0A4F');


Sword:= DTMFromString('78DA635CC8C0C0A0C8C8800A1819FE8349068' +
'6FF40C03817C850C254832081F47420614C40CD3420A14340CD22' +
'2021895F0D007E9A08D8');

Scimitar := DTMFromString('78DA635CC0C0C010CDC8800A1819FE8349068' +
'6FF40C0B802C8F0C754832081F40420914E40CD1420114740CD1C' +
'20118A5F0D00E91A09DC');

WarHammer := DTMFromString('78DA637CCDC0C010C7C8800A1819FE8349068' +
'6FF40C0F81DC808C654832081F41B20E18DAE860155CD1320914A' +
'C01C909A4CFC6A008D170B6F');

PlateSkirt:= DTMFromString('78DA63B467646088016214C0C8F01F4C3230F' +
'C0702461B202B1D530D8204D27A44A85107B2E209A83104B20208' +
'A8D102B2C2F0AB010050DF0874');

SquareShield:= DTMFromString('78DA635CC4C8C0100FC4288091E13F986460F' +
'80F048C5380AC304C35081248F70159A904D4CC02B2FC09A89947' +
'580D00E39409C9');

LongSword := DTMFromString('78DA635CC8C0C0D0C7C8800A1819FE8349068' +
'6FF40C0381BC89880A9064102E91940620E01355381C434026A96' +
'008956FC6A0057430AF2');

BattleAxe := DTMFromString('78DA637CC4C0C0308F9101153032FC07930C0' +
'CFF8180F10D90D18AA9064102E9A740A28D809A6F40A29F809ACF' +
'40A213BF1A00F29C0C6D');

PlateBody := DTMFromString('78DA637CC4C0C0308F9101153032FC07930C0' +
'CFF8180F10D90D18AA9064102E9A740A28D809A6F40A29F809ACF' +
'40A213BF1A00F29C0C6D');

KiteShield := DTMFromString('78DA635CCCC8C0301588510023C37F30C9C0F' +
'01F0818670059F331D5204820DD0764CD24A006644F2B01354B80' +
'AC2EFC6A005CC10AF3');

TwoHandSword := DTMFromString('78DA639CCFC0C0708A9101153032FC07930C0' +
'CFF8180712E907114530D8204D2CB81C45E026A1601893D04D44C' +
'0312D7F0AB0100C5C40C09');

Bar := DTMFromString('78DA63DCC1C4C0B097910115302291407A1F5' +
'0CD365435215ED6A86A4E03D51C2260CE054C7330D41C01AAD944' +
'843984DCBC07A8E6087E35007BFD0B82');
end;
Theres the DTMs, and in the constant WhatItem, I want them to be able to put Whatever in there, and it will look for the DTM they selected, you get the Idea (hopefully :p) And heres what I was trying to do, and when I do it, I get a type mismatch error on it:

if(FindDTM(WhatItem, x, y, 437, 337, 2, 4))then
Also Tried:

if(FindDTM((WhatItem), x, y, 437, 337, 2, 4))then
Both of those got the type mismatch error in my clicking the armor/weapon procedure. If anybody knows how to help me, it would be greatly appreciated because then I can finish my script of uberness :) thanks for reading, and thanks for the help you hopefully give in advance.
~JAD

WhoCares357

2007-03-22 22:50:09

This is kinda off topic, but I noticed that you load them all at once. Wouldn't that lag very badly? I would suggest loading the one the user wants to make.

Junior

2007-03-22 23:11:20

Use a case statement, I think that will work.

function item: integer;
begin
case (WhatItem) of
'FullHelm': Result := FullHelm;
'Dagger': Result := Dagger;
'WCAxe': Result := WCAxe;
'ChainBody': Result := ChainBody;
'MediumHelm': Result := MediumHelm;
'PlateLegs': Result := PlateLegs;
'Mace': Result := Mace;
'Sword': Result := Sword;
'Scimitar': Result := Scimitar;
'WarHammer': Result := WarHammer;
'PlateSkirt': Result := PlateSkirt;
'SquareShield': Result := SquareShield;
'LongSword': Result := LongSword;
'BattleAxe': Result := BattleAxe;
'PlateBody': Result := PlateBody;
'KiteShield': Result := KiteShield;
'TwoHandSword': Result := TwoHandSword;
else
begin
Writeln('Invalid smithing option.');
Exit;
end;
end;
end;
And use your DTM procedure like this.
if(FindDTM(Item, x, y, 437, 337, 2, 4))then

JAD

2007-03-23 10:07:42

From: WhoCares357
This is kinda off topic, but I noticed that you load them all at once. Wouldn't that lag very badly? I would suggest loading the one the user wants to make.


It said all your help you need here, and I didn't want to post this publicly yet so yeah.. I posted to the members. And I was planning on making them load separately, I just started the script though to yeah..

@Junior Awesome! thanks, I'll try this out. never thought of doing it like that :p thanks man. I'll edit this post if it works.

Edit: It works!! Awesome thanks JR :) I'll give you credits for that. thanks a lot.

Edit again: Theres only 1 thing I don't get in that. Why is it function Item: Integer;? I just don't get why its an integer. thought it would be string or something :p or does it really matter that much?