SomeGuyFromHere
2013-04-26 09:35:15
Hey,
just coded a procedure that checks if a Lodestone is activated or not. For some reason it doesn't seem to work, when I call it like this CheckLodestone('Yanille') the Yanille code is not being processed (neither of both Writeln lines are displayed); the DTMs and locations being inserted in FindDTM have already been checked though.
Could anybody have a look and tell me what I'm doing wrong? First time I use case… of.
Also any more feedback such as how I could make this more compact?
just coded a procedure that checks if a Lodestone is activated or not. For some reason it doesn't seem to work, when I call it like this CheckLodestone('Yanille') the Yanille code is not being processed (neither of both Writeln lines are displayed); the DTMs and locations being inserted in FindDTM have already been checked though.
Could anybody have a look and tell me what I'm doing wrong? First time I use case… of.
Also any more feedback such as how I could make this more compact?
Procedure CheckLodestone(Lodestone: String);
var x, y, Lunarisle, SeersVillage, Ardougne, Yanille, Catherby, Taverley, Edgeville, Falador, PortSalim, DraynorVillage, Varrock, AlKharid, BanditCamp :integer;
begin
Wait(5000);
OpenLodestoneScreen;
case Lowercase(Lodestone) of
'Lunarisle':
begin
Lunarisle:= DTMFromString('mggAAAHicY2NgYNAFYnMg1gFiBSDWBmIjIG4C4gYgLgHiOiDuBuIyIDbV12YQUHNm+PXrD5jW1tRk6J0yk4ELKIcNM+LAEAAAT3sK8w==');
if FindDTM(Lunarisle, x, y, 27, 62, 59, 96) then
begin
Writeln('Lunarisle is inactive and was found!');
end else
begin
Writeln('Lunarisle icon not found, either active or DTM is wrong');
end;
FreeDTM(Lunarisle);
end;
'SeersVillage':
begin
SeersVillage:= DTMFromString('mbQAAAHicY2VgYDgOxNuAeD8U7wTik0B8BIjvAvFZIL4MxLs2bmDQ1tRkiIyJYxAWl2U4efkWAxdQHB0zYsFgAAANEw5j');
if FindDTM(SeersVillage, x, y, 176, 137, 204, 179) then
begin
Writeln('SeersVillage is inactive and was found!');
end else
begin
Writeln('SeersVillage icon not found, either active or DTM is wrong');
end;
FreeDTM(SeersVillage);
end;
'Ardougne':
begin
Ardougne:= DTMFromString('mggAAAHicY2NgYFgGxHOAeCMQLwfiJUC8BogZGRkYvjNAsCCQzQnEzECsrKbLUKyuyuAGxLJC/Ay7D59mWLRxJwMXUB02zIgDQwAAKqwMnQ==');
if FindDTM(Ardougne, x, y, 150, 191, 180, 230) then
begin
Writeln('Ardougne is inactive and was found!');
end else
begin
Writeln('Ardougne icon not found, either active or DTM is wrong');
end;
FreeDTM(Ardougne);
end;
'Yanille':
begin
Yanille:= DTMFromString('mggAAAHicY2NgYJgLxNOAeAWUvQiIpwOxCSMDgxYQawOxMxCbArExECspKTAo6IczpCfHMhioSTL0Tp3J4G6lzMAF1IMNM+LAEAAAcl4KMw==');
if FindDTM(Yanille, x, y, 145, 243, 172, 282) then
begin
Writeln('Yanille is inactive and was found!');
end else
begin
Writeln('Yanille icon not found, either active or DTM is wrong');
end;
FreeDTM(Yanille);
end;
'Catherby':
begin
Catherby:= DTMFromString('mlwAAAHicY2dgYLgGxE+A+B4U3wHiq0D8DIhvQ/FLIH4IxJ+B+CkUO+f3gLGpvg4Dj4Aog4KxE4OCiTcYcwHlcWFGPBgKAHUMEa8=');
if FindDTM(Catherby, x, y, 201, 153, 236, 205) then
begin
Writeln('Catherby is inactive and was found!');
end else
begin
Writeln('Catherby icon not found, either active or DTM is wrong');
end;
FreeDTM(Catherby);
end;
'Taverley':
begin
Taverley:= DTMFromString('mggAAAHicY2NgYPgNxKyMDAwfgfQvIGYAsj8DqftAfAOIrzNA5J4D8SMg5hEQZdi6ajbDusUzGQyMzRhOXr7FEBgYxsAFlMOGGXFgCAAAzQERjQ==');
if FindDTM(Taverley, x, y, 234, 159, 274, 203) then
begin
Writeln('Taverley is inactive and was found!');
end else
begin
Writeln('Taverley icon not found, either active or DTM is wrong');
end;
FreeDTM(Taverley);
end;
'Edgeville':
begin
Edgeville:= DTMFromString('mggAAAHicY2NgYFBjZGBQAmI5INYFYmUgVgDic0C5E0B8EIiPAPFtIL4CxC/fvGEQFhZmsPMLZ3CNzWDgN9djWL39IAMXUA4bZsSBIQAAJDoNbQ==');
if FindDTM(Edgeville, x, y, 268, 131, 312, 178) then
begin
Writeln('Edgeville is inactive and was found!');
end else
begin
Writeln('Edgeville icon not found, either active or DTM is wrong');
end;
FreeDTM(Edgeville);
end;
'Falador':
begin
Falador:= DTMFromString('mggAAAHicY2NgYJBgZGAQAmJ5IOYCYl4gFgdiZiD+ApR/D8SfgPgvEH8F4tXbDzL8+vWHwdovnSEjvZFBQsWA4dqVSwxcQDlsmBEHhgAArq0PzA==');
if FindDTM(Falador, x, y, 261, 182, 290, 222) then
begin
Writeln('Falador is inactive and was found!');
end else
begin
Writeln('Falador icon not found, either active or DTM is wrong');
end;
FreeDTM(Falador);
end;
'PortSalim':
begin
PortSalim:= DTMFromString('mlwAAAHicY2dgYOBgZGCQBWIZRghbGoi5gVgYiCWBWAqITYHYBIhVgFgRiLWAOC4pl0FeP5VhzqLVDFPnLmHIzitkyM4vYjDV02bgApqLCzPiwVAAAH2bCrM=');
if FindDTM(PortSalim, x, y, 259, 226, 292, 266) then
begin
Writeln('PortSalim is inactive and was found!');
end else
begin
Writeln('PortSalim icon not found, either active or DTM is wrong');
end;
FreeDTM(PortSalim);
end;
'DraynorVillage':
begin
DraynorVillage:= DTMFromString('mlwAAAHicY2dgYDBgZGDQAmIbIDYGYk0gtgViMyBmBOLvQDXfgFgIyGaD4v9Afu/UmQzKaroMwuKyDAZqkmBaXlqYQZiXk4ELKI8LM+LBUAAASY0IdA==');
if FindDTM(DraynorVillage, x, y, 294, 190, 322, 230) then
begin
Writeln('DraynorVillage is inactive and was found!');
end else
begin
Writeln('DraynorVillage icon not found, either active or DTM is wrong');
end;
FreeDTM(DraynorVillage);
end;
'Varrock':
begin
Varrock:= DTMFromString('mggAAAHicY2NgYIhgZGDwA+IkII4E4gAo+xlQ7gYUfwTix0D8EIg5ubgZJpS5M3Sn2jLISwszNKTpM/RnGDFwAeWwYUYcGAIAOk4M0A==');
if FindDTM(Varrock, x, y, 328, 161, 362, 202) then
begin
Writeln('Varrock is inactive and was found!');
end else
begin
Writeln('Varrock icon not found, either active or DTM is wrong');
end;
FreeDTM(Varrock);
end;
'AlKharid':
begin
AlKharid:= DTMFromString('mbQAAAHicY2VgYMhiZGAoA+I4IM6EYlEg5gdiHiDmBGI5IJ4zZQKDHxcbg0O2F8OvX38YLIzVGLiA+tExIxYMBgBfyAlC');
if FindDTM(AlKharid, x, y, 335, 204, 381, 247) then
begin
Writeln('AlKharid is inactive and was found!');
end else
begin
Writeln('AlKharid icon not found, either active or DTM is wrong');
end;
FreeDTM(AlKharid);
end;
'BanditCamp':
begin
BanditCamp:= DTMFromString('mlwAAAHicY2dgYPBmZGCwA2IHIHYHYhcoHyQeDsWBQOwPxDFAnADFB09fBuN7j54wXL9yicFUX4dh6tzFYIwPMOLBUAAAZ6oSfQ==');
if FindDTM(BanditCamp, x, y, 302, 274, 343, 313) then
begin
Writeln('BanditCamp is inactive and was found!');
end else
begin
Writeln('BanditCamp icon not found, either active or DTM is wrong');
end;
FreeDTM(BanditCamp);
end;
end;
end;