Just some random scripts I've made to flash games. Most are quite simple, to simple games.. All of these were made because I was bored, and are like 5 mins of work. Enjoi, if anyone needs these
CurveBall.
Sonar challenge :
GunSlinger :
There's lots of more of these too.. I'll Post more if anyone cares. Also, maybe you should add a other scripts section? Or does it matter if people post 'other scripts' here?
CurveBall.
Code:
//CurveBall
//Fill the setup and start.. After game over can refresh window to restart :D
//Alot of useless stuff.. Use this for learning or watever u wish to use this for.
//You dont have to target the game window, script finds it by itself.
//
// You can play the game at:
// http://www.albinoblacksheep.com/flash/curveball.php
program CurveBall;
const
BallOne = 12517323;//Green color from the ball.
BallTwo = 12845007;//Green color from the ball behind the glass.
PlayTO = 5;//Time in minutes to play. (Most likely gets pwned after few mins)
var
BallX,BallY: Integer;
X,Y: Integer;
Ax,Ay: Integer;
GoingOn: Integer;
GameStarted: Boolean;
Reason: String;
procedure Welcome;//So useless.
begin
Writeln('');
Writeln('Welcome to using CurveBaller by GoF');
Writeln('');
Wait(2000);
end;
procedure SetTime;
begin
GoingOn := GetSystemTime;
end;
function CheckForTime: Integer;
begin
Result := GetSystemTime - GoingOn;
end;
procedure UnSafeDisguiseScar(disguise: String);//By WT-Fakawi
begin
GetApplication.Title:= disguise;
GetSelf.Caption:= disguise;
end;
procedure DisguiseScar(disguise: String);//By Yakman
var
T: TVariantArray;
begin
SetArrayLength(T,1);
T[0] := Disguise;
ThreadSafeCall('UnSafeDisguiseScar',T);
end;
procedure Termination;
begin
Writeln('Script terminated because '+ Reason + '.');
Writeln('Im sorry.');
DisguiseSCAR(Reason);
GetSelf.Show;//show window.
TerminateScript;
end;
procedure CheckFKey;
begin
if(IsFKeyDown(3))then
begin
Writeln('Done.');
Reason := 'F-Key Pressed.';
Termination;
end;
end;
function LocateBall: Boolean; //Finds ball on screen.
var
XeX: Integer;
YeY: Integer;
Add: Integer;
begin
XeX := 40;
YeY := 40;
Add := 0;
if(FindColor(BallX,BallY,BallOne,0,0,XeX,YeY))or
(FindColor(BallX,BallY,BallTwo,0,0,XeX,YeY))then
begin
Result := True;
Writeln('Ball located on screen.');
Exit;
end else
begin
repeat
if(FindColor(BallX,BallY,BallOne,0,0,XeX,YeY))or
(FindColor(BallX,BallY,BallTwo,0,0,XeX,YeY))then
Break;
Add := Add+1;
XeX := XeX + 55;
YeY := YeY + 55;
until(Add = 15)
if(Add = 15)then
begin
Result := False;
Writeln('Ball not located!');
end else
begin
Writeln('Ball located!');
Result := True;
end;
end;
end;
procedure ClientDim;
begin
if(FindWindowBySize(551,401))then
begin
Writeln('Window found.');
GetClientDimensions(Ax,Ay);
end else
begin
Writeln('Failed to locate curveball window.');
Reason := 'Window not found!';
Termination;
end;
end;
procedure CountDown;//useless.. But i wanted to make this.
var
CountIt: Integer;
begin
for CountIt := 5 downto 0 do
begin
Wait(1000);
DisguiseSCAR('Game starting in ' +IntToStr(CountIt)+' seconds!');
Writeln('Game starting in ' +IntToStr(CountIt)+' seconds!');
end;
end;
procedure SetUp;
var
StartTab: Integer;
CheckCol: Integer;
begin
GameStarted := False;
StartTab := 16777215;
X := 225;
Y := 185;
WriteLn('Starting game in 5 seconds! Now make the curveball window visible!');
CountDown;
ClientDim;
LocateBall;
if(LocateBall)then
begin
GameStarted := True;
end else
begin
Writeln('Start screen.');
CheckCol := GetColor(X,Y);
if(CheckCol = StartTab)then
begin
MoveMouseSmooth(X,Y);
ClickMouse(X,Y,True);
Wait(Random(1000));
GameStarted := True;
end else
begin
Writeln('Unable To Locate ball or start tab.');
Wait(1000);
Writeln('Script has failed.');
Reason := 'Ball not found';
Termination;
end;
end;
end;
procedure FindBall;//Finds the ball on screen and moves mouse over it.
var
Times: Integer;
Brekr: Integer;
begin
DisguiseSCAR('Playing');
Times := 0;
Brekr := 15 + Random(10);
Wait(10);
if(FindColor(BallX,BallY,BallOne,0,0,Ax,Ay))or
(FindColor(BallX,BallY,BallTwo,0,0,Ax,Ay))then
begin
repeat
if(FindColor(BallX,BallY,BallOne,0,0,Ax,Ay))or
(FindColor(BallX,BallY,BallTwo,0,0,Ax,Ay))then
begin
MoveMouseSmooth(BallX,BallY);
BallX := BallX + Random(15) - Random(15);
BallY := BallY + Random(15) - Random(15);
ClickMouse(BallX,BallY,True);
Wait(10);//Reduces lagg.
end;
Times := Times + 1;
until(Times = Brekr)
Wait(5);
end;
end;
function CheckForEnd: Boolean;//checks for a bitmap to see if game is over.
var
EndMap: Integer;//Bitmap to see if game is over.
EndX,EndY: Integer;
begin
Endmap := BitmapFromString(15, 15, 'z78DA33302006B8989A9A62' +
'8A3AB9812026700143030A4C36750341333034064303082401603' +
'7991A6070996CEC460C747133773326118E82A10E28491BCE6088' +
'0B18D0A0DC18BA260300A5F83A48');
if(FindBitMapIn(EndMap,EndX,EndY,80,145,145,215))then
begin
Writeln('Found game over bitmap..');
Result := True;
end;
FreeBitMap(EndMap);//Free the bitmap from memory.
end;
begin
ClearDebug;
Welcome;
SetTime;
SetUp;
repeat
CheckFKey;
FindBall;
if(CheckForTime > PlayTO*60000)then
begin
Writeln('Done!');
Reason := 'Played enough';
Termination;
end;
if(not(LocateBall))then
begin
if(CheckForEnd)then
begin
Writeln('Game over.');
Reason := 'Game over.';
Termination;
end;
end;
until(False)//Doesnt matter.. Theres CheckFKey.
end.
Sonar challenge :
Code:
//SonarChallenge by GoF
//Play the game at:
// http://www.albinoblacksheep.com/flash/sonar.php
//Just target the window and press run.
program SonarChallenge;
const
//Colors:
BallOne = 395014;
BallTwo = 12105912;
BallThr = 8947848;
//Other stuff:
TimeOut = 1;//How long in minutes to play?
var
Bx,By: Integer;
Located: Boolean;
GoingOn: Integer;
procedure SetTime;
begin
GoingOn := GetSystemTime;
end;
function CheckForTime: Integer;
begin
Result := GetSystemTime - GoingOn;
end;
procedure LocateTheBall;
var
Lx,Ly: Integer;
begin
Located := False;
Status('Locating ball.');
if(FindColor(Lx,Ly,BallOne,0,0,530,495))or
(FindColor(Lx,Ly,BallTwo,0,0,530,495))or
(FindColor(Lx,Ly,BallThr,0,0,530,495))then
begin
Located := True;
Writeln('Ball located on screen.');
Exit;
end else
begin
Writeln('Ball not located.');
Writeln('Terminating!');
TerminateScript;
end;
end;
procedure ClickBall(BallColor: Integer);
var
Ax,Ay: Integer;
Addy: Integer;
begin
Ax := 0;
Ay := 230;
Addy := 0;
if(FindColor(Bx,By,BallColor,Ax,Ay,530,490))then
MoveMouseSmooth(Bx,By)
else
begin
repeat
Ay := Ay - 30;
Addy := Addy + 1;
if(FindColor(Bx,By,BallColor,Ax,Ay,530,490))then
begin
MoveMouseSmooth(Bx,By);
Wait(10);
Break;
end;
until(Addy = 7)
if(Addy = 7)then
begin
Writeln('Ball not found!');
Exit;
end else
begin
Writeln('Moved mouse over ball!');
end;
end;
end;
begin
ClearDebug;
Writeln('Script starts in 5 seconds!');
Wait(5000);
LocateTheBall;
repeat
ClickBall(BallOne);
ClickBall(BallTwo);
ClickBall(BallThr);
until(false)or(IsFKeyDown(3))
end.
GunSlinger :
Code:
{ GunSlinger by GoF
You can play the game at :
http://www.mousebreaker.com/games/gunslinger/play.php
Start script at the mainscreen of the game (before facing any
gunslingers), target the GunSlinger screen and press play.
Let me know of any bugs..
~GoF
}
program GunSlinger;
const
HowManyFools = 100;//How many fools to kill before submitting?
SubNick = 'GoF Ownz';//Nickname for hiscores?
var
TColor, FoolCounter: Integer;
AnotherFool: Boolean;
begin
FoolCounter := 0;
ClearDebug;
Writeln('Starting script in 5 seconds!');
Wait(5000);
ActivateClient;
if (GetColor(114, 144) = 10079436) then
begin
Writeln('At mainscreen..');
ActivateClient;
MoveMouseSmoothEx(500, 355, 10, 10, 6, 7, 5);
ClickMouse(500, 355, True);
Wait(3000);
end;
repeat
if IsFKeyDown(3) then
TerminateScript;
TColor := 0;
TColor := GetColor(207, 238);
if not (TColor = 6724044) then
begin
Writeln('Going for the gun..');
Writeln('Lets kill him');
SendKeys(' ');
FoolCounter := FoolCounter + 1;
AnotherFool := True;
end else
Wait(35);//A little wait so the we won't lagg too much
if (AnotherFool) then
begin
while not (GetColor(164, 57) = 52479) do
begin
Wait(1000);
Writeln('Waiting for "GOOD SHOT" text..');
end;
if not (FoolCounter = HowManyFools) then
begin
MoveMouseSmoothEx(515, 360, 10, 10, 6, 7, 5);
ClickMouse(515, 360, True );
AnotherFool := False;
end else
begin
Writeln('Done killing! Limit reached.');
MoveMouseSmoothEx(250, 360, 10, 10, 6, 7, 5);
ClickMouse(250, 360, True);
while not (GetColor(261, 211) = 16777215) do
begin
Writeln('Waiting for "Enter your name"..');
Wait(1000);
end;
MoveMouseSmoothEx(275, 215, 10, 10, 6, 7, 5);
ClickMouse(275, 215, True);
SendKeys(SubNick);
Wait(1000);
ClickMouse(270, 275, True);
Writeln('Clicked submit :)');
Writeln('Done.. Terminating.');
TerminateScript;
end;
Wait(3000);//Little wait here too.
Writeln('Currently killed '+IntToStr(FoolCounter)+' gunslingers.');
end;
until(False)
end.
There's lots of more of these too.. I'll Post more if anyone cares. Also, maybe you should add a other scripts section? Or does it matter if people post 'other scripts' here?



