SRL Archive - SRL Archives

procedure EnterPin;


Ejjman

2006-05-14 16:48:39

If some1 could help, 4 and 7 don't work. Instead, it goes up to the upperleft corner of the client. The rest work like a charm. Post feedback, and test it if you want. Trust me, I've tried getting the bitmaps a couple times, and 4 and 7 don't work!


Program Bankpin;

{.include SRL\SRL.scar}

var
sx, sy, hx, hy, fx, fy, qx, qy, zero, one, two, three, four, five, six, seven, eight, nine : integer;

const
Pin1 = 5;
Pin2 = 7;
Pin3 = 8;
Pin4 = 9;


procedure BMPS;
begin
zero := BitmapFromString(9, 15, 'z78DA3330187AC0CDCDDC0D95245E' +
'3D2E11FCEA89B1975ABA887127E5BA68E77E4A429E9258A635000' +
'03E7BA46D');
one := BitmapFromString(11, 14, 'z78DA333018BCC0CDCDDC0D4652A' +
'297541330F592E706CA7D316A02E526E08A4DCADD436B000075EE' +
'B4F4');
two := BitmapFromString(11, 15, 'z78DA3330189EC0CDCDDC0D1B49A' +
'A5E62C429711BFD4D18D54BADB4445EEAA2270000E0A5C1E6');
three := BitmapFromString(10, 15, 'z78DA3330180EC0CDCDDC0D1B49B' +
'C2E62C4497509EDF492E7DF817533797A298F23EA86152D000011' +
'2FB14F');
four := BitmapFromString(1, 16, 'z78DA3330A02D0000698D1201');
five := BitmapFromString(10, 16, 'z78DA333018DAC0CDCDDC8D10498' +
'C5E4AECA5969B290F01FA9B406BBDB8D4106F2F75437BB001005C' +
'94BC8F');
six := BitmapFromString(11, 14, 'z78DA333018BCC0CDCDDC0D95244' +
'F2F2E11E2F552E2726AF99D543371E9A2563810630EE526501E9B' +
'D44A51F407003689B785');
seven := BitmapFromString(2, 1, '000000000000');
eight := BitmapFromString(12, 14, 'z78DA3330181AC0CDCDDC0D95A4C' +
'4045C22A49A40BC2C2DDC335CC3677887F3C002007D5BC78E');
nine := BitmapFromString(13, 14, 'z78DA3330184AC0CDCDDC0D37499' +
'E39A4CA0E2DD3F0EB22CF34EAC60579E1306ADAE001006F08D673' +
'');
end;

procedure pinnumber1;
begin
case Pin1 of
0: FindBitmap(zero, qx, qy);
1: FindBitmap(one, qx, qy);
2: FindBitmap(two, qx, qy);
3: FindBitmap(three, qx, qy);
4: FindBitmap(four, qx, qy);
5: FindBitmap(five, qx, qy);
6: FindBitmap(six, qx, qy);
7: FindBitmap(seven, qx, qy);
8: FindBitmap(eight, qx, qy);
9: FindBitmap(nine, qx, qy);
end;
MMouse(qx, qy, 0, 0);
Mouse(qx, qy, 0, 0, True);
wait(6000);
end;

procedure pinnumber2;
begin
case Pin2 of
0: FindBitmap(zero, sx, sy);
1: FindBitmap(one, sx, sy);
2: FindBitmap(two, sx, sy);
3: FindBitmap(three, sx, sy);
4: FindBitmap(four, sx, sy);
5: FindBitmap(five, sx, sy);
6: FindBitmap(six, sx, sy);
7: FindBitmap(seven, sx, sy);
8: FindBitmap(eight, sx, sy);
9: FindBitmap(nine, sx, sy);
end;
MMouse(sx, sy, 0, 0);
Mouse(sx, sy, 0, 0, True);
wait(6000);
end;

procedure pinnumber3;
begin
case Pin3 of
0: FindBitmap(zero, hx, hy);
1: FindBitmap(one, hx, hy);
2: FindBitmap(two, hx, hy);
3: FindBitmap(three, hx, hy);
4: FindBitmap(four, hx, hy);
5: FindBitmap(five, hx, hy);
6: FindBitmap(six, hx, hy);
7: FindBitmap(seven, hx, hy);
8: FindBitmap(eight, hx, hy);
9: FindBitmap(nine, hx, hy);
end;
MMouse(hx, hy, 0, 0);
Mouse(hx, hy, 0, 0, True);
wait(6000);
end;

procedure pinnumber4;
begin
case Pin4 of
0: FindBitmap(zero, fx, fy);
1: FindBitmap(one, fx, fy);
2: FindBitmap(two, fx, fy);
3: FindBitmap(three, fx, fy);
4: FindBitmap(four, fx, fy);
5: FindBitmap(five, fx, fy);
6: FindBitmap(six, fx, fy);
7: FindBitmap(seven, fx, fy);
8: FindBitmap(eight, fx, fy);
9: FindBitmap(nine, fx, fy);
end;
MMouse(fx, fy, 0, 0);
Mouse(fx, fy, 0, 0, True);
end;

begin
BMPS;
Pinnumber1;
Pinnumber2;
Pinnumber3;
Pinnumber4;
end.

Dankness

2006-05-14 17:01:39

here Try this…

[php]
Program Bankpin;

{.include SRL\SRL.scar}

var NumberMaps : Array [0..9] of Integer;
const PinNumber = '4747';

procedure BMPS;
begin
NumberMaps [0] := BitmapFromString(9, 15, 'z78DA3330187AC0CDCDDC0D95245E' +
'3D2E11FCEA89B1975ABA887127E5BA68E77E4A429E9258A635000' +
'03E7BA46D');
NumberMaps [1] := BitmapFromString(11, 14, 'z78DA333018BCC0CDCDDC0D4652A' +
'297541330F592E706CA7D316A02E526E08A4DCADD436B000075EE' +
'B4F4');
NumberMaps [2] := BitmapFromString(11, 15, 'z78DA3330189EC0CDCDDC0D1B49A' +
'A5E62C429711BFD4D18D54BADB4445EEAA2270000E0A5C1E6');
NumberMaps [3] := BitmapFromString(10, 15, 'z78DA3330180EC0CDCDDC0D1B49B' +
'C2E62C4497509EDF492E7DF817533797A298F23EA86152D000011' +
'2FB14F');
NumberMaps [4] := BitmapFromString(7, 10, 'z78DA737333773330700393F881DB' +
'2053894B2FAD55E22769111A008EE75798');
NumberMaps [5] := BitmapFromString(10, 16, 'z78DA333018DAC0CDCDDC8D10498' +
'C5E4AECA5969B290F01FA9B406BBDB8D4106F2F75437BB001005C' +
'94BC8F');
NumberMaps [6] := BitmapFromString(11, 14, 'z78DA333018BCC0CDCDDC0D95244' +
'F2F2E11E2F552E2726AF99D543371E9A2563810630EE526501E9B' +
'D44A51F407003689B785');
NumberMaps [7] := BitmapFromString(6, 10, 'z78DA73733377333070C34BE202F8' +
'D58C9A800C0036BB4A59');
NumberMaps [8] := BitmapFromString(12, 14, 'z78DA3330181AC0CDCDDC0D95A4C' +
'4045C22A49A40BC2C2DDC335CC3677887F3C002007D5BC78E');
NumberMaps [9] := BitmapFromString(13, 14, 'z78DA3330184AC0CDCDDC0D37499' +
'E39A4CA0E2DD3F0EB22CF34EAC60579E1306ADAE001006F08D673' +
'');
end;

procedure FreeBMPS;
var I : Integer;
begin
for I := 0 to 9 do
FreeBitMap ( NumbersMap );
end;

procedure PinIt ( Pin : String );
var CX,CY,Z,I : Integer;
begin
BMPS;
for I := 1 to 4 do
begin
Z:=StrToInt ( Pin );
if ( FindBitMapToleranceIn ( CX, CY, IntToStr[Z], MSX1, MSY1, MSX2, MSY2, 20 )) then
Mouse ( CX, CY, 5, 5, True );
Wait ( 1000 + Random ( 1000 ));
end;
end;

begin
SetUpSRL;
PinIt ( PinNumber );
end.
[/php]

please note the usage of Local Variables, instead of Global Variables, also the Useage of Arrays to make a huge procedure into a simple 5 line loop.

Ejjman

2006-05-14 17:35:50

I don't get any of that you typed though…sry…