TRiLeZ
04-18-2009, 08:35 AM
I have re-made my Sergeant Randoms.
Tell me if you think this will work.
function Moving:Boolean;
var
c: array[0..7] of Integer;
i: Integer;
begin
if Not LoggedIn then
begin
Result := False;
Exit;
end;
for i := 0 to 1 do
begin
c[((i * 4) + 0)] := GetColor(MSCx - 40, MSCy - 40);
c[((i * 4) + 1)] := GetColor(MSCx + 40, MSCy + 40);
c[((i * 4) + 0)] := GetColor(MSCx - 40, MSCy - 40);
c[((i * 4) + 1)] := GetColor(MSCx + 40, MSCy + 40);
Wait(100);
end;
if ( c[0] = c[4] ) and ( c[1] = c[5] ) and ( c[2] = c[6] ) and ( c[3] = c[7] )
then
Result := False
else
Result:= True;
end;
function T_DoSitUps: boolean;
var
x,y,SitUps: Integer;
begin
SitUps := BitmapFromString(25, 16, 'beNqrcvWvIhm1zM8CIjI0wv' +
'UiI/LMweoMZBGSDMfUiOy8gTUKWSNaoOE3Cs0uzJDHDD2CzsBlGjF' +
'hjkcLQbcRE8ukJi1cYUtq+qTcHKyJBE8qojyPkJEIqZJbKTUK ABt6' +
'6ec=');
Mouse(305,455,0,0,true);
if FindBitmap(SitUps,x,y) then
begin
repeat
Mouse(x,y - 100,15,15,false);
until ChooseOption('Use');
Wait(1000);
While Moving do wait(20);
Wait(1000);
repeat
Wait(20);
until FindText(x,y,'Sergeant',NPCChars,243,357,378,385) or
FindColorSpiralTolerance(x,y,3425787,39,372,107,43 8,4);
Result:= True;
FreeBitmap(SitUps);
end
else
Result:= False;
FreeBitmap(SitUps);
end;
function T_DoPushUps: boolean;
var
x,y,PushUps: Integer;
begin
PushUps := BitmapFromString(34, 12, 'beNqrcvWvAqHS3jgIgnBph' +
'OC20NQiTCta5mfR1F8QKwgiOlhBoS1EWkGJRVi1k2QvQccQdC Hltp' +
'AUCGRbRJVkgzV3ILNpagVN8zhCBABCTus1');
Mouse(305,455,0,0,true);
if FindBitmap(PushUps,x,y) then
begin
repeat
Mouse(x,y - 100,15,15,false);
until ChooseOption('Use');
Wait(1000);
While Moving do wait(20);
Wait(1000);
repeat
Wait(20);
until FindText(x,y,'Sergeant',NPCChars,243,357,378,385) or
FindColorSpiralTolerance(x,y,3425787,39,372,107,43 8,4);
Result:= True;
FreeBitmap(PushUps);
end
else
Result:= False;
FreeBitmap(PushUps);
end;
function T_DoStarJumps: boolean;
var
x,y,StarJumps: Integer;
begin
StarJumps := BitmapFromString(19, 15, 'beNqrcvWvwolKe+MgCI8' +
'a4nW1zM+CICLNgauHa8EUwaWeGAWYiHj3EK8Lj/bBqZG6gUOSRmIi' +
'EU9KwKMRniZxKUDWi5l64XrxOAZuBUgvAFxFYjc=');
Mouse(305,455,0,0,true);
if FindBitmap(StarJumps,x,y) then
begin
repeat
Mouse(x,y - 100,15,15,false);
until ChooseOption('Use');
Wait(1000);
While Moving do wait(20);
Wait(1000);
repeat
Wait(20);
until FindText(x,y,'Sergeant',NPCChars,243,357,378,385) or
FindColorSpiralTolerance(x,y,3425787,39,372,107,43 8,4);
Result:= True;
FreeBitmap(StarJumps);
end
else
Result:= False;
FreeBitmap(StarJumps);
end;
function T_DoJogging: boolean;
var
x,y,Jogging: Integer;
begin
Jogging := BitmapFromString(15, 16, 'beNqrci3tjYMg/yoUNlaEV' +
'TEe9XDUMCsdiOCGEFRMjBo4ItINyF4gSTGyevy+RnMMLovQXI 7fQO' +
'SgwxNHmCqJCT0iw4FU9cQnDFKjg4AaAOzHFUs=');
Mouse(305,455,0,0,true);
if FindBitmap(Jogging,x,y) then
begin
repeat
Mouse(x,y - 100,15,15,false);
until ChooseOption('Use');
Wait(1000);
While Moving do wait(20);
Wait(1000);
repeat
Wait(20);
until FindText(x,y,'Sergeant',NPCChars,243,357,378,385) or
FindColorSpiralTolerance(x,y,3425787,39,372,107,43 8,4);
Result:= True;
FreeBitmap(Jogging);
end
else
Result:= False;
FreeBitmap(Jogging);
end;
function T_FindSergeant: boolean;
var
x,y: Integer;
begin
if FindText(x,y,'Sergeant',NPCChars,243,357,378,385) or
FindColorSpiralTolerance(x,y,3425787,39,372,107,43 8,4) then
begin
Mouse(305,455,0,0,true);
SetAngle(false);
repeat
Wait(250);
if FindText(x,y,'sit',NPCChars,168,398,486,436) then T_DoSitUps;
if FindText(x,y,'push',NPCChars,168,398,486,436) then T_DoPushUps;
if FindText(x,y,'star',NPCChars,168,398,486,436) then T_DoStarJumps;
if FindText(x,y,'jogging',NPCChars,168,398,486,436) then T_DoJogging;
until FindText(x,y,'actually',NPCChars,168,395,486,436);
Mouse(305,455,0,0,true);
SetAngle(true);
Result:= True;
end
else
Result:= false;
end;
Edit: Better Text Finding
function Moving:Boolean;
var
c: array[0..7] of Integer;
i: Integer;
begin
if Not LoggedIn then
begin
Result := False;
Exit;
end;
for i := 0 to 1 do
begin
c[((i * 4) + 0)] := GetColor(MSCx - 40, MSCy - 40);
c[((i * 4) + 1)] := GetColor(MSCx + 40, MSCy + 40);
c[((i * 4) + 0)] := GetColor(MSCx - 40, MSCy - 40);
c[((i * 4) + 1)] := GetColor(MSCx + 40, MSCy + 40);
Wait(100);
end;
if ( c[0] = c[4] ) and ( c[1] = c[5] ) and ( c[2] = c[6] ) and ( c[3] = c[7] )
then
Result := False
else
Result:= True;
end;
function T_DoSitUps: boolean;
var
x,y,SitUps: Integer;
begin
SitUps := BitmapFromString(25, 16, 'beNqrcvWvIhm1zM8CIjI0wv' +
'UiI/LMweoMZBGSDMfUiOy8gTUKWSNaoOE3Cs0uzJDHDD2CzsBlGjF' +
'hjkcLQbcRE8ukJi1cYUtq+qTcHKyJBE8qojyPkJEIqZJbKTUK ABt6' +
'6ec=');
Mouse(305,455,0,0,true);
if FindBitmap(SitUps,x,y) then
begin
repeat
Mouse(x,y - 100,15,15,false);
until ChooseOption('Use');
Wait(1000);
While Moving do wait(20);
Wait(1000);
repeat
Wait(20);
until FindNPCChatText('Sergeant', Nothing) or
FindColorSpiralTolerance(x,y,3425787,39,372,107,43 8,4);
Result:= True;
FreeBitmap(SitUps);
end
else
Result:= False;
FreeBitmap(SitUps);
end;
function T_DoPushUps: boolean;
var
x,y,PushUps: Integer;
begin
PushUps := BitmapFromString(34, 12, 'beNqrcvWvAqHS3jgIgnBph' +
'OC20NQiTCta5mfR1F8QKwgiOlhBoS1EWkGJRVi1k2QvQccQdC Hltp' +
'AUCGRbRJVkgzV3ILNpagVN8zhCBABCTus1');
Mouse(305,455,0,0,true);
if FindBitmap(PushUps,x,y) then
begin
repeat
Mouse(x,y - 100,15,15,false);
until ChooseOption('Use');
Wait(1000);
While Moving do wait(20);
Wait(1000);
repeat
Wait(20);
until FindNPCChatText('Sergeant', Nothing) or
FindColorSpiralTolerance(x,y,3425787,39,372,107,43 8,4);
Result:= True;
FreeBitmap(PushUps);
end
else
Result:= False;
FreeBitmap(PushUps);
end;
function T_DoStarJumps: boolean;
var
x,y,StarJumps: Integer;
begin
StarJumps := BitmapFromString(19, 15, 'beNqrcvWvwolKe+MgCI8' +
'a4nW1zM+CICLNgauHa8EUwaWeGAWYiHj3EK8Lj/bBqZG6gUOSRmIi' +
'EU9KwKMRniZxKUDWi5l64XrxOAZuBUgvAFxFYjc=');
Mouse(305,455,0,0,true);
if FindBitmap(StarJumps,x,y) then
begin
repeat
Mouse(x,y - 100,15,15,false);
until ChooseOption('Use');
Wait(1000);
While Moving do wait(20);
Wait(1000);
repeat
Wait(20);
until FindNPCChatText('Sergeant', Nothing) or
FindColorSpiralTolerance(x,y,3425787,39,372,107,43 8,4);
Result:= True;
FreeBitmap(StarJumps);
end
else
Result:= False;
FreeBitmap(StarJumps);
end;
function T_DoJogging: boolean;
var
x,y,Jogging: Integer;
begin
Jogging := BitmapFromString(15, 16, 'beNqrci3tjYMg/yoUNlaEV' +
'TEe9XDUMCsdiOCGEFRMjBo4ItINyF4gSTGyevy+RnMMLovQXI 7fQO' +
'SgwxNHmCqJCT0iw4FU9cQnDFKjg4AaAOzHFUs=');
Mouse(305,455,0,0,true);
if FindBitmap(Jogging,x,y) then
begin
repeat
Mouse(x,y - 100,15,15,false);
until ChooseOption('Use');
Wait(1000);
While Moving do wait(20);
Wait(1000);
repeat
Wait(20);
until FindNPCChatText('Sergeant', Nothing) or
FindColorSpiralTolerance(x,y,3425787,39,372,107,43 8,4);
Result:= True;
FreeBitmap(Jogging);
end
else
Result:= False;
FreeBitmap(Jogging);
end;
function T_FindSergeant: boolean;
var
x,y: Integer;
begin
if FindNPCChatText('Sergeant', Nothing) or
FindColorSpiralTolerance(x,y,3425787,39,372,107,43 8,4) then
begin
Mouse(305,455,0,0,true);
SetAngle(false);
repeat
Wait(250);
if FindNPCChatText('sit', Nothing) then T_DoSitUps;
if FindNPCChatText('push', Nothing) then T_DoPushUps;
if FindNPCChatText('star', Nothing) then T_DoStarJumps;
if FindNPCChatText('jogging', Nothing) then T_DoJogging;
until FindText('actually', Nothing);
Mouse(305,455,0,0,true);
SetAngle(true);
Result:= True;
end
else
Result:= false;
end;
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.