Jump to content

Recommended Posts

Game:

mini Tower Defence (mTD)

 

Script:

Gathers upgrade points by completing levels.

- Basic version is only suitable for level 1 and gives 10 points per run.

- Expert version will be made suitable for more levels and gives 22 points per level 1 run.

 

Basic:

[scar]//by MarkD

program mTD_basic;

var

a : Integer;

g : boolean;

 

Procedure MnC(x,y : integer);

begin

MoveMouse(x,y);

Wait(96);

ClickMouse(x,y,false);

Wait(96);

end;

 

Procedure InitM1;

begin

MnC(115,57); //mission select

MnC(85,103); //select mission 1

MnC(434,423); //play

end;

 

begin

ClearDebug;

for a := 0 to 0 do //change to the required amount of runs

begin

InitM1;

t := true;

Wait(200);

MnC(468,151); //buy basic tower

MnC(66,145); //place first

MnC(469,155);

MnC(60,67); //place third

 

MnC(515,418); //send start

Wait(2800); //1-2

MnC(515,418); //send w2

Wait(4000); //2-3

MnC(515,418); //send w3

Wait(8000); //3-4

MnC(515,418); //send w4

Wait(10000); //4-5

MnC(515,418); //send w5

while g do //while level not completed

begin

if (GetColor(246,112) = 4934475) then

begin

MnC(343,316); //click go

g := false;

Wait(1000); //try again in 1s

end;

end;

end;

end.[/scar]

 

 

Expert:

[scar]//by MarkD, version 1.3

program mTD_expert;

var

a,MAX : Integer;

g,u : boolean;

 

Procedure MnC(mx,my : integer);

begin

MoveMouse(mx,my);

Wait(88);

ClickMouse(mx,my,false);

Wait(88);

end;

 

Procedure Upg(nx,ny : integer);

begin

MnC(nx,ny); //select tower

while u do //while insufficient money

begin

if (GetColor(531,304) = 14013909) then

begin

MnC(531,304); //upgrade tower

u := false;

Wait(100); //try again in .1s

end;

end;

u := true;

end;

 

//M1 requires 1x "Initial Money"

Procedure InitM1;

begin

MnC(115,57); //mission select

MnC(85,103); //select mission 1

MnC(434,423); //play

end;

 

//M2 requires 4x "Intial Money",

//4x "Tower Prices", 4x "Tower Damage"

//and 3x "Money per Kill"

Procedure InitM2;

begin

MnC(115,57); //mission select

MnC(85,129); //select mission 2

MnC(434,423); //play

end;

 

//M3 requires 5x "Intial Money",

//4x "Tower Prices", 5x "Tower Damage"

//and 6x "Money per Kill"

Procedure InitM3;

begin

MnC(115,57); //mission select

MnC(85,162); //select mission 3

MnC(434,423); //play

end;

 

Procedure PlayM1;

begin

Wait(200);

MnC(468,151); //buy basic tower

MnC(66,145); //place first tower

MnC(469,151);

MnC(60,67); //place third tower

 

MnC(515,418); //send start

MnC(66,145); //select tower1

Wait(500);

while u do //while insufficient money

begin

if (GetColor(531,304) = 14013909) then

begin

MnC(531,304); //upgrade!

u := false;

Wait(100); //try again in .1s

end;

end;

MnC(515,418); //send w2

Wait(1300); //2-3

MnC(515,418); //send w3

Wait(6000); //3-4

MnC(515,418); //send w4

Wait(9500); //4-5

MnC(515,418); //send w5

while g do //while level not completed

begin

if (GetColor(246,112) = 4934475) then

begin

MnC(343,316); //click go

g := false;

Wait(1000); //try again in 1s

end;

end;

end;

 

Procedure PlayM2;

begin

Wait(200);

MnC(468,151); //buy basic tower

MnC(26,85); //place first tower

MnC(468,151); //buy basic tower

MnC(45,165); //place second tower

MnC(468,151); //buy basic tower

MnC(86,165); //place third tower

 

MnC(26,85); //select tower1

MnC(531,304); //upgrade

MnC(45,165); //select tower2

MnC(531,304); //upgrade

MnC(86,165); //select tower3

MnC(531,304); //upgrade

 

MnC(515,418); //send start

 

MnC(515,418); //send w2

Wait(1000); //2-3

MnC(515,418); //send w3

Wait(2700); //3-4

MnC(515,418); //send w4

Wait(5500); //4-5

MnC(515,418); //send w5

Wait(6300); //5-6

MnC(515,418); //send w6

while u do //while insufficient money

begin

if (GetColor(531,304) = 14013909) then

begin

MnC(531,304); //upgrade tower 3

u := false;

Wait(100); //try again in .1s

end;

end;

 

while g do //while level not completed

begin

if (GetColor(246,112) = 4934475) then

begin

MnC(343,316); //click go

g := false;

Wait(1000); //try again in 1s

end;

end;

end;

 

Procedure PlayM3;

begin

Wait(200);

MnC(468,151); //buy basic tower

MnC(350,406); //place first tower

MnC(468,151); //buy basic tower

MnC(425,427); //place second tower

MnC(468,151); //buy basic tower

MnC(425,389); //place third tower

MnC(468,151); //buy basic tower

MnC(425,346); //place fourth tower

MnC(468,151); //buy basic tower

MnC(344,330); //place fifth tower

 

MnC(350,406); //select tower1

MnC(531,304); //upgrade

MnC(425,427); //select tower2

MnC(531,304); //upgrade

 

MnC(515,418); //send start

 

MnC(515,418); //send w2

//2-3

Upg(425,389); //upgrade tower3

MnC(515,418); //send w3

//3-4

Upg(425,346); //upgrade tower4

MnC(515,418); //send w4

//4-5

Upg(344,330); //upgrade tower5

MnC(515,418); //send w5

Wait(1000); //5-6

MnC(515,418); //send w6

//6-7

MnC(515,418); //send w7

Upg(344,330); //upgrade tower5

 

while g do //while level not completed

begin

if (GetColor(246,112) = 4934475) then

begin

MnC(343,316); //click go

g := false;

Wait(1000); //try again in 1s

end;

end;

end;

 

begin

ClearDebug;

MAX := 0;

for a := 0 to MAX do

begin

InitM3;

g := true;

u := true;

PlayM3;

end;

end.[/scar]

 

How to use:

- Start the game in your browser.

- Drag the crosshair to the game.

- Hit Play, choose either new game or continue

- EXPERT ONLY: Buy the first "Initial Money" upgrade that comes for free

- Hit F9

 

For more runs after each other, change ln 24.

for a := 0 to [b]0[/b] do
//replace the 0 between to and do with whatever amount you like, 0 will do one run

 

Both versions are only verified with Scar Divi 3.35 in Firefox 14.0.1 and 15, on 1680x1050 resolution and with the Kongregate version of the game.

Edited by MarkD
expert v1.3
Link to comment
Share on other sites

4.0.1 should've been 14.0.1 :)

Besides that, this script is posted in the wrong category I guess. It's not a snippet.

 

v1.3

Added mission 3 support. Init and Play are now on ln 198 and 201.

I've tried to organize the code a little, next will be even better I hope.

//M3 requires 5x "Intial Money",
//4x "Tower Prices", 5x "Tower Damage"
//and 6x "Money per Kill"

 

For some reason, mobs sometimes glitch through. If you experience this as a problem, try upgrading Tower Damage :)

Link to comment
Share on other sites

Your version of Firefox is slightly outdated :P I think I'm going to give this a try when I've got some more time on my hands :)

 

They update Firefox so much now a days. I remember when it hit 3.6, and I thought that was good. Now its at 16+ lol.

 

This is cool though! Classic tower defense! Good job, I don't know if the latest SCAR build has enough web browser functions yet. But soon it will be good enough to bot on instead of firefox :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...