Ok, this is the procedure inside the main script itself which loads the bitmaps in my include. (Also, don't laugh at the code, I know it's sloopy but understand this is beta stage)
Simba Code:
procedure Walk;
Var x,y,x2,y2,
x3,y3,x4,y4,
x5,y5,x6,y6,
x7,y7,x8,y8,
x9,y9,x10,y10,
x11,y11:integer;
begin
LogsText := BitmapFromString(23, 10, 'meJxrYDBpYMAHGsBoqwUWQSSEz5AlSOxtZnATTJYimXY0CZ8haA5owCbeALYIvyFw21ENMVmCqoYMQxhgVgPR0WQEFxdADhO0sEWzDhNhKkANHBNkxZNwuwE/wGMpkQDTXw3UQADo6zdd');
setbitmapname(LogsText,'LogsText');
//~Produce walking coordinates~//
x := 200+Random(15);
y := 310+Random(10);
x2 := 265+Random(20);
y2 := 240+Random(15);
x3 := 5+Random(20);
y3 := 135+Random(20);
x4 := 5+Random(10);
y4 := 170+Random(20);
x5 := 290+Random(30);
y5 := 5+Random(10);
x6 := 340+Random(25);
y6 := 5+Random(10);
x7 := 340+Random(20);
y7 := 5+Random(10);
x8 := 355+Random(25);
y8 := 140+Random(10);
x10 := 360+Random(15);
y10 := 310+Random(10);
x11 := 360+Random(15);
y11 := 310+Random(10);
MoveMouse(x,y);
wait(350+Random(200));
ClickMouse(x,y,mouse_Left);
wait(2000+Random(400));
repeat
if ((GetRegion = 'R_OutsideMine') And (Clicked = False)) then
begin
Clicked := True;
MoveMouse(x2,y2);
wait(350+Random(200));
ClickMouse(x2,y2,mouse_Left);
wait(1800+Random(400));
MoveMouse(x3,y3);
wait(350+Random(200));
ClickMouse(x3,y3,mouse_Left);
wait(2000+Random(400));
WStage := 1;
end else if ((WStage = 1) And (GetRegion = 'R_FoxBuilding') And (Clicked = True)) then
begin
Clicked := False;
MoveMouse(x4,y4);
wait(350+Random(200));
ClickMouse(x4,y4,mouse_Left);
wait(2000+Random(400));
WStage := 2;
end else if ((WStage = 2) And (GetRegion = 'R_OutsideOakland') And (Clicked = False)) then
begin
Clicked := True;
MoveMouse(x5,y5);
wait(350+Random(200));
ClickMouse(x5,y5,mouse_Left);
wait(2000+Random(400));
WStage := 3;
end else if ((WStage = 3) And (GetRegion = 'R_Furnace') And (Clicked = True)) then
begin
Clicked := False;
MoveMouse(x6,y6);
wait(350+Random(200));
ClickMouse(x6,y6,mouse_Left);
wait(2000+Random(400));
WStage := 4;
end else if ((WStage = 4) And (GetRegion = 'R_FurnaceNorthA') And (Clicked = False)) then
begin
Clicked := True;
MoveMouse(x7,y7);
wait(350+Random(200));
ClickMouse(x7,y7,mouse_Left);
wait(2000+Random(400));
WStage := 5;
end else if ((WStage = 5) And (GetRegion = 'R_FurnaceNorthB') And (Clicked = True)) then
begin
Clicked := False
MoveMouse(x8,y8);
wait(350+Random(200));
ClickMouse(x8,y8,mouse_Left);
wait(350+Random(200));
if (FindBitmapToleranceIn(LogsText,x9,y9,340,5,425,190,25)) then
begin
Writeln('Taking logs');
x9 := x9+Random(20);
y9 := y9+Random(10);
MoveMouse(x9,y9);
wait(350+Random(200));
ClickMouse(x9,y9,mouse_Left);
wait(3100+Random(300));
MoveMouse(x10,y10);
wait(350+Random(200));
ClickMouse(x10,y10,mouse_Left);
wait(2000+Random(400));
//WStage := 6; //Skip it
WStage := 7;
end;
end else if ((WStage = 7) And (GetRegion = 'R_FurnaceNorthA') And (Clicked = False)) then
begin
Clicked := True;
MoveMouse(x11,y11);
wait(350+Random(200));
ClickMouse(x11,y11,mouse_Left);
wait(2000+Random(300));
WStage := 8;
end else
begin
Writeln('Lost!');
end;
until(WStage = 8)
FreeBitmap(LogsText);
PStage := 2;
end;
And this (below) is in the main script loop (also repeated)
Simba Code:
if(PStage = 1) then
Walk;
And here is the "GetRegion" function in my include (Not including the bitmaps defined within the function, or should the be globally defined?):
Simba Code:
function GetRegion: String;
Var
R_HeartMine,R_FoxBuilding,
R_Furnace,R_FurnaceNorthA,
R_FurnaceNorthB,R_InsideOakland,
R_OutsideMine,R_OutsideOakland,
x,y: integer;
begin
setbitmapname(R_HeartMine,'R_HeartMine');
setbitmapname(R_FoxBuilding,'R_FoxBuilding');
setbitmapname(R_Furnace,'R_Furnace');
setbitmapname(R_FurnaceNorthA,'R_FurnaceNorthA');
setbitmapname(R_FurnaceNorthB,'R_FurnaceNorthB');
setbitmapname(R_HeartMine,'R_OutsideOakland');
setbitmapname(R_HeartMine,'R_InsideOakland');
setbitmapname(R_HeartMine,'R_OutsideMine');
if (FindBitmapToleranceIn(R_HeartMine,x,y,0,0,455,325,25)) then
begin
Result := 'R_HeartMine';
end else if (FindBitmapToleranceIn(R_FoxBuilding,x,y,0,0,455,325,25)) then
begin
Result := 'R_FoxBuilding';
end else if (FindBitmapToleranceIn(R_Furnace,x,y,0,0,455,325,25)) then
begin
Result := 'R_Furnace';
end else if (FindBitmapToleranceIn(R_FurnaceNorthA,x,y,0,0,455,325,25)) then
begin
Result := 'R_FurniceNorthA';
end else if (FindBitmapToleranceIn(R_FurnaceNorthB,x,y,0,0,455,325,25)) then
begin
Result := 'R_FurnaceNorthB';
end else if (FindBitmapToleranceIn(R_OutsideMine,x,y,0,0,455,325,25)) then
begin
Result := 'R_OutsideMine';
end else if (FindBitmapToleranceIn(R_OutsideOakland,x,y,0,0,455,325,25)) then
begin
Result := 'R_OutsideOakland';
end;
FreeBitmap(R_HeartMine);
FreeBitmap(R_FoxBuilding);
FreeBitmap(R_Furnace);
FreeBitmap(R_FurnaceNorthA);
FreeBitmap(R_FurnaceNorthB);
FreeBitmap(R_OutsideMine);
FreeBitmap(R_OutsideOakland);
end;
I have the bitmaps declared within 'GetRegion' function, they're pretty big so I didn't include them above.