SRL Archive - Help and Support

Need help with function...


n3ss3s

2007-06-10 14:48:42

function ToBeSmith:string;
var i,l:integer;
Done,AnyOfThose1,AnyOfThose2:boolean;
begin
l:=GetSkillLevel('smithing');
for i:= 15 to 33 do
begin
if(l = i)then
begin
Result:=ItemList[i];
Done:=True;
AnyOfThose1:=True;
end;
end;
if(i = 33) and (not(Done))then
begin
if(L > 33)then
begin
Result:=ItemList[33];
Done:=True;
AnyOfThose2:=True;
end;
end;
if(not(AnyOfThose1)) and (not(AnyOfThose2))then
begin
Writeln('Teach n3ss3s to script plz,exitting procedure');
Exit;
end;
end;

It should result an item from an array(itemlist) depending of the users smithing level, but when I use it with writeln it just writelns an empty line.

Junior

2007-06-10 19:56:29

I was looking at the function, and the bitmap masks are integers. Try making teh function result in a integer and use inttostr for the writeln, dont know if that would work.

n3ss3s

2007-06-11 05:18:01

Sorry, but the function returns an item from an array of string.
So, returning an integer is not possible.

Junior

2007-06-11 16:54:08

My b..
ItemList.Name