This macro keeps track of the amount of money in the lotto pot. Thanks to jakeyray18 for his help with this and for letting me use some of his screenshots from his tutorial for a balance display macro. Spoiler First you must access the macro mod menu. To find the key press the Esc key. Then go to "Options", click on "Controls" and then use the arrows keys to find your "Macro activate" key. Default is grave which is the "~" key. Spoiler Now you want to open the Macro Mod menu. Do this by pressing the shift key and your "macro activate" key simultaneously. Then click the GUI editor button located in the bottom right corner, circled in the screenshot below. Spoiler Now you must double click on the tab called "ingame" listed under the available screens as shown in the screenshot below. Spoiler Now we want to create a label in the "ingame" screen so first click on the "Button Panel Commands" icon. Then click on the "Add Label" button. Spoiler Now you must choose where you would like to place the label, I have it at the top middle of my screen but it is up to you. It can be changed later on so it does not really matter. Once you have placed the label a box should appear. In the "Control name" box type "lotpot" without the quotation marks. Then click OK. Spoiler Now we must add the script that will show which channel you are in. To do this go back to the screen with the keyboard on it. At the top it should have a box saying "Macro bindings: Keys", click the right arrow once, it should then say "Macro bindings: Events". Then click the "Text editor" button in the lower right corner as shown in the picture. Spoiler Now you want to create a new file. Type the word "Lottery" without quotes in the box under "Create a new file:". Then click "Create". Spoiler A screen like this should appear: Spoiler In the editor copy and paste this code: Code: $${ STRIP(&chat,%CHAT%) 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(lotpot,Lotto: $%#pot%,lotpot) ENDIF() IFMATCHES(%&chat%,^\[LOTTERY\] There is currently \$[0-9]+ in the pot\.) MATCH(%&chat%,^\[LOTTERY\] There is currently \$([0-9]+) in the pot\.,{#current}) #pot = #current SETLABEL(lotpot,Lotto: $%#pot%,lotpot) ENDIF() IFMATCHES(%&chat%,^\[LOTTERY\] Congratulations go to (.*) for winning \$[0-9]+ with [0-9]+ tickets\.) #pot = 0 SETLABEL(lotpot,Lotto: $%#pot%,lotpot) ENDIF() }$$ After clicking the save button you need to go back to the "Macro bindings: Events" page and click on "onChat" In the box at the bottom type "$$<Lottery.txt>" without the quotes. If you already have something in the box separate it with "|". For example: $$<random.txt>|$$<Lottery.txt> Spoiler Now finally we must make the lottery pot update upon log in so go back to the "Macro bindings: Events" page and click on "onJoinGame" In the box at the bottom copy and paste this: Code: $${ECHO(/lot)}$$ If you already have something in the box separate it with "|". For example: $${ECHO(/bal|/lot)}$$
I did everything you had, but the lottery thing doesnt show up. On the label do i add anything for the label text or binding?
No, if you have done it right it should fill in, type /lot to get it started for the first time. I also need to apply a minor fix for the last instruction.
Yes this will work, however for users that have been saying that they get temporarily denied to join the server, this is because they have spammed the commands they have on onjoingame, they will need to separate them with a wait. For Example: Code: $${ECHO("/bal");WAIT(2);ECHO("/lot")}$$ This should solve the little spamming problem when users attempt to connect and get denied. Just a heads up if anyone else asks. - Jakey