g0tp0t
2010-03-26 19:36:17
this is my script. it connects my computer to a network named marge automatically when i disconnect. i am getting an 'identifier expected error. i checked and cant see any missing begin's or end's
[PHP]program New;
var x,y,i,n,t,marge,MargeFail:integer;notify:string;
function checkspinner(output:string): string;
begin
clickmouse(1275,789,true)
wait(700);
clickmouse(1159,790,true);
wait(700);
if findbitmap(MargeFail,x,y) then
begin
clickmouse(1249,527,true)
result := 'CF'
output := 'Connection failed! Retrying…'
wait(500);
end
else if findcolortolerance(x,y,15200093 ,1151,782,1163,793,100) then
begin
result := 'CO'
Output := 'Connection list opened'
end
else
begin
Result := 'CU'
Output := 'Connection status unknown!! :['
end;
begin
marge := BitmapFromString(30, 8, 'beNqtUjsShTAI9D6eJ1fwHFwj' +
'V7D1GpRapjRlStsI5EPei5l5M88dC1wXWMAYpwUNxn07KKBn3q4oW' +
'C0mZrJBiGCWw1iSuZXeTj9nvSceTpEUMmvQaUGOhVSEkkhB7csx+S' +
'GIpSooLdCJsmE+v2bPfSJ5A79/tVbDddKnyixL5i+A3yuP5m1iMpx' +
'yWd9VHm5DzzSszFZlKHCm99zsanDBevc/8LCEd8A/p+68wQ2okD7q' +
'');
MargeFail := BitmapFromString(243, 3, 'beNqlVcERxCAIvH7yTC3' +
'Wkq9t2EJasIU887WFtJCLRAUU1Llz8lAJy7Ii3vc7Trd/zHG+C+9h' +
'flnjFnfBFp3f++Y+W8D5WkzBrJXJ7+8iHMtjyiGYCcCT1xMa9wFt3' +
'W3ApfF0AlAu0y5jCuRJ2edNmtEIHNiWH5J0E2oo4SD3lWtLVaLI9I' +
'AwQc7EIGFV5NYL9bnsFhE6vqMT100SfzF6lchfOcbCS/hFTwQhVkF' +
'wAkXisgpp0JiJ4BMvuF92y0LFfyAFTkYaEyDaXRiDjwpbVkO7es1Z' +
'SAfRsKo5COF6IitasT9V306OqknlL0WfL+ypHEtPJrFKGfAWURV26' +
'TbsyJqugpSEhoNB6bWKyOn5EBqjlvskSG4XLn+J0gh8UNiyGmo49h' +
'RqUgCOqz7uJT27usgaw3vCt5Njtxgk/nNPzy85fgH20Z0U');
repeat
if findcolor(x,y,44543,1145,787,1160,793) then
begin //section a
clickmouse(x,y,true);
while not findbitmap(marge,x,y) do
begin //section a.a
wait(100);
i := i + 1;
if i = 600 then playsound(notify);;
end; //end section a.a
clickmouse(x,y,true);
wait(50)
clickmouse(x,y,true);
while not findcolor(x,y,16777215,1146,788,1150,792) do //loop a.l1
begin //a.li.a
wait(100);
t := t + 1;
CheckSpinner(output) //<— check to see if the network icon is loading/connecting
writeln(output); // with blue spinning wheel from vista and windows 7
if t = 6000 then
begin //a.li.b
writeln('fail!!');
//terminatescript;
wait(5000);
end; //end a.li.b
end; //end a.li.a
inc(n);
Writeln('success ' + inttostr(n));
end; //end section a
until false;
end.[/PHP]
[PHP]program New;
var x,y,i,n,t,marge,MargeFail:integer;notify:string;
function checkspinner(output:string): string;
begin
clickmouse(1275,789,true)
wait(700);
clickmouse(1159,790,true);
wait(700);
if findbitmap(MargeFail,x,y) then
begin
clickmouse(1249,527,true)
result := 'CF'
output := 'Connection failed! Retrying…'
wait(500);
end
else if findcolortolerance(x,y,15200093 ,1151,782,1163,793,100) then
begin
result := 'CO'
Output := 'Connection list opened'
end
else
begin
Result := 'CU'
Output := 'Connection status unknown!! :['
end;
begin
marge := BitmapFromString(30, 8, 'beNqtUjsShTAI9D6eJ1fwHFwj' +
'V7D1GpRapjRlStsI5EPei5l5M88dC1wXWMAYpwUNxn07KKBn3q4oW' +
'C0mZrJBiGCWw1iSuZXeTj9nvSceTpEUMmvQaUGOhVSEkkhB7csx+S' +
'GIpSooLdCJsmE+v2bPfSJ5A79/tVbDddKnyixL5i+A3yuP5m1iMpx' +
'yWd9VHm5DzzSszFZlKHCm99zsanDBevc/8LCEd8A/p+68wQ2okD7q' +
'');
MargeFail := BitmapFromString(243, 3, 'beNqlVcERxCAIvH7yTC3' +
'Wkq9t2EJasIU887WFtJCLRAUU1Llz8lAJy7Ii3vc7Trd/zHG+C+9h' +
'flnjFnfBFp3f++Y+W8D5WkzBrJXJ7+8iHMtjyiGYCcCT1xMa9wFt3' +
'W3ApfF0AlAu0y5jCuRJ2edNmtEIHNiWH5J0E2oo4SD3lWtLVaLI9I' +
'AwQc7EIGFV5NYL9bnsFhE6vqMT100SfzF6lchfOcbCS/hFTwQhVkF' +
'wAkXisgpp0JiJ4BMvuF92y0LFfyAFTkYaEyDaXRiDjwpbVkO7es1Z' +
'SAfRsKo5COF6IitasT9V306OqknlL0WfL+ypHEtPJrFKGfAWURV26' +
'TbsyJqugpSEhoNB6bWKyOn5EBqjlvskSG4XLn+J0gh8UNiyGmo49h' +
'RqUgCOqz7uJT27usgaw3vCt5Njtxgk/nNPzy85fgH20Z0U');
repeat
if findcolor(x,y,44543,1145,787,1160,793) then
begin //section a
clickmouse(x,y,true);
while not findbitmap(marge,x,y) do
begin //section a.a
wait(100);
i := i + 1;
if i = 600 then playsound(notify);;
end; //end section a.a
clickmouse(x,y,true);
wait(50)
clickmouse(x,y,true);
while not findcolor(x,y,16777215,1146,788,1150,792) do //loop a.l1
begin //a.li.a
wait(100);
t := t + 1;
CheckSpinner(output) //<— check to see if the network icon is loading/connecting
writeln(output); // with blue spinning wheel from vista and windows 7
if t = 6000 then
begin //a.li.b
writeln('fail!!');
//terminatescript;
wait(5000);
end; //end a.li.b
end; //end a.li.a
inc(n);
Writeln('success ' + inttostr(n));
end; //end section a
until false;
end.[/PHP]