With me back playing on ECC, I thought I'd properly share a lottery macro I had made over a year ago, with me finally managing to fix the few bugs it had. This macro provides you with the pot amount, time till draw, last pot winner and last pot amount. Spoiler: How it Looks 1. Navigate to the text editor and create 3 files Spoiler The first to create is "lotto.txt", it is important that you keep the exact names: Code: $${ IFMATCHES(%&chat%,^\[LOTTERY\] Congratulations go to (.*) for winning \$[0-9]+ with [0-9]+ tickets\.); MATCH(%&chat%,^\[LOTTERY\] Congratulations go to (.*) for winning \$([0-9]+) with ([0-9]+) tickets\.,{@&winner,@#lotwin,#wintix}); @#pot=0; STOP(timer); @#seccount=0; @#mincount=15; EXEC(lottotimer.txt,timer); SETLABEL(lot,Last Winner: &5%@&winner%\n&fLast Pot: &2$%@#lotwin%\n&fPot: &a$%@#pot%\n&fDraw in: &b%@#mincount%min &b%@#seccount%sec,lot); ENDIF; IFMATCHES(%&chat%,^\[LOTTERY\] Draw in: [0-9]+ seconds?); MATCH(%&chat%,^\[LOTTERY\] Draw in: ([0-9]+) seconds?,{#countsec}); @#mincount=0; @#seccount=#countsec; ENDIF; IFMATCHES(%&chat%,^\[LOTTERY\] Draw in: [0-9]+ minutes?\, and [0-9]+ seconds?); MATCH(%&chat%,^\[LOTTERY\] Draw in: ([0-9]+) minutes?\, and ([0-9]+) seconds?,{#countmin,#countsec}); @#mincount=#countmin; @#seccount=#countsec; ENDIF; IFMATCHES(%&chat%,^\[LOTTERY\] (.*) just bought [0-9]+ tickets?); MATCH(%&chat%,^\[LOTTERY\] (.*) just bought ([0-9]+) tickets?,{&username,#tickets}); #amount=#tickets*850; @#pot=@#pot+#amount; SETLABEL(lot,Last Winner: &5%@&winner%\n&fLast Pot: &2$%@#lotwin%\n&fPot: &a$%@#pot%\n&fDraw in: &b%@#mincount%min &b%@#seccount%sec,lot); ENDIF; IFMATCHES(%&chat%,^\[LOTTERY\] (.*) just bought [0-9]+ tickets?! Draw in [0-9]+m [0-9]+s); MATCH(%&chat%,^\[LOTTERY\] (.*) just bought [0-9]+ tickets?! Draw in ([0-9]+)m ([0-9]+)s,{&username,#countmin,#countsec}); @#mincount=#countmin; @#seccount=#countsec; SETLABEL(lot,Last Winner: &5%@&winner%\n&fLast Pot: &2$%@#lotwin%\n&fPot: &a$%@#pot%\n&fDraw in: &b%@#mincount%min &b%@#seccount%sec,lot); ENDIF; IFMATCHES(%&chat%,^\[LOTTERY\] (.*) just bought [0-9]+ tickets?! Draw in [0-9]+s); MATCH(%&chat%,^\[LOTTERY\] (.*) just bought ([0-9]+) tickets?! Draw in ([0-9]+)s,{&username,#tickets,#countsec}); @#mincount=0; @#seccount=#countsec; SETLABEL(lot,Last Winner: &5%@&winner%\n&fLast Pot: &2$%@#lotwin%\n&fPot: &a$%@#pot%\n&fDraw in: &b%@#mincount%min &b%@#seccount%sec,lot); ENDIF; IFMATCHES(%&chat%,^\[LOTTERY\] Last winner: (.*) \$[0-9]+); MATCH(%&chat%,^\[LOTTERY\] Last winner: (.*) \$([0-9]+),{@&winner,@#lotwin}); SETLABEL(lotpot,Last Winner: &5%@&winner%\n&fLast Pot: &2$%@#lotwin%\n&fPot: &a$%@#pot%\n&fTime: %@#minutes%m %@#seconds%s ,lotpot); ENDIF; IFMATCHES(%&chat%,^\[LOTTERY\] There is currently \$[0-9]+ in the pot\.); MATCH(%&chat%,^\[LOTTERY\] There is currently \$([0-9]+) in the pot\.,{@#pot}); SETLABEL(lot,Last Winner: &5%@&winner%\n&fLast Pot: &2$%@#lotwin%\n&fPot: &a$%@#pot%\n&fDraw in: &b%@#mincount%min &b%@#seccount%sec,lot); ENDIF; }$$ Next create "lottoloop.txt": Code: $${ DO; SETLABEL(lot,Last Winner: &5%@&winner%\n&fLast Pot: &2$%@#lotwin%\n&fPot: &a$%@#pot%\n&fDraw in: &b%@#mincount%min &b%@#seccount%sec,lot); WAIT(10t) LOOP; }$$ And finally "lottotimer.txt": Code: $${ DO; WAIT(19t); IF(%@#seccount%=0); INC(@#seccount,60); DEC(@#mincount); ENDIF; DEC(@#seccount); IF(%@#mincount%=0); IF(%@#seccount%=0); STOP(timer); ENDIF; ENDIF; SETLABEL(lot,Last Winner: &5%@&winner%\n&fLast Pot: &2$%@#lotwin%\n&fPot: &a$%@#pot%\n&fDraw in: &b%@#mincount%min &b%@#seccount%sec,lot); LOOP; }$$ 2. Navigate to the GUI editor for the ingame screen Spoiler 3. Create a label with "lot" in the Control Name and Binding Spoiler 4. Navigate to the "onChat" event and paste "$$<lotto.txt>" into the box at the bottom using a "|" to separate it from anything else you have Spoiler 5. Navigate to the "onJoinGame" event and paste the code below into the box at the bottom, again using "|" to separate it from any code you have already Code: $${ECHO(/lot);EXEC(lottotimer.txt,timer);EXEC(lottoloop.txt,lottoloop)}$$ Spoiler 6. Disconnect and rejoin the server and you should be good to go! I do plan on adding features such as it telling you how many tickets you have in the pot and your percentage chance at winning. If you have any issues or suggestions please post below! Thanks to @Videowiz92 for his help all that time ago
It should be lottotimer.txt, not timer.txt. Anyway, this macro is interesting... When I do /lot, there's three possible things that can occur - The timer going down to 0min 0sec and staying there, the timer going into negative time/numbers or the macro actually correctly telling the time until the next lotto draw. Fix this?
Will edit the lottotimer.txt thing, thanks. In terms of the bugs you are experiencing I can't re-create them, so I'm not sure if you are doing something wrong?
This macro doesnt work for me. Everytime I try to join ECC I get kicked and it says "You Are Not Allowed To Spam In Chat".
Make sure you have "$${" (without the quotes) at the beginning of every text file and "}$$" (again without the quotes) at the end of every text file, or else the mod will output all the code into chat, which would then get you kicked for spamming. That's usually what's going on for me, anyway
Go on your opening Minecraft screen (the one that looks like this): Spoiler: Minecraft screen and then click on Options...>Controls>(scroll all the way down)>Macro Settings... By doing this, you can either edit the script and add $${ }$$ or unbind the script from the event to prevent it from running at all (either of which should allow you to connect to ECC without getting kicked.)