SRL Archive - OSR Help

Lodestone Checking Script: Need Feedback


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?

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;

t4q

2013-04-26 10:19:06

do you have constant for
Lodestone = 'lodestone name';
if you are testing?

and I'm not sure but you can make script shorter like this:
'Lunarisle':
begin
Lunarisle:= DTMFromString('mggAAAHicY2NgYNAFYnMg1gFiBSDWBmIjIG4C4gYgLgHiOiDuBuIyIDbV12YQUHNm+PXrD5jW1tRk6J0yk4ELKIcNM+LAEAAAT3sK8w==');
if FindDTM(Lunarisle, x, y, 27, 62, 59, 96) then
Writeln('Lunarisle is inactive and was found!')
else
Writeln('Lunarisle icon not found, either active or DTM is wrong');
FreeDTM(Lunarisle);
end;

Chris!

2013-04-26 19:08:47

Shouldn't your lodestone variables be string's?

Procedure CheckLodestone(Lodestone: String);
var
x, y: Integer
Lunarisle, SeersVillage, Ardougne, Yanille, Catherby, Taverley, Edgeville, Falador, PortSalim, DraynorVillage, Varrock, AlKharid, BanditCamp: string;
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;

I've changed the variables to strings for you. See under var.

SomeGuyFromHere

2013-04-28 05:29:50

No, since they actually refer to the DTMs. To make things clearer I've changed their names:
Procedure CheckLodestone(Lodestone: String);

var x, y, LunarisleDTM, SeersVillageDTM, ArdougneDTM, YanilleDTM, CatherbyDTM, TaverleyDTM, EdgevilleDTM, FaladorDTM, PortSalimDTM, DraynorVillageDTM, VarrockDTM, AlKharidDTM, BanditCampDTM: integer;

begin
Wait(5000);
OpenLodestoneScreen;
case Lowercase(Lodestone) of
'Lunarisle':
begin
LunarisleDTM:= DTMFromString('mggAAAHicY2NgYNAFYnMg1gFiBSDWBmIjIG4C4gYgLgHiOiDuBuIyIDbV12YQUHNm+PXrD5jW1tRk6J0yk4ELKIcNM+LAEAAAT3sK8w==');
if FindDTM(LunarisleDTM, 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(LunarisleDTM);
end;

'SeersVillage':
begin
SeersVillageDTM:= DTMFromString('mbQAAAHicY2VgYDgOxNuAeD8U7wTik0B8BIjvAvFZIL4MxLs2bmDQ1tRkiIyJYxAWl2U4efkWAxdQHB0zYsFgAAANEw5j');
if FindDTM(SeersVillageDTM, 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(SeersVillageDTM);
end;

'Ardougne':
begin
ArdougneDTM:= DTMFromString('mggAAAHicY2NgYFgGxHOAeCMQLwfiJUC8BogZGRkYvjNAsCCQzQnEzECsrKbLUKyuyuAGxLJC/Ay7D59mWLRxJwMXUB02zIgDQwAAKqwMnQ==');
if FindDTM(ArdougneDTM, 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(ArdougneDTM);
end;

'Yanille':
begin
YanilleDTM:= DTMFromString('mggAAAHicY2NgYJgLxNOAeAWUvQiIpwOxCSMDgxYQawOxMxCbArExECspKTAo6IczpCfHMhioSTL0Tp3J4G6lzMAF1IMNM+LAEAAAcl4KMw==');
if FindDTM(YanilleDTM, 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(YanilleDTM);
end;

'Catherby':
begin
CatherbyDTM:= DTMFromString('mlwAAAHicY2dgYLgGxE+A+B4U3wHiq0D8DIhvQ/FLIH4IxJ+B+CkUO+f3gLGpvg4Dj4Aog4KxE4OCiTcYcwHlcWFGPBgKAHUMEa8=');
if FindDTM(CatherbyDTM, 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(CatherbyDTM);
end;

'Taverley':
begin
TaverleyDTM:= DTMFromString('mggAAAHicY2NgYPgNxKyMDAwfgfQvIGYAsj8DqftAfAOIrzNA5J4D8SMg5hEQZdi6ajbDusUzGQyMzRhOXr7FEBgYxsAFlMOGGXFgCAAAzQERjQ==');
if FindDTM(TaverleyDTM, 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(TaverleyDTM);
end;

'Edgeville':
begin
EdgevilleDTM:= DTMFromString('mggAAAHicY2NgYFBjZGBQAmI5INYFYmUgVgDic0C5E0B8EIiPAPFtIL4CxC/fvGEQFhZmsPMLZ3CNzWDgN9djWL39IAMXUA4bZsSBIQAAJDoNbQ==');
if FindDTM(EdgevilleDTM, 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(EdgevilleDTM);
end;

'Falador':
begin
FaladorDTM:= DTMFromString('mggAAAHicY2NgYJBgZGAQAmJ5IOYCYl4gFgdiZiD+ApR/D8SfgPgvEH8F4tXbDzL8+vWHwdovnSEjvZFBQsWA4dqVSwxcQDlsmBEHhgAArq0PzA==');
if FindDTM(FaladorDTM, 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(FaladorDTM);
end;

'PortSalim':
begin
PortSalimDTM:= DTMFromString('mlwAAAHicY2dgYOBgZGCQBWIZRghbGoi5gVgYiCWBWAqITYHYBIhVgFgRiLWAOC4pl0FeP5VhzqLVDFPnLmHIzitkyM4vYjDV02bgApqLCzPiwVAAAH2bCrM=');
if FindDTM(PortSalimDTM, 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(PortSalimDTM);
end;

'DraynorVillage':
begin
DraynorVillageDTM:= DTMFromString('mlwAAAHicY2dgYDBgZGDQAmIbIDYGYk0gtgViMyBmBOLvQDXfgFgIyGaD4v9Afu/UmQzKaroMwuKyDAZqkmBaXlqYQZiXk4ELKI8LM+LBUAAASY0IdA==');
if FindDTM(DraynorVillageDTM, 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(DraynorVillageDTM);
end;

'Varrock':
begin
VarrockDTM:= DTMFromString('mggAAAHicY2NgYIhgZGDwA+IkII4E4gAo+xlQ7gYUfwTix0D8EIg5ubgZJpS5M3Sn2jLISwszNKTpM/RnGDFwAeWwYUYcGAIAOk4M0A==');
if FindDTM(VarrockDTM, 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(VarrockDTM);
end;

'AlKharid':
begin
AlKharidDTM:= DTMFromString('mbQAAAHicY2VgYMhiZGAoA+I4IM6EYlEg5gdiHiDmBGI5IJ4zZQKDHxcbg0O2F8OvX38YLIzVGLiA+tExIxYMBgBfyAlC');
if FindDTM(AlKharidDTM, 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(AlKharidDTM);
end;

'BanditCamp':
begin
BanditCampDTM:= DTMFromString('mlwAAAHicY2dgYPBmZGCwA2IHIHYHYhcoHyQeDsWBQOwPxDFAnADFB09fBuN7j54wXL9yicFUX4dh6tzFYIwPMOLBUAAAZ6oSfQ==');
if FindDTM(BanditCampDTM, 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(BanditCampDTM);
end;

end;
end;

do you have constant fordo you have constant for


Lodestone = 'lodestone name';

if you are testing?

Well as I said I'm calling it like this:
CheckLodestone('Yanille');
so it should work right?
It doesn't though :-/

Chris!

2013-04-28 06:07:13

procedure CheckLodestone(Lodestone: string);
var
x, y, LunarisleDTM, SeersVillageDTM, ArdougneDTM, YanilleDTM, CatherbyDTM, TaverleyDTM, EdgevilleDTM, FaladorDTM, PortSalimDTM, DraynorVillageDTM, VarrockDTM, AlKharidDTM, BanditCampDTM: integer;
begin
Wait(5000);
if OpenLodestoneScreen then
case Lowercase(Lodestone) of
'Lunarisle':
begin
LunarisleDTM := DTMFromString('mggAAAHicY2NgYNAFYnMg1gFiBSDWBmIjIG4C4gYgLgHiOiDuBuIyIDbV12YQUHNm+PXrD5jW1tRk6J0yk4ELKIcNM+LAEAAAT3sK8w==');
if FindDTM(LunarisleDTM, 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(LunarisleDTM);
end;
'SeersVillage':
begin
SeersVillageDTM := DTMFromString('mbQAAAHicY2VgYDgOxNuAeD8U7wTik0B8BIjvAvFZIL4MxLs2bmDQ1tRkiIyJYxAWl2U4efkWAxdQHB0zYsFgAAANEw5j');
if FindDTM(SeersVillageDTM, 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(SeersVillageDTM);
end;
'Ardougne':
begin
ArdougneDTM := DTMFromString('mggAAAHicY2NgYFgGxHOAeCMQLwfiJUC8BogZGRkYvjNAsCCQzQnEzECsrKbLUKyuyuAGxLJC/Ay7D59mWLRxJwMXUB02zIgDQwAAKqwMnQ==');
if FindDTM(ArdougneDTM, 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(ArdougneDTM);
end;
'Yanille':
begin
YanilleDTM := DTMFromString('mggAAAHicY2NgYJgLxNOAeAWUvQiIpwOxCSMDgxYQawOxMxCbArExECspKTAo6IczpCfHMhioSTL0Tp3J4G6lzMAF1IMNM+LAEAAAcl4KMw==');
if FindDTM(YanilleDTM, 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(YanilleDTM);
end;
'Catherby':
begin
CatherbyDTM := DTMFromString('mlwAAAHicY2dgYLgGxE+A+B4U3wHiq0D8DIhvQ/FLIH4IxJ+B+CkUO+f3gLGpvg4Dj4Aog4KxE4OCiTcYcwHlcWFGPBgKAHUMEa8=');
if FindDTM(CatherbyDTM, 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(CatherbyDTM);
end;
'Taverley':
begin
TaverleyDTM := DTMFromString('mggAAAHicY2NgYPgNxKyMDAwfgfQvIGYAsj8DqftAfAOIrzNA5J4D8SMg5hEQZdi6ajbDusUzGQyMzRhOXr7FEBgYxsAFlMOGGXFgCAAAzQERjQ==');
if FindDTM(TaverleyDTM, 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(TaverleyDTM);
end;
'Edgeville':
begin
EdgevilleDTM := DTMFromString('mggAAAHicY2NgYFBjZGBQAmI5INYFYmUgVgDic0C5E0B8EIiPAPFtIL4CxC/fvGEQFhZmsPMLZ3CNzWDgN9djWL39IAMXUA4bZsSBIQAAJDoNbQ==');
if FindDTM(EdgevilleDTM, 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(EdgevilleDTM);
end;
'Falador':
begin
FaladorDTM := DTMFromString('mggAAAHicY2NgYJBgZGAQAmJ5IOYCYl4gFgdiZiD+ApR/D8SfgPgvEH8F4tXbDzL8+vWHwdovnSEjvZFBQsWA4dqVSwxcQDlsmBEHhgAArq0PzA==');
if FindDTM(FaladorDTM, 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(FaladorDTM);
end;
'PortSalim':
begin
PortSalimDTM := DTMFromString('mlwAAAHicY2dgYOBgZGCQBWIZRghbGoi5gVgYiCWBWAqITYHYBIhVgFgRiLWAOC4pl0FeP5VhzqLVDFPnLmHIzitkyM4vYjDV02bgApqLCzPiwVAAAH2bCrM=');
if FindDTM(PortSalimDTM, 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(PortSalimDTM);
end;
'DraynorVillage':
begin
DraynorVillageDTM := DTMFromString('mlwAAAHicY2dgYDBgZGDQAmIbIDYGYk0gtgViMyBmBOLvQDXfgFgIyGaD4v9Afu/UmQzKaroMwuKyDAZqkmBaXlqYQZiXk4ELKI8LM+LBUAAASY0IdA==');
if FindDTM(DraynorVillageDTM, 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(DraynorVillageDTM);
end;
'Varrock':
begin
VarrockDTM := DTMFromString('mggAAAHicY2NgYIhgZGDwA+IkII4E4gAo+xlQ7gYUfwTix0D8EIg5ubgZJpS5M3Sn2jLISwszNKTpM/RnGDFwAeWwYUYcGAIAOk4M0A==');
if FindDTM(VarrockDTM, 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(VarrockDTM);
end;
'AlKharid':
begin
AlKharidDTM := DTMFromString('mbQAAAHicY2VgYMhiZGAoA+I4IM6EYlEg5gdiHiDmBGI5IJ4zZQKDHxcbg0O2F8OvX38YLIzVGLiA+tExIxYMBgBfyAlC');
if FindDTM(AlKharidDTM, 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(AlKharidDTM);
end;
'BanditCamp':
begin
BanditCampDTM := DTMFromString('mlwAAAHicY2dgYPBmZGCwA2IHIHYHYhcoHyQeDsWBQOwPxDFAnADFB09fBuN7j54wXL9yicFUX4dh6tzFYIwPMOLBUAAAZ6oSfQ==');
if FindDTM(BanditCampDTM, 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(BanditCampDTM);
end;
end;
if not (OpenLodestoneScreen) then
Exit;
end;

OpenLodeStone; returns true if found. So if it's found you want to execute that case..of and if not then you want to exit, am I right?

Give that code a go. :s

SomeGuyFromHere

2013-04-28 17:54:38

No, OpenLodestoneScreen is what needs to be executed in order for the procedure to do what it should, that is to check if a certain lodestone has already been activated or not. So it needs to open the lodestone screen and then look for a certain DTM at a certain location, depending on what lodestone needs to be checked.

But when calling it as I indicated ( CheckLodestone('Yanille'); ) it isn't executing the part of the script it should, which is:
'Yanille':
begin
YanilleDTM := DTMFromString('mggAAAHicY2NgYJgLxNOAeAWUvQiIpwOxCSMDgxYQawOxMxCbArExECspKTAo6IczpCfHMhioSTL0Tp3J4G6lzMAF1IMNM+LAEAAAcl4KMw==');
if FindDTM(YanilleDTM, 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(YanilleDTM);
end;
Why is that, what did I do wrong?

senrath

2013-04-28 19:11:03

What you're doing wrong is calling Lowercase, but not having your cases in lowercase.

SomeGuyFromHere

2013-04-29 15:55:12

From: senrath
What you're doing wrong is calling Lowercase, but not having your cases in lowercase.

That did the trick, thanks! Now the only thing left is to close the lodestone window after the check is done. I tried using CloseWindow and CloseAllScreens but both don't seem to work, could anybody help me out with this one too? If there is no build-in way in SRL to do this I can code something myself but I guess I shouldn't need to…

Btw I made the procedure into a function so that it can be used more easily. Will post the updated code when it's done, maybe it'll be handy for someone :)

Haxz

2013-04-29 16:00:44

Make yourself a procedure to do that. Replace x and y with the close button coordinate. That takes only few seconds.

Procedure CloseLodestoneScreen;
begin
If LodestoneScreen then
Mouse(x, y, 3, 3, mouse_left);
end;

Chris!

2013-04-30 05:08:48

Well I made myself seem silly there, didn't I? >:( Sorry SomeGuyFromHere… Someone only recently pointed out that in my lowercase cases the options need to actually be in lowercase.

CloseAllScreens; doesn't have lodestone support yet.
CloseWindow;… I don't know.

Sorry for my dodgy help and lack of knowledge pertaining to the subject. ;)

SomeGuyFromHere

2013-04-30 07:18:52

Function CheckLodestone(Lodestone: String):Boolean;

var x, y, LunarisleDTM, SeersVillageDTM, ArdougneDTM, YanilleDTM, CatherbyDTM, TaverleyDTM, EdgevilleDTM, FaladorDTM, PortSalimDTM, DraynorVillageDTM, VarrockDTM, AlKharidDTM, BanditCampDTM: integer;

begin
Wait(1000+Random(5000));
OpenLodestoneScreen;

case Lowercase(Lodestone) of
'lunarisle':
begin
LunarisleDTM:= DTMFromString('mggAAAHicY2NgYNAFYnMg1gFiBSDWBmIjIG4C4gYgLgHiOiDuBuIyIDbV12YQUHNm+PXrD5jW1tRk6J0yk4ELKIcNM+LAEAAAT3sK8w==');
if FindDTM(LunarisleDTM, x, y, 27, 62, 59, 96) then
begin
Writeln('Lunarisle lodestone is inactive');
Result:= False;
end else
begin
Writeln('Lunarisle lodestone is active');
Result:= True;
end;
FreeDTM(LunarisleDTM);
end;

'seersvillage':
begin
SeersVillageDTM:= DTMFromString('mbQAAAHicY2VgYDgOxNuAeD8U7wTik0B8BIjvAvFZIL4MxLs2bmDQ1tRkiIyJYxAWl2U4efkWAxdQHB0zYsFgAAANEw5j');
if FindDTM(SeersVillageDTM, x, y, 176, 137, 204, 179) then
begin
Writeln('Seers Village lodestone is inactive');
Result:= False;
end else
begin
Writeln('Seers Village lodestone is active');
Result:= True;
end;
FreeDTM(SeersVillageDTM);
end;

'ardougne':
begin
ArdougneDTM:= DTMFromString('mggAAAHicY2NgYFgGxHOAeCMQLwfiJUC8BogZGRkYvjNAsCCQzQnEzECsrKbLUKyuyuAGxLJC/Ay7D59mWLRxJwMXUB02zIgDQwAAKqwMnQ==');
if FindDTM(ArdougneDTM, x, y, 150, 191, 180, 230) then
begin
Writeln('Ardougne lodestone is inactive');
Result:= False;
end else
begin
Writeln('Ardougne lodestone is active');
Result:= True;
end;
FreeDTM(ArdougneDTM);
end;

'yanille':
begin
YanilleDTM:= DTMFromString('mggAAAHicY2NgYJgLxNOAeAWUvQiIpwOxCSMDgxYQawOxMxCbArExECspKTAo6IczpCfHMhioSTL0Tp3J4G6lzMAF1IMNM+LAEAAAcl4KMw==');
if FindDTM(YanilleDTM, x, y, 145, 243, 172, 282) then
begin
Writeln('Yanille lodestone is inactive');
Result:= False;
end else
begin
Writeln('Yanille lodestone is active');
Result:= True;
end;
FreeDTM(YanilleDTM);
end;

'catherby':
begin
CatherbyDTM:= DTMFromString('mlwAAAHicY2dgYLgGxE+A+B4U3wHiq0D8DIhvQ/FLIH4IxJ+B+CkUO+f3gLGpvg4Dj4Aog4KxE4OCiTcYcwHlcWFGPBgKAHUMEa8=');
if FindDTM(CatherbyDTM, x, y, 201, 153, 236, 205) then
begin
Writeln('Catherby lodestone is inactive');
Result:= False;
end else
begin
Writeln('Catherby lodestone is active');
Result:= True;
end;
FreeDTM(CatherbyDTM);
end;

'taverley':
begin
TaverleyDTM:= DTMFromString('mggAAAHicY2NgYPgNxKyMDAwfgfQvIGYAsj8DqftAfAOIrzNA5J4D8SMg5hEQZdi6ajbDusUzGQyMzRhOXr7FEBgYxsAFlMOGGXFgCAAAzQERjQ==');
if FindDTM(TaverleyDTM, x, y, 234, 159, 274, 203) then
begin
Writeln('Taverley lodestone is inactive');
Result:= False;
end else
begin
Writeln('Taverley lodestone is active');
Result:= True;
end;
FreeDTM(TaverleyDTM);
end;

'edgeville':
begin
EdgevilleDTM:= DTMFromString('mggAAAHicY2NgYFBjZGBQAmI5INYFYmUgVgDic0C5E0B8EIiPAPFtIL4CxC/fvGEQFhZmsPMLZ3CNzWDgN9djWL39IAMXUA4bZsSBIQAAJDoNbQ==');
if FindDTM(EdgevilleDTM, x, y, 268, 131, 312, 178) then
begin
Writeln('Edgeville lodestone is inactive');
Result:= False;
end else
begin
Writeln('Edgeville lodestone is active');
Result:= True;
end;
FreeDTM(EdgevilleDTM);
end;

'falador':
begin
FaladorDTM:= DTMFromString('mggAAAHicY2NgYJBgZGAQAmJ5IOYCYl4gFgdiZiD+ApR/D8SfgPgvEH8F4tXbDzL8+vWHwdovnSEjvZFBQsWA4dqVSwxcQDlsmBEHhgAArq0PzA==');
if FindDTM(FaladorDTM, x, y, 261, 182, 290, 222) then
begin
Writeln('Falador lodestone is inactive');
Result:= False;
end else
begin
Writeln('Falador lodestone is active');
Result:= True;
end;
FreeDTM(FaladorDTM);
end;

'portsalim':
begin
PortSalimDTM:= DTMFromString('mlwAAAHicY2dgYOBgZGCQBWIZRghbGoi5gVgYiCWBWAqITYHYBIhVgFgRiLWAOC4pl0FeP5VhzqLVDFPnLmHIzitkyM4vYjDV02bgApqLCzPiwVAAAH2bCrM=');
if FindDTM(PortSalimDTM, x, y, 259, 226, 292, 266) then
begin
Writeln('Port Salim lodestone is inactive!');
Result:= False;
end else
begin
Writeln('Port Salim lodestone is active');
Result:= True;
end;
FreeDTM(PortSalimDTM);
end;

'draynorvillage':
begin
DraynorVillageDTM:= DTMFromString('mlwAAAHicY2dgYDBgZGDQAmIbIDYGYk0gtgViMyBmBOLvQDXfgFgIyGaD4v9Afu/UmQzKaroMwuKyDAZqkmBaXlqYQZiXk4ELKI8LM+LBUAAASY0IdA==');
if FindDTM(DraynorVillageDTM, x, y, 294, 190, 322, 230) then
begin
Writeln('Draynor Village lodestone is inactive');
Result:= False;
end else
begin
Writeln('Draynor Village lodestone is active');
Result:= True;
end;
FreeDTM(DraynorVillageDTM);
end;

'varrock':
begin
VarrockDTM:= DTMFromString('mggAAAHicY2NgYIhgZGDwA+IkII4E4gAo+xlQ7gYUfwTix0D8EIg5ubgZJpS5M3Sn2jLISwszNKTpM/RnGDFwAeWwYUYcGAIAOk4M0A==');
if FindDTM(VarrockDTM, x, y, 328, 161, 362, 202) then
begin
Writeln('Varrock lodestone is inactive');
Result:= False;
end else
begin
Writeln('Varrock lodestone is active');
Result:= True;
end;
FreeDTM(VarrockDTM);
end;

'alkharid':
begin
AlKharidDTM:= DTMFromString('mbQAAAHicY2VgYMhiZGAoA+I4IM6EYlEg5gdiHiDmBGI5IJ4zZQKDHxcbg0O2F8OvX38YLIzVGLiA+tExIxYMBgBfyAlC');
if FindDTM(AlKharidDTM, x, y, 335, 204, 381, 247) then
begin
Writeln('Al Kharid is inactive');
Result:= False;
end else
begin
Writeln('Al Kharid is active');
Result:= True;
end;
FreeDTM(AlKharidDTM);
end;

'banditcamp':
begin
BanditCampDTM:= DTMFromString('mlwAAAHicY2dgYPBmZGCwA2IHIHYHYhcoHyQeDsWBQOwPxDFAnADFB09fBuN7j54wXL9yicFUX4dh6tzFYIwPMOLBUAAAZ6oSfQ==');
if FindDTM(BanditCampDTM, x, y, 302, 274, 343, 313) then
begin
Writeln('Bandit Camp lodestone is inactive');
Result:= False;
end else
begin
Writeln('Bandit Camp lodestone is active');
Result:= True;
end;
FreeDTM(BanditCampDTM);
end;

end;
Wait(1000+Random(5000));
If LodestoneScreen then
Mouse(498, 34, 3, 3, mouse_left);
end;
:)