newguy45
03-30-2015, 12:25 AM
Hello all I'm writing a script for a facebook game called shipping manager, the idea is it's going to fuel up my ships and send them on their routes every three minuets.
25412
this is what the screen looks like
now what my script does is it looks for the depart button on every line and clicks beside it to bring up the fuel screen. My only problem is my bitmaps are horribly unreliable. I've try tiny bitmaps to medium bitmaps of the depart button but simba is always randomly throwing me cant find the bitmap messages.
here is my code , any advice or help is greatly appreciated.
program SetSail;
var count:integer;
procedure Fuel1; //detects the depart button on the first line
var DepartDetect, X, Y: Integer;
begin
DepartDetect := BitmapFromString(19, 2, 'meJzryTPvyTc/uWv+9y/vLh5ZC2T' +
'vWt765cPLQ5umANk9YFkICRT/+uHF4U2T+/JN+/JM+wsgyOz07vnf' +
'Pr1eOzVr9wqQxsObpwAFkRFE/MjmyRMLTIAIAMo6QNY=');
if (FindBitmapIn(DepartDetect, X, Y, 912, 503, 985, 540)) Then
begin
writeln('found Depart Button');
MoveMouse(665, 515);
wait(200);
ClickMouse(665, 515, mouse_Left);
wait(1200);
MoveMouse(871, 340);
wait(400);
ClickMouse(871, 340, mouse_Left);
wait(400);
MoveMouse(952, 317);
wait(400);
ClickMouse(952, 317, mouse_Left);
end else
writeln('Did not find Depart Button 1');
FreeBitmap(DepartDetect);
end;
procedure Fuel2; //detects the depart button on the second line
var DepartDetect2, X, Y: Integer;
begin
DepartDetect2 := BitmapFromString(20, 4, 'meJz78Or++v6IQ2uav358eWrbpDm' +
'lRkD2t0+vrh1fDWTPKTOGiMBlISIQ8suH5zdOrD6ytgkoe3r7 xPnl' +
'RvPLDS/um/vt0+sds9KBbKAImiycfHbn5OvHl4+tA8me3T5xUaXBo' +
'kpDIAkUB2rfNScdyMaUhZBLK/WXVeqTRwIAZWaJCw==');
if (FindBitmapIn(DepartDetect2, X, Y, 908, 558, 989, 593)) Then
begin
writeln('found Depart Button');
MoveMouse(623, 576);
wait(200);
ClickMouse(623, 576, mouse_Left);
wait(1200);
MoveMouse(871, 340);
wait(400);
ClickMouse(871, 340, mouse_Left);
wait(400);
MoveMouse(952, 317);
wait(400);
ClickMouse(952, 317, mouse_Left);
end else
writeln('Did not find Depart Button 2');
FreeBitmap(DepartDetect2);
end;
procedure Fuel3; //detects the depart button on the third line
var DepartDetect3, X, Y: Integer;
begin
DepartDetect3 := BitmapFromString(26, 8, 'meJylkNtKAlEUht+pUSd7gO4rKCJ' +
'6gTHtZD2A2mQiVI6KnbCEyjwglIVYFo2YZnVRjEZJmlnqTHlo nNTL' +
'lm6TIO+CxeLf3/+xZzMkISEJnCQkczJpc3r+s8vs06Z2RDeGa+XdC' +
'3LpqmqwUsrl0gxkRHw75Bf/XhOKaKr8u52SramGQGvDVlX5yDxEym' +
'xySzeqH8f1CvzSb2UzMb6YpfeNiPjtc0KZbRwVOJD7ax9c6KB kHds' +
'tTZ9QeA0eGBcnJDCZx+hdyA07ydCIHDf9ttA85t0momN7alcJ n2zo' +
'gDJMim3kALzKYyKuTqwlLrWrHzFMiAN7GvBDXgoyOPChfJpB+ W/79' +
'hBhXxjztNg8Jb4JWFHenu+vFLNhLwX5zKH54rn2z2EuXGAiv9 V+ss' +
'gEwqVvV5SiFSUGO5uIxsMuixKzKEVviehzjIZ87mz4kUODTdV byD4' +
'2oQg5v1tENma6GjOLBV3qGs/VhUL95xllLuVZGqZdavCjR8vrsxjk' +
'Ks/Fw07I6zNdiLRbIN9/3n/Y');
if (FindBitmapIn(DepartDetect3, X, Y, 909, 610, 992, 650)) Then
begin
writeln('found Depart Button');
MoveMouse(628, 627);
wait(200);
ClickMouse(628, 627, mouse_Left);
wait(1200);
MoveMouse(871, 340);
wait(400);
ClickMouse(871, 340, mouse_Left);
wait(400);
MoveMouse(952, 317);
wait(400);
ClickMouse(952, 317, mouse_Left);
end else
writeln('Did not find Depart Button 3');
FreeBitmap(DepartDetect3);
end;
procedure Fuel4; //detects the depart button on the forth line
var DepartDetect4, X, Y: Integer;
begin
DepartDetect4 := BitmapFromString(15, 6, 'meJxrzbZqzbZszbZqy7ZohbFxkR2' +
'5Fp25lkByx7K2r59ef//yDoK+fXq9YnLOrKawz++fwwUPbZrSk2fe' +
'k2++a3nrlw8vQdx8c6DI9TM7gOpXTclGlr135VB/gRkQ7VnRAuQe3' +
'jwFwt29Aij7Yu3ULCTuy/ev7i/vjp5UaLp3ZcuXjy+Pbp4MZE8qMH' +
'1869SLh1cgbLjs53fPjm+dPK3I9MCq5q+fXsGdd+XYmmnFpkB xCLl' +
'/VcvXjy8BIIel/A==');
if (FindBitmapIn(DepartDetect4, X, Y, 910, 665, 995, 703)) Then
begin
writeln('found Depart Button');
MoveMouse(601, 683);
wait(200);
ClickMouse(601, 683, mouse_Left);
wait(1200);
MoveMouse(871, 340);
wait(400);
ClickMouse(871, 340, mouse_Left);
wait(400);
MoveMouse(952, 317);
wait(400);
ClickMouse(952, 317, mouse_Left);
end else
writeln('Did not find Depart Button 4');
FreeBitmap(DepartDetect4);
end;
procedure Madness;
var Hide, X, Y: Integer;
begin
wait(600);
MoveMouse(660, 733); //click send ships
wait(400);
ClickMouse(660, 733, mouse_Left);
wait(2000);
Hide := BitmapFromString(19, 4, 'meJxtz0EKgzAQBdATqfFkweol3Bp' +
'QCOgRkrlGk31LS8mmKri0i5Ld9GtBumhWn/dnEsK8ncisjH8aEfnV' +
'GH+ROXNQ59BIoWT+6xFuPLwrxGg3b62f9tBZfwjathCHXwuBC/enW' +
'J/SibLIqyYsphjQ1t1KSICg1WX214cqnSnBYk9uJgysA7m+Snih+ 8' +
'JokeOjxl++jjy/4fUHKpKfEQ==');
if (FindBitmapIn(Hide, X, Y, 629, 327, 715, 544)) Then
begin
writeln('found Hide Button');
MoveMouse(X, Y);
wait(200);
ClickMouse(X, Y, mouse_Left);
wait(180000);
MoveMouse(580, 332); //click routes
wait(400);
ClickMouse(580, 332, mouse_Left);
wait(3000);
end else
writeln('No ships avalible, checking again in three mins');
MoveMouse(580, 332); //click routes
wait(180000);
ClickMouse(580, 332, mouse_Left);
FreeBitmap(Hide);
end;
procedure DetectGlitch;
var Glitch, X, Y: Integer;
begin
wait(400);
Glitch := BitmapFromString(21, 9, 'meJzb/P7f5lE0ikhEAE6S8DA=');
if (FindBitmapIn(Glitch, X, Y, 738, 247, 932, 270)) Then
begin
writeln('found Glitch!');
MoveMouse(662, 253);
wait(200);
ClickMouse(662, 253, mouse_Left);
wait(1200);
end else
writeln('No Glitch!');
end;
begin
repeat
wait(400);
DetectGlitch;
wait(2000);
Fuel1;
wait(2000);
Fuel2;
wait(2000);
Fuel3;
wait(2000);
Fuel4;
wait(200);
Madness;
until( false );
end.
25412
this is what the screen looks like
now what my script does is it looks for the depart button on every line and clicks beside it to bring up the fuel screen. My only problem is my bitmaps are horribly unreliable. I've try tiny bitmaps to medium bitmaps of the depart button but simba is always randomly throwing me cant find the bitmap messages.
here is my code , any advice or help is greatly appreciated.
program SetSail;
var count:integer;
procedure Fuel1; //detects the depart button on the first line
var DepartDetect, X, Y: Integer;
begin
DepartDetect := BitmapFromString(19, 2, 'meJzryTPvyTc/uWv+9y/vLh5ZC2T' +
'vWt765cPLQ5umANk9YFkICRT/+uHF4U2T+/JN+/JM+wsgyOz07vnf' +
'Pr1eOzVr9wqQxsObpwAFkRFE/MjmyRMLTIAIAMo6QNY=');
if (FindBitmapIn(DepartDetect, X, Y, 912, 503, 985, 540)) Then
begin
writeln('found Depart Button');
MoveMouse(665, 515);
wait(200);
ClickMouse(665, 515, mouse_Left);
wait(1200);
MoveMouse(871, 340);
wait(400);
ClickMouse(871, 340, mouse_Left);
wait(400);
MoveMouse(952, 317);
wait(400);
ClickMouse(952, 317, mouse_Left);
end else
writeln('Did not find Depart Button 1');
FreeBitmap(DepartDetect);
end;
procedure Fuel2; //detects the depart button on the second line
var DepartDetect2, X, Y: Integer;
begin
DepartDetect2 := BitmapFromString(20, 4, 'meJz78Or++v6IQ2uav358eWrbpDm' +
'lRkD2t0+vrh1fDWTPKTOGiMBlISIQ8suH5zdOrD6ytgkoe3r7 xPnl' +
'RvPLDS/um/vt0+sds9KBbKAImiycfHbn5OvHl4+tA8me3T5xUaXBo' +
'kpDIAkUB2rfNScdyMaUhZBLK/WXVeqTRwIAZWaJCw==');
if (FindBitmapIn(DepartDetect2, X, Y, 908, 558, 989, 593)) Then
begin
writeln('found Depart Button');
MoveMouse(623, 576);
wait(200);
ClickMouse(623, 576, mouse_Left);
wait(1200);
MoveMouse(871, 340);
wait(400);
ClickMouse(871, 340, mouse_Left);
wait(400);
MoveMouse(952, 317);
wait(400);
ClickMouse(952, 317, mouse_Left);
end else
writeln('Did not find Depart Button 2');
FreeBitmap(DepartDetect2);
end;
procedure Fuel3; //detects the depart button on the third line
var DepartDetect3, X, Y: Integer;
begin
DepartDetect3 := BitmapFromString(26, 8, 'meJylkNtKAlEUht+pUSd7gO4rKCJ' +
'6gTHtZD2A2mQiVI6KnbCEyjwglIVYFo2YZnVRjEZJmlnqTHlo nNTL' +
'lm6TIO+CxeLf3/+xZzMkISEJnCQkczJpc3r+s8vs06Z2RDeGa+XdC' +
'3LpqmqwUsrl0gxkRHw75Bf/XhOKaKr8u52SramGQGvDVlX5yDxEym' +
'xySzeqH8f1CvzSb2UzMb6YpfeNiPjtc0KZbRwVOJD7ax9c6KB kHds' +
'tTZ9QeA0eGBcnJDCZx+hdyA07ydCIHDf9ttA85t0momN7alcJ n2zo' +
'gDJMim3kALzKYyKuTqwlLrWrHzFMiAN7GvBDXgoyOPChfJpB+ W/79' +
'hBhXxjztNg8Jb4JWFHenu+vFLNhLwX5zKH54rn2z2EuXGAiv9 V+ss' +
'gEwqVvV5SiFSUGO5uIxsMuixKzKEVviehzjIZ87mz4kUODTdV byD4' +
'2oQg5v1tENma6GjOLBV3qGs/VhUL95xllLuVZGqZdavCjR8vrsxjk' +
'Ks/Fw07I6zNdiLRbIN9/3n/Y');
if (FindBitmapIn(DepartDetect3, X, Y, 909, 610, 992, 650)) Then
begin
writeln('found Depart Button');
MoveMouse(628, 627);
wait(200);
ClickMouse(628, 627, mouse_Left);
wait(1200);
MoveMouse(871, 340);
wait(400);
ClickMouse(871, 340, mouse_Left);
wait(400);
MoveMouse(952, 317);
wait(400);
ClickMouse(952, 317, mouse_Left);
end else
writeln('Did not find Depart Button 3');
FreeBitmap(DepartDetect3);
end;
procedure Fuel4; //detects the depart button on the forth line
var DepartDetect4, X, Y: Integer;
begin
DepartDetect4 := BitmapFromString(15, 6, 'meJxrzbZqzbZszbZqy7ZohbFxkR2' +
'5Fp25lkByx7K2r59ef//yDoK+fXq9YnLOrKawz++fwwUPbZrSk2fe' +
'k2++a3nrlw8vQdx8c6DI9TM7gOpXTclGlr135VB/gRkQ7VnRAuQe3' +
'jwFwt29Aij7Yu3ULCTuy/ev7i/vjp5UaLp3ZcuXjy+Pbp4MZE8qMH' +
'1869SLh1cgbLjs53fPjm+dPK3I9MCq5q+fXsGdd+XYmmnFpkB xCLl' +
'/VcvXjy8BIIel/A==');
if (FindBitmapIn(DepartDetect4, X, Y, 910, 665, 995, 703)) Then
begin
writeln('found Depart Button');
MoveMouse(601, 683);
wait(200);
ClickMouse(601, 683, mouse_Left);
wait(1200);
MoveMouse(871, 340);
wait(400);
ClickMouse(871, 340, mouse_Left);
wait(400);
MoveMouse(952, 317);
wait(400);
ClickMouse(952, 317, mouse_Left);
end else
writeln('Did not find Depart Button 4');
FreeBitmap(DepartDetect4);
end;
procedure Madness;
var Hide, X, Y: Integer;
begin
wait(600);
MoveMouse(660, 733); //click send ships
wait(400);
ClickMouse(660, 733, mouse_Left);
wait(2000);
Hide := BitmapFromString(19, 4, 'meJxtz0EKgzAQBdATqfFkweol3Bp' +
'QCOgRkrlGk31LS8mmKri0i5Ld9GtBumhWn/dnEsK8ncisjH8aEfnV' +
'GH+ROXNQ59BIoWT+6xFuPLwrxGg3b62f9tBZfwjathCHXwuBC/enW' +
'J/SibLIqyYsphjQ1t1KSICg1WX214cqnSnBYk9uJgysA7m+Snih+ 8' +
'JokeOjxl++jjy/4fUHKpKfEQ==');
if (FindBitmapIn(Hide, X, Y, 629, 327, 715, 544)) Then
begin
writeln('found Hide Button');
MoveMouse(X, Y);
wait(200);
ClickMouse(X, Y, mouse_Left);
wait(180000);
MoveMouse(580, 332); //click routes
wait(400);
ClickMouse(580, 332, mouse_Left);
wait(3000);
end else
writeln('No ships avalible, checking again in three mins');
MoveMouse(580, 332); //click routes
wait(180000);
ClickMouse(580, 332, mouse_Left);
FreeBitmap(Hide);
end;
procedure DetectGlitch;
var Glitch, X, Y: Integer;
begin
wait(400);
Glitch := BitmapFromString(21, 9, 'meJzb/P7f5lE0ikhEAE6S8DA=');
if (FindBitmapIn(Glitch, X, Y, 738, 247, 932, 270)) Then
begin
writeln('found Glitch!');
MoveMouse(662, 253);
wait(200);
ClickMouse(662, 253, mouse_Left);
wait(1200);
end else
writeln('No Glitch!');
end;
begin
repeat
wait(400);
DetectGlitch;
wait(2000);
Fuel1;
wait(2000);
Fuel2;
wait(2000);
Fuel3;
wait(2000);
Fuel4;
wait(200);
Madness;
until( false );
end.