Sythe     Register     FAQ     Members List     Calendar     Mark Forums Read    
 
Sythe  
  Cheap RS Gold Store
Pokemon Tower Defence script
Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 10-25-2011, 06:30 PM
Newcomer
 
Join Date: Oct 2011
Posts: 2
 
Default Pokemon Tower Defence script

Okay, I've written a script for PTD based at http://www.newgrounds.com/portal/view/566150.
It just repeats route 8 (takes a while to reach but has pretty fast levelling potential), levels pokemon and should catch any shine pokemon to appear.
Unfortunately it seems to crash every time the shiny procedure gets called. I've looked through the script and can't see any problem that would scar to crash completly.

A few other side notes, I use ubuntu and so have to run it through WINE, this has also meant that I've had to set the window myself, hence the TLx and TLy constants that you need to set yourself.

Anyway, any suggestions, and any idea why it crashes, also does it crash for anyone else who doesn't run it in linux?

If you want me to edit the code a bit to make it clearer just ask (I'll indent it and add a few more notes and stuff...)

Code:
program PTDroute8;
var
x,y, fin,a,d,c, lvl,levels, finishes, caught : Integer ;
one,two,three,four,five,six : Integer;

const
TLx =   113;     // choose the very top left corner, it must be the exact pixel.
TLy =   113;
///////////////////////////////////////////////////////////////////////////////
procedure start ;
begin
     Movemousesmooth ((TLx + 548), (TLy + 129));
     wait (100)
     clickmouse((TLx + 548), (TLy + 129),true)      //select route 8
     wait(500)
     Movemousesmooth (TLx + 626, TLy + 21);
     wait (100)
     clickmouse(TLx + 626, TLy + 21,true)          //select start
     wait(500)
     Movemousesmooth (TLx + 126, TLy + 18);
     wait (100)
     clickmouse(TLx + 126, TLy + 18,true)         //select skip
     wait (3000)
end;
//////// GO!!!!!!
///////////////////////////////////////////////////////////////////////////////
procedure chooserandpoke;
begin
     repeat
     d:= random (6)
         if (d=0) and (one <> 1) then  begin       // choose 1
            x:= (TLx + 167)
            y:= (TLy + 291)
            one :=1
            c:=1
         end;
         if (d=1) and (two <> 1)  then begin      //choose 2
            x:= (TLx + 247)
            y:= (TLy + 291)
            two :=1
            c:=1
         end;
         if (d=2) and (three <> 1)  then begin   //choose 3
            x:= (TLx + 329)
            y:= (TLy + 297)
            three :=1
            c:=1
         end;
         if (d=3) and (four <> 1)  then begin   //choose 4
            x:= (TLx + 413)
            y:= (TLy + 298)
            four :=1
            c:=1
         end;
         if (d=4) and (five <> 1)  then begin   //choose 5
            x:= (TLx + 501)
            y:= (TLy + 298)
            five :=1
            c:=1
         end;
         if (d=5) and (six <> 1)  then begin   //choose 6
            x:= (TLx + 583)
            y:= (TLy + 298)
            six :=1
            c:=1
         end;
     until (c = 1)
     c:=0
end;
procedure placepokemon ;
begin
     chooserandpoke;
     movemousesmooth (x, y)
     wait(100)
     holdmouse (x, y,true) //Pokemon 1
     wait (300)
     movemousesmooth (TLx + 340, TLy + 316)
     wait(100)
     releasemouse (TLx + 340, TLy + 316,true)
     wait (500)
///////////////////
     chooserandpoke;
     movemousesmooth (x, y)
     wait(100)
     holdmouse (x, y,true) //Pokemon 2
     wait (300)
     movemousesmooth (TLx + 663,TLy + 290)
     wait(100)
     releasemouse (TLx + 663,TLy + 290,true)
     wait (500)
///////////////////
     movemousesmooth (TLx + 623,TLy + 298)
     wait(100)
     holdmouse (TLx + 623,TLy + 298,true)  //Move screen right
     wait (300)
     movemousesmooth (TLx + 127,TLy + 288)
     wait(100)
     releasemouse (TLx + 127,TLy + 288,true)
     wait (500)
///////////////////
     chooserandpoke;
     movemousesmooth (x, y)
     wait(100)
     holdmouse (x, y,true)  //Pokemon 3
     wait (300)
     movemousesmooth (TLx + 445,TLy + 289)
     wait(100)
     releasemouse (TLx + 445,TLy + 289,true)
     wait (500)
///////////////////
     chooserandpoke;
     movemousesmooth (x, y)
     wait(100)
     holdmouse (x, y,true)  //Pokemon 4
     wait (300)
     movemousesmooth (TLx + 677,TLy + 338)
     wait(100)
     releasemouse (TLx + 677,TLy + 338,true)
     wait (500)
///////////////////
     movemousesmooth (TLx + 639,TLy + 393)
     wait(100)
     holdmouse (TLx + 639,TLy + 393,true)  //Move Down
     wait (300)
     movemousesmooth (TLx + 637,TLy + 11)
     wait(100)
     releasemouse (TLx + 637,TLy + 11,true)
     wait (500)
///////////////////
     chooserandpoke;
     movemousesmooth (x, y)
     wait(100)
     holdmouse (x, y,true)  //Pokemon 5
     wait (300)
     movemousesmooth (TLx + 501,TLy + 80)
     wait(100)
     releasemouse (TLx + 501,TLy + 80,true)
     wait (500)
///////////////////
     chooserandpoke;
     movemousesmooth (x, y)
     wait(100)
     holdmouse (x, y,true)  //Pokemon 6
     wait (300)
     movemousesmooth (TLx + 664,TLy + 235)
     wait(100)
     releasemouse (TLx + 664,TLy + 235,true)
     wait (500)
end;
///////////////////////////////////////////////////////////////////////////////
procedure movetoBL;
begin
     a :=1;                                                    //drag screen down
     repeat
           wait (200)
           movemousesmooth (TLx + 460,TLy + 208)
           wait(100)
           holdmouse (TLx + 460,TLy + 208,true)
           wait (300)
           movemousesmooth (TLx + 24,TLy + 16)
           wait(100)
           releasemouse (TLx + 24,TLy + 16,true)
           a:= a + 1;
     until (a=5)
     a:=1
end;
///////////////////////////////////////////////////////////////////////////////
procedure speedup;
begin
     movemousesmooth (TLx + 124,TLy + 380)    //speed up
     wait (200)
     clickmouse(TLx + 124,TLy + 380,true)
     wait(100)
     clickmouse(TLx + 124,TLy + 380,true)
     wait(100)
     clickmouse(TLx + 124,TLy + 380,true)
     wait(100)
end;

///////////////////////////////////////////////////////////////////////////////
procedure finish;
begin
     finishes := finishes + 1
     movemousesmooth (x,y);                     //click skip at end
     clickmouse (x,y,true);
     writeln ('completed  ' + (inttostr(finishes)) + ' rounds!')
     one:=0
     two:=0
     three:=0
     four:=0
     five:=0
     six:=0
end;
///////////////////////////////////////////////////////////////////////////////
procedure shiny;
begin
     movemousesmooth (TLx + 677, TLy + 340)               //click pokeball
     clickmouse (TLx + 677, TLy + 340,true);
     wait (100)
     holdmouse (TLx + 677, TLy + 340,true)                //drag pokeball
     wait (300)
     movemousesmooth (TLx + 604, TLy + 222)
     wait(1000)
     releasemouse (TLx + 604, TLy + 222,true)             //catch pokemon
     if findcolor (x,y,0,TLx + 540, TLy + 231,TLx + 395, TLy + 412) then caught:= caught+1; //check if anything got caught
     writeln ('caught ' + (Inttostr(caught)) + ' pokemon')
     clickmouse (x,y,true)                         //click off shiny
     speedup;
end;

///////////////////////////////////////////////////////////////////////////////
procedure levelup;
begin
     levels := levels + 1;
     writeln ('levelling up!')
     writeln ('Gained ' + (inttostr (levels)) + ' levels!')
     movemousesmooth (x,y)                          //click pokemon
     clickmouse (x,y,true)
     wait (300)
     movemousesmooth (TLx + 621,TLy + 204)
     wait (300)
     clickmouse (TLx + 621,TLy + 204,true)          //click level up
     wait(700)
     if(FindColor(x,y,0,TLx +  477,TLy + 249,TLx + 490,TLy + 259)) = true then
              begin
                   movemousesmooth (x,y)
                   wait (300)                      //click don't learn move
                   clickmouse (x,y,true)
                   wait(300)
              end;
     movemousesmooth (TLx + 477,TLy + 249)        //mouse back to center screen
     wait (300)
     clickmouse (TLx + 477,TLy + 249,true)
     wait(300)
     movetoBL;
end;
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
begin
     Levels := 0;
     finishes :=0
     repeat
           fin :=0;
           start;
           placepokemon;
           speedup;
           movetoBL;
           repeat
                 repeat
                       if (FindColor(x,y,251,TLx +  128,TLy + 270,TLx + 621,TLy + 290)) = true then levelup;
                       if findcolor (x,y,16777215,TLx + 395,TLy + 154, TLx + 396, TLy + 171) then shiny;
                       lvl := lvl +1;
                       wait (100)
                 until (lvl = 20)
                 lvl:=1;
                 if (FindColor(x,y,238, TLx + 77,TLy + 10,TLx + 138,TLy + 40)) = true then fin:=1;
                 if (FindColor(x,y,238, TLx + 77,TLy + 10,TLx + 138,TLy + 40)) = true then finish;
                 wait (1000)
           until (fin = 1)
     until (false);
     writeln ('caught ' + (inttostr (caught)) + ' pokemon')
     writeln ('gained ' + (inttostr (levels)) + ' levels')
end.

Last edited by nghtspud : 10-25-2011 at 10:53 PM.
Copy this message to clipboard Reply With Quote
  #2  
Old 10-25-2011, 09:37 PM
M_A_I_N_FTW's Avatar
Guru
 
Join Date: Dec 2007
Referrals: 1
Posts: 1,338
 
Default Re: Pokemon Tower Defence script

i'd check it out but i can't load the game 0_o
__________________
People that have sent me spam email, enjoy being picked up by spam bots
[email protected]
[email protected]
[email protected]
[email protected]
Copy this message to clipboard Reply With Quote
  #3  
Old 10-25-2011, 10:31 PM
Newcomer
 
Join Date: Oct 2011
Posts: 2
 
Default Re: Pokemon Tower Defence script

did you try ctrl F5 to refresh the page etc? There are other places you can play but the resolution of the screen is slightly different at each place so none of the co-ords would be right...
http://samdangames.blogspot.com/p/play-ptd_03.html

Just edited first post to give a slightly clearer view of the code.

Last edited by nghtspud : 10-25-2011 at 10:55 PM.
Copy this message to clipboard Reply With Quote
  #4  
Old 11-02-2011, 07:23 AM
ashieldlol's Avatar
Guru
$5 USD Donor
 
Join Date: Jun 2010
Location: Varrock West Bank Basement
Referrals: 2
Posts: 1,013
Send a message via MSN to ashieldlol
 
Default Re: Pokemon Tower Defence script

Cool man, I've been playing this from time to time for the past couple months. I was wondering if anyone had written scripts for it yet. I might try this out if I get a chance.
__________________


Vouches: 262 (Click to See) Total Amount Traded: $9000+

Last edited by ashieldlol : 11-02-2011 at 07:23 AM.
Copy this message to clipboard Reply With Quote
  #5  
Old 11-03-2011, 01:58 AM
Active Member
 
Join Date: Jul 2005
Location: Belgium
Referrals: 1
Posts: 149
Send a message via AIM to freddy1990 Send a message via MSN to freddy1990
 
Default Re: Pokemon Tower Defence script

Heh, nice to see people still use SCAR to beat those addicting flash games
__________________
Copy this message to clipboard Reply With Quote
  #6  
Old 11-23-2011, 11:56 AM
Member
 
Join Date: Aug 2010
Posts: 30
 
Default Re: Pokemon Tower Defence script

Is the shiny glitch fixed yet? I might try this if it works.
Copy this message to clipboard Reply With Quote
Reply



rs gold no confirmation for paypal users Cheap RS Gold Store

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

All times are GMT +1. The time now is 07:25 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.6.1