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.
1. Navigate to the text editor and create 3 files
The first to create is "lotto.txt", it is important that you keep the exact names:
Next create "lottoloop.txt":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; }$$
And finally "lottotimer.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; }$$
2. Navigate to the GUI editor for the ingame screenCode:$${ 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; }$$
3. Create a label with "lot" in the Control Name and Binding
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
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)}$$
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 :)
Thread Tools
Thread Tools
-
rockboy2000 MayorMayor ⛰️⛰️ Ex-Tycoon ⚜️⚜️⚜️ Premium Upgrade
- Joined:
- Oct 19, 2012
- Messages:
- 1,335
- Trophy Points:
- 54,410
- Gender:
- Male
- EcoDollars:
- $0
- Ratings:
- +310
-
Videowiz92 YesMythic ⚔️ I ⚔️ ECC Benefactor President ⛰️⛰️ Ex-EcoLegend ⚜️⚜️⚜️⚜️ Prestige ⭐⭐ X ⭐⭐ Gameplay Architect Premium Upgrade
Wow I can't believe this still exists after all these years :)
-
Like x 3 - List
-
-
UnitedStates2 BuilderBuilder ⛰️ Ex-President ⚒️⚒️ Gameplay Architect Premium UpgradeIt 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?-
Like x 1 - List
-
-
rockboy2000 MayorMayor ⛰️⛰️ Ex-Tycoon ⚜️⚜️⚜️ Premium Upgrade
- Joined:
- Oct 19, 2012
- Messages:
- 1,335
- Trophy Points:
- 54,410
- Gender:
- Male
- EcoDollars:
- $0
- Ratings:
- +310
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? -
iTzXtremeGaming ResidentResident ⛰️ Ex-EcoLegend ⚜️⚜️⚜️⚜️ Prestige ⭐ III ⭐
This is impressive, great work!
-
glitch_404 The Legendary ResidentBuilder ⛰️ Ex-Resident ⚒️ Premium Upgrade
-
rockboy2000 MayorMayor ⛰️⛰️ Ex-Tycoon ⚜️⚜️⚜️ Premium Upgrade
- Joined:
- Oct 19, 2012
- Messages:
- 1,335
- Trophy Points:
- 54,410
- Gender:
- Male
- EcoDollars:
- $0
- Ratings:
- +310
Okay I'll look into it when I find the time :)
-
glitch_404 The Legendary ResidentBuilder ⛰️ Ex-Resident ⚒️ Premium UpgradeThankyou.
-
freddyagogog Ex-SModECC Sponsor Mayor ⛰️⛰️ Ex-EcoLegend ⚜️⚜️⚜️⚜️ Prestige ⭐ II ⭐ Premium Upgrade
- Joined:
- Jun 7, 2014
- Messages:
- 876
- Trophy Points:
- 57,910
- Gender:
- Male
- EcoDollars:
- $202,638
- Ratings:
- +513
Same error to me... -
OppyStoppy PainBuilder ⛰️ Ex-President ⚒️⚒️ Premium Upgrade
- Joined:
- Mar 16, 2015
- Messages:
- 1,329
- Trophy Points:
- 31,355
- Gender:
- Male
- EcoDollars:
- $0
- Ratings:
- +633
Same here -
Coolslammer3 BuilderBuilder ⛰️ Ex-President ⚒️⚒️
Could you post those other macros, they look really cool.
-
spencer23baller BuilderBuilder ⛰️ Ex-President ⚒️⚒️
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".
-
SionainnSun MayorMayor ⛰️⛰️ Ex-Mayor ⚒️⚒️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
-
spencer23baller BuilderBuilder ⛰️ Ex-President ⚒️⚒️
but how can I get on ECC If I get kicked the second I join
-
SionainnSun MayorMayor ⛰️⛰️ Ex-Mayor ⚒️⚒️Go on your opening Minecraft screen (the one that looks like this):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.) -
spencer23baller BuilderBuilder ⛰️ Ex-President ⚒️⚒️
Ok. Thanks
-
spencer23baller BuilderBuilder ⛰️ Ex-President ⚒️⚒️
Can you tell me how to fix it on LiteLoader?