User File #36375112543959751

Upload All User Files

#36375112543959751 - Lua script for Quackshot

Dooty_Quackshot_v2.lua
1406 downloads
Uploaded 1/16/2017 3:30 AM by Dooty (see all 36)
This a submission text sort of for my TAS of Quack Shot.
while true do

 Fct = emu.framecount()
 Dsx = mainmemory.read_s32_be(0xA2D8)
 Dsy = mainmemory.read_s32_be(0xA2DC)
 Dpx = mainmemory.read_u16_be(0xA2D0)
 Dpy = mainmemory.read_u16_be(0xA2D4)
 Scx = mainmemory.read_u16_be(0x852C)
 Scy = mainmemory.read_u16_be(0x8528)
 Hxr = mainmemory.read_u16_be(0x8F5A)
 Hyt = mainmemory.read_u16_be(0x8F54)
 Hyb = mainmemory.read_u16_be(0x8F5E)
 Hxl = mainmemory.read_u16_be(0x8F60)

--Title
  if Fct > 63 and Fct  < 341 then  gui.drawText(2,164,"One day, Donald found a map inside\none of uncle Scrooge's old books.","white","black");end
  if Fct > 340 and Fct  < 619 then  gui.drawText(2,164,"Then, he and his nephews got on a plane\nto search for \"The Great Duck Treasure.\"","white","black");end

--Mexico
 if Fct > 649 and Fct  < 3812 then
  if Fct > 650 and Fct < 891 then gui.drawText(2,164,"Mexico:\nHere Donald will get \"Some Information.\" ");end
  if Fct > 890 and Fct < 1191 then gui.drawText(2,164,"I assume you already know what a TAS is, \nbut here's the basics just in case.");end
  if Fct > 1190 and Fct < 1491 then gui.drawText(2,164,"First of all, to keep track of our speed \nand position we watch memory adresses.");end
  if Fct > 1490 and Fct < 1851 then gui.drawText(2,10,"Speed:\nX: "..Dsx.."\nY: "..Dsy.."\nPosition: \nX: "..Dpx.."\nY: "..Dpy);end
  if Fct > 1884 and Fct < 2185 then gui.drawText(2,164,"Pretty confusing in real time, isn't it? \nBut TASes are played frame by frame.");end
  if Fct > 2184 and Fct < 2465 then gui.drawText(2,164,"We no longer rely on reflexes to dodge \nbullets, or jump over bottomless pits.");end
  if Fct > 2464 and Fct < 2745 then gui.drawText(2,164,"But if a mistake is made, and we know how \nto fix it, save states are there for us.");end
  if Fct > 2746 and Fct < 3089 then gui.drawText(2,164,"Do you want to know more?\nPlease visit http://TASvideos.org  ");end
  if Fct > 3329 and Fct < 3370 then gui.drawRectangle(62,19,191,87,0xFF660000,0xFF660000);
    gui.drawBox(64,21,251,104,0xFFFF6666)
    gui.drawText(68,89,"                         ","white","black");
   gui.drawText(68,24,"\"WITHOUT THE HERO KEY,  \n THE DOOR WON'T OPEN.\n\n AN EXPLORER WENT TO \n DUCKBURG WITH IT.\"","white","black");end
  if Fct > 3369 and Fct < 3595 then gui.drawRectangle(62,19,191,87,0x55660000,0x55660000);
    gui.drawBox(64,21,251,104,0xFFFF6666)
   gui.drawText(68,24,"\"WITHOUT THE HERO KEY,  \n THE DOOR WON'T OPEN.\n\n AN EXPLORER WENT TO \n DUCKBURG WITH IT.\"","white",0x00000000);end
  if Fct > 3622 and Fct < 3811 then gui.drawText(10,164,"Mexico: 159 frames saved. \nTotal : 159 frames ahead.");end
 end

--Duckburg
 if Fct > 3839 and Fct < 5402 then
  if Fct > 3840 and Fct < 4081 then gui.drawText(2,164,"Duckburg:\nHere Donald will take the \"Hero Key.\" "); end
  if Fct > 4080 and Fct < 4381 then gui.drawText(2,164,"Even being the smallest stage of the game, \nquite some time was saved here." ); end
  if Fct > 5200 and Fct < 5401 then gui.drawText(2,164,"Duckburg:  27 frames saved. \nTotal   : 186 frames ahead."); end
  if Fct > 4885 and Fct < 4957 then gui.drawRectangle(64,9,191,71,0xFF660066,0xFF660066);
    gui.drawBox(66,11,253,78,0xFFCC00CC)
    gui.drawText(70,63,"                         ","white","black");
    gui.drawText(70,14,"\"PLEASE TAKE THIS KEY.  \n\n I DON'T NEED TO GO TO\n THE RUINS ANYMORE.\"\n","white","black");end
  if Fct > 4956 and Fct < 5175 then gui.drawRectangle(64,9,191,71,0x55660066,0x55660066);
    gui.drawBox(66,11,253,78,0xFFCC00CC)
    gui.drawText(70,14,"\"PLEASE TAKE THIS KEY.  \n\n I DON'T NEED TO GO TO\n THE RUINS ANYMORE.\"\n","white",0X00000000);end
 end

--Mexico
 if Fct > 5429 and Fct < 10474 then
 Act = mainmemory.read_u16_be(0xA2E6)
  if Fct > 5430 and Fct < 5751 then gui.drawText(2,164,"Mexico:\nHere Donald will get the \"Red Plunger.\" "); end
  if Fct > 5784 and Fct < 7305 then gui.drawText(2,10,"Actions: "..Act.." "); end
  if Fct > 5784 and Fct < 6165 then gui.drawText(2,164,"I don't fully understand this address, \nbut it was helpful to create this TAS."); end
  if Fct > 6164 and Fct < 6545 then gui.drawText(2,164,"It controls some of Donald's actions, \nlike recover from damage animation."); end
  if Fct > 6544 and Fct < 6925 then gui.drawText(2,164,"The Belly Slide is also controlled by this \ntimer making it easier to start a new one."); end
  if Fct > 6924 and Fct < 7305 then gui.drawText(2,164,"In the previous run it was not found, \nso there's less trial and error now."); end
  if Fct > 7564 and Fct < 7945 then gui.drawText(2,164,"In this stage Donald must do something he \ndoesn't do very often; go to the left."); end
  if Fct > 7944 and Fct < 8325 then gui.drawText(2,164,"Not really a big deal, but I don't know \nwhy Donald moves so fast to the left."); end
  if Fct > 8472 and Fct < 8614 then gui.drawRectangle(58,95,191,71,0xFF004C99,0xFF004C99);
    gui.drawBox(60,97,247,164,0xFF0080FF)
    gui.drawText(64,149,"                         ","white","black");
    gui.drawText(64,100,"\"I FOUND THIS PLUNGER.  \n\n HERE, USE IT TO MEET\n GYRO IN DUCKBURG.\" ","white","black");end
  if Fct > 8613 and Fct < 8753 then gui.drawRectangle(58,95,191,71,0x55004C99,0x55004C99);
    gui.drawBox(60,97,247,164,0xFF0080FF)
    gui.drawText(64,100,"\"I FOUND THIS PLUNGER.  \n\n HERE, USE IT TO MEET\n GYRO IN DUCKBURG.\" ","white",0X00000000);end
  if Fct > 8862 and Fct < 9031 then gui.drawText(2,164,"Avoid this green block was not so hard..."); end
  if Fct > 9030 and Fct < 9199 then gui.drawText(2,164,"...but this one still needs to be shot."); end
  if Fct > 9272 and Fct < 9513 then gui.drawText(2,164,"Hit boxes are really useful sometimes, \nlike when Donald goes underground.");end
   if Fct > 9512 and Fct < 9815 then gui.drawBox(Hxl-Scx,Hyt-Scy,Hxr-Scx,Hyb-Scy,"blue"); end
  if Fct > 9816 and Fct < 9959 then gui.drawText(2,164,"How to go underground:\npress Up\+Down on ladders. "); end
  if Fct > 9992 and Fct < 10257 then gui.drawText(2,164,"Trivia: Donald made his debut in the 1934 \nshort film \"The Wise Little Hen.\""); end
  if Fct > 10284 and Fct < 10473 then gui.drawText(2,164,"Mexico: 168 frames saved. \nTotal : 354 frames ahead."); end
 end

--Duckburg
 if Fct > 10501 and Fct < 16144 then
 if Hyt > 10000 then Hyt = 1; end
  if Fct > 10502 and Fct < 10725 then gui.drawText(2,164,"Duckburg:\nHere Donald will take the \"Bubblegum Ammo.\" "); end
  if Fct > 10758 and Fct < 11139 then gui.drawText(2,164,"One of the new tricks, the \"Long Jump,\" \nadds a lot of speed to Donald's jumps."); end
  if Fct > 11138 and Fct < 11519 then gui.drawText(2,164,"But some times you can only do a normal \njump as it needs some room to perform."); end
  if Fct > 11518 and Fct < 11724 then gui.drawText(2,164,"You must press C\+Down to Belly Slide, \njump and then hold C\+Down."); end
  if Fct > 11756 and Fct < 12105 then gui.drawText(2,164,"There's a long zip-line section coming, \nand the only thing to do is hang on..."); end
  if Fct > 12104 and Fct < 12361 then gui.drawText(2,164,"Um... what about that hit box again?\nIt'll sure make it more entertaining. ");end
   if Fct > 12104 and Fct < 14583 then gui.drawBox(Hxl-Scx,Hyt-Scy,Hxr-Scx,Hyb-Scy,"blue");end
  if Fct > 12476 and Fct < 12755 then gui.drawText(2,164,"Ah, I've got something else to show; \nthe long jump seems to have a buffer.");end
  if Fct > 12476 and Fct < 13245 then gui.drawText(Hxl-Scx,Hyb-Scy,"X:"..string.sub(Dsx,1,2).." ");end
  if Fct > 12754 and Fct < 13037 then gui.drawText(2,164,"Donald jumped from the last zip-line \nwith a speed of 19."); end
  if Fct > 13036 and Fct < 13245 then gui.drawText(2,164,"Now it's back to a normal zip-line \njumping speed of 15."); end
  if Fct > 13293 and Fct < 13398 then gui.drawRectangle(59,17,191,87,0xFF660066,0xFF660066);
    gui.drawBox(61,19,248,102,0xFFCC00CC)
    gui.drawText(65,87,"                         ","white","black");
    gui.drawText(65,22,"\"DONALD, PLEASE TRY OUT\n MY NEW BUBBLEGUM AMMO.\n\n WITH IT, YOU CAN BREAK\n WALLS IN TRANSYLVANIA.\" ","white","black");end
  if Fct > 13397 and Fct < 13573 then gui.drawRectangle(59,17,191,87,0x55660066,0x55660066);
    gui.drawBox(61,19,248,102,0xFFCC00CC)
    gui.drawText(65,22,"\"DONALD, PLEASE TRY OUT\n MY NEW BUBBLEGUM AMMO.\n\n WITH IT, YOU CAN BREAK\n WALLS IN TRANSYLVANIA.\" ","white",0x00000000);end
  if Fct > 14300 and Fct < 14581 then gui.drawText(2,164,"There are two more stages with zip-lines, \nand I'll try to use that \"buffer\" again."); end
  if Fct > 14740 and Fct < 14981 then gui.drawText(2,164,"Are you wondering why this ladder was \nnot used to go underground here?"); end
  if Fct > 14980 and Fct < 15221 then gui.drawText(2,164,"It's not possible to reach the start\nof this stage doing the Ladder Trick. "); end
  if Fct > 15220 and Fct < 15461 then gui.drawText(2,164,"Not really useful, but he can go to the \nzip-line section while down there."); end
  if Fct > 15685 and Fct < 15949 then gui.drawText(2,164,"Trivia: Donald's full name is \n\"Donald Fauntleroy Duck.\""); end
  if Fct > 15976 and Fct < 16143 then gui.drawText(2,164,"Duckburg: 149 frames saved. \nTotal   : 503 frames ahead."); end
 end

--Transylvania
 if Fct > 16175 and Fct < 26188 then
 Bss = mainmemory.read_u8(0x9039)
  if Fct > 16176 and Fct < 16417 then gui.drawText(2,164,"Transylvania:\nHere Donald gets the \"Real Treasure Map.\" "); end
  if Fct > 16416 and Fct < 16717 then gui.drawText(2,164,"Jump just to shoot an enemy was one \nof many mistakes of the old run."); end
  if Fct > 16716 and Fct < 17017 then gui.drawText(2,164,"Now I'm trying to plan farther ahead \nand shoot whenever I have to jump."); end
  if Fct > 17285 and Fct < 17443 then gui.drawRectangle(130,12,175,63,0xFF006600,0xFF006600);
    gui.drawBox(132,14,303,73,0xFF66CC00)
    gui.drawText(136,58,"                       ","white","black");
    gui.drawText(136,17,"\"WOW! THIS IS THE     \n FAMOUS DRACULA'S\n CASTLE....\"\n ","white","black");end
  if Fct > 17476 and Fct < 17777 then gui.drawText(2,164,"Pausing before a chat is older than \nthe old run, but it's still useful."); end
  if Fct > 18236 and Fct < 18537 then gui.drawText(2,164,"There are places where it would just \nwaste time to avoid damage..."); end
  if Fct > 18536 and Fct < 18837 then gui.drawText(2,164,"...but waiting here saves 15 frames \ncompared to taking damage."); end
  if Fct > 18978 and Fct < 19191 then gui.drawText(2,164,"The Long Jump is even more effective \nunderwater. "); end
  if Fct > 19426 and Fct < 19727 then gui.drawText(2,164,"Here's a place where it's easy to avoid \ntaking damage but it's not worth it."); end
  if Fct > 20300 and Fct < 20541 then gui.drawText(2,164,"If you import the old run into BizHawk, \nyou'll get a desync at this point."); end
  if Fct > 20540 and Fct < 20893 then gui.drawText(2,164,"There is much more lag in this stage now, \nbut I tried to reduce it when possible."); end
  if Fct > 21584 and Fct < 21885 then gui.drawText(2,164,"The strategy used in this section comes \nfrom the RTA World Record of Quack Shot."); end
  if Fct > 22130 and Fct < 22471 then gui.drawText(2,164,"The RTA runner jumps inside this wall and  \nDonald zips to the end of this area."); end
  if Fct > 22656 and Fct < 22957 then gui.drawText(2,164,"The drawback; he dies in the process... \nStill, faster than the old strategy."); end
  if Fct > 23278 and Fct < 23369 then gui.drawText(2,164,"Boss: \nDracula. "); end
  if Fct > 23400 and Fct < 23641 then gui.drawText(2,164,"Dracula: But enough talk... \nHave at you!"); end
  if Fct > 23400 and Fct < 25535 then   gui.drawRectangle(2,8,84,18,0xFFFF6666,0xFF660000);
   gui.drawText(5,11,"Dracula: "..Bss.." ","white","black");end
  if Fct > 23640 and Fct < 23921 then gui.drawText(2,164,"Donald: Die monster.\nYou don't belong in this world! "); end
  if Fct > 25544 and Fct < 25675 then gui.drawRectangle(58,9,191,71,0xFF006600,0xFF006600);
    gui.drawBox(60,11,247,78,0xFF66CC00)
    gui.drawText(64,63,"                         ","white","black");
    gui.drawText(64,14,"\n DONALD TAKES THE REAL  \n TREASURE MAP.\n\n","white","black");end
  if Fct > 25708 and Fct < 25971 then gui.drawText(2,164,"Trivia: In the Kingdom Hearts series, \nDonald has the highest Magic stat."); end
  if Fct > 26000 and Fct < 26187 then gui.drawText(2,164,"Transylvania:  603 frames saved. \nTotal       : 1176 frames ahead."); end
 end

--Maharajah
 if Fct > 26219 and Fct < 31006 then
 Tux = mainmemory.read_u16_be(0x90D0)
 Tuy = mainmemory.read_u16_be(0x90D4)
 Tup = mainmemory.read_u16_be(0x90C4)
 if Tup < 2 then Tuh = 15 else Tuh = 1; end
 Bss = mainmemory.read_u8(0x9038)
  if Fct > 26220 and Fct < 26461 then gui.drawText(2,164,"Maharajah:\nHere Donald will get the \"Sphinx Tear.\" "); end
  if Fct > 26460 and Fct < 26741 then gui.drawText(2,164,"As you can see, I won't collect all five \nPeppers here, just four of them."); end
  if Fct > 26740 and Fct < 27021 then gui.drawText(2,164,"Why not? Well, the Peppers are not so \nuseful here as they were in Duckburg."); end
  if Fct > 27020 and Fct < 27321 then gui.drawText(2,164,"And in Egypt they are pretty much useless \nsince the last one is almost at the end."); end
  if Fct > 27404 and Fct < 27599 then gui.drawRectangle(130,11,175,79,0xFF006600,0xFF006600);
    gui.drawBox(132,13,303,88,0xFF66CC00)
    gui.drawText(136,73,"                       ","white","black");
    gui.drawText(136,17,"\"WOW! THIS IS THE     \n BIG MAHARAJARA'S\n PALACE...\"\n\n ","white","black");end
  if Fct > 27632 and Fct < 27827 then gui.drawText(2,164,"More hit box fun, \nfor every one!");
    gui.drawBox(110,130,142,162,"red");end
  if Fct > 27632 and Fct < 28757 then gui.drawBox(Hxl-Scx,Hyt-Scy,Hxr-Scx,Hyb-Scy,"blue");end
  if Fct > 27860 and Fct < 28095 then gui.drawText(2,164,"In most places jumping around ledges \nis slower than falling off of them."); end
  if Fct > 28128 and Fct < 28349 then gui.drawText(2,164,"Shooting makes Donald's hit box smaller, \nbut it was overlooked in the old run.");
   gui.drawBox(Tux-15-Scx,Tuy-15-Tuh-Scy,Tux+15-Scx,Tuy-Scy,"red");end
  if Fct > 28383 and Fct < 28637 then gui.drawBox(144-Scx,464-Scy,176-Scx,460-Scy,"red");
   gui.drawText(103-Scx,355-Scy,"a small hit box \n       V")end
  if Fct > 28790 and Fct < 29071 then gui.drawText(2,164,"Not using the Peppers in Maharajah forced \nme to find better ways to kill some foes."); end
  if Fct > 29148 and Fct < 29243 then gui.drawText(2,164,"Boss:\nShere Khan. "); end
  if Fct > 29274 and Fct < 29755 then   gui.drawRectangle(2,8,105,18,0xFFFFB266,0xFFCC6600);
   gui.drawText(5,11,"Shere Khan: "..Bss.." ","white","black");end
  if Fct > 29274 and Fct < 29515 then gui.drawText(2,164,"Shere Khan: Did you think \nI would let you grow old?"); end
  if Fct > 29514 and Fct < 29755 then gui.drawText(2,164,"Donald: You don't scare me! \nI don't run from anyone!");end
  if Fct > 30301 and Fct < 30485 then gui.drawRectangle(64,11,191,71,0xFF990000,0xFF990000);
    gui.drawBox(66,13,253,80,0xFFFF3333)
    gui.drawText(70,65,"                         ","white","black");
    gui.drawText(70,16,"\"AS I PROMISED, I WILL  \n GIVE YOU THE SPHINX\n TEAR.\"\n\n","white","black");end
  if Fct > 30518 and Fct < 30781 then gui.drawText(2,164,"Trivia: In Finland, Donald's comics were \nbanned due to \"inappropriate clothing.\""); end
  if Fct > 30810 and Fct < 31005 then gui.drawText(2,164,"Maharajah:   83 frames slower. \nTotal    : 1093 frames  ahead."); end
 end

--Egypt 
 if Fct > 31035 and Fct < 38176 then
  if Fct > 31036 and Fct < 31277 then gui.drawText(2,164,"Egypt:\nHere Donald will get the \"Scepter of Ra.\" "); end
  if Fct > 31276 and Fct < 31557 then gui.drawText(2,164,"And here we are with a strategy that will \nput these Peppers to good use at last."); end
  if Fct > 31742 and Fct < 32021 then gui.drawText(2,164,"The Long Jump was found here during \na \"play around\" to enter this door."); end
  if Fct > 32054 and Fct < 32335 then gui.drawText(2,164,"By the way, you can not enter this door \nbefore the flag is set, not matter what."); end
  if Fct > 32778 and Fct < 33059 then gui.drawText(2,164,"Here you can jump at the top of this \nladder, but in Mexico you can not."); end
  if Fct > 33212 and Fct < 33493 then gui.drawText(2,164,"I almost forgot to say it, but shooting \nafter a Long Jump makes it even faster."); end
  if Fct > 33492 and Fct < 33773 then gui.drawText(2,164,"So, if you see me shooting for no apparent \nreason, it is to gain that extra boost."); end
  if Fct > 34212 and Fct < 34493 then gui.drawText(2,164,"It's also kinda late to say it, but it's \nnot possible to slide on steep slopes."); end
  if Fct > 34492 and Fct < 34773 then gui.drawText(2,164,"And without a slide, it's impossible to \nstart a new Power Walk, unfortunately."); end
  if Fct > 35570 and Fct < 35667 then gui.drawText(2,164,"How to Power Walk:\nPress C\+Down then Up\+Down\+Right\+A\+C "); end
  if Fct > 35905 and Fct < 35911 then gui.drawRectangle(60,16,191,71,0xFF006600,0xFF006600);
    gui.drawBox(62,18,249,85,0xFF66CC00)
    gui.drawText(66,70,"                         ","white","black");
    gui.drawText(66,21,"\n DONALD GETS THE        \n SCEPTER OF RA.\n\n","white","black");end
  if Fct > 35910 and Fct < 36135 then gui.drawRectangle(60,16,191,71,0x55006600,0x55006600);
    gui.drawBox(62,18,249,85,0xFF66CC00)
    gui.drawText(66,21,"\n DONALD GETS THE\n SCEPTER OF RA.","white",0x00000000);end
  if Fct > 36494 and Fct < 36795 then gui.drawText(2,164,"Wow, Egypt is a huge stage! The Hideout \nis longer, but there we have a boss..."); end
  if Fct > 37220 and Fct < 37519 then gui.drawText(2,164,"If you go slower at the end Donald starts \na death animation but doesn't lose a life."); end
  if Fct > 37696 and Fct < 37959 then gui.drawText(2,164,"Trivia: Donald has black eyes and \nsuffers from color blindness."); end
  if Fct > 37986 and Fct < 38175 then gui.drawText(2,164,"Egypt:  696 frames saved.\nTotal: 1789 frames ahead."); end
 end

--Southpole
 if Fct > 38205 and Fct < 39810 then
  if Fct > 38206 and Fct < 38447 then gui.drawText(2,164,"South Pole:\nHere donald will take the \"Viking Key.\" "); end
  if Fct > 38446 and Fct < 38727 then gui.drawText(2,164,"Another small stage full of improvements; \na lot more damage was taken, for example."); end
  if Fct > 38726 and Fct < 39007 then gui.drawText(2,164,"The trick to collect the Viking Key and \ncall the Airplane was also improved."); end
  if Fct > 39491 and Fct < 39599 then gui.drawRectangle(58,12,191,71,0xFF006600,0xFF006600);
    gui.drawBox(60,14,247,81,0xFF66CC00)
    gui.drawText(64,66,"                         ","white","black");
    gui.drawText(64,17," DONALD TAKES THE       \n VIKING KEY.\n\n\n","white","black");end
  if Fct > 39626 and Fct < 39809 then gui.drawText(2,164,"South Pole:  113 frames saved.\nTotal     : 1902 frames ahead."); end
 end

--Viking Ship 
 if Fct > 39839 and Fct < 45694 then
 Bss = mainmemory.read_u8(0x92A1)
 Pla = mainmemory.read_s16_be(0x90D4)-16
  if Fct > 39840 and Fct < 40081 then gui.drawText(2,164,"Viking Ship:\nHere Donald will take the \"Green Plunger.\" "); end
  if Fct > 40080 and Fct < 40361 then gui.drawText(2,164,"Plungers... not the best ammo of the game, \nthen, why is it the most used one?"); end
  if Fct > 40360 and Fct < 40641 then gui.drawText(2,164,"The reason is pretty simple; it's not \npossible to manipulate enemy drops."); end
  if Fct > 40800 and Fct < 41081 then gui.drawText(2,164,"Gunshots interupt some of the other sound \neffects, but the opposite is also true."); end
  if Fct > 41594 and Fct < 41875 then gui.drawText(2,164,"Remember the speed buffer? It's impossible \nto use it here, but I'll keep trying."); end
  if Fct > 41990 and Fct < 42271 then gui.drawText(2,164,"Some platforms drop your speed to zero. \nYou must slowdown a bit to avoid it.");
   gui.drawText(2629-Scx,Pla-Scy,"STOP!");end
  if Fct > 42412 and Fct < 42557 then gui.drawText(2,164,"Hit boxes, again? ");
   gui.drawBox(Hxl-Scx,Hyt-Scy,Hxr-Scx,Hyb-Scy,"blue");
    gui.drawBox(314-Scx,130,330-Scx,176,"red");end
  if Fct > 42720 and Fct < 43001 then gui.drawText(2,164,"I have been saving Popcorn Ammo for some \ntime and it's time to find out why."); end
  if Fct > 43286 and Fct < 43369 then gui.drawText(2,164,"Boss:\nViking Ghost."); end
  if Fct > 43402 and Fct < 44931 then   gui.drawRectangle(2,8,120,18,0xFFC0C0C0,0xFF606060);
   gui.drawText(5,11,"Viking Ghost: "..Bss.." ","white","black");end
  if Fct > 43402 and Fct < 43683 then gui.drawText(2,164,"Viking Ghost:\nLet another's wounds be your warning. "); end
  if Fct > 43682 and Fct < 43963 then gui.drawText(2,164,"Donald:\nOverconfidence has brought many to death. "); end
  if Fct > 45104 and Fct < 45477 then gui.drawRectangle(62,24,191,87,0xFF990000,0xFF990000);
    gui.drawBox(64,26,251,109,0xFFFF3333)
    gui.drawText(68,94,"                         ","white","black");
    gui.drawText(68,29,"\"WITH THIS PLUNGER,\n THE CHASM NEAR THE\n SOUTH POLE SHALL NOT\n STOP YOU FROM FINDING  \n THE VIKING DIARY.\"","white","black");end
  if Fct > 45502 and Fct < 45693 then gui.drawText(2,164,"Viking Ship:  220 frames saved.\nTotal      : 2122 frames ahead."); end
 end

--South Pole 
 if Fct > 45725 and Fct < 99999 then
  if Fct > 45726 and Fct < 45921 then gui.drawText(2,164,"South Pole:\nHere Donald will take the \"Viking Diary.\" "); end
  if Fct > 45954 and Fct < 46255 then gui.drawText(2,164,"The Long Jump buffer, as one would expect, \ndoesn't work with Green Plungers."); end
  if Fct > 46254 and Fct < 46555 then gui.drawText(2,164,"In any case, it's a good idea to grab the \nPlunger as high as you possibly can."); end
  if Fct > 46554 and Fct < 46855 then gui.drawText(2,164,"Why? Well, that's the height you're going \nto release the Plunger no matter what."); end
  if Fct > 46854 and Fct < 47135 then gui.drawText(2,164,"I'll freeze his hit box at the position \nhe will release it as an example.");end
  if Fct > 47134 and Fct < 47415 then gui.drawText(2,164,"If I jump, take damage or go all the way\ndown, Donald appears at the green square. ");end
  if Fct > 46854 and Fct < 48355 then gui.drawBox(Hxl-Scx,Hyt-Scy,Hxr-Scx,Hyb-Scy,"blue");end
  if Fct > 46854 and Fct < 48299 then gui.drawBox(Hxl-Scx,330-Scy,Hxr-Scx,314-Scy,"green");end
  if Fct > 48382 and Fct < 48491 then gui.drawText(2,164,"How to Get Low:\nPress Up\+Down on Birds. "); end
  if Fct > 48522 and Fct < 48803 then gui.drawText(2,164,"Here comes a barrage of Long Jumps! \nI'll shut up for a while, enjoy. "); end
  if Fct > 50032 and Fct < 50313 then gui.drawText(2,164,"New South Pole skip strategy, and again, \nit's from the RTA World Record."); end
  if Fct > 50544 and Fct < 50550 then gui.drawRectangle(64,9,191,71,0xFF006600,0xFF006600);
    gui.drawBox(66,11,253,78,0xFF66CC00)
    gui.drawText(70,63,"                         ","white","black");
    gui.drawText(70,14,"\n DONALD TAKES THE       \n VIKING DIARY.\"\n\n","white","black");end
  if Fct > 50549 and Fct < 50752 then gui.drawRectangle(64,9,191,71,0x55006600,0x55006600);
    gui.drawBox(66,11,253,78,0xFF66CC00)
    gui.drawText(70,14,"\n DONALD TAKES THE       \n VIKING DIARY.\"\n\n","white",0X00000000);end
  if Fct > 51135 and Fct < 51401 then gui.drawRectangle(103,7,215,79,0xFF990000,0xFF990000);
    gui.drawBox(105,9,316,84,0xFFFF3333)
    gui.drawText(108,68,"                             ","white","black");
    gui.drawText(108,12,"\"DONALD, IF YOU WANT TO\n SAVE YOUR NEPHEWS, YOU'D   \n BETTER GIVE ME THAT\n TREASURE MAP AND DIARY!\"\n  ","white","black");
    gui.drawLine(315,10,315,83,0xFF990000);
    gui.drawLine(314,10,314,83,0xFF990000);end
  if Fct > 51498 and Fct < 51671 then gui.drawText(2,164,"South Pole:  203 frames saved.\nTotal     : 2325 frames ahead."); end
 end

--Hideout 
 if Fct > 51703 and Fct < 99999 then
 Bss = mainmemory.read_u8(0x90F9)
  if Fct > 51704 and Fct < 51945 then gui.drawText(2,164,"Hideout:\nHere Donald gets back the \"Viking Diary.\" "); end
  if Fct > 51944 and Fct < 52225 then gui.drawText(2,164,"That's right, Donald won't get the \n\"Map\" back as Pete has promised..."); end
  if Fct > 52224 and Fct < 52505 then gui.drawText(2,164,"...otherwise it would be possible to go \nback to \"Duckburg,\" for example."); end
  if Fct > 52798 and Fct < 53079 then gui.drawText(2,164,"Like in South Pole, Donald releases the \nPlunger as high as he grabbed it.");end
  if Fct > 52798 and Fct < 53181 then gui.drawBox(Hxl-Scx,Hyt-Scy,Hxr-Scx,Hyb-Scy,"blue");
   gui.drawText(Hxl-Scx,Hyb-Scy,"H:"..Dpy.." ");end
  if Fct > 53280 and Fct < 53561 then gui.drawText(2,164,"It's possible to shoot upward and keep \nall your speed while doing so."); end
  if Fct > 53560 and Fct < 53841 then gui.drawText(2,164,"This is a pretty basic trick, but I just \nfound it at this point in the run."); end
  if Fct > 53866 and Fct < 53959 then gui.drawText(2,164,"How to Shoot Up:\nPress Right\+A\+B\+C then Up\+Down\+C "); end
  if Fct > 53994 and Fct < 54275 then gui.drawText(2,164,"The physics of these mine carts and how \nit messes with Donald's speed is crazy."); end
  if Fct > 53994 and Fct < 54581 then gui.drawText(Hxl-Scx,Hyb-Scy,"X:"..string.sub(Dsx,1,2).." ");
   gui.drawBox(Hxl-Scx,Hyt-Scy,Hxr-Scx,Hyb-Scy,"blue");end
  if Fct > 54734 and Fct < 55015 then gui.drawText(2,164,"Thanks to faster movements, one phase of \nthese moving platforms is now skipped."); end
  if Fct > 55014 and Fct < 55295 then gui.drawText(2,164,"Something I have tried for quite some time \nin the old run, but couldn't make happen."); end
  if Fct > 56120 and Fct < 56401 then gui.drawText(2,164,"There are Big Bad Pete faces everywhere.\nI wonder what \"B.B.P\" stands for though... "); end
  if Fct > 56932 and Fct < 57213 then gui.drawText(2,164,"The muscle bound thugs are invincible, \nso it's faster to just take damage."); end
  if Fct > 99999 and Fct < 99999 then gui.drawText(2,164,""); end
  if Fct > 99999 and Fct < 99999 then gui.drawText(2,164,""); end
  if Fct > 57240 and Fct < 57339 then gui.drawText(2,164,"Boss:\nBig Bad Pete. "); end
  if Fct > 57646 and Fct < 61031 then   gui.drawRectangle(2,8,120,18,0xFF0080FF,0xFF0000CC);
   gui.drawText(5,11,"Big Bad Pete: "..Bss.." ","white","black");end
  if Fct > 57400 and Fct < 57647 then gui.drawRectangle(63,10,191,71,0xFF60000CC,0xFF0000CC);
    gui.drawBox(65,12,252,79,0xFF0080FF)
    gui.drawText(69,64,"                         ","white","black");
    gui.drawText(69,15,"\"IF YOU DEFEAT ME,\n I'LL GIVE YOU THE MAP  \n AND THE VIKING DIARY.\n HA,HA,HA...\"\n","white","black");end
  if Fct > 57646 and Fct < 57926 then gui.drawText(2,164,"Donald: You won't trick me, Pete! \nI know you don't have any map. "); end
  if Fct > 61176 and Fct < 61429 then gui.drawText(2,164,"Hideout:  321 frames saved.\nTotal  : 2646 frames ahead."); end
  if Fct > 99999 and Fct < 99999 then gui.drawText(2,164,""); end
 end

--The Island 
 if Fct > 61461 and Fct < 69716 then
 Bss = mainmemory.read_u8(0x9079)
  if Fct > 61462 and Fct < 61703 then gui.drawText(2,164,"The Island:\nHere Donald finally beats \"The Guardian.\" "); end
  if Fct > 61702 and Fct < 61983 then gui.drawText(2,164,"When a video of a guy beating him in one \nphase was shown, little detail was given."); end
  if Fct > 61982 and Fct < 62263 then gui.drawText(2,164,"It was all figured out and explained much \nlater, after the old run was published."); end
  if Fct > 62262 and Fct < 62543 then gui.drawText(2,164,"Now, imagine how frustrating it is to know \nthat your TAS is not on par with an RTA...");end
  if Fct > 62542 and Fct < 62823 then gui.drawText(2,164,"Please don't get me wrong, I'm not saying \n\"TASes must be better,\" no, it's not it."); end
  if Fct > 62822 and Fct < 63103 then gui.drawText(2,164,"But since it uses all sorts of tools, \nit should at a very least be faster."); end
  if Fct > 63580 and Fct < 63861 then gui.drawText(2,164,"Here comes the last zip-line of the game. \nIt's now or never for that buffer..."); end
  if Fct > 63744 and Fct < 64027 then gui.drawBox(Hxl-Scx,Hyt-Scy,Hxr-Scx,Hyb-Scy,"blue");
   gui.drawText(Hxl-Scx,Hyb-Scy,"X:"..string.sub(Dsx,1,2).." ");end
  if Fct > 64026 and Fct < 64307 then gui.drawText(2,164,"It worked! Long Jumps do have a buffer \nif you can grab a zip-line afterwards."); end
  if Fct > 64440 and Fct < 64721 then gui.drawText(2,164,"Earlier I said; \"to the left is faster,\"\nbut how much faster is it anyway?"); end
  if Fct > 64720 and Fct < 65001 then gui.drawText(2,164,"It's so fast I can reach the last platform \nbefore it goes to the right this time."); end
  if Fct > 65000 and Fct < 65325 then gui.drawText(2,164,"Here's an estimate of the maximum speeds: \nto the Right: 31, to the Left: 37!"); end
  if Fct > 65460 and Fct < 65735 then gui.drawText(2,164,"What lies ahead is a good example of how \nTAS and RTA can benefit from each other."); end
  if Fct > 65896 and Fct < 66177 then gui.drawText(2,164,"Guardian:\nYou're strangely dressed, for a knight. "); end
  if Fct > 66176 and Fct < 66457 then gui.drawText(2,164,"Donald:\nA knight? What do you mean? "); end
  if Fct > 65762 and Fct < 65863 then gui.drawText(2,164,"Boss:\nGuardian. "); end
  if Fct > 65896 and Fct < 69221 then gui.drawRectangle(2,8,91,18,0xFFCC99FF,0xFF4C0099);
   gui.drawText(5,11,"Guardian:   ","white","black");
    gui.drawText(70,11,Bss);end
  if Fct > 69230 and Fct < 69471 then gui.drawRectangle(60,9,191,71,0xFF4C0099,0xFF4C0099);
    gui.drawBox(62,12,249,78,0xFFCC99FF)
    gui.drawText(66,63,"                         ","white","black");
    gui.drawText(66,15,"\"FINALLY, SOMEONE WHO   \n IS WORTHY OF THE\n TREASURE.\"\n\n","white","black");end
  if Fct > 69470 and Fct < 69715 then gui.drawRectangle(60,9,191,71,0xFF006600,0xFF006600);
    gui.drawBox(62,12,249,78,0xFF66CC00)
    gui.drawText(66,63,"                         ","white","black");
    gui.drawText(66,15,"\"OH MY GOSH! IT IS\n JUST A PLAIN STONE     \n FIGURINE OF A DUCK\n PRINCESS!!\"\n","white","black");end
 end

--Credits
 if Fct > 72023 and Fct < 76980 then
  if Fct > 72024 and Fct < 75899 then gui.drawText(2,144,"\n\n\n\n\n                                           ","white","black"); end
  if Fct > 72024 and Fct < 75899 then gui.drawText(92,156,"SPECIAL THANKS TO:"); end
  if Fct > 72024 and Fct < 72447 then gui.drawText(15,170,"\t        mklip2001 \nFor bringing this game to my attention."); end
  if Fct > 72504 and Fct < 72927 then gui.drawText(14,170,"\t\t   Mitjitsu \nFor pointing out the Final Boss Glitch \n  and sugesting the use of sub pixels."); end
  if Fct > 73014 and Fct < 73437 then gui.drawText(14,170,"\t\t   sicanjal \nFor figuring out the Final Boss Glitch."); end
  if Fct > 73494 and Fct < 73917 then gui.drawText(30,170,"\t\t PPLToast \nFor his Wall Trick in Transylvania.\n \n "); end
  if Fct > 74006 and Fct < 74429 then gui.drawText(37,170,"\t    FatRatKnight\nFor his tutorial about sub pixels.\n \n "); end
  if Fct > 74486 and Fct < 74909 then gui.drawText(36,170,"\t\tmarzojr \nFor sharing his memory addresses."); end
  if Fct > 74996 and Fct < 75419 then gui.drawText(21,170,"\t\t  Reeve \n    For support on the forum and\nsuggestions of possible improvements."); end
  if Fct > 75476 and Fct < 75899 then gui.drawText(66,170,"\t  Evil_3D \nFor support on the forum.\n "); end
  if Fct > 75996 and Fct < 76277 then gui.drawText(51,156,"Tool Assisted Submission Text\n\t    by Dooty"); end
  if Fct > 76276 and Fct < 76979 then gui.drawText(73,156,"Thank you for watching,\nand see you next time!");end
 end
emu.frameadvance();
end