Advertisement
Guest User

Zombies Ate My Neighbors TAS LUA Script HUD RNG Manipulator

a guest
Jul 27th, 2016
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.18 KB | None | 0 0
  1. -- Zombies Ate My Neighbors HUD and RNG manipulator for TAS
  2. xBoyP = 0
  3. xGirlP = 0
  4. yBoyP = 0
  5. yGirlP = 0
  6. xBoy = 0
  7. xGirl = 0
  8. yBoy = 0
  9. yGirl = 0
  10.  
  11.  
  12. shoes = {91, 162, 349, 418, 605, 672, 927, 928, 1118, 1183, 1353, 1374, 1609, 1716, 1971, 1972, 2122, 2227, 2378, 2485, 2632, 2741, 2887, 2888, 3143, 3254, 3505, 3510, 3660, 3761, 3915, 3916, 4171, 4274, 4429, 4530, 4685, 4784, 5039, 5040, 5198, 5295, 5454, 5561, 5700, 5817, 5955, 5956, 6211, 6330, 6469, 6586, 6725, 6840, 7095, 7096, 7238, 7351, 7489, 7494, 7745, 7868, 8123, 8124, 8258, 8379, 8514, 8637, 8768, 8893, 9023, 9024, 9279, 9406, 9577, 9662, 9833, 9876, 10131, 10132, 10346, 10387, 10602, 10645, 10856, 10901, 11111, 11112, 11367, 11414, 11665, 11670, 11884, 11921, 12139, 12140, 12395, 12434, 12653, 12690, 12909, 12944, 13199, 13200, 13422, 13455, 13678, 13721, 13924, 13977, 14179, 14180, 14435, 14490, 14693, 14746, 14949, 15000, 15255, 15256, 15462, 15511, 15713, 15718, 15969, 16028, 16283, 16284, 16482, 16539, 16738, 16797, 16992, 17053, 17247, 17248, 17503, 17566, 17801, 17822, 18036, 18057, 18291, 18292, 18547, 18570, 18805, 18826, 19061, 19080, 19335, 19336, 19574, 19591, 19825, 19830, 20081, 20108, 20363, 20364, 20594, 20619, 20850, 20877, 21104, 21133, 21359, 21360, 21615, 21646, 21881, 21902, 22137, 22148, 22403, 22404, 22650, 22659, 22906, 22917, 23160, 23173, 23415, 23416, 23671, 23686, 23937, 23942, 24188, 24193, 24443, 24444, 24699, 24706, 24957, 24962, 25213, 25216, 25471, 25472, 25726, 25727, 25897, 25982, 26153, 26324, 26579, 26580, 26666, 26835, 26922, 27093, 27176, 27349, 27431, 27432, 27687, 27862, 28113, 28118, 28204, 28369, 28459, 28460, 28715, 28882, 28973, 29138, 29229, 29392, 29647, 29648, 29742, 29903, 29998, 30169, 30244, 30425, 30499, 30500, 30755, 30938, 31013, 31194, 31269, 31448, 31703, 31704, 31782, 31959, 32033, 32038, 32289, 32476, 32731, 32732, 32802, 32987, 33058, 33245, 33312, 33501, 33567, 33568, 33823, 34014, 34249, 34270, 34356, 34505, 34611, 34612, 34867, 35018, 35125, 35274, 35381, 35528, 35783, 35784, 35894, 36039, 36145, 36150, 36401, 36556, 36811, 36812, 36914, 37067, 37170, 37325, 37424, 37581, 37679, 37680, 37935, 38094, 38201, 38350, 38457, 38596, 38851, 38852, 38970, 39107, 39226, 39365, 39480, 39621, 39735, 39736, 39991, 40134, 40385, 40390, 40508, 40641, 40763, 40764, 41019, 41154, 41277, 41410, 41533, 41664, 41919, 41920, 42046, 42175, 42302, 42473, 42516, 42729, 42771, 42772, 43027, 43242, 43285, 43498, 43541, 43752, 44007, 44008, 44054, 44263, 44305, 44310, 44561, 44780, 45035, 45036, 45074, 45291, 45330, 45549, 45584, 45805, 45839, 45840, 46095, 46318, 46361, 46574, 46617, 46820, 47075, 47076, 47130, 47331, 47386, 47589, 47640, 47845, 47895, 47896, 48151, 48358, 48609, 48614, 48668, 48865, 48923, 48924, 49179, 49378, 49437, 49634, 49693, 49888, 50143, 50144, 50206, 50399, 50441, 50462, 50697, 50932, 51187, 51188, 51210, 51443, 51466, 51701, 51720, 51957, 51975, 51976, 52231, 52470, 52721, 52726, 52748, 52977, 53003, 53004, 53259, 53490, 53517, 53746, 53773, 54000, 54255, 54256, 54286, 54511, 54542, 54777, 54788, 55033, 55043, 55044, 55299, 55546, 55557, 55802, 55813, 56056, 56311, 56312, 56326, 56567, 56577, 56582, 56833, 57084, 57339, 57340, 57346, 57595, 57602, 57853, 57856, 58109, 58111, 58112, 58367, 58622, 58793, 58878, 58964, 59049, 59219, 59220, 59475, 59562, 59733, 59818, 59989, 60072, 60327, 60328, 60502, 60583, 60753, 60758, 61009, 61100, 61355, 61356, 61522, 61611, 61778, 61869, 62032, 62125, 62287, 62288, 62543, 62638, 62809, 62894, 63065, 63140, 63395, 63396, 63578, 63651, 63834, 63909, 64088, 64165, 64343, 64344, 64599, 64678, 64929, 64934, 65116, 65185, 65371, 65372 }
  13.  
  14. skeletons = {145, 364, 619, 914, 1133, 1424, 1679, 1902, 2201, 2404, 2659, 2970, 3173, 3480, 3735, 3942, 4193, 4508, 4763, 4962, 5277, 5472, 5727, 6046, 6281, 6516, 6771, 7050, 7285, 7560, 7815, 8054, 8305, 8588, 8843, 9074, 9357, 9584, 9839, 10126, 10361, 10628, 10883, 11130, 11397, 11640, 11895, 12166, 12417, 12668, 12923, 13186, 13437, 13696, 13951, 14206, 14377, 14804, 15059, 15146, 15573, 15656, 15911, 16342, 16593, 16684, 16939, 17362, 17453, 17872, 18127, 18222, 18649, 18724, 18979, 19418, 19493, 19928, 20183, 20262, 20513, 20956, 21211, 21282, 21725, 21792, 22047, 22494, 22729, 22836, 23091, 23498, 23605, 24008, 24263, 24374, 24625, 25036, 25291, 25394, 25805, 25904, 26159, 26574, 26681, 27076, 27331, 27450, 27845, 27960, 28215, 28614, 28865, 28988, 29243, 29634, 29757, 30144, 30399, 30526, 30953, 30996, 31251, 31722, 31765, 32232, 32487, 32534, 32785, 33260, 33515, 33554, 34029, 34064, 34319, 34798, 34841, 35300, 35555, 35610, 36069, 36120, 36375, 36838, 37089, 37148, 37403, 37858, 37917, 38368, 38623, 38686, 38921, 39412, 39667, 39690, 40181, 40200, 40455, 40950, 41201, 41228, 41483, 41970, 41997, 42480, 42735, 42766, 43257, 43268, 43523, 44026, 44037, 44536, 44791, 44806, 45057, 45564, 45819, 45826, 46333, 46336, 46591, 47102, 47273, 47444, 47699, 48042, 48213, 48552, 48807, 48982, 49233, 49580, 49835, 50002, 50349, 50512, 50767, 51118, 51289, 51620, 51875, 52058, 52389, 52568, 52823, 53158, 53409, 53596, 53851, 54178, 54365, 54688, 54943, 55134, 55369, 55732, 55987, 56138, 56501, 56648, 56903, 57270, 57521, 57676, 57931, 58290, 58445, 58800, 59055, 59214, 59577, 59716, 59971, 60346, 60485, 60856, 61111, 61254, 61505, 61884, 62139, 62274, 62653, 62784, 63039, 63422, 63593, 63892, 64147, 64362, 64661, 64872, 65127, 65430}
  15.  
  16. function readMemory()
  17. xBoyP = xBoy
  18. xGirlP = xGirl
  19. yBoyP = yBoy
  20. yGirlP = yGirl
  21.  
  22. yBoy = memory.readbyte(0x0D1F) + memory.readbyte(0x0D20)*255
  23. yGirl = memory.readbyte(0x0DAF) + memory.readbyte(0x0DB0)*255
  24.  
  25. xBoy = memory.readbyte(0x0D21) + memory.readbyte(0x0D22)*255
  26. xGirl = memory.readbyte(0x0DB1) + memory.readbyte(0x0DB2)*255
  27. randomizer = memory.readbyte(0x0024)
  28. end
  29.  
  30. function getRandomizerString()
  31. x = memory.readbyte(0x0024)+memory.readbyte(0x0025)*256
  32. randomizerText = 'r:'
  33.  
  34. for _,v in pairs(shoes) do
  35. if v == x then
  36. randomizerText = randomizerText .. 'SHOE-' .. v
  37. break
  38. end
  39. end
  40.  
  41. for _,v in pairs(skeletons) do
  42. if v == x then
  43. randomizerText = randomizerText .. 'skeleton-' .. v
  44. break
  45. end
  46. end
  47.  
  48. return randomizerText
  49. end
  50.  
  51. function getRandomizerStringOld(randomizer)
  52. if randomizer == 3 then
  53. randomizerText = randomizerText .. 'none'
  54. elseif randomizer == 12 then
  55. randomizerText = randomizerText .. 'gun'
  56. elseif randomizer == 13 then
  57. randomizerText = randomizerText .. 'Extinguisher'
  58. elseif randomizer == 15 then
  59. randomizerText = randomizerText .. 'weed'
  60. elseif randomizer == 16 then
  61. randomizerText = randomizerText .. 'holy'
  62. elseif randomizer == 17 then
  63. randomizerText = randomizerText .. '~Zooka~'
  64. elseif randomizer == 18 then
  65. randomizerText = randomizerText .. 'soda'
  66. elseif randomizer == 19 then
  67. randomizerText = randomizerText .. 'tomato'
  68. elseif randomizer == 20 then
  69. randomizerText = randomizerText .. 'popsicles'
  70. elseif randomizer == 22 then
  71. randomizerText = randomizerText .. 'plates'
  72. elseif randomizer == 23 then
  73. randomizerText = randomizerText .. 'silverware'
  74. elseif randomizer == 33 then
  75. randomizerText = randomizerText .. 'key'
  76. elseif randomizer == 34 then
  77. randomizerText = randomizerText .. '~Shoe~'
  78. elseif randomizer == 35 then
  79. randomizerText = randomizerText .. 'Red Pot'
  80. elseif randomizer == 36 then
  81. randomizerText = randomizerText .. '~Blue Pot~'
  82. elseif randomizer == 37 then
  83. randomizerText = randomizerText .. 'Mystery Pot'
  84. elseif randomizer == 40 then
  85. randomizerText = randomizerText .. 'Medkit'
  86. elseif randomizer == 41 then
  87. randomizerText = randomizerText .. 'pandora'
  88. elseif randomizer == 42 then
  89. randomizerText = randomizerText .. '~Skeleton Key~'
  90. elseif randomizer == 43 then
  91. randomizerText = randomizerText .. 'Clown'
  92. elseif randomizer == 47 then
  93. randomizerText = randomizerText .. 'gold'
  94. elseif randomizer == 48 then
  95. randomizerText = randomizerText .. '$$'
  96. else
  97. randomizerText = randomizerText .. '?????'
  98. end
  99. return randomizerText
  100. end
  101.  
  102. function displayPosition()
  103. boyPos = 'B: (' .. xBoy .. ', ' .. yBoy .. ')'
  104. girlPos = 'G: (' .. xGirl .. ', ' .. yGirl .. ')'
  105. gui.drawText(0, 0, boyPos);
  106. --gui.drawText(0, 15, girlPos);
  107.  
  108. randomizer = memory.readbyte(0x1A74)
  109. randomizerText = getRandomizerString()
  110.  
  111. gui.drawText(0, 210, randomizerText)
  112. end
  113.  
  114. function displayVelocity()
  115. boyVel = 'vB: (' .. xBoy - xBoyP .. ', ' .. yBoy - yBoyP .. ')'
  116. girlVel = 'vG: (' .. xGirl - xGirlP .. ', ' .. yGirl - yGirlP .. ')'
  117.  
  118. gui.drawText(100, 0, boyVel);
  119. --gui.drawText(100, 15, girlVel);
  120.  
  121. end
  122.  
  123. function gatherRNG()
  124. savestate.saveslot(1)
  125.  
  126. savestate.loadslot(1)
  127. local tab={}
  128. tab["Up"]=1
  129. for i=0x0,0xFF do
  130. for j=0x0,0xFF do
  131. savestate.loadslot(1)
  132. memory.writebyte(0x25,i)
  133. memory.writebyte(0x24,j)
  134. for c=1,5 do
  135. joypad.set(tab,2)
  136. emu.frameadvance()
  137. end
  138. displayPosition()
  139. console.log(i*256+j .. randomizerText)
  140. if randomizerText == 'r:?????' then
  141. break
  142. end
  143. end
  144. end
  145. end
  146.  
  147. displayPosition();
  148. while true do
  149. emu.frameadvance();
  150. readMemory();
  151. displayVelocity();
  152. displayPosition();
  153. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement