Advertisement
Guest User

DC Emulator Code

a guest
Feb 26th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.85 KB | None | 0 0
  1. ;=================================================
  2. ; function SendRound
  3. ; Description: this function sends the default bloon
  4. ; lineup for a given round.
  5. ; Variables:
  6. ; $r: the number of the round to be sent.
  7. ; Example: to send round 7, call
  8. ; SendRound(7)
  9. ; TODO: still needs rounds 51+
  10. ;=================================================
  11. func SendRound($r)
  12. ; notify the user which round is being sent.
  13. GUICtrlSetData($Group_Status, "Sending Round " & String($r))
  14.  
  15. ; reset income, counters and labels from any previous rounds.
  16. $income = 0;
  17. For $i = 0 to 12
  18. $counters[$i] = 0
  19. Next
  20. For $i = 0 to 5
  21. GUICtrlSetData($Label_Status[$i],"")
  22. Next
  23.  
  24. ; set global $round used for income multipliers
  25. $round = $r
  26.  
  27. ; send the appropriate bloons for the round selected.
  28. Select
  29. case $r = 0
  30. TrayTip("Program ", " closing", 1000)
  31.  
  32. case $r = 1
  33. SetLabelControls($red)
  34. SendBloons(20, $red, 0, 933)
  35. SleepFF(18660)
  36.  
  37. case $r = 2
  38. SetLabelControls($red)
  39. SendBloons(30, $red, 0, 566)
  40. SleepFF(16980)
  41.  
  42. case $r = 3
  43. SetLabelControls($red, $blue)
  44. SendBloons(20, $red, 0, 566)
  45. SendBloons(5, $blue, 5000, 566)
  46. SleepFF(5000)
  47.  
  48. case $r = 4
  49. SetLabelControls($red, $blue)
  50. SendBloons(20, $red, 0, 566)
  51. SendBloons(15, $blue, 11366, 566)
  52. SendBloons(10, $red, 8500, 333)
  53. SleepFF(3330)
  54.  
  55. case $r = 5
  56. SetLabelControls($blue, $red)
  57. SendBloons(10, $blue, 0, 566)
  58. SendBloons(5, $red, 5133, 566)
  59. SendBloons(15, $blue, 2866, 566)
  60. SleepFF(8490)
  61.  
  62. case $r = 6
  63. SetLabelControls($green, $red, $blue)
  64. SendBloons(4, $green, 0, 566)
  65. SendBloons(15, $red, 2333, 566)
  66. SendBloons(15, $blue, 8566, 566)
  67. SleepFF(8490)
  68.  
  69. case $r = 7
  70. SetLabelControls($blue, $green, $red)
  71. SendBloons(10, $blue, 0, 566)
  72. SendBloons(5, $green, 5700, 1233)
  73. SendBloons(20, $red, 6100, 500)
  74. SendBloons(15, $blue, 0, 283)
  75. SleepFF(4245)
  76.  
  77. case $r = 8
  78. SetLabelControls($blue, $green, $red)
  79. SendBloons(20, $blue, 0, 566)
  80. SendBloons(2, $green, 11333, 566)
  81. SendBloons(10, $red, 733, 233)
  82. SendBloons(12, $green, 6233, 966)
  83. SleepFF(12000)
  84.  
  85. case $r = 9
  86. SetLabelControls($green)
  87. SendBloons(30, $green, 0, 666)
  88. SleepFF(20000)
  89.  
  90. case $r = 10
  91. SetLabelControls($blue)
  92. SendBloons(60, $blue, 0, 600)
  93. SendBloons(20, $blue, 35000, 466)
  94. SendBloons(22, $blue, 9000, 166)
  95. SleepFF(3652)
  96.  
  97. case $r = 11
  98. SetLabelControls($yellow, $green, $blue)
  99. SendBloons(2, $yellow, 0, 566)
  100. SendBloons(10, $green, 3800, 566)
  101. SendBloons(10, $blue, 6433, 433)
  102. SendBloons(12, $red, 3366, 500)
  103. SleepFF(6000)
  104.  
  105. case $r = 12
  106. SetLabelControls($green, $blue, $yellow)
  107. SendBloons(10, $green, 0, 566)
  108. SendBloons(15, $blue, 5700, 433)
  109. SendBloons(5, $yellow, 13700, 766)
  110. SleepFF(3830)
  111.  
  112. case $r = 13
  113. SetLabelControls($red, $yellow, $green)
  114. SendBloons(100, $red, 0, 266)
  115. SendBloons(4, $yellow, 11433, 450)
  116. SendBloons(23, $green, 5700, 566)
  117. SleepFF(13018)
  118.  
  119. case $r = 14
  120. SetLabelControls($red, $blue, $green, $yellow)
  121. SendBloons(49, $red, 0, 566)
  122. SendBloons(5, $blue, 2850, 266)
  123. SendBloons(5, $green, 2850, 266)
  124. SendBloons(5, $yellow, 2850, 333)
  125. SendBloons(10, $blue, 7400, 166)
  126. SendBloons(5, $green, 3866, 333)
  127. SendBloons(5, $yellow, 3866, 400)
  128. SleepFF(5000)
  129.  
  130. case $r = 15
  131. SetLabelControls($red, $pink, $green)
  132. SendBloons(20, $red, 0, 566)
  133. SendBloons(3, $pink, 12433, 433)
  134. SendBloons(12, $green, 2700, 566)
  135. SendBloons(5, $yellow, 8000, 666)
  136. SleepFF(3330)
  137.  
  138. case $r = 16
  139. SetLabelControls($green, $pink, $yellow)
  140. SendBloons(20, $green, 0, 566)
  141. SendBloons(4, $pink, 1667, 4866)
  142. SendBloons(8, $yellow, 11900, 200)
  143. SleepFF(10000)
  144.  
  145. case $r = 17
  146. SetLabelControls($yellow) ; TODO: these 8 yellows should be regrowth.
  147. SendBloons(8, $yellow, 0, 566)
  148. SleepFF(4528)
  149.  
  150. case $r = 18
  151. SetLabelControls($green)
  152. SendBloons(60, $green, 0, 433)
  153. SendBloons(20, $green, 26000, 100)
  154. SleepFF(2000)
  155.  
  156. case $r = 19
  157. SetLabelControls($green, $yellow, $pink)
  158. SendBloons(10, $green, 0, 300)
  159. SendBloons(5, $yellow, 2333, 566) ;TODO: these 5 yellows should be regrowth
  160. SendBloons(7, $pink, 3633, 1266)
  161. SendBloons(4, $yellow, 7533, 566)
  162. SleepFF(3000)
  163.  
  164. case $r = 20
  165. SetLabelControls($black)
  166. SendBloons(6, $black, 0, 1000)
  167. SleepFF(6000)
  168.  
  169. case $r = 21
  170. SetLabelControls($pink)
  171. SendBloons(14, $pink, 0, 550)
  172. SleepFF(7700)
  173.  
  174. case $r = 22
  175. SetLabelControls($white)
  176. Sendbloons(8, $white, 0, 666)
  177. SleepFF(5328)
  178.  
  179. case $r = 23
  180. SetLabelControls($black, $white)
  181. Sendbloons(5, $black, 0, 500)
  182. Sendbloons(4, $white, 5766, 600)
  183. SleepFF(2400)
  184.  
  185. case $r = 24
  186. SetLabelControls($green)
  187. SendBloons(1, $green, 0, 0); TODO: this should be camo
  188.  
  189. case $r = 25
  190. SetLabelControls($yellow)
  191. SendBloons(31, $yellow, 0, 566) ; TODO: these should be regrowth
  192. SleepFF(17546)
  193.  
  194. case $r = 26
  195. SetLabelControls($pink, $zebra)
  196. SendBloons(23, $pink, 0, 400)
  197. SendBloons(4, $zebra, 11000, 1133)
  198. SleepFF(4532)
  199.  
  200. case $r = 27
  201. SetLabelControls($yellow, $green, $blue, $red)
  202. SendBloons(45, $yellow, 0, 175)
  203. SendBloons(45, $green, 9433, 166)
  204. SendBloons(55, $blue, 9566, 100)
  205. SendBloons(120, $red, 5566, 66)
  206. SleepFF(8000)
  207.  
  208. case $r = 28
  209. SetLabelControls($lead)
  210. SendBloons(4, $lead, 0, 1333)
  211. SleepFF(5332)
  212.  
  213. case $r = 29
  214. SetLabelControls($yellow, $pink)
  215. SendBloons(25, $yellow, 0, 366)
  216. SendBloons(12, $pink, 13500, 200); TODO: these pinks should be regrowth
  217. SleepFF(2400)
  218.  
  219. case $r = 30
  220. SetLabelControls($lead)
  221. SendBloons(8, $lead, 0, 1633)
  222. SleepFF(13064)
  223.  
  224. case $r = 31
  225. SetLabelControls($zebra)
  226. SendBloons(8, $zebra, 0, 733)
  227. SendBloons(2, $zebra, 5700, 1700) ;TODO: last two zebras should be regrowth
  228. SleepFF(3400)
  229.  
  230. case $r = 32
  231. SetLabelControls($black, $white, $lead)
  232. SendBloons(25, $black, 0, 566)
  233. SendBloons(28, $white, 14266, 600)
  234. SendBloons(8, $lead, 17133, 566)
  235. SleepFF(4528)
  236.  
  237. case $r = 33
  238. SetLabelControls($yellow)
  239. SendBloons(20, $yellow, 0, 1333) ; TODO: these should be camo
  240. SleepFF(26660)
  241.  
  242. case $r = 34
  243. SetLabelControls($yellow, $zebra)
  244. SendBloons(140, $yellow, 0, 250)
  245. SendBloons(5, $zebra, 7500, 4500)
  246. SleepFF(35000)
  247.  
  248. case $r = 35
  249. SetLabelControls($white, $rainbow, $pink)
  250. SendBloons(25, $white, 0, 433)
  251. SendBloons(5, $rainbow, 14333, 566)
  252. SendBloons(35, $pink, 4866, 200)
  253. SleepFF(7000)
  254.  
  255. case $r = 36
  256. SetLabelControls($pink)
  257. SendBloons(20, $pink, 0, 66)
  258. SendBloons(20, $pink, 8416, 66)
  259. SendBloons(41, $pink, 8500, 66)
  260. SleepFF(2706)
  261.  
  262. case $r = 37
  263. SetLabelControls($black, $white, $lead, $zebra)
  264. SendBloons(20, $black, 0, 566)
  265. SendBloons(20, $white, 11333, 566)
  266. SendBloons(15, $lead, 11333, 566)
  267. SendBloons(10, $zebra, 8500, 566)
  268. SendBloons(7, $white, 10500, 266); TODO these 7 white should be camo
  269. SleepFF(1862)
  270.  
  271. case $r = 38
  272. SetLabelControls($white, $pink, $lead, $zebra, $rainbow)
  273. SendBloons(17, $white, 0, 233)
  274. SendBloons(42, $pink, 2000, 566)
  275. SendBloons(14, $lead, 2833, 666)
  276. SendBloons(10, $zebra, 7266, 700)
  277. SendBloons(4, $rainbow, 13633, 966)
  278. SleepFF(4000)
  279.  
  280. case $r = 39
  281. SetLabelControls($black, $white, $lead, $zebra, $rainbow)
  282. SendBloons(10, $black, 0, 566)
  283. SendBloons(10, $white, 5700, 566)
  284. SendBloons(20, $lead, 5700, 566)
  285. SendBloons(20, $zebra, 11433, 566)
  286. SendBloons(18, $rainbow, 11433, 566)
  287. SleepFF(10188)
  288.  
  289. case $r = 40
  290. SetLabelControls($rainbow, $ceramic)
  291. SendBloons(10, $rainbow, 0, 566)
  292. SendBloons(4, $ceramic, 8000, 566)
  293. SleepFF(2264)
  294.  
  295. case $r = 41
  296. SetLabelControls($black, $zebra)
  297. SendBloons(60, $black, 0, 333)
  298. SendBloons(10, $zebra, 18845, 466)
  299. SleepFF(4660)
  300.  
  301. case $r = 42
  302. SetLabelControls($rainbow)
  303. SendBloons(6, $rainbow, 0, 1000);TODO: these 6 rainbow should be regrowth
  304. SendBloons(6, $rainbow, 6000, 1000);TODO: these 6 rainbow should be camo
  305. SleepFF(6000)
  306.  
  307. case $r = 43
  308. SetLabelControls($rainbow, $ceramic)
  309. SendBloons(10, $rainbow, 0, 566)
  310. SendBloons(7, $ceramic, 5700, 600)
  311. SleepFF(4200)
  312.  
  313. case $r = 44
  314. SetLabelControls($zebra)
  315. SendBloons(10, $zebra, 0, 1100)
  316. SendBloons(10, $zebra, 10366, 766)
  317. SendBloons(10, $zebra, 7333, 433)
  318. SendBloons(10, $zebra, 4066, 233)
  319. SendBloons(10, $zebra, 2333, 100)
  320. SleepFF(1000)
  321.  
  322.  
  323. case $r = 45
  324. SetLabelControls($rainbow, $pink, $lead)
  325. SendBloons(25, $rainbow, 0, 566)
  326. SendBloons(200, $pink, 14266, 300) ; unexpected, but accurate
  327. SendBloons(8, $lead, 60725, 566)
  328. SleepFF(5333)
  329.  
  330. case $r = 46
  331. SetLabelControls($moab)
  332. SendBloons(1, $moab, 0, 0)
  333.  
  334. case $r = 47
  335. SetLabelControls($ceramic, $pink)
  336. SendBloons(12, $ceramic, 0, 566)
  337. SendBloons(70, $pink, 6500, 266) ; TODO: these 70 pinks should be camo
  338. SleepFF(18666);
  339.  
  340. case $r = 48
  341. SetLabelControls($pink, $rainbow)
  342. SendBloons(120, $pink, 0, 333) ; TODO: these 120 pink should be regrowth
  343. SendBloons(50, $rainbow, 39683, 466)
  344. SleepFF(23300)
  345.  
  346. case $r = 49
  347. SetLabelControls($green, $rainbow, $ceramic, $zebra)
  348. SendBloons(343, $green, 0, 175)
  349. SendBloons(10, $rainbow, 4200, 600)
  350. SendBloons(18, $ceramic, 12200, 400)
  351. SendBloons(20, $zebra, 14400, 200)
  352. SendBloons(10, $rainbow, 15000, 600)
  353. SendBloons(10, $rainbow, 0, 600) ; TODO: these 10 rainbow should be regrowth
  354. SleepFF(14500)
  355.  
  356. case $r = 50
  357. SetLabelControls($moab, $lead, $red, $ceramic)
  358. SendBloons(1, $moab, 0, 0)
  359. SendBloons(8, $lead, 566, 566)
  360. SendBloons(20, $red, 9300, 66)
  361. SendBloons(20, $ceramic, 6600, 566)
  362. SendBloons(1, $moab, 11320, 0)
  363. SleepFF(1000)
  364.  
  365. case $r = 51
  366. SetLabelControls($ceramic, $rainbow)
  367. SendBloons(28, $ceramic, 0, 566)
  368. SendBloons(10, $rainbow, 15600, 566); TODO: these should be regrowth
  369. SleepFF(5666)
  370.  
  371. case $r = 52
  372. SetLabelControls($rainbow, $moab, $ceramic)
  373. SendBloons(25, $rainbow, 0, 566)
  374. SendBloons(2, $moab, 14266, 3450)
  375. SendBloons(5, $ceramic, 566, 566)
  376. SendBloons(5, $ceramic, 3400, 566)
  377. SleepFF(2830)
  378.  
  379. case $r = 53
  380. SetLabelControls($pink, $moab)
  381. SendBloons(80, $pink, 0, 566); TODO: these should be camo
  382. SendBloons(3, $moab, 28000, 2600);
  383. SleepFF(17280)
  384.  
  385. case $r = 54
  386. SetLabelControls($ceramic, $moab)
  387. SendBloons(35, $ceramic, 0, 600)
  388. SendBloons(2, $moab, 5766, 6233)
  389. SleepFF(15234)
  390.  
  391. case $r = 55
  392. SetLabelControls($ceramic, $moab)
  393. SendBloons(10, $ceramic, 0, 185)
  394. SendBloons(10, $ceramic, 7000, 166)
  395. SendBloons(10, $ceramic, 7000, 166)
  396. SendBloons(15, $ceramic, 8200, 66)
  397. SendBloons(1, $moab, 6800, 0)
  398. SleepFF(1000)
  399.  
  400. case $r = 56
  401. SetLabelControls($rainbow, $moab)
  402. SendBloons(40, $rainbow, 0, 320); TODO: these should be Regrowth
  403. SendBloons(1, $moab, 15166, 0)
  404. SleepFF(1000)
  405.  
  406. case $r = 57
  407. SetLabelControls($moab, $rainbow)
  408. SendBloons(2, $moab, 0, 566)
  409. SendBloons(40, $rainbow, 1000, 650)
  410. SendBloons(2, $moab, 12200, 566)
  411. SleepFF(1200)
  412.  
  413. case $r = 58
  414. SetLabelControls($moab, $ceramic)
  415. SendBloons(5, $moab, 0, 8800)
  416. SendBloons(29, $ceramic, 300, 1533)
  417. SleepFF(44000)
  418.  
  419. case $r = 59
  420. SetLabelControls($ceramic, $lead)
  421. SendBloons(50, $ceramic, 0, 583)
  422. Sendbloons(28, $lead, 10166, 275); TODO: these should be camo
  423. SleepFF(18987)
  424.  
  425. case $r = 60
  426. SetLabelControls($bfb)
  427. SendBloons(1, $bfb, 0, 0)
  428.  
  429. case $r = 61
  430. SetLabelControls($zebra, $moab)
  431. SendBloons(150, $zebra, 0, 133); TODO: these should be Regrowth
  432. Sendbloons(5, $moab, 1533, 1917)
  433. SleepFF(18467)
  434.  
  435. case $r = 62
  436. SetLabelControls($pink, $rainbow, $moab)
  437. SendBloons(6, $moab, 0, 5000)
  438. Sendbloons(300, $pink, 200, 200); TODO: these should be camo
  439. SendBloons(15, $rainbow, 50000, 566); TODO: these should be camo + regrowth
  440. SleepFF(8500)
  441.  
  442. case $r = 63
  443. SetLabelControls($lead, $ceramic)
  444. SendBloons(75, $lead, 0, 600)
  445. Sendbloons(40, $ceramic, 3866, 5)
  446. Sendbloons(40, $ceramic, 16166, 5)
  447. Sendbloons(42, $ceramic, 16166, 5)
  448. SleepFF(8802)
  449.  
  450. case $r = 64
  451. SetLabelControls($moab)
  452. SendBloons(9, $moab, 0, 716)
  453. SleepFF(6444)
  454.  
  455. case $r = 65
  456. SetLabelControls($zebra, $rainbow, $ceramic, $moab, $bfb)
  457. SendBloons(100, $zebra, 0, 333)
  458. Sendbloons(70, $rainbow, 32600, 200)
  459. Sendbloons(50, $ceramic, 14733, 233)
  460. Sendbloons(3, $moab, 11250, 566)
  461. Sendbloons(2, $bfb, 2000, 1000)
  462. SleepFF(2000)
  463.  
  464. case $r = 66
  465. SetLabelControls($moab)
  466. Sendbloons(2, $moab, 0, 500)
  467. Sendbloons(2, $moab, 7000, 500)
  468. Sendbloons(4, $moab, 7000, 333)
  469. Sendbloons(4, $moab, 6833, 250)
  470. SleepFF(1000)
  471.  
  472. case $r = 67
  473. SetLabelControls($ceramic, $moab)
  474. Sendbloons(5, $moab, 0, 566)
  475. SendBloons(15, $ceramic, 9100, 566)
  476. Sendbloons(5, $moab, 15000, 566)
  477. SleepFF(8802)
  478.  
  479. case $r = 68
  480. SetLabelControls($moab, $bfb)
  481. Sendbloons(4, $moab, 0, 566)
  482. SendBloons(1, $bfb, 0, 7433)
  483. SleepFF(7433)
  484.  
  485. case $r = 69
  486. SetLabelControls($lead, $ceramic)
  487. Sendbloons(60, $lead, 0, 166)
  488. SendBloons(70, $ceramic, 17100, 566); TODO: these should be regrowth
  489. SleepFF(39620)
  490.  
  491. case $r = 70; pixelchecked - hard
  492. SetLabelControls($rainbow, $moab)
  493. SendBloons(200, $rainbow, 0, 200); TODO: these should be camo
  494. Sendbloons(4, $moab, 40000, 566)
  495. SleepFF(42264)
  496.  
  497. case $r = 71
  498. SetLabelControls($ceramic, $moab)
  499. SendBloons(30, $ceramic, 0, 566)
  500. Sendbloons(10, $moab, 4416, 566)
  501. SleepFF(12564)
  502.  
  503. case $r = 72
  504. SetLabelControls($ceramic, $bfb)
  505. SendBloons(38, $ceramic, 0, 566); TODO: these should be regrowth
  506. Sendbloons(2, $bfb, 12700, 566)
  507. SleepFF(1200)
  508.  
  509. case $r = 73
  510. SetLabelControls($moab, $bfb)
  511. SendBloons(7, $moab, 0, 566)
  512. Sendbloons(3, $bfb, 13400, 566)
  513. SendBloons(2, $moab, 13000, 566)
  514. SleepFF(1200)
  515.  
  516. case $r = 74
  517. SetLabelControls($ceramic, $bfb)
  518. SendBloons(100, $ceramic, 0, 566)
  519. Sendbloons(1, $bfb, 41433, 0)
  520. SendBloons(100, $ceramic, 15000, 266)
  521. SleepFF(26600)
  522.  
  523. case $r = 75
  524. SetLabelControls($lead, $moab, $bfb)
  525. Sendbloons(3, $bfb, 0, 9700)
  526. SendBloons(14, $lead, 566, 566)
  527. SendBloons(2, $moab, 8000, 566)
  528. SendBloons(14, $lead, 566, 566)
  529. SendBloons(2, $moab, 8000, 566)
  530. SleepFF(1200)
  531.  
  532. case $r = 76
  533. SetLabelControls($ceramic); TODO: these ceramic should be regrowth.
  534. SendBloons(60, $ceramic, 0, 33)
  535. SleepFF(2000)
  536.  
  537. case $r = 77
  538. SetLabelControls($moab, $bfb)
  539. SendBloons(14, $moab, 0, 4600)
  540. Sendbloons(5, $bfb, 26666, 1166)
  541. SleepFF(33333)
  542.  
  543. case $r = 78
  544. SetLabelControls($moab, $bfb)
  545. SendBloons(150, $rainbow, 0, 566)
  546. SendBloons(75, $ceramic, 10000, 16)
  547. Sendbloons(1, $bfb, 34000, 1166)
  548. SendBloons(72, $ceramic, 34000, 16); TODO: these should be camo
  549. SleepFF(12000)
  550.  
  551. case $r = 79
  552. SetLabelControls($rainbow, $bfb)
  553. SendBloons(500, $rainbow, 0, 133); TODO: these should be regrowth
  554. Sendbloons(7, $bfb, 3166, 8833)
  555. SleepFF(5000)
  556.  
  557. case $r = 80
  558. SetLabelControls($moab)
  559. SendBloons(31, $moab, 0, 666)
  560. SleepFF(20646)
  561.  
  562. case $r = 81
  563. SetLabelControls($bfb)
  564. SendBloons(9, $bfb, 0, 2500)
  565. SleepFF(22500)
  566.  
  567. case $r = 82
  568. SetLabelControls($rainbow, $bfb)
  569. SendBloons(400, $rainbow, 0, 166); TODO: these should be camo + regrowth
  570. Sendbloons(10, $bfb, 0, 533)
  571. SleepFF(60000)
  572.  
  573. case $r = 83
  574. SetLabelControls($ceramic, $moab)
  575. SendBloons(50, $ceramic, 0, 1000)
  576. SendBloons(50, $ceramic, 100, 1000)
  577. SendBloons(50, $ceramic, 200, 1000)
  578. Sendbloons(30, $moab, 10000, 333)
  579. SleepFF(40000)
  580.  
  581. case $r = 84
  582. SetLabelControls($moab, $bfb)
  583. SendBloons(50, $moab, 200, 1000)
  584. Sendbloons(10, $bfb, 10000, 333)
  585. SleepFF(40000)
  586.  
  587. case $r = 85
  588. SetLabelControls($zomg)
  589. SendBloons(1, $zomg, 0, 0)
  590.  
  591. case Else
  592. MsgBox(0, "Error", "unknown round entered");
  593. EndSelect
  594.  
  595. ; notify the user round is complete.
  596. GUICtrlSetData($Group_Status, "Round " & String($r) & " complete.")
  597. $income = $income + 99 + $r; end of round bonus cash
  598. GUICtrlSetData($Label_Money, "$" & String(GUICtrlRead($Input_Money) + floor($income)))
  599. Sleep(500)
  600. EndFunc
  601.  
  602. ;=================================================
  603. ; function SendBloons
  604. ; Description: this function sends one or more bloons.
  605. ; Variables:
  606. ; $number: the number of bloons to send.
  607. ; $bloon: the unmodified base bloon sent.
  608. ; $first: the time in milliseconds to wait before sending in the first bloon.
  609. ; $delay: the delay in milliseconds between bloons.
  610. ; Example: to send 20 red bloons each 1 second apart, call SendBloons(20, 0, 1000)
  611. ;=================================================
  612. func SendBloons($number, $bloon, $first, $delay)
  613. $modifiedBloon = $bloon + $modifiers[$bloon]
  614. if $speed = 3 then
  615. $first = round($first / 3)
  616. $delay = round($delay / 3)
  617. EndIf
  618. sleep($first)
  619.  
  620. ; send the first bloon without delay
  621. Select
  622. case $modifiedBloon = $red
  623. send("1")
  624. case $modifiedBloon = $blue
  625. send("2")
  626. case $modifiedBloon = $green
  627. send("3")
  628. case $modifiedBloon = $yellow
  629. send("4")
  630. case $modifiedBloon = $pink
  631. send("5")
  632. case $modifiedBloon = $black
  633. send("6")
  634. case $modifiedBloon = $white
  635. send("7")
  636. case $modifiedBloon = $lead
  637. send("8")
  638. case $modifiedBloon = $zebra
  639. send("9")
  640. case $modifiedBloon = $rainbow
  641. send("0")
  642. case $modifiedBloon = $ceramic
  643. send("u")
  644. case $modifiedBloon = $moab
  645. send("i")
  646. case $modifiedBloon = $bfb
  647. send("o")
  648. case else
  649. send("p")
  650. EndSelect
  651. CountBloon($modifiedBloon) ; count the sent bloon
  652.  
  653. ; set up timers to send any remaining bloons
  654. if $number > 1 then
  655. Select
  656. case $modifiedBloon = $red
  657. _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendRed"))
  658. _ArrayAdd($arrayTimerCountDowns, $number - 1)
  659. case $modifiedBloon = $blue
  660. _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendBlue"))
  661. _ArrayAdd($arrayTimerCountDowns, $number - 1)
  662. case $modifiedBloon = $green
  663. _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendGreen"))
  664. _ArrayAdd($arrayTimerCountDowns, $number - 1)
  665. case $modifiedBloon = $yellow
  666. _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendYellow"))
  667. _ArrayAdd($arrayTimerCountDowns, $number - 1)
  668. case $modifiedBloon = $pink
  669. _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendPink"))
  670. _ArrayAdd($arrayTimerCountDowns, $number - 1)
  671. case $modifiedBloon = $black
  672. _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendBlack"))
  673. _ArrayAdd($arrayTimerCountDowns, $number - 1)
  674. case $modifiedBloon = $white
  675. _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendWhite"))
  676. _ArrayAdd($arrayTimerCountDowns, $number - 1)
  677. case $modifiedBloon = $lead
  678. _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendLead"))
  679. _ArrayAdd($arrayTimerCountDowns, $number - 1)
  680. case $modifiedBloon = $zebra
  681. _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendZebra"))
  682. _ArrayAdd($arrayTimerCountDowns, $number - 1)
  683. case $modifiedBloon = $rainbow
  684. _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendRainbow"))
  685. _ArrayAdd($arrayTimerCountDowns, $number - 1)
  686. case $modifiedBloon = $ceramic
  687. _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendCeramic"))
  688. _ArrayAdd($arrayTimerCountDowns, $number - 1)
  689. case $modifiedBloon = $moab
  690. _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendMOAB"))
  691. _ArrayAdd($arrayTimerCountDowns, $number - 1)
  692. case $modifiedBloon = $bfb
  693. _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendBFB"))
  694. _ArrayAdd($arrayTimerCountDowns, $number - 1)
  695. case else
  696. _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendZOMG"))
  697. _ArrayAdd($arrayTimerCountDowns, $number - 1)
  698. EndSelect
  699. EndIf
  700.  
  701. EndFunc
  702.  
  703. ;=================================================
  704. ; function SleepFF($delay)
  705. ; modified version of Sleep($delay)
  706. ; if the user is using Fast Forward mode Then
  707. ; sleep delays will be appropriately shorter.
  708. ;=================================================
  709. func SleepFF($delay)
  710. if $speed = 1 then
  711. Sleep($delay)
  712. else
  713. Sleep(round($delay / $speed))
  714. EndIf
  715. EndFunc
  716.  
  717. ;=================================================
  718. ; function SetLabelControls
  719. ; this function sets up which labels in the status GUI
  720. ; will display updates for each group of bloons.
  721. ; variables:
  722. ; $groupX indicates the type of bloon being sent in a given group of SendBloons().
  723. ; inputs $group2 through $group6 are optional.
  724. ; for example, if a round first sends reds, then blues, Call
  725. ; SetLabelControls($red, $blue);
  726. ;=================================================
  727. func SetLabelControls($group1, $group2 = 14, $group3 = 14, $group4 = 14, $group5 = 14, $group6 = 14)
  728. $Label_Controls[$group1 + $modifiers[$group1]] = $Label_Status[0]
  729. if $group2 <> 14 then $Label_Controls[$group2 + $modifiers[$group2]] = $Label_Status[1]
  730. if $group3 <> 14 then $Label_Controls[$group3 + $modifiers[$group3]] = $Label_Status[2]
  731. if $group4 <> 14 then $Label_Controls[$group4 + $modifiers[$group4]] = $Label_Status[3]
  732. if $group5 <> 14 then $Label_Controls[$group5 + $modifiers[$group5]] = $Label_Status[4]
  733. if $group6 <> 14 then $Label_Controls[$group6 + $modifiers[$group6]] = $Label_Status[5]
  734. EndFunc
  735.  
  736. ;=================================================
  737. ; function CountBloon($bloon)
  738. ; keeps track of the count for bloons sent as well as the income generated
  739. ;=================================================
  740. func CountBloon($bloon)
  741. $counters[$bloon] += 1;
  742. GUICtrlSetData($Label_Controls[$bloon], $names[$bloon] & ": " & String($counters[$bloon]))
  743. If $round < 52 then
  744. $income += $baseValues[$bloon]
  745. elseif $round < 62 Then
  746. $income += $baseValues[$bloon] / 2
  747. elseif $round < 87 Then
  748. $income += $baseValues[$bloon] / 5
  749. elseif $round < 101 Then
  750. $income += $baseValues[$bloon] / 10
  751. else
  752. $income += $baseValues[$bloon] / 50
  753. EndIf
  754. GUICtrlSetData($Label_Money, "$" & String(GUICtrlRead($Input_Money) + floor($income)))
  755. EndFunc
  756.  
  757. ;=================================================
  758. ; functions HandleTimer($timerID)
  759. ; This function tests to see if a timer should expire by
  760. ; reducing it's associated countdown and killing the timer if all bloons have been sent.
  761. ;=================================================
  762. Func HandleTimer($timerID)
  763. $i = _ArraySearch($arrayTimerIDs, $timerID)
  764. if $i <> -1 Then
  765. $arrayTimerCountDowns[$i] -= 1
  766. If $arrayTimerCountDowns[$i] = 0 Then
  767. _Timer_KillTimer(0, $timerID)
  768. _ArrayDelete($arrayTimerIDs, $i)
  769. _ArrayDelete($arrayTimerCountDowns, $i)
  770. EndIf
  771. Else
  772. ConsoleWrite("Error, SendBloon from unknown timer ID: " & $timerID & @CRLF)
  773. EndIf
  774. EndFunc
  775.  
  776. ;=================================================
  777. ; functions SendX($a, $b, $timerID, $c)
  778. ; these functions are called by timers when bloon X is ready to be sent.
  779. ; $a, b & c are not used. $timerID is the timer calling the function.
  780. ;=================================================
  781. func SendRed($a, $b, $timerID, $c)
  782. send("1")
  783. CountBloon($red)
  784. HandleTimer($timerID)
  785. EndFunc
  786.  
  787. func SendBlue($a, $b, $timerID, $c)
  788. send("2")
  789. CountBloon($blue)
  790. HandleTimer($timerID)
  791. EndFunc
  792.  
  793. func SendGreen($a, $b, $timerID, $c)
  794. send("3")
  795. CountBloon($green)
  796. HandleTimer($timerID)
  797. EndFunc
  798.  
  799. func SendYellow($a, $b, $timerID, $c)
  800. send("4")
  801. CountBloon($yellow)
  802. HandleTimer($timerID)
  803. EndFunc
  804.  
  805. func SendPink($a, $b, $timerID, $c)
  806. send("5")
  807. CountBloon($pink)
  808. HandleTimer($timerID)
  809. EndFunc
  810.  
  811. func SendBlack($a, $b, $timerID, $c)
  812. send("6")
  813. CountBloon($black)
  814. HandleTimer($timerID)
  815. EndFunc
  816.  
  817. func SendWhite($a, $b, $timerID, $c)
  818. send("7")
  819. CountBloon($white)
  820. HandleTimer($timerID)
  821. EndFunc
  822.  
  823. func SendLead($a, $b, $timerID, $c)
  824. send("8")
  825. CountBloon($lead)
  826. HandleTimer($timerID)
  827. EndFunc
  828.  
  829. func SendZebra($a, $b, $timerID, $c)
  830. send("9")
  831. CountBloon($zebra)
  832. HandleTimer($timerID)
  833. EndFunc
  834.  
  835. func SendRainbow($a, $b, $timerID, $c)
  836. send("0")
  837. CountBloon($rainbow)
  838. HandleTimer($timerID)
  839. EndFunc
  840.  
  841. func SendCeramic($a, $b, $timerID, $c)
  842. send("u")
  843. CountBloon($ceramic)
  844. HandleTimer($timerID)
  845. EndFunc
  846.  
  847. func SendMOAB($a, $b, $timerID, $c)
  848. send("i")
  849. CountBloon($moab)
  850. HandleTimer($timerID)
  851. EndFunc
  852.  
  853. func SendBFB($a, $b, $timerID, $c)
  854. send("o")
  855. CountBloon($bfb)
  856. HandleTimer($timerID)
  857. EndFunc
  858.  
  859. func SendZOMG($a, $b, $timerID, $c)
  860. send("p")
  861. CountBloon($zomg)
  862. HandleTimer($timerID)
  863. EndFunc
  864.  
  865. ;=================================================
  866. ; function AdjustModifier
  867. ; this function is called to modify the RBE, for example, changing reds into blues.
  868. ; variables:
  869. ; $baseBloon: the base bloon being modified (i.e. red)
  870. ; $label: this is just the label on the GUI which will indicate the change.
  871. ; $adjustment: the amount to change the current modifier.
  872. ; while this function can accept any amount, the input currently will always be +1 or -1.
  873. ; example: to change reds to blues, Call AdjustModifier($red, $label_red, 1)
  874. ;=================================================
  875. Func AdjustModifier($baseBloon, ByRef $label, $adjustment)
  876. $modifiers[$baseBloon] = $modifiers[$baseBloon] + $adjustment
  877. if $modifiers[$baseBloon] + $baseBloon < 0 then $modifiers[$baseBloon] = 13 - $baseBloon
  878. If $modifiers[$baseBloon] + $baseBloon > 13 then $modifiers[$baseBloon] = 0 - $baseBloon
  879. GUICtrlSetData($label, $names[mod($baseBloon + $modifiers[$baseBloon], 14)])
  880. EndFunc
  881.  
  882. ;=================================================
  883. ; main function begins here.
  884. ; Essentially this just constructs the GUI, then loops endlessly until the user exits
  885. ; Terminate by closing the GUI.
  886. ; Important Note: In order for Bloons to be sent, focus must be on the BTD 5 Game, NOT the GUI.
  887. ;=================================================
  888. Main()
  889.  
  890. Func Main()
  891. Local $msg
  892.  
  893. ;=================================================
  894. ; Create the GUI
  895. ;=================================================
  896. GUICreate("BTD4 DCE", 150, 600, round(@DesktopWidth / 2) - 660, 200, -1, $WS_EX_TOPMOST)
  897. GUISetFont(9, 300)
  898.  
  899. GUICtrlCreateTab(0, 0, 150, 600)
  900. GUICtrlCreateTabItem("Round")
  901. GUICtrlSetState(-1, $GUI_SHOW) ; this tab will be displayed first
  902.  
  903. GUICtrlCreateGroup("Settings", 10, 40, 130, 140) ; 105
  904. $Radio_Easy = GUICtrlCreateRadio("Easy", 20, 60)
  905. $Radio_Medium = GUICtrlCreateRadio("Medium", 20, 85)
  906. $Radio_Hard = GUICtrlCreateRadio( "Hard", 20, 110)
  907. GUICtrlSetState($Radio_Hard, $GUI_CHECKED)
  908. $Checkbox_FastForward = GUICtrlCreateCheckbox("Fast Forward", 20, 145)
  909. $Button_Send = GUICtrlCreateButton("Send!", 10, 240, 130, 40)
  910. $Button_Stop = GUICtrlCreateButton("Stop", 10, 285, 130, 40)
  911.  
  912. ;=================================================
  913. ; Create the Round GUI (TODO: as more rounds are added, add them here as well)
  914. ;=================================================
  915. GUICtrlCreateGroup("", 10, 180, 130, 55)
  916. GUICtrlCreateLabel("Round:", 20, 200, 50, 20)
  917. $Combo_Round = GUICtrlCreateCombo("1", 70, 200, 60, 60)
  918. GUICtrlSetData(-1, "2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20", "1")
  919. GUICtrlSetData(-1, "21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36", "1")
  920. GUICtrlSetData(-1, "37|38|39|40|41|42|43|44|45|46|47|48|49|50", "1")
  921. GUICtrlSetData(-1, "51|52|53|54|55|56|57|58|59|60|61|62|63|64|65", "1")
  922. GUICtrlSetData(-1, "66|67|68|69|70|71|72|73|74|75|76|77|78|79", "1")
  923. GUICtrlSetData(-1, "80|81|82|83|84|85", "1")
  924.  
  925. ;=================================================
  926. ; Create the Income GUI
  927. ;=================================================
  928. GUICtrlCreateGroup("Income", 10, 330, 130, 115)
  929. GUICtrlCreateLabel("Start round with:", 20, 355, 110, 20)
  930. ; 0x0002 is just $ES_RIGHT alignment rather than left justified.
  931. ; 0x2000 is $ES_NUMBER which prevents non-numerical inputs.
  932. $Input_Money = GUICtrlCreateInput("0", 20, 375, 110, 20, 0x2002)
  933. GUICtrlCreateLabel("Current amount:", 20, 400, 110, 20)
  934. $Label_Money = GUICtrlCreateLabel("$0", 20, 420, 105, 20, 0x0002)
  935.  
  936. ;=================================================
  937. ; Create the Status GUI
  938. ;=================================================
  939. $Group_Status = GUICtrlCreateGroup("Status...", 10, 450, 130, 140)
  940. $Label_Status[0] = GUICtrlCreateLabel("Waiting for input", 20, 468, 110, 20, 0x0002)
  941. For $i = 1 to 5
  942. $Label_Status[$i] = GUICtrlCreateLabel("", 20, 468 + 20* $i, 110, 20, 0x0002)
  943. Next
  944.  
  945. ;=================================================
  946. ; Create the RBE modification tab
  947. ;=================================================
  948. GUICtrlCreateTabItem("RBE")
  949. For $i = 0 to 13
  950. GUICtrlCreateGroup($names[$i], 10, $i*40 + 30, 130, 40)
  951. $Label_Color[$i] = GUICtrlCreateLabel($names[$i], 50, $i * 40 + 46, 50, 20)
  952. $Button_Color_Down[$i] = GUICtrlCreateButton("-", 20, $i * 40 + 45, 20, 20)
  953. $Button_Color_Up[$i] = GUICtrlCreateButton("+", 110, $i * 40 + 45, 20, 20)
  954. Next
  955.  
  956. ;=================================================
  957. ; Create the Custom modification tab
  958. ;=================================================
  959. GUICtrlCreateTabItem("Custom")
  960. GUICtrlCreateGroup("Group 1", 10, 30, 130, 90)
  961. GUICtrlCreateLabel("Send:", 15, 50, 50, 20)
  962. $Combo_Group[0] = GUICtrlCreateCombo("red", 75, 46, 60, 60)
  963. GUICtrlSetData(-1, "blue|green|yellow|pink|black|white|lead|zebra|rainbow|ceramic|MOAB|BFB|ZOMG", "red")
  964. GUICtrlCreateLabel("Number:", 15, 74, 50, 20)
  965. $Input_Number[0] = GUICtrlCreateInput("1", 95, 72, 40, 20, 0x2002)
  966. GUICtrlCreateLabel("Spaced (ms):", 15, 98, 75, 20)
  967. $Input_Delay[0] = GUICtrlCreateInput("500", 95, 95, 40, 20, 0x2002)
  968. For $i = 1 to 4
  969. GUICtrlCreateGroup("Group " & String($i + 1), 10, 6 + 114 * $i, 130, 114)
  970. GUICtrlCreateLabel("Delay (ms):", 15, 26 + 114 * $i, 75, 20)
  971. $Input_Start[$i] = GUICtrlCreateInput("2000", 85, 24 + 114 * $i, 50, 20, 0x2002)
  972. GUICtrlCreateLabel("Send:", 15, 50 + 114 * $i, 50, 20)
  973. $Combo_Group[$i] = GUICtrlCreateCombo("red", 75, 46 + 114 * $i, 60, 60)
  974. GUICtrlSetData(-1, "blue|green|yellow|pink|black|white|lead|zebra|rainbow|ceramic|MOAB|BFB|ZOMG|none", "none")
  975. GUICtrlCreateLabel("Number:", 15, 74 + 114 * $i, 50, 20)
  976. $Input_Number[$i] = GUICtrlCreateInput("1", 95, 72 + 114 * $i, 40, 20, 0x2002)
  977. GUICtrlCreateLabel("Spaced (ms):", 15, 98 + 114 * $i, 75, 20)
  978. $Input_Delay[$i] = GUICtrlCreateInput("500", 95, 95 + 114 * $i, 40, 20, 0x2002)
  979. Next
  980. $Button_CustomSend = GUICtrlCreateButton("Send!", 10, 575, 130, 20)
  981.  
  982. GUICtrlCreateTabItem("") ; end tabitem definition
  983. GUISetState()
  984.  
  985. ;=================================================
  986. ; Run the GUI until the dialog is closed and respond to user inputs appropriately
  987. ;=================================================
  988. While 1
  989. $msg = GUIGetMsg()
  990. Select
  991. Case $msg = $GUI_EVENT_CLOSE
  992. _Timer_KillAllTimers(0)
  993. ExitLoop
  994. Case $msg = $Checkbox_FastForward
  995. If $speed = 1 then
  996. $speed = 3
  997. else
  998. $speed = 1
  999. EndIf
  1000. Case $msg = $Button_Send
  1001. $roundSelection = GUICtrlRead($Combo_Round)
  1002. MouseClick("left", round(@DesktopWidth / 2), round(@DesktopHeight / 2)); crude attempt to give focus to game
  1003. Sleep(1000); 1 second delay to allow user to give focus to game if needed.
  1004. SendRound($roundSelection)
  1005. Case $msg = $Button_Stop
  1006. _Timer_KillAllTimers(0)
  1007.  
  1008. ;================
  1009. ; Send a Custom Round
  1010. ;================
  1011. Case $msg = $Button_CustomSend
  1012. MouseClick("left", round(@DesktopWidth / 2), round(@DesktopHeight / 2)); crude attempt to give focus to game
  1013. Sleep(1000); 1 second delay to allow user to give focus to game if needed.
  1014. GUICtrlSetData($Group_Status, "Sending Custom")
  1015. ; reset income, counters and labels from any previous rounds.
  1016. $income = 0;
  1017. For $i = 0 to 12
  1018. $counters[$i] = 0
  1019. Next
  1020. For $i = 0 to 5
  1021. GUICtrlSetData($Label_Status[$i],"")
  1022. Next
  1023. SetLabelControls(_GUICtrlComboBox_GetCurSel($Combo_Group[0]), _GUICtrlComboBox_GetCurSel($Combo_Group[1]), _GUICtrlComboBox_GetCurSel($Combo_Group[2]), _GUICtrlComboBox_GetCurSel($Combo_Group[3]), _GUICtrlComboBox_GetCurSel($Combo_Group[4]))
  1024. SendBloons(GUICtrlRead($Input_Number[0]), _GUICtrlComboBox_GetCurSel($Combo_Group[0]), 0, GUICtrlRead($Input_Delay[0]))
  1025. for $i = 1 to 4
  1026. if _GUICtrlComboBox_GetCurSel($Combo_Group[$i]) <> 14 Then; if bloon selection <> "none"
  1027. SendBloons(GUICtrlRead($Input_Number[$i]), _GUICtrlComboBox_GetCurSel($Combo_Group[$i]), GUICtrlRead($Input_Start[$i]), GUICtrlRead($Input_Delay[$i]))
  1028. EndIf
  1029. Next
  1030. SleepFF(1000)
  1031. GUICtrlSetData($Group_Status, "Custom Complete")
  1032. ;End Sending of Custom Round.
  1033. Case $msg = $Input_Money
  1034. GUICtrlSetData($Label_Money, "$" & String(GUICtrlRead($Input_Money) + $income))
  1035. Case Else ; modifying the RBE
  1036. for $i = 0 to 13
  1037. if $msg = $Button_Color_Down[$i] Then
  1038. AdjustModifier($i, $Label_Color[$i], -1)
  1039. ExitLoop
  1040. elseif $msg = $Button_Color_Up[$i] Then
  1041. AdjustModifier($i, $Label_Color[$i], 1)
  1042. ExitLoop
  1043. EndIf
  1044. Next
  1045. EndSelect
  1046. WEnd
  1047. _Timer_KillAllTimers(0)
  1048. TrayTip("Program ", " complete", 1000)
  1049. Sleep(1000)
  1050. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement