Hobbit
2007-01-27 00:35:18
I finally had time to finish my script…
this new version has many update such as set-up in form….bugs fixed….2 new gametypes to choose from….please check it out and enjoy….
Edit: if you run the reflex game if the score comes up as 0 it is bug in the game….i've checked it out and script procedure for that works perfect.
If you vote please make a post :D
this new version has many update such as set-up in form….bugs fixed….2 new gametypes to choose from….please check it out and enjoy….
Edit: if you run the reflex game if the score comes up as 0 it is bug in the game….i've checked it out and script procedure for that works perfect.
If you vote please make a post :D
//Hobbit's King of Buttons 3 P0wn3r V2.4
//Made by Hobbit
//==Set-up==
//Go to [url]http://www.ugoplayer.com/games/kingofbuttons3.html[/url]
//Silent Mouse MUST be OFF!
//Click and drag Cross-hairs on to screen ^^^
//Start at game options screen(after the intro and preloading)
//Press play
//Set-up form only
{/-\\-//-\\-//-\\-//-\\-//-\\-//-\\-//-\\-//-\\-//-\\-//-\\-//-\\-//-\\-//-\\-//
IMPORTANT:for setting 4 and 5 there is a 50 second delay before the highscore
procedure kicks in..this is intentional..it gives the game counter time to
finish counting down for the game to end..if it doesnt highscores wont work
properly!!
//-\\-//-\\-//-\\-//-\\-//-\\-//-\\-//-\\-//-\\-//-\\-//-\\-//-\\-//-\\-//-\\-/}
//Specail thanks to:
//drowningtrout for help with radiobuttons and var convertion
{ V2.3 Feature list:
*2 new game options
*reflex game fail-safe
*start game procedure now with DTM so it never misses
*form set-up
*Hold Game Timing Fixed
*Other bugs fixed }
program Kingofbuttons3powner;
//----------------------------------------------------------------------------\\
//****************************************************************************\\
var
click, click2, DTM, DTM2, DTM3, DTM4, DTM5, button : integer;
who, amount,clock, maxhurry : string;
frmDesign : TForm;
Label1 : TLabel;
Label2 : TLabel;
Label3 : TLabel;
Label4 : TLabel;
Edit1 : TEdit;
Edit2 : TEdit;
Edit3 : TEdit;
Edit4 : TEdit;
Memo1 : TMemo;
Button1 : TButton;
Game : TGroupBox;
RadioButton1 : TRadioButton;
RadioButton2 : TRadioButton;
RadioButton3 : TRadioButton;
RadioButton4 : TRadioButton;
RadioButton5 : TRadioButton;
RadioButton6 : TRadioButton;
RadioButton7 : TRadioButton;
//----------------------------------------------------------------------------\\
//****************************************************************************\\
const
//----------------------------------------------------------------------------\\
// DONT TOUCH UNDER HERE!!!!
//----------------------------------------------------------------------------\\
holdpay=510;//don't touch will NEVER need to be changed!!
hurrypay=1020;//don't tocuh will NEVER need to be changed!!
reflexpay=2025;//don't tocuh will NEVER need to be changed!!
//----------------------------------------------------------------------------\\
//****************************************************************************\\
//\\//\\//\\//\\//\\//\\//\\//\\//\\//Begin\\//\\//\\//\\//\\//\\//\\//\\//\\//\
procedure ButtonClick(Sender: TObject);
begin
who:=Edit1.Text;
amount:=Edit2.Text;
clock:=Edit3.Text;
maxhurry:=Edit4.Text;
frmDesign.ModalResult:=mrOk;
end;
//----------------------------------------------------------------------------\\
//****************************************************************************\\
procedure Endurance;
begin
MoveMouse(180,160);
Wait(30);
ClickMouse(180,160,True);
Wait(20);
end;
//----------------------------------------------------------------------------\\
//****************************************************************************\\
procedure Pokespaceendurance;
begin
KeyDown(32);
Wait(100);
KeyUp(32);
Wait(50);
end;
//----------------------------------------------------------------------------\\
//****************************************************************************\\
procedure Gametomain;
begin
MoveMouseSmooth(107,81);
Wait(30);
ClickMouse(107,81,True);
end;
//----------------------------------------------------------------------------\\
//****************************************************************************\\
procedure Starttomain;
begin
MoveMouseSmooth(118,86);
Wait(30);
ClickMouse(107,81,True);
end;
//----------------------------------------------------------------------------\\
//****************************************************************************\\
procedure Shop;
begin
MoveMouseSmooth(72,116);
Wait(20);
ClickMouse(72,116,True);
end;
//----------------------------------------------------------------------------\\
//****************************************************************************\\
procedure Buyhold;
begin
MoveMouseSmooth(91,231);
Wait(20);
ClickMouse(91,231,True);
Wait(300);
MoveMouseSmooth(503,376);
Wait(20);
ClickMouse(506,380,True);
end;
//----------------------------------------------------------------------------\\
//****************************************************************************\\
procedure Buyhurry;
begin
MoveMouseSmooth(87,289);
Wait(20);
ClickMouse(87,289,True);
Wait(48);
MoveMouseSmooth(500,376);
Wait(20);
ClickMouse(506,380,True);
end;
//----------------------------------------------------------------------------\\
//****************************************************************************\\
procedure Buyreflex;
begin
MoveMouseSmooth(90,259);
Wait(40);
ClickMouse(90,259,True);
Wait(80);
MoveMouseSmooth(505,378);
Wait(500);
ClickMouse(506,380,True);
end;
//----------------------------------------------------------------------------\\
//****************************************************************************\\
procedure Shoptomain;
begin
MoveMouseSmooth(89,72);
Wait(20);
ClickMouse(89,72,True);
end;
//----------------------------------------------------------------------------\\
//****************************************************************************\\
procedure Hold;
begin
MoveMouseSmooth(372,157);
Wait(20);
ClickMouse(372,157,True);
end;
//----------------------------------------------------------------------------\\
//****************************************************************************\\
procedure Holdspace;
begin
Wait(100);
KeyDown(32);
Wait(20);
Sleep(StrToInt(clock)+1500);
Wait(20);
KeyUp(32);
end;
//----------------------------------------------------------------------------\\
//****************************************************************************\\
procedure Hurry;
begin
MoveMouseSmooth(373,316);
Wait(80);
ClickMouse(373,316,True);
end;
//----------------------------------------------------------------------------\\
//****************************************************************************\\
procedure Hurryspace;
begin
KeyDown(32);
Wait(55);
KeyUp(32);
Wait(55);
end;
//----------------------------------------------------------------------------\\
//****************************************************************************\\
procedure Reflex;
begin
MoveMouseSmooth(282,314);
Wait(80);
ClickMouse(282,314,True);
end;
//----------------------------------------------------------------------------\\
//****************************************************************************\\
procedure StartgameEnd;
var
x,y : integer;
begin
DTM3 := DTMFromString('78DA635CC5C0C0308B910119FC47660301E33' +
'A20633176353051C6E544A8D90C242613A1662A0135EB8950B39C' +
'08358B885443C8CDAB8850B39A88F00185F36C22FC45400D00B3F' +
'72185');
FindDTM(DTM3,x,y,160,400,177,421);
Wait(200);
ClickMouse(x,y,True);
end;
//----------------------------------------------------------------------------\\
//****************************************************************************\\
procedure StartgameRef;
var
x,y : integer;
begin
DTM2 := DTMFromString('78DA635CC5C0C0B09C910119FC47660301E36' +
'620632E76353051B09A0504D4AC03129B08A8594EA41A4276AD07' +
'120B51D5BCE5E64155B38808731611E1F75544A8594DD85F00338' +
'A1D80');
FindDTM(DTM2,x,y,162,411,177,436);
Wait(200);
ClickMouse(x,y,True);
end;
//----------------------------------------------------------------------------\\
//****************************************************************************\\
Procedure StartgameHold;
var
x,y : integer;
begin
DTM4 := DTMFromString('78DA635CCDC0C0B092910119FC47660301E33' +
'A20631376353051C6E544A8594D849AF5406205AA9A2B22229876' +
'AD20C23D0B08A85947849ACD44A85944A49AB944D83597883024A' +
'006006D302224');
FindDTM(DTM4,x,y,160,412,178,437);
Wait(200);
ClickMouse(x,y,True);
end;
//----------------------------------------------------------------------------\\
//****************************************************************************\\
procedure StartgameHurry;
var
x,y :integer;
begin
DTM5 := DTMFromString('78DA635CCDC0C0B084910119FC47660301E33' +
'A20631D76353051C65544A8594EA49A6544A8994340CD2222D5CC' +
'24C25F84D46C26520D21F7AC2352CD52FC6A00233921F2');
FindDTM(DTM5,x,y,160,407,176,431);
Wait(200);
ClickMouse(x,y,True);
end;
//----------------------------------------------------------------------------\\
//****************************************************************************\\
procedure LocateRef;
var
x,y : integer;
begin
If(FindColorSpiral(x,y,1974015,297,315,363,348))then
begin
DTM := DTMFromString('78DA63F460646008026224F05F43034CC3441' +
'9416A96A1AAE981C9C1686120AB1D554D38BA1A4E202B1155CD4B' +
'6666543542409607AA9A3B2C2CA86A94802C235435AFD0ED7200B' +
'25450D56C66644455530A64991330A703C88A4255F3989515554D' +
'1390D584AAA69609CD9C1C206B2EAA9A343654350076500FCC');
MoveMouse(x,y);
Wait(360);
If(FindDTM(DTM,x,y,231,279,433,424))then
begin
repeat
Wait(236);
Status('Clicking Button...');
ClickMouse(x,y,True);
button:= button + 1;
repeat
Sleep(100);
until(FindColorSpiral(x,y,592382,268,295,400,413));
until(button = 5);
end;
end;
end;
//----------------------------------------------------------------------------\\
//****************************************************************************\\
procedure Enternameother;
begin
MoveMouseSmooth(409,269);
HoldMouse(409,269,True);
Wait(30);
MoveMouseSmooth(255,278);
Wait(150);
ReleaseMouse(255,278,True);
Wait(200);
SendKeys(who);
Wait(200);
MoveMouseSmooth(319,402);
Wait(15);
ClickMouse(319,402,True);
Wait(200);
MoveMouseSmooth(318,311);
Wait(15);
ClickMouse(318,311,True);
end;
//----------------------------------------------------------------------------\\
//****************************************************************************\\
procedure Enternameendurance;
begin
MoveMouseSmooth(630,326);
HoldMouse(630,326,True);
Wait(30);
MoveMouseSmooth(447,324);
Wait(200);
ReleaseMouse(447,324,True);
Wait(200);
SendKeys(who);
Wait(500);
MoveMouseSmooth(104,385);
Wait(20);
ClickMouse(104,385,True);
Wait(150);
MoveMouseSmooth(536,359);
Wait(20);
ClickMouse(536,359,True);
end;
//----------------------------------------------------------------------------\\
//****************************************************************************\\
procedure Report;
begin
ClearDebug
Writeln('//-\\-//-\\-//-\\-//-\\-//-\\-//-\\-//-\\-//-\\-//-\\-//-\\');
Writeln('Thank you for Useing Hobbit''s King of Buttons 3 P0wn3r');
Writeln('You have entered you name into the Highscores...');
Writeln('Happy Scripting');
Writeln('//-\\-//-\\-//-\\-//-\\-//-\\-//-\\-//-\\-//-\\-//-\\-//-\\');
end;
//\\//\\//\\//\\//\\//\\//\\//\\//\\Main Loop//\\//\\//\\//\\//\\//\\//\\//\\//\
procedure InitForm;
begin
frmDesign := CreateForm;
frmDesign.Left := 250;
frmDesign.Top := 111;
frmDesign.Width := 423;
frmDesign.Height := 472;
frmDesign.Caption := 'Set-up';
frmDesign.Color := clBtnFace;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.Visible := False;
frmDesign.PixelsPerInch := 96;
Label1 := TLabel.Create(frmDesign);
Label1.Parent := frmDesign;
Label1.Left := 42;
Label1.Top := 39;
Label1.Width := 28;
Label1.Height := 13;
Label1.Caption := 'Name';
Label2 := TLabel.Create(frmDesign);
Label2.Parent := frmDesign;
Label2.Left := 42;
Label2.Top := 73;
Label2.Width := 178;
Label2.Height := 13;
Label2.Caption := 'Amount of clicks for Endurance Mode';
Label3 := TLabel.Create(frmDesign);
Label3.Parent := frmDesign;
Label3.Left := 42;
Label3.Top := 108;
Label3.Width := 23;
Label3.Height := 13;
Label3.Caption := 'Time';
Label4 := TLabel.Create(frmDesign);
Label4.Parent := frmDesign;
Label4.Left := 42;
Label4.Top := 203;
Label4.Width := 152;
Label4.Height := 13;
Label4.Caption := 'Amount of clicks for Hurry Game';
Edit1 := TEdit.Create(frmDesign);
Edit1.Parent := frmDesign;
Edit1.Left := 42;
Edit1.Top := 51;
Edit1.Width := 121;
Edit1.Height := 21;
Edit1.Cursor := crIBeam;
Edit1.TabOrder := 0;
Edit2 := TEdit.Create(frmDesign);
Edit2.Parent := frmDesign;
Edit2.Left := 42;
Edit2.Top := 86;
Edit2.Width := 121;
Edit2.Height := 21;
Edit2.Cursor := crIBeam;
Edit2.TabOrder := 1;
Edit3 := TEdit.Create(frmDesign);
Edit3.Parent := frmDesign;
Edit3.Left := 42;
Edit3.Top := 120;
Edit3.Width := 121;
Edit3.Height := 21;
Edit3.Cursor := crIBeam;
Edit3.TabOrder := 2;
Edit4 := TEdit.Create(frmDesign);
Edit4.Parent := frmDesign;
Edit4.Left := 42;
Edit4.Top := 215;
Edit4.Width := 121;
Edit4.Height := 21;
Edit4.Cursor := crIBeam;
Edit4.TabOrder := 3;
Memo1 := TMemo.Create(frmDesign);
Memo1.Parent := frmDesign;
Memo1.Left := 42;
Memo1.Top := 142;
Memo1.Width := 344;
Memo1.Height := 59;
Memo1.Lines.Add('For Time selection: Type in time you want in seconds then add 000');
Memo1.Lines.Add('NOTE:For Hurry Game the max clicks you set will not be your final');
Memo1.Lines.Add('score it is merelyto tell it when to stop clicking, your score will');
Memo1.Lines.Add('keep going up till time=0 then in 45 sec & your highscore will be saved ');
Memo1.TabOrder := 4;
Button1 := TButton.Create(frmDesign);
Button1.OnClick:=@ButtonClick;
Button1.Parent := frmDesign;
Button1.Left := 176;
Button1.Top := 393;
Button1.Width := 75;
Button1.Height := 25;
Button1.Cursor := crHandPoint;
Button1.Caption := 'OK';
Button1.ModalResult := 1;
Button1.TabOrder := 5;
Game := TGroupBox.Create(frmDesign);
Game.Parent := frmDesign;
Game.Left := 34;
Game.Top := 248;
Game.Width := 185;
Game.Height := 139;
Game.Caption := 'Game Type';
Game.Color := clBtnFace;
Game.Font.Color := clBlack;
Game.Font.Height := -11;
Game.Font.Name := 'MS Sans Serif';
Game.Font.Style := [];
Game.ParentColor := False;
Game.ParentFont := False;
Game.TabOrder := 6;
RadioButton1 := TRadioButton.Create(Game);
RadioButton1.Parent := Game;
RadioButton1.Left := 6;
RadioButton1.Top := 12;
RadioButton1.Width := 113;
RadioButton1.Height := 17;
RadioButton1.Caption := 'Endurance Game';
RadioButton1.TabOrder := 0;
RadioButton2 := TRadioButton.Create(Game);
RadioButton2.Parent := Game;
RadioButton2.Left := 6;
RadioButton2.Top := 30;
RadioButton2.Width := 168;
RadioButton2.Height := 17;
RadioButton2.Caption := 'Hold Game (not already bought)';
RadioButton2.TabOrder := 1;
RadioButton3 := TRadioButton.Create(Game);
RadioButton3.Parent := Game;
RadioButton3.Left := 6;
RadioButton3.Top := 48;
RadioButton3.Width := 167;
RadioButton3.Height := 17;
RadioButton3.Caption := 'Hold Game (already bought)';
RadioButton3.TabOrder := 2;
RadioButton4 := TRadioButton.Create(Game);
RadioButton4.Parent := Game;
RadioButton4.Left := 6;
RadioButton4.Top := 66;
RadioButton4.Width := 175;
RadioButton4.Height := 17;
RadioButton4.Caption := 'Hurry Game (not already bought)';
RadioButton4.TabOrder := 3;
RadioButton5 := TRadioButton.Create(Game);
RadioButton5.Parent := Game;
RadioButton5.Left := 6;
RadioButton5.Top := 84;
RadioButton5.Width := 171;
RadioButton5.Height := 17;
RadioButton5.Caption := 'Hurry Game (already bought)';
RadioButton5.TabOrder := 4;
RadioButton6 := TRadioButton.Create(Game);
RadioButton6.Parent := Game;
RadioButton6.Left := 6;
RadioButton6.Top := 102;
RadioButton6.Width := 178;
RadioButton6.Height := 17;
RadioButton6.Caption := 'Reflex Game (not already bought)';
RadioButton6.TabOrder := 5;
RadioButton7 := TRadioButton.Create(Game);
RadioButton7.Parent := Game;
RadioButton7.Left := 6;
RadioButton7.Top := 120;
RadioButton7.Width := 169;
RadioButton7.Height := 17;
RadioButton7.Caption := 'Reflex Game (already Bought)';
RadioButton7.TabOrder := 6;
end;
procedure SafeInitForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('InitForm', v);
end;
procedure ShowFormModal;
begin
frmDesign.ShowModal;
end;
procedure SafeShowFormModal;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('ShowFormModal', v);
end;
begin
SafeInitForm;
SafeShowFormModal;
begin
if(RadioButton1.checked) then
begin
frmDesign.Caption:= frmDesign.Caption + '.';
begin
ActivateClient;
Endurance;
Wait(750);
StartgameEnd;
Wait(1000);
repeat
Pokespaceendurance;
Wait(55);
click:= click + 1;
until(click = StrToInt(amount));
Wait(750);
Enternameendurance;
Wait(120);
Report;
end;
end;
if(RadioButton2.checked) then
begin
frmDesign.Caption:= frmDesign.Caption + '.';
begin
ActivateClient;
Endurance;
Wait(600);
StartgameEnd;
Wait(1000);
repeat
Pokespaceendurance;
click:= click + 1;
until(click = holdpay);
Wait(300);
Gametomain;
Wait(600);
Starttomain;
Wait(500);
Shop;
Wait(1000);
Buyhold;
Wait(800);
Shoptomain;
Wait(750);
Hold;
Wait(600);
StartgameHold;
Wait(1000);
Holdspace;
Wait(750);
Enternameother;
Wait(80);
Report;
end;
end;
if(RadioButton3.checked) then
begin
frmDesign.Caption:= frmDesign.Caption + '.';
begin
ActivateClient;
Hold;
Wait(600);
StartgameHold;
Wait(1000);
Holdspace;
Wait(750);
Enternameother;
Wait(80);
Report;
end;
end;
if(RadioButton4.checked) then
begin
frmDesign.Caption:= frmDesign.Caption + '.';
begin
ActivateClient;
Endurance;
Wait(1000);
StartgameEnd;
Wait(800);
repeat
Pokespaceendurance;
click:= click + 1;
until(click = hurrypay);
Wait(100);
Gametomain;
Wait(750);
Starttomain;
Wait(500);
Shop;
Wait(1000);
Buyhurry;
Wait(1000);
Shoptomain;
Wait(1000);
Hurry;
Wait(1000);
StartgameHurry;
Wait(750);
repeat
Hurryspace;
click2:= click2 + 1;
until(click2 = StrToInt(maxhurry));
Wait(45000);
Enternameother;
Wait(80);
Report;
end;
end;
if(RadioButton5.checked) then
begin
frmDesign.Caption:= frmDesign.Caption + '.';
begin
ActivateClient;
Hurry;
Wait(1000);
StartgameHurry;
Wait(350);
repeat
Hurryspace;
click2:= click2 + 1;
until(click2 = StrToInt(maxhurry));
Wait(45000);
Enternameother;
Wait(80);
Report;
end;
end;
if(RadioButton6.checked) then
begin
frmDesign.Caption:= frmDesign.Caption + '.';
begin
ActivateClient;
Endurance;
Wait(30);
StartgameEnd;
Wait(250);
repeat
Pokespaceendurance;
click:= click + 1;
until(click = reflexpay);
Wait(100);
Gametomain;
Wait(60);
Starttomain;
Wait(60);
Shop;
Wait(100);
Buyreflex;
Wait(100);
Shoptomain;
Wait(100);
Reflex;
Wait(180);
StartgameRef;
Wait(4050);
LocateRef;
Wait(750);
Enternameother;
Wait(650);
Report;
end;
end;
if(RadioButton7.checked) then
begin
frmDesign.Caption:= frmDesign.Caption + '.';
begin
ActivateClient;
Reflex;
Wait(1000);
StartgameRef;
Wait(4050);
LocateRef;
Wait(950);
Enternameother;
Wait(800);
Report;
end;
end;
end;
end.