Hello,
I want to have this command, that leaves all channels. I got it to work so it will leave all of them with a 1second delay, but I want to make sure that I actually leave sg and lotto.
This means that there has to be some clause that if the chat matches "[ECC-SG] You will now receive SG broadcast messages", then it will do /sg messages again. Same with lottery, if the chat matches "[Lottery] You will now receive Lottery broadcast messages."
It currently looks like this:
I tried to use the "IFMATCHES" and other commands like that but couldn't figure out how to do it, and I can't find any macro references online.$${
ECHO("/leave g")
Wait(1)
ECHO("/leave l")
Wait(1)
ECHO("/leave tr")
Wait(1)
ECHO("/leave V")
Wait(1)
ECHO("/leave Auc")
Wait(1)
ECHO("/leave trv")
Wait(1)
ECHO("/leave SG")
Wait(1)
ECHO("/leave M")
Wait(1)
ECHO("/leave E")
Wait(1)
ECHO("/leave N")
Wait(1)
ECHO("/sg messages")
Wait(1)
ECHO("/lot messages")
}$$
Thread Tools
Thread Tools
-
MaxToMinimum PresidentPresident ⛰️⛰️ Ex-Tycoon ⚜️⚜️⚜️
-
Code:^\[ECC-SG\] You will now receive SG broadcast messages. ^\[Lottery\] You will now receive Lottery broadcast messages.
Code:ECHO("/sg messages") WAIT(1) IFMATCHES(%CHATCLEAN%, "^\[ECC-SG\] You will now receive SG broadcast messages.") ECHO("/sg messages") WAIT(1) ENDIF ECHO("/lot messages") WAIT(1) IFMATCHES(%CHATCLEAN%, "^\[Lottery\] You will now receive Lottery broadcast messages.") ECHO("/lot messages") ENDIF
Small question: Since commands like /fly or /dtag have the option to specify "on" or "off" as a parameter - does the same apply to the /lot messages and /sg messages commands? -
MaxToMinimum PresidentPresident ⛰️⛰️ Ex-Tycoon ⚜️⚜️⚜️
I am kind of confused on what you mean by "This needs to be a separate macro using the onChat binding because utilizing chat in a script requires an event trigger.", like what do you mean I should do? -
kukelekuuk C͕̹̲̽ͪ͐ͩ̔L̜̦̝͈ͦ̿̾̿ḘA̻̗̤̳̐ͭ̆̿̃̑ͭN̊̓͑̇ͯBuilder ⛰️ Ex-EcoLeader ⚜️⚜️⚜️ Premium Upgrade
314, you know better than that. You should at least test the script.
Anyway. Basically you need 2 scripts. 1 that issues the commands and sets a global flag. And the onchat script that checks if you see the message and if the global flag is set. If so, do /sg messages again -
MaxToMinimum PresidentPresident ⛰️⛰️ Ex-Tycoon ⚜️⚜️⚜️
Also, how would I set a global flag? I am quite new to macros and not good at programming them at all -
kukelekuuk C͕̹̲̽ͪ͐ͩ̔L̜̦̝͈ͦ̿̾̿ḘA̻̗̤̳̐ͭ̆̿̃̑ͭN̊̓͑̇ͯBuilder ⛰️ Ex-EcoLeader ⚜️⚜️⚜️ Premium Upgrade
the "@" part makes it global. Without the @ it can only be used in the same script.
so say you name your flag sgmessages you get SET(@sgmessages) and UNSET(@sgmessages)
They can be used in if statements. SET = true, UNSET = false. so like:
Code:IF(@sgmessages); IFMATCHES(<regexstuff>); ENDIF; ENDIF;
-
The script itself was supposed to be within an IF() block checking for a global flag, as you mentioned. If my script doesn't contain "$${ }$$", it usually means that it is only an extract that shouldn't be run as a standalone script; I acknowledge that I should have made this clear beforehand.
Set it to 'true':
Code:SET(@flagname)
Code:UNSET(@flagname)
Code:IF(@flagname) //Insert code here ENDIF
-
MaxToMinimum PresidentPresident ⛰️⛰️ Ex-Tycoon ⚜️⚜️⚜️
So I've spent like 45 minutes trying to figure out how to make this work, but I cannot figure it out.
It would be lovely if any of you two could figure it out how to make it work, and actually show me how to do it. This is mainly as I am not as talented and knowledgeable in macros as you guys are.
No rush, this isn't a need so take your time. -
kukelekuuk C͕̹̲̽ͪ͐ͩ̔L̜̦̝͈ͦ̿̾̿ḘA̻̗̤̳̐ͭ̆̿̃̑ͭN̊̓͑̇ͯBuilder ⛰️ Ex-EcoLeader ⚜️⚜️⚜️ Premium Upgrade
I haven't installed macromod in 2 years. So I won't be available for help.
-
First script bind to onChat Event.
Code:$${ IFMATCHES(%CHATCLEAN%, "^\[ECC-SG\] You will now receive SG broadcast messages.") IF(@sgmessage) ECHO("/sg messages") UNSET(@sgmessage) ENDIF ENDIF IFMATCHES(%CHATCLEAN%, "^\[Lottery\] You will now receive Lottery broadcast messages.") IF(@lotmessage) ECHO("/lot messages") UNSET(@lotmessage) ENDIF ENDIF }$$
Code:$${ SET(@sgmessage) SET(@lotmessage) ECHO("/leave global") WAIT(1) ECHO("/leave local") WAIT(1) ECHO("/leave trade") WAIT(1) ECHO("/leave auction") WAIT(1) ECHO("/leave trv") WAIT(1) ECHO("/leave nether") WAIT(1) ECHO("/leave end") WAIT(1) ECHO("/leave mining") WAIT(1) ECHO("/leave vip") WAIT(1) ECHO("/leave sg") WAIT(1) ECHO("/sg messages") WAIT(1) ECHO("/lot messages") }$$
-
MaxToMinimum PresidentPresident ⛰️⛰️ Ex-Tycoon ⚜️⚜️⚜️
-
kukelekuuk C͕̹̲̽ͪ͐ͩ̔L̜̦̝͈ͦ̿̾̿ḘA̻̗̤̳̐ͭ̆̿̃̑ͭN̊̓͑̇ͯBuilder ⛰️ Ex-EcoLeader ⚜️⚜️⚜️ Premium Upgrade
Should unset the global flags when the correct message shows up, too. The "no longer receive" messages. -
MaxToMinimum PresidentPresident ⛰️⛰️ Ex-Tycoon ⚜️⚜️⚜️
-
kukelekuuk C͕̹̲̽ͪ͐ͩ̔L̜̦̝͈ͦ̿̾̿ḘA̻̗̤̳̐ͭ̆̿̃̑ͭN̊̓͑̇ͯBuilder ⛰️ Ex-EcoLeader ⚜️⚜️⚜️ Premium Upgrade