Advertisement
Guest User

Untitled

a guest
May 29th, 2011
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.07 KB | None | 0 0
  1. while true do
  2.  
  3. --** variables to move everything around if needed **--
  4.  
  5. x = 0
  6. y = 0
  7.  
  8.  
  9.  
  10. --** design **--
  11. -- box
  12. gui.opacity(0.77)
  13. gui.fillbox(5+x, -2+y, 160+x ,31+y, "#1c1c1c")
  14.  
  15. -- mushroom graphic
  16. gui.drawline(10+x,2+y ,14+x,2+y, "red")
  17. gui.drawline(9+x,3+y ,15+x,3+y, "red")
  18. gui.drawline(9+x,4+y ,15+x,4+y, "red")
  19. gui.drawline(11+x,5+y, 13+x,5+y, "#F5D0A9")
  20. gui.drawline(11+x,6+y, 13+x,6+y, "#F5D0A9")
  21. gui.drawpixel(10+x,3+y, "white")
  22. gui.drawpixel(12+x,2+y, "white")
  23. gui.drawpixel(14+x,3+y, "white")
  24.  
  25. -- nut graphic
  26. gui.drawline(10+x, 8+y, 12+x, 8+y, "#FFCC66")
  27. gui.drawline(9+x, 9+y, 13+x, 9+y, "#FFCC66")
  28. gui.drawline(9+x, 10+y, 14+x, 10+y, "#FFCC66")
  29. gui.drawline(12+x, 11+y, 14+x, 11+y, "#FFCC66")
  30. gui.drawline(13+x, 12+y, 14+x, 12+y, "#FFCC66")
  31.  
  32. -- syrup graphic
  33. gui.drawline(11+x, 14+y, 12+x, 14+y, "#FF9900")
  34. gui.drawline(11+x, 15+y, 12+x, 15+y, "#FF9900")
  35. gui.drawline(9+x, 16+y, 14+x, 16+y, "#FF9900")
  36. gui.drawline(9+x, 17+y, 14+x, 17+y, "#FF9900")
  37. gui.drawline(10+x, 18+y, 13+x, 18+y, "#FF9900")
  38.  
  39. -- others graphic
  40. --e
  41. gui.drawline(9+x, 20+y, 9+x, 20+y , "white")
  42. gui.drawline(9+x, 21+y, 10+x, 21+y , "white")
  43. gui.drawline(8+x, 21+y, 8+x, 23+y , "white")
  44. gui.drawline(9+x, 24+y, 10+x, 24+y , "white")
  45. gui.drawline(9+x, 22+y, 10+x, 22+y , "white")
  46. gui.drawpixel(9+x, 21+y, "black")
  47. --t
  48. gui.drawline(13+x, 20+y, 13+x, 24+y , "white")
  49. gui.drawline(12+x, 21+y, 14+x, 21+y , "white")
  50. --c
  51. gui.drawline(17+x, 21+y, 17+x, 21+y , "white")
  52. gui.drawline(16+x, 24+y, 17+x, 24+y , "white")
  53. gui.drawline(16+x, 22+x, 16+x, 23+y , "white")
  54.  
  55.  
  56.  
  57. --** ADDRESS VALUES **--
  58. mushrooms = memory.readbytesigned(0x020048e2)
  59. supermushrooms = memory.readbytesigned(0x020048e3)
  60. ultramushrooms = memory.readbytesigned(0x020048e4)
  61. maxmushrooms = memory.readbytesigned(0x020048e5)
  62. nuts = memory.readbytesigned(0x020048e6)
  63. supernuts = memory.readbytesigned(0x020048e7)
  64. ultranuts = memory.readbytesigned(0x020048e8)
  65. maxnuts = memory.readbytesigned(0x020048e9)
  66. syrups = memory.readbytesigned(0x020048ea)
  67. supersyrups = memory.readbytesigned(0x020048eb)
  68. ultrasyrups = memory.readbytesigned(0x020048ec)
  69. maxsyrups = memory.readbytesigned(0x020048ed)
  70. ONEups = memory.readbytesigned(0x020048ee)
  71. ONEupDXs = memory.readbytesigned(0x020048ef)
  72. goldmushrooms = memory.readbytesigned(0x020048f0)
  73. herbs = memory.readbytesigned(0x020048f1)
  74. redpeppers = memory.readbytesigned(0x020048f2)
  75. greenpeppers = memory.readbytesigned(0x020048f3)
  76. ahastraights = memory.readbytesigned(0x020048f4)
  77. ufustraights = memory.readbytesigned(0x020048f5)
  78. gerastraights = memory.readbytesigned(0x020048f6)
  79. dehestraights = memory.readbytesigned(0x020048f7)
  80. ufumanjaros = memory.readbytesigned(0x020048f8)
  81. gerapuccinos = memory.readbytesigned(0x020048f9)
  82. dehepressos = memory.readbytesigned(0x020048fa)
  83.  
  84. ahabeans = memory.readbyte(0x02004902)
  85. ufubeans = memory.readbyte(0x02004903)
  86. gerabeans = memory.readbyte(0x02004904)
  87. dehebeans = memory.readbyte(0x02004905)
  88.  
  89.  
  90.  
  91. --TODO: CLOTHES
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99. --Mario
  100. HPM = memory.readword(0x02004866)
  101. HPmaxM = memory.readword(0x0200486A)
  102. BPM = memory.readword(0x0200486c)
  103. BPmaxM = memory.readword(0x02004870)
  104. PowM = memory.readword(0x02004874)
  105. DefM = memory.readword(0x0200487c)
  106. SpeedM = memory.readword(0x02004878)
  107. HigeM = memory.readword(0x02004880)
  108. levelM = memory.readbyte(0x02004888)
  109. ExpM = memory.readword(0x0200485c)
  110.  
  111.  
  112. -- This calculates how much experience you have to get for the next level.
  113. -- The NextM/NextL values seem to be hardcoded into the game.
  114. NextM = 0
  115. if levelM == 1 then NextM = 7
  116.  
  117. elseif levelM == 2 then NextM = 32
  118. elseif levelM == 3 then NextM = 68
  119. elseif levelM == 4 then NextM = 108
  120. elseif levelM == 5 then NextM = 218
  121. elseif levelM == 6 then NextM = 336
  122. elseif levelM == 7 then NextM = 470
  123. elseif levelM == 8 then NextM = 694
  124. elseif levelM == 9 then NextM = 962
  125. elseif levelM == 10 then NextM = 1254
  126. elseif levelM == 11 then NextM = 1578
  127. elseif levelM == 12 then NextM = 1924
  128. elseif levelM == 13 then NextM = 2306
  129. elseif levelM == 14 then NextM = 2756
  130. elseif levelM == 15 then NextM = 3256
  131. elseif levelM == 16 then NextM = 3830
  132. elseif levelM == 17 then NextM = 4480
  133. elseif levelM == 18 then NextM = 5195
  134. elseif levelM == 19 then NextM = 5975
  135. elseif levelM == 20 then NextM = 6845
  136. else NextM = 0 end
  137.  
  138. NextexpM = NextM - ExpM
  139.  
  140. --Luigi
  141. HPL = memory.readword(0x020048a2)
  142. HPmaxL = memory.readword(0x020048a6)
  143. BPL = memory.readword(0x020048a8)
  144. BPmaxL = memory.readword(0x020048ac)
  145. PowL = memory.readword(0x020048b0)
  146. DefL = memory.readword(0x020048b8)
  147. SpeedL = memory.readword(0x020048b4)
  148. HigeL = memory.readword(0x020048bc)
  149. levelL = memory.readbyte(0x020048c4)
  150. ExpL = memory.readword(0x02004898)
  151.  
  152. -- 'Next' calculator
  153. NextL = 0
  154. if levelL == 1 then NextL = 10
  155. elseif levelL == 2 then NextL = 37
  156. elseif levelL == 3 then NextL = 77
  157. elseif levelL == 4 then NextL = 123
  158. elseif levelL == 5 then NextL = 233
  159. elseif levelL == 6 then NextL = 353
  160. elseif levelL == 7 then NextL = 493
  161. elseif levelL == 8 then NextL = 699
  162. elseif levelL == 9 then NextL = 969
  163. elseif levelL == 10 then NextL = 1272
  164. elseif levelL == 11 then NextL = 1552
  165. elseif levelL == 12 then NextL = 1898
  166. elseif levelL == 13 then NextL = 2280
  167. elseif levelL == 14 then NextL = 2730
  168. elseif levelL == 15 then NextL = 3239
  169. elseif levelL == 16 then NextL = 3813
  170. elseif levelL == 17 then NextL = 4463
  171. elseif levelL == 18 then NextL = 5178
  172. elseif levelL == 19 then NextL = 5958
  173. elseif levelL == 20 then NextL = 6858
  174. elseif levelL == 20 then NextL = 6845
  175. else NextL = 0 end
  176.  
  177. NextexpL = NextL - ExpL
  178.  
  179.  
  180. -- display
  181. if mushrooms == -1 then mushrooms = 0 end
  182. if supermushrooms == -1 then supermushrooms = 0 end
  183. if ultramushrooms == -1 then ultramushrooms = 0 end
  184. if maxmushrooms == -1 then maxmushrooms = 0 end
  185. if nuts == -1 then nuts = 0 end
  186. if supernuts == -1 then supernuts = 0 end
  187. if ultranuts == -1 then ultranuts = 0 end
  188. if maxnuts == -1 then maxnuts = 0 end
  189. if syrups == -1 then syrups = 0 end
  190. if supersyrups == -1 then supersyrups = 0 end
  191. if ultrasyrups == -1 then ultrasyrups = 0 end
  192. if maxsyrups == -1 then maxsyrups = 0 end
  193. if ONEups == -1 then ONEups = 0 end
  194. if ONEupDXs == -1 then ONEupDXs = 0 end
  195. if redpeppers == -1 then redpeppers = 0 end
  196. if greenpeppers == -1 then greenpeppers = 0 end
  197. if herbs == -1 then herbs = 0 end
  198. if goldmushrooms == -1 then goldmushrooms = 0 end
  199. if ahastraights == -1 then ahastraights = 0 end
  200. if ufustraights == -1 then ufustraights = 0 end
  201. if gerastraights == -1 then gerastraights = 0 end
  202. if dehestraights == -1 then dehestraights = 0 end
  203. if ufumanjaros == -1 then ufumanjaros = 0 end
  204. if gerapuccinos == -1 then gerapuccinos = 0 end
  205. if dehepressos == -1 then dehepressos = 0 end
  206. if ahabeans == -1 then ahabeans = 0 end
  207. if ufubeans == -1 then ufubeans = 0 end
  208. if gerabeans == -1 then gerabeans = 0 end
  209. if dehebeans == -1 then dehebeans = 0 end
  210.  
  211.  
  212. gui.text(18+x,1+y, mushrooms)
  213. gui.text(28+x,1+y, supermushrooms)
  214. gui.text(38+x,1+y, ultramushrooms)
  215. gui.text(48+x,1+y, maxmushrooms)
  216.  
  217. gui.text(166+x,1+y, "(" ..mushrooms*0.078 + supermushrooms*0.098 + ultramushrooms*0.117 + maxmushrooms*0.199 .. ")" , "yellow")
  218.  
  219. gui.text(18+x,7+y, nuts)
  220. gui.text(28+x,7+y, supernuts)
  221. gui.text(38+x,7+y, ultranuts)
  222. gui.text(48+x,7+y, maxnuts)
  223.  
  224. gui.text(18+x,13+y, syrups)
  225. gui.text(28+x,13+y, supersyrups)
  226. gui.text(38+x,13+y, ultrasyrups)
  227. gui.text(48+x,13+y, maxsyrups)
  228.  
  229. gui.text(57+x,1+y, "=" ..mushrooms*20+supermushrooms*50+ultramushrooms*110+maxmushrooms*280 ,"#81F7F3")
  230. gui.text(78+x,1+y, mushrooms*24+supermushrooms*60+ultramushrooms*100+maxmushrooms*180 ,"#ACFA58")
  231.  
  232. gui.text(57+x,7+y, "=" ..nuts*50+supernuts*120+ultranuts*260+maxnuts*340 , "#81f7f3")
  233. gui.text(78+x,7+y, nuts*50+supernuts*90+ultranuts*140+maxnuts*220 , "#acfa58")
  234.  
  235. gui.text(57+x,13+y, "=" ..syrups*24+supersyrups*50+ultrasyrups*80+maxsyrups*280 , "#81f7f3")
  236. gui.text(78+x,13+y, syrups*24+supersyrups*50+ultrasyrups*80+maxsyrups*150 , "#acfa58")
  237.  
  238.  
  239. gui.text(22+x,19+y, "=" ..ONEups*70+ONEupDXs*420+herbs*30+goldmushrooms*105+redpeppers*30+greenpeppers*30+ahastraights*100+ufustraights*100+gerastraights*100+dehestraights*100+ufumanjaros*100+gerapuccinos*100+dehepressos*100 , "#81f7f3")
  240. gui.text(43+x,19+y, ONEups*80+ONEupDXs*240+herbs*30+goldmushrooms*60+redpeppers*50+greenpeppers*50+ahastraights*100+ufustraights*100+gerastraights*100+dehestraights*100+ufumanjaros*100+gerapuccinos*100+dehepressos*100 , "#acfa58")
  241.  
  242. gui.text(67+x,19+y, "$" ..memory.readword(0x020048e0))
  243.  
  244. gui.text(100+x,1+y, "(M)", "#F78181")
  245. gui.text(134+x,1+y, "(L)", "#ACFA58")
  246. gui.text(112+x,1+y, "Lv" .. levelM)
  247. gui.text(146+x,1+y, "Lv" .. levelL)
  248. gui.text(100+x,7+y, "BP " .. BPM .. "/" .. BPmaxM .. " " .. BPL .. "/" .. BPmaxL)
  249. gui.text(100+x,13+y, "Pow " , "#F5A9A9")
  250. gui.text(100+x,19+y, "hige " , "#A9F5D0")
  251. gui.text(100+x,25+y, "NEXT ", "#A9D0F5")
  252. gui.text(120+x,13+y, PowM .. " " .. PowL)
  253. gui.text(120+x,19+y, HigeM .. " " .. HigeL)
  254. gui.text(120+x,25+y, NextexpM .. " " .. NextexpL)
  255.  
  256. --Bros Attacks counters
  257. SplashCounter = 20 - memory.readbyte(0x02004684)
  258. if SplashCounter < 0 then SplashCounter = 0 end
  259. BounceCounter = 8 - memory.readbyte(0x0200468c)
  260. if BounceCounter < 0 then BounceCounter = 0 end
  261. ChopperCounter = 32 - memory.readbyte(0x02004686)
  262. if ChopperCounter < 0 then ChopperCounter = 0 end
  263. KnockCounter = 43 - memory.readbyte(0x0200468e)
  264. if ChopperCounter < 0 then KnockCounter = 0 end
  265.  
  266.  
  267. gui.text(8+x,25+y, "S=".. SplashCounter)
  268. gui.text(28+x,25+y, "B=".. BounceCounter)
  269. gui.text(49+x,25+y, "C=".. ChopperCounter)
  270. gui.text(71+x,25+y, "K=".. KnockCounter)
  271.  
  272. -- Boss HP
  273. gui.opacity(1.00)
  274. gui.text(8+x,34+y, "[ Boss HP " .. memory.readbyte(0x0200a912) .. " ]")
  275.  
  276.  
  277. -- CORRECTIONS --
  278. -- Since Bros Rock was collected, but not required, it shouldn't have been
  279. -- along the items that were sold. Due to this mistake, memory address values
  280. -- now need to be changed.
  281.  
  282. -- reduces coins by 2.
  283. if vba.framecount() == 500000 then
  284. memory.writeword(0x020048E0, (memory.readword(0x020048E0)-2))
  285. end
  286.  
  287. -- reduces mushrooms by 4.
  288. if vba.framecount() == 500000 then
  289. memory.writebyte(0x020048e2, (memory.readbyte(0x020048E2)-4))
  290. end
  291.  
  292.  
  293. vba.frameadvance()
  294. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement