Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;=================================================
- ; function SendRound
- ; Description: this function sends the default bloon
- ; lineup for a given round.
- ; Variables:
- ; $r: the number of the round to be sent.
- ; Example: to send round 7, call
- ; SendRound(7)
- ; TODO: still needs rounds 51+
- ;=================================================
- func SendRound($r)
- ; notify the user which round is being sent.
- GUICtrlSetData($Group_Status, "Sending Round " & String($r))
- ; reset income, counters and labels from any previous rounds.
- $income = 0;
- For $i = 0 to 12
- $counters[$i] = 0
- Next
- For $i = 0 to 5
- GUICtrlSetData($Label_Status[$i],"")
- Next
- ; set global $round used for income multipliers
- $round = $r
- ; send the appropriate bloons for the round selected.
- Select
- case $r = 0
- TrayTip("Program ", " closing", 1000)
- case $r = 1
- SetLabelControls($red)
- SendBloons(20, $red, 0, 933)
- SleepFF(18660)
- case $r = 2
- SetLabelControls($red)
- SendBloons(30, $red, 0, 566)
- SleepFF(16980)
- case $r = 3
- SetLabelControls($red, $blue)
- SendBloons(20, $red, 0, 566)
- SendBloons(5, $blue, 5000, 566)
- SleepFF(5000)
- case $r = 4
- SetLabelControls($red, $blue)
- SendBloons(20, $red, 0, 566)
- SendBloons(15, $blue, 11366, 566)
- SendBloons(10, $red, 8500, 333)
- SleepFF(3330)
- case $r = 5
- SetLabelControls($blue, $red)
- SendBloons(10, $blue, 0, 566)
- SendBloons(5, $red, 5133, 566)
- SendBloons(15, $blue, 2866, 566)
- SleepFF(8490)
- case $r = 6
- SetLabelControls($green, $red, $blue)
- SendBloons(4, $green, 0, 566)
- SendBloons(15, $red, 2333, 566)
- SendBloons(15, $blue, 8566, 566)
- SleepFF(8490)
- case $r = 7
- SetLabelControls($blue, $green, $red)
- SendBloons(10, $blue, 0, 566)
- SendBloons(5, $green, 5700, 1233)
- SendBloons(20, $red, 6100, 500)
- SendBloons(15, $blue, 0, 283)
- SleepFF(4245)
- case $r = 8
- SetLabelControls($blue, $green, $red)
- SendBloons(20, $blue, 0, 566)
- SendBloons(2, $green, 11333, 566)
- SendBloons(10, $red, 733, 233)
- SendBloons(12, $green, 6233, 966)
- SleepFF(12000)
- case $r = 9
- SetLabelControls($green)
- SendBloons(30, $green, 0, 666)
- SleepFF(20000)
- case $r = 10
- SetLabelControls($blue)
- SendBloons(60, $blue, 0, 600)
- SendBloons(20, $blue, 35000, 466)
- SendBloons(22, $blue, 9000, 166)
- SleepFF(3652)
- case $r = 11
- SetLabelControls($yellow, $green, $blue)
- SendBloons(2, $yellow, 0, 566)
- SendBloons(10, $green, 3800, 566)
- SendBloons(10, $blue, 6433, 433)
- SendBloons(12, $red, 3366, 500)
- SleepFF(6000)
- case $r = 12
- SetLabelControls($green, $blue, $yellow)
- SendBloons(10, $green, 0, 566)
- SendBloons(15, $blue, 5700, 433)
- SendBloons(5, $yellow, 13700, 766)
- SleepFF(3830)
- case $r = 13
- SetLabelControls($red, $yellow, $green)
- SendBloons(100, $red, 0, 266)
- SendBloons(4, $yellow, 11433, 450)
- SendBloons(23, $green, 5700, 566)
- SleepFF(13018)
- case $r = 14
- SetLabelControls($red, $blue, $green, $yellow)
- SendBloons(49, $red, 0, 566)
- SendBloons(5, $blue, 2850, 266)
- SendBloons(5, $green, 2850, 266)
- SendBloons(5, $yellow, 2850, 333)
- SendBloons(10, $blue, 7400, 166)
- SendBloons(5, $green, 3866, 333)
- SendBloons(5, $yellow, 3866, 400)
- SleepFF(5000)
- case $r = 15
- SetLabelControls($red, $pink, $green)
- SendBloons(20, $red, 0, 566)
- SendBloons(3, $pink, 12433, 433)
- SendBloons(12, $green, 2700, 566)
- SendBloons(5, $yellow, 8000, 666)
- SleepFF(3330)
- case $r = 16
- SetLabelControls($green, $pink, $yellow)
- SendBloons(20, $green, 0, 566)
- SendBloons(4, $pink, 1667, 4866)
- SendBloons(8, $yellow, 11900, 200)
- SleepFF(10000)
- case $r = 17
- SetLabelControls($yellow) ; TODO: these 8 yellows should be regrowth.
- SendBloons(8, $yellow, 0, 566)
- SleepFF(4528)
- case $r = 18
- SetLabelControls($green)
- SendBloons(60, $green, 0, 433)
- SendBloons(20, $green, 26000, 100)
- SleepFF(2000)
- case $r = 19
- SetLabelControls($green, $yellow, $pink)
- SendBloons(10, $green, 0, 300)
- SendBloons(5, $yellow, 2333, 566) ;TODO: these 5 yellows should be regrowth
- SendBloons(7, $pink, 3633, 1266)
- SendBloons(4, $yellow, 7533, 566)
- SleepFF(3000)
- case $r = 20
- SetLabelControls($black)
- SendBloons(6, $black, 0, 1000)
- SleepFF(6000)
- case $r = 21
- SetLabelControls($pink)
- SendBloons(14, $pink, 0, 550)
- SleepFF(7700)
- case $r = 22
- SetLabelControls($white)
- Sendbloons(8, $white, 0, 666)
- SleepFF(5328)
- case $r = 23
- SetLabelControls($black, $white)
- Sendbloons(5, $black, 0, 500)
- Sendbloons(4, $white, 5766, 600)
- SleepFF(2400)
- case $r = 24
- SetLabelControls($green)
- SendBloons(1, $green, 0, 0); TODO: this should be camo
- case $r = 25
- SetLabelControls($yellow)
- SendBloons(31, $yellow, 0, 566) ; TODO: these should be regrowth
- SleepFF(17546)
- case $r = 26
- SetLabelControls($pink, $zebra)
- SendBloons(23, $pink, 0, 400)
- SendBloons(4, $zebra, 11000, 1133)
- SleepFF(4532)
- case $r = 27
- SetLabelControls($yellow, $green, $blue, $red)
- SendBloons(45, $yellow, 0, 175)
- SendBloons(45, $green, 9433, 166)
- SendBloons(55, $blue, 9566, 100)
- SendBloons(120, $red, 5566, 66)
- SleepFF(8000)
- case $r = 28
- SetLabelControls($lead)
- SendBloons(4, $lead, 0, 1333)
- SleepFF(5332)
- case $r = 29
- SetLabelControls($yellow, $pink)
- SendBloons(25, $yellow, 0, 366)
- SendBloons(12, $pink, 13500, 200); TODO: these pinks should be regrowth
- SleepFF(2400)
- case $r = 30
- SetLabelControls($lead)
- SendBloons(8, $lead, 0, 1633)
- SleepFF(13064)
- case $r = 31
- SetLabelControls($zebra)
- SendBloons(8, $zebra, 0, 733)
- SendBloons(2, $zebra, 5700, 1700) ;TODO: last two zebras should be regrowth
- SleepFF(3400)
- case $r = 32
- SetLabelControls($black, $white, $lead)
- SendBloons(25, $black, 0, 566)
- SendBloons(28, $white, 14266, 600)
- SendBloons(8, $lead, 17133, 566)
- SleepFF(4528)
- case $r = 33
- SetLabelControls($yellow)
- SendBloons(20, $yellow, 0, 1333) ; TODO: these should be camo
- SleepFF(26660)
- case $r = 34
- SetLabelControls($yellow, $zebra)
- SendBloons(140, $yellow, 0, 250)
- SendBloons(5, $zebra, 7500, 4500)
- SleepFF(35000)
- case $r = 35
- SetLabelControls($white, $rainbow, $pink)
- SendBloons(25, $white, 0, 433)
- SendBloons(5, $rainbow, 14333, 566)
- SendBloons(35, $pink, 4866, 200)
- SleepFF(7000)
- case $r = 36
- SetLabelControls($pink)
- SendBloons(20, $pink, 0, 66)
- SendBloons(20, $pink, 8416, 66)
- SendBloons(41, $pink, 8500, 66)
- SleepFF(2706)
- case $r = 37
- SetLabelControls($black, $white, $lead, $zebra)
- SendBloons(20, $black, 0, 566)
- SendBloons(20, $white, 11333, 566)
- SendBloons(15, $lead, 11333, 566)
- SendBloons(10, $zebra, 8500, 566)
- SendBloons(7, $white, 10500, 266); TODO these 7 white should be camo
- SleepFF(1862)
- case $r = 38
- SetLabelControls($white, $pink, $lead, $zebra, $rainbow)
- SendBloons(17, $white, 0, 233)
- SendBloons(42, $pink, 2000, 566)
- SendBloons(14, $lead, 2833, 666)
- SendBloons(10, $zebra, 7266, 700)
- SendBloons(4, $rainbow, 13633, 966)
- SleepFF(4000)
- case $r = 39
- SetLabelControls($black, $white, $lead, $zebra, $rainbow)
- SendBloons(10, $black, 0, 566)
- SendBloons(10, $white, 5700, 566)
- SendBloons(20, $lead, 5700, 566)
- SendBloons(20, $zebra, 11433, 566)
- SendBloons(18, $rainbow, 11433, 566)
- SleepFF(10188)
- case $r = 40
- SetLabelControls($rainbow, $ceramic)
- SendBloons(10, $rainbow, 0, 566)
- SendBloons(4, $ceramic, 8000, 566)
- SleepFF(2264)
- case $r = 41
- SetLabelControls($black, $zebra)
- SendBloons(60, $black, 0, 333)
- SendBloons(10, $zebra, 18845, 466)
- SleepFF(4660)
- case $r = 42
- SetLabelControls($rainbow)
- SendBloons(6, $rainbow, 0, 1000);TODO: these 6 rainbow should be regrowth
- SendBloons(6, $rainbow, 6000, 1000);TODO: these 6 rainbow should be camo
- SleepFF(6000)
- case $r = 43
- SetLabelControls($rainbow, $ceramic)
- SendBloons(10, $rainbow, 0, 566)
- SendBloons(7, $ceramic, 5700, 600)
- SleepFF(4200)
- case $r = 44
- SetLabelControls($zebra)
- SendBloons(10, $zebra, 0, 1100)
- SendBloons(10, $zebra, 10366, 766)
- SendBloons(10, $zebra, 7333, 433)
- SendBloons(10, $zebra, 4066, 233)
- SendBloons(10, $zebra, 2333, 100)
- SleepFF(1000)
- case $r = 45
- SetLabelControls($rainbow, $pink, $lead)
- SendBloons(25, $rainbow, 0, 566)
- SendBloons(200, $pink, 14266, 300) ; unexpected, but accurate
- SendBloons(8, $lead, 60725, 566)
- SleepFF(5333)
- case $r = 46
- SetLabelControls($moab)
- SendBloons(1, $moab, 0, 0)
- case $r = 47
- SetLabelControls($ceramic, $pink)
- SendBloons(12, $ceramic, 0, 566)
- SendBloons(70, $pink, 6500, 266) ; TODO: these 70 pinks should be camo
- SleepFF(18666);
- case $r = 48
- SetLabelControls($pink, $rainbow)
- SendBloons(120, $pink, 0, 333) ; TODO: these 120 pink should be regrowth
- SendBloons(50, $rainbow, 39683, 466)
- SleepFF(23300)
- case $r = 49
- SetLabelControls($green, $rainbow, $ceramic, $zebra)
- SendBloons(343, $green, 0, 175)
- SendBloons(10, $rainbow, 4200, 600)
- SendBloons(18, $ceramic, 12200, 400)
- SendBloons(20, $zebra, 14400, 200)
- SendBloons(10, $rainbow, 15000, 600)
- SendBloons(10, $rainbow, 0, 600) ; TODO: these 10 rainbow should be regrowth
- SleepFF(14500)
- case $r = 50
- SetLabelControls($moab, $lead, $red, $ceramic)
- SendBloons(1, $moab, 0, 0)
- SendBloons(8, $lead, 566, 566)
- SendBloons(20, $red, 9300, 66)
- SendBloons(20, $ceramic, 6600, 566)
- SendBloons(1, $moab, 11320, 0)
- SleepFF(1000)
- case $r = 51
- SetLabelControls($ceramic, $rainbow)
- SendBloons(28, $ceramic, 0, 566)
- SendBloons(10, $rainbow, 15600, 566); TODO: these should be regrowth
- SleepFF(5666)
- case $r = 52
- SetLabelControls($rainbow, $moab, $ceramic)
- SendBloons(25, $rainbow, 0, 566)
- SendBloons(2, $moab, 14266, 3450)
- SendBloons(5, $ceramic, 566, 566)
- SendBloons(5, $ceramic, 3400, 566)
- SleepFF(2830)
- case $r = 53
- SetLabelControls($pink, $moab)
- SendBloons(80, $pink, 0, 566); TODO: these should be camo
- SendBloons(3, $moab, 28000, 2600);
- SleepFF(17280)
- case $r = 54
- SetLabelControls($ceramic, $moab)
- SendBloons(35, $ceramic, 0, 600)
- SendBloons(2, $moab, 5766, 6233)
- SleepFF(15234)
- case $r = 55
- SetLabelControls($ceramic, $moab)
- SendBloons(10, $ceramic, 0, 185)
- SendBloons(10, $ceramic, 7000, 166)
- SendBloons(10, $ceramic, 7000, 166)
- SendBloons(15, $ceramic, 8200, 66)
- SendBloons(1, $moab, 6800, 0)
- SleepFF(1000)
- case $r = 56
- SetLabelControls($rainbow, $moab)
- SendBloons(40, $rainbow, 0, 320); TODO: these should be Regrowth
- SendBloons(1, $moab, 15166, 0)
- SleepFF(1000)
- case $r = 57
- SetLabelControls($moab, $rainbow)
- SendBloons(2, $moab, 0, 566)
- SendBloons(40, $rainbow, 1000, 650)
- SendBloons(2, $moab, 12200, 566)
- SleepFF(1200)
- case $r = 58
- SetLabelControls($moab, $ceramic)
- SendBloons(5, $moab, 0, 8800)
- SendBloons(29, $ceramic, 300, 1533)
- SleepFF(44000)
- case $r = 59
- SetLabelControls($ceramic, $lead)
- SendBloons(50, $ceramic, 0, 583)
- Sendbloons(28, $lead, 10166, 275); TODO: these should be camo
- SleepFF(18987)
- case $r = 60
- SetLabelControls($bfb)
- SendBloons(1, $bfb, 0, 0)
- case $r = 61
- SetLabelControls($zebra, $moab)
- SendBloons(150, $zebra, 0, 133); TODO: these should be Regrowth
- Sendbloons(5, $moab, 1533, 1917)
- SleepFF(18467)
- case $r = 62
- SetLabelControls($pink, $rainbow, $moab)
- SendBloons(6, $moab, 0, 5000)
- Sendbloons(300, $pink, 200, 200); TODO: these should be camo
- SendBloons(15, $rainbow, 50000, 566); TODO: these should be camo + regrowth
- SleepFF(8500)
- case $r = 63
- SetLabelControls($lead, $ceramic)
- SendBloons(75, $lead, 0, 600)
- Sendbloons(40, $ceramic, 3866, 5)
- Sendbloons(40, $ceramic, 16166, 5)
- Sendbloons(42, $ceramic, 16166, 5)
- SleepFF(8802)
- case $r = 64
- SetLabelControls($moab)
- SendBloons(9, $moab, 0, 716)
- SleepFF(6444)
- case $r = 65
- SetLabelControls($zebra, $rainbow, $ceramic, $moab, $bfb)
- SendBloons(100, $zebra, 0, 333)
- Sendbloons(70, $rainbow, 32600, 200)
- Sendbloons(50, $ceramic, 14733, 233)
- Sendbloons(3, $moab, 11250, 566)
- Sendbloons(2, $bfb, 2000, 1000)
- SleepFF(2000)
- case $r = 66
- SetLabelControls($moab)
- Sendbloons(2, $moab, 0, 500)
- Sendbloons(2, $moab, 7000, 500)
- Sendbloons(4, $moab, 7000, 333)
- Sendbloons(4, $moab, 6833, 250)
- SleepFF(1000)
- case $r = 67
- SetLabelControls($ceramic, $moab)
- Sendbloons(5, $moab, 0, 566)
- SendBloons(15, $ceramic, 9100, 566)
- Sendbloons(5, $moab, 15000, 566)
- SleepFF(8802)
- case $r = 68
- SetLabelControls($moab, $bfb)
- Sendbloons(4, $moab, 0, 566)
- SendBloons(1, $bfb, 0, 7433)
- SleepFF(7433)
- case $r = 69
- SetLabelControls($lead, $ceramic)
- Sendbloons(60, $lead, 0, 166)
- SendBloons(70, $ceramic, 17100, 566); TODO: these should be regrowth
- SleepFF(39620)
- case $r = 70; pixelchecked - hard
- SetLabelControls($rainbow, $moab)
- SendBloons(200, $rainbow, 0, 200); TODO: these should be camo
- Sendbloons(4, $moab, 40000, 566)
- SleepFF(42264)
- case $r = 71
- SetLabelControls($ceramic, $moab)
- SendBloons(30, $ceramic, 0, 566)
- Sendbloons(10, $moab, 4416, 566)
- SleepFF(12564)
- case $r = 72
- SetLabelControls($ceramic, $bfb)
- SendBloons(38, $ceramic, 0, 566); TODO: these should be regrowth
- Sendbloons(2, $bfb, 12700, 566)
- SleepFF(1200)
- case $r = 73
- SetLabelControls($moab, $bfb)
- SendBloons(7, $moab, 0, 566)
- Sendbloons(3, $bfb, 13400, 566)
- SendBloons(2, $moab, 13000, 566)
- SleepFF(1200)
- case $r = 74
- SetLabelControls($ceramic, $bfb)
- SendBloons(100, $ceramic, 0, 566)
- Sendbloons(1, $bfb, 41433, 0)
- SendBloons(100, $ceramic, 15000, 266)
- SleepFF(26600)
- case $r = 75
- SetLabelControls($lead, $moab, $bfb)
- Sendbloons(3, $bfb, 0, 9700)
- SendBloons(14, $lead, 566, 566)
- SendBloons(2, $moab, 8000, 566)
- SendBloons(14, $lead, 566, 566)
- SendBloons(2, $moab, 8000, 566)
- SleepFF(1200)
- case $r = 76
- SetLabelControls($ceramic); TODO: these ceramic should be regrowth.
- SendBloons(60, $ceramic, 0, 33)
- SleepFF(2000)
- case $r = 77
- SetLabelControls($moab, $bfb)
- SendBloons(14, $moab, 0, 4600)
- Sendbloons(5, $bfb, 26666, 1166)
- SleepFF(33333)
- case $r = 78
- SetLabelControls($moab, $bfb)
- SendBloons(150, $rainbow, 0, 566)
- SendBloons(75, $ceramic, 10000, 16)
- Sendbloons(1, $bfb, 34000, 1166)
- SendBloons(72, $ceramic, 34000, 16); TODO: these should be camo
- SleepFF(12000)
- case $r = 79
- SetLabelControls($rainbow, $bfb)
- SendBloons(500, $rainbow, 0, 133); TODO: these should be regrowth
- Sendbloons(7, $bfb, 3166, 8833)
- SleepFF(5000)
- case $r = 80
- SetLabelControls($moab)
- SendBloons(31, $moab, 0, 666)
- SleepFF(20646)
- case $r = 81
- SetLabelControls($bfb)
- SendBloons(9, $bfb, 0, 2500)
- SleepFF(22500)
- case $r = 82
- SetLabelControls($rainbow, $bfb)
- SendBloons(400, $rainbow, 0, 166); TODO: these should be camo + regrowth
- Sendbloons(10, $bfb, 0, 533)
- SleepFF(60000)
- case $r = 83
- SetLabelControls($ceramic, $moab)
- SendBloons(50, $ceramic, 0, 1000)
- SendBloons(50, $ceramic, 100, 1000)
- SendBloons(50, $ceramic, 200, 1000)
- Sendbloons(30, $moab, 10000, 333)
- SleepFF(40000)
- case $r = 84
- SetLabelControls($moab, $bfb)
- SendBloons(50, $moab, 200, 1000)
- Sendbloons(10, $bfb, 10000, 333)
- SleepFF(40000)
- case $r = 85
- SetLabelControls($zomg)
- SendBloons(1, $zomg, 0, 0)
- case Else
- MsgBox(0, "Error", "unknown round entered");
- EndSelect
- ; notify the user round is complete.
- GUICtrlSetData($Group_Status, "Round " & String($r) & " complete.")
- $income = $income + 99 + $r; end of round bonus cash
- GUICtrlSetData($Label_Money, "$" & String(GUICtrlRead($Input_Money) + floor($income)))
- Sleep(500)
- EndFunc
- ;=================================================
- ; function SendBloons
- ; Description: this function sends one or more bloons.
- ; Variables:
- ; $number: the number of bloons to send.
- ; $bloon: the unmodified base bloon sent.
- ; $first: the time in milliseconds to wait before sending in the first bloon.
- ; $delay: the delay in milliseconds between bloons.
- ; Example: to send 20 red bloons each 1 second apart, call SendBloons(20, 0, 1000)
- ;=================================================
- func SendBloons($number, $bloon, $first, $delay)
- $modifiedBloon = $bloon + $modifiers[$bloon]
- if $speed = 3 then
- $first = round($first / 3)
- $delay = round($delay / 3)
- EndIf
- sleep($first)
- ; send the first bloon without delay
- Select
- case $modifiedBloon = $red
- send("1")
- case $modifiedBloon = $blue
- send("2")
- case $modifiedBloon = $green
- send("3")
- case $modifiedBloon = $yellow
- send("4")
- case $modifiedBloon = $pink
- send("5")
- case $modifiedBloon = $black
- send("6")
- case $modifiedBloon = $white
- send("7")
- case $modifiedBloon = $lead
- send("8")
- case $modifiedBloon = $zebra
- send("9")
- case $modifiedBloon = $rainbow
- send("0")
- case $modifiedBloon = $ceramic
- send("u")
- case $modifiedBloon = $moab
- send("i")
- case $modifiedBloon = $bfb
- send("o")
- case else
- send("p")
- EndSelect
- CountBloon($modifiedBloon) ; count the sent bloon
- ; set up timers to send any remaining bloons
- if $number > 1 then
- Select
- case $modifiedBloon = $red
- _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendRed"))
- _ArrayAdd($arrayTimerCountDowns, $number - 1)
- case $modifiedBloon = $blue
- _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendBlue"))
- _ArrayAdd($arrayTimerCountDowns, $number - 1)
- case $modifiedBloon = $green
- _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendGreen"))
- _ArrayAdd($arrayTimerCountDowns, $number - 1)
- case $modifiedBloon = $yellow
- _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendYellow"))
- _ArrayAdd($arrayTimerCountDowns, $number - 1)
- case $modifiedBloon = $pink
- _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendPink"))
- _ArrayAdd($arrayTimerCountDowns, $number - 1)
- case $modifiedBloon = $black
- _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendBlack"))
- _ArrayAdd($arrayTimerCountDowns, $number - 1)
- case $modifiedBloon = $white
- _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendWhite"))
- _ArrayAdd($arrayTimerCountDowns, $number - 1)
- case $modifiedBloon = $lead
- _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendLead"))
- _ArrayAdd($arrayTimerCountDowns, $number - 1)
- case $modifiedBloon = $zebra
- _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendZebra"))
- _ArrayAdd($arrayTimerCountDowns, $number - 1)
- case $modifiedBloon = $rainbow
- _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendRainbow"))
- _ArrayAdd($arrayTimerCountDowns, $number - 1)
- case $modifiedBloon = $ceramic
- _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendCeramic"))
- _ArrayAdd($arrayTimerCountDowns, $number - 1)
- case $modifiedBloon = $moab
- _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendMOAB"))
- _ArrayAdd($arrayTimerCountDowns, $number - 1)
- case $modifiedBloon = $bfb
- _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendBFB"))
- _ArrayAdd($arrayTimerCountDowns, $number - 1)
- case else
- _ArrayAdd($arrayTimerIDs, _Timer_SetTimer(0, $delay, "SendZOMG"))
- _ArrayAdd($arrayTimerCountDowns, $number - 1)
- EndSelect
- EndIf
- EndFunc
- ;=================================================
- ; function SleepFF($delay)
- ; modified version of Sleep($delay)
- ; if the user is using Fast Forward mode Then
- ; sleep delays will be appropriately shorter.
- ;=================================================
- func SleepFF($delay)
- if $speed = 1 then
- Sleep($delay)
- else
- Sleep(round($delay / $speed))
- EndIf
- EndFunc
- ;=================================================
- ; function SetLabelControls
- ; this function sets up which labels in the status GUI
- ; will display updates for each group of bloons.
- ; variables:
- ; $groupX indicates the type of bloon being sent in a given group of SendBloons().
- ; inputs $group2 through $group6 are optional.
- ; for example, if a round first sends reds, then blues, Call
- ; SetLabelControls($red, $blue);
- ;=================================================
- func SetLabelControls($group1, $group2 = 14, $group3 = 14, $group4 = 14, $group5 = 14, $group6 = 14)
- $Label_Controls[$group1 + $modifiers[$group1]] = $Label_Status[0]
- if $group2 <> 14 then $Label_Controls[$group2 + $modifiers[$group2]] = $Label_Status[1]
- if $group3 <> 14 then $Label_Controls[$group3 + $modifiers[$group3]] = $Label_Status[2]
- if $group4 <> 14 then $Label_Controls[$group4 + $modifiers[$group4]] = $Label_Status[3]
- if $group5 <> 14 then $Label_Controls[$group5 + $modifiers[$group5]] = $Label_Status[4]
- if $group6 <> 14 then $Label_Controls[$group6 + $modifiers[$group6]] = $Label_Status[5]
- EndFunc
- ;=================================================
- ; function CountBloon($bloon)
- ; keeps track of the count for bloons sent as well as the income generated
- ;=================================================
- func CountBloon($bloon)
- $counters[$bloon] += 1;
- GUICtrlSetData($Label_Controls[$bloon], $names[$bloon] & ": " & String($counters[$bloon]))
- If $round < 52 then
- $income += $baseValues[$bloon]
- elseif $round < 62 Then
- $income += $baseValues[$bloon] / 2
- elseif $round < 87 Then
- $income += $baseValues[$bloon] / 5
- elseif $round < 101 Then
- $income += $baseValues[$bloon] / 10
- else
- $income += $baseValues[$bloon] / 50
- EndIf
- GUICtrlSetData($Label_Money, "$" & String(GUICtrlRead($Input_Money) + floor($income)))
- EndFunc
- ;=================================================
- ; functions HandleTimer($timerID)
- ; This function tests to see if a timer should expire by
- ; reducing it's associated countdown and killing the timer if all bloons have been sent.
- ;=================================================
- Func HandleTimer($timerID)
- $i = _ArraySearch($arrayTimerIDs, $timerID)
- if $i <> -1 Then
- $arrayTimerCountDowns[$i] -= 1
- If $arrayTimerCountDowns[$i] = 0 Then
- _Timer_KillTimer(0, $timerID)
- _ArrayDelete($arrayTimerIDs, $i)
- _ArrayDelete($arrayTimerCountDowns, $i)
- EndIf
- Else
- ConsoleWrite("Error, SendBloon from unknown timer ID: " & $timerID & @CRLF)
- EndIf
- EndFunc
- ;=================================================
- ; functions SendX($a, $b, $timerID, $c)
- ; these functions are called by timers when bloon X is ready to be sent.
- ; $a, b & c are not used. $timerID is the timer calling the function.
- ;=================================================
- func SendRed($a, $b, $timerID, $c)
- send("1")
- CountBloon($red)
- HandleTimer($timerID)
- EndFunc
- func SendBlue($a, $b, $timerID, $c)
- send("2")
- CountBloon($blue)
- HandleTimer($timerID)
- EndFunc
- func SendGreen($a, $b, $timerID, $c)
- send("3")
- CountBloon($green)
- HandleTimer($timerID)
- EndFunc
- func SendYellow($a, $b, $timerID, $c)
- send("4")
- CountBloon($yellow)
- HandleTimer($timerID)
- EndFunc
- func SendPink($a, $b, $timerID, $c)
- send("5")
- CountBloon($pink)
- HandleTimer($timerID)
- EndFunc
- func SendBlack($a, $b, $timerID, $c)
- send("6")
- CountBloon($black)
- HandleTimer($timerID)
- EndFunc
- func SendWhite($a, $b, $timerID, $c)
- send("7")
- CountBloon($white)
- HandleTimer($timerID)
- EndFunc
- func SendLead($a, $b, $timerID, $c)
- send("8")
- CountBloon($lead)
- HandleTimer($timerID)
- EndFunc
- func SendZebra($a, $b, $timerID, $c)
- send("9")
- CountBloon($zebra)
- HandleTimer($timerID)
- EndFunc
- func SendRainbow($a, $b, $timerID, $c)
- send("0")
- CountBloon($rainbow)
- HandleTimer($timerID)
- EndFunc
- func SendCeramic($a, $b, $timerID, $c)
- send("u")
- CountBloon($ceramic)
- HandleTimer($timerID)
- EndFunc
- func SendMOAB($a, $b, $timerID, $c)
- send("i")
- CountBloon($moab)
- HandleTimer($timerID)
- EndFunc
- func SendBFB($a, $b, $timerID, $c)
- send("o")
- CountBloon($bfb)
- HandleTimer($timerID)
- EndFunc
- func SendZOMG($a, $b, $timerID, $c)
- send("p")
- CountBloon($zomg)
- HandleTimer($timerID)
- EndFunc
- ;=================================================
- ; function AdjustModifier
- ; this function is called to modify the RBE, for example, changing reds into blues.
- ; variables:
- ; $baseBloon: the base bloon being modified (i.e. red)
- ; $label: this is just the label on the GUI which will indicate the change.
- ; $adjustment: the amount to change the current modifier.
- ; while this function can accept any amount, the input currently will always be +1 or -1.
- ; example: to change reds to blues, Call AdjustModifier($red, $label_red, 1)
- ;=================================================
- Func AdjustModifier($baseBloon, ByRef $label, $adjustment)
- $modifiers[$baseBloon] = $modifiers[$baseBloon] + $adjustment
- if $modifiers[$baseBloon] + $baseBloon < 0 then $modifiers[$baseBloon] = 13 - $baseBloon
- If $modifiers[$baseBloon] + $baseBloon > 13 then $modifiers[$baseBloon] = 0 - $baseBloon
- GUICtrlSetData($label, $names[mod($baseBloon + $modifiers[$baseBloon], 14)])
- EndFunc
- ;=================================================
- ; main function begins here.
- ; Essentially this just constructs the GUI, then loops endlessly until the user exits
- ; Terminate by closing the GUI.
- ; Important Note: In order for Bloons to be sent, focus must be on the BTD 5 Game, NOT the GUI.
- ;=================================================
- Main()
- Func Main()
- Local $msg
- ;=================================================
- ; Create the GUI
- ;=================================================
- GUICreate("BTD4 DCE", 150, 600, round(@DesktopWidth / 2) - 660, 200, -1, $WS_EX_TOPMOST)
- GUISetFont(9, 300)
- GUICtrlCreateTab(0, 0, 150, 600)
- GUICtrlCreateTabItem("Round")
- GUICtrlSetState(-1, $GUI_SHOW) ; this tab will be displayed first
- GUICtrlCreateGroup("Settings", 10, 40, 130, 140) ; 105
- $Radio_Easy = GUICtrlCreateRadio("Easy", 20, 60)
- $Radio_Medium = GUICtrlCreateRadio("Medium", 20, 85)
- $Radio_Hard = GUICtrlCreateRadio( "Hard", 20, 110)
- GUICtrlSetState($Radio_Hard, $GUI_CHECKED)
- $Checkbox_FastForward = GUICtrlCreateCheckbox("Fast Forward", 20, 145)
- $Button_Send = GUICtrlCreateButton("Send!", 10, 240, 130, 40)
- $Button_Stop = GUICtrlCreateButton("Stop", 10, 285, 130, 40)
- ;=================================================
- ; Create the Round GUI (TODO: as more rounds are added, add them here as well)
- ;=================================================
- GUICtrlCreateGroup("", 10, 180, 130, 55)
- GUICtrlCreateLabel("Round:", 20, 200, 50, 20)
- $Combo_Round = GUICtrlCreateCombo("1", 70, 200, 60, 60)
- GUICtrlSetData(-1, "2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20", "1")
- GUICtrlSetData(-1, "21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36", "1")
- GUICtrlSetData(-1, "37|38|39|40|41|42|43|44|45|46|47|48|49|50", "1")
- GUICtrlSetData(-1, "51|52|53|54|55|56|57|58|59|60|61|62|63|64|65", "1")
- GUICtrlSetData(-1, "66|67|68|69|70|71|72|73|74|75|76|77|78|79", "1")
- GUICtrlSetData(-1, "80|81|82|83|84|85", "1")
- ;=================================================
- ; Create the Income GUI
- ;=================================================
- GUICtrlCreateGroup("Income", 10, 330, 130, 115)
- GUICtrlCreateLabel("Start round with:", 20, 355, 110, 20)
- ; 0x0002 is just $ES_RIGHT alignment rather than left justified.
- ; 0x2000 is $ES_NUMBER which prevents non-numerical inputs.
- $Input_Money = GUICtrlCreateInput("0", 20, 375, 110, 20, 0x2002)
- GUICtrlCreateLabel("Current amount:", 20, 400, 110, 20)
- $Label_Money = GUICtrlCreateLabel("$0", 20, 420, 105, 20, 0x0002)
- ;=================================================
- ; Create the Status GUI
- ;=================================================
- $Group_Status = GUICtrlCreateGroup("Status...", 10, 450, 130, 140)
- $Label_Status[0] = GUICtrlCreateLabel("Waiting for input", 20, 468, 110, 20, 0x0002)
- For $i = 1 to 5
- $Label_Status[$i] = GUICtrlCreateLabel("", 20, 468 + 20* $i, 110, 20, 0x0002)
- Next
- ;=================================================
- ; Create the RBE modification tab
- ;=================================================
- GUICtrlCreateTabItem("RBE")
- For $i = 0 to 13
- GUICtrlCreateGroup($names[$i], 10, $i*40 + 30, 130, 40)
- $Label_Color[$i] = GUICtrlCreateLabel($names[$i], 50, $i * 40 + 46, 50, 20)
- $Button_Color_Down[$i] = GUICtrlCreateButton("-", 20, $i * 40 + 45, 20, 20)
- $Button_Color_Up[$i] = GUICtrlCreateButton("+", 110, $i * 40 + 45, 20, 20)
- Next
- ;=================================================
- ; Create the Custom modification tab
- ;=================================================
- GUICtrlCreateTabItem("Custom")
- GUICtrlCreateGroup("Group 1", 10, 30, 130, 90)
- GUICtrlCreateLabel("Send:", 15, 50, 50, 20)
- $Combo_Group[0] = GUICtrlCreateCombo("red", 75, 46, 60, 60)
- GUICtrlSetData(-1, "blue|green|yellow|pink|black|white|lead|zebra|rainbow|ceramic|MOAB|BFB|ZOMG", "red")
- GUICtrlCreateLabel("Number:", 15, 74, 50, 20)
- $Input_Number[0] = GUICtrlCreateInput("1", 95, 72, 40, 20, 0x2002)
- GUICtrlCreateLabel("Spaced (ms):", 15, 98, 75, 20)
- $Input_Delay[0] = GUICtrlCreateInput("500", 95, 95, 40, 20, 0x2002)
- For $i = 1 to 4
- GUICtrlCreateGroup("Group " & String($i + 1), 10, 6 + 114 * $i, 130, 114)
- GUICtrlCreateLabel("Delay (ms):", 15, 26 + 114 * $i, 75, 20)
- $Input_Start[$i] = GUICtrlCreateInput("2000", 85, 24 + 114 * $i, 50, 20, 0x2002)
- GUICtrlCreateLabel("Send:", 15, 50 + 114 * $i, 50, 20)
- $Combo_Group[$i] = GUICtrlCreateCombo("red", 75, 46 + 114 * $i, 60, 60)
- GUICtrlSetData(-1, "blue|green|yellow|pink|black|white|lead|zebra|rainbow|ceramic|MOAB|BFB|ZOMG|none", "none")
- GUICtrlCreateLabel("Number:", 15, 74 + 114 * $i, 50, 20)
- $Input_Number[$i] = GUICtrlCreateInput("1", 95, 72 + 114 * $i, 40, 20, 0x2002)
- GUICtrlCreateLabel("Spaced (ms):", 15, 98 + 114 * $i, 75, 20)
- $Input_Delay[$i] = GUICtrlCreateInput("500", 95, 95 + 114 * $i, 40, 20, 0x2002)
- Next
- $Button_CustomSend = GUICtrlCreateButton("Send!", 10, 575, 130, 20)
- GUICtrlCreateTabItem("") ; end tabitem definition
- GUISetState()
- ;=================================================
- ; Run the GUI until the dialog is closed and respond to user inputs appropriately
- ;=================================================
- While 1
- $msg = GUIGetMsg()
- Select
- Case $msg = $GUI_EVENT_CLOSE
- _Timer_KillAllTimers(0)
- ExitLoop
- Case $msg = $Checkbox_FastForward
- If $speed = 1 then
- $speed = 3
- else
- $speed = 1
- EndIf
- Case $msg = $Button_Send
- $roundSelection = GUICtrlRead($Combo_Round)
- MouseClick("left", round(@DesktopWidth / 2), round(@DesktopHeight / 2)); crude attempt to give focus to game
- Sleep(1000); 1 second delay to allow user to give focus to game if needed.
- SendRound($roundSelection)
- Case $msg = $Button_Stop
- _Timer_KillAllTimers(0)
- ;================
- ; Send a Custom Round
- ;================
- Case $msg = $Button_CustomSend
- MouseClick("left", round(@DesktopWidth / 2), round(@DesktopHeight / 2)); crude attempt to give focus to game
- Sleep(1000); 1 second delay to allow user to give focus to game if needed.
- GUICtrlSetData($Group_Status, "Sending Custom")
- ; reset income, counters and labels from any previous rounds.
- $income = 0;
- For $i = 0 to 12
- $counters[$i] = 0
- Next
- For $i = 0 to 5
- GUICtrlSetData($Label_Status[$i],"")
- Next
- 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]))
- SendBloons(GUICtrlRead($Input_Number[0]), _GUICtrlComboBox_GetCurSel($Combo_Group[0]), 0, GUICtrlRead($Input_Delay[0]))
- for $i = 1 to 4
- if _GUICtrlComboBox_GetCurSel($Combo_Group[$i]) <> 14 Then; if bloon selection <> "none"
- SendBloons(GUICtrlRead($Input_Number[$i]), _GUICtrlComboBox_GetCurSel($Combo_Group[$i]), GUICtrlRead($Input_Start[$i]), GUICtrlRead($Input_Delay[$i]))
- EndIf
- Next
- SleepFF(1000)
- GUICtrlSetData($Group_Status, "Custom Complete")
- ;End Sending of Custom Round.
- Case $msg = $Input_Money
- GUICtrlSetData($Label_Money, "$" & String(GUICtrlRead($Input_Money) + $income))
- Case Else ; modifying the RBE
- for $i = 0 to 13
- if $msg = $Button_Color_Down[$i] Then
- AdjustModifier($i, $Label_Color[$i], -1)
- ExitLoop
- elseif $msg = $Button_Color_Up[$i] Then
- AdjustModifier($i, $Label_Color[$i], 1)
- ExitLoop
- EndIf
- Next
- EndSelect
- WEnd
- _Timer_KillAllTimers(0)
- TrayTip("Program ", " complete", 1000)
- Sleep(1000)
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement