The correct command is $${SHOWGUI(secondscreen);}$$. The parameters work the same on every GUI and the homes/towns/friends list will remain the same for every macro.
Thanks for that Rene_Z. I've managed now to go to the second screen, however I cannot execute commands from it... the don't do anything. Any ideas?
Can anyone help me? I'm executing a script using EXEC and passing string variables like so: EXEC(script.txt,script,%&variable%);But when that script is executed, the variables act funny. The variable passed is the message part of a chat message from chat, and is a string. If I log $$[1] within the executed script, it gives me exactly what I expect, but if I do IF($$[1] = !free); then it runs no matter what as long as the first character is an exclamation point. Help please?
This is the code. I use the global varialbe spamproof to make sure that I don't get kicked for automatically saying things too quickly.
EDIT2: I've noticed that when I try LOGTO(test.txt,%&player%); , nothing happens. I log &player right before to see that it's not empty, and it never is. Help?
So, I'm trying to find a way to make the item slot change when the items in stack are less than a certain amount, sure I can use stacksize and inventoryup but, the problem here is I would like to make it toggle, so when I press the key it activates, and pressing again it stops, showing of course a message. I tried something like this example but it won't work:
Which I made by merging 2 different codes. Problem is that it won't detect the size of the stack, it simply rotates endlessly the slots no matter how many items it has. Any idea what is wrong? I'm really new on this. This is to place inside a txt with $${<file.txt>}$$ for the key. Should I add toggle to it?
You should never, ever use user input text as parameters and use it with $$[1]. Because parameters are replaced before the macro gets executed and can contain syntax elements.
For example, if you use LOG($$[1]); in your code and someone writes ");ECHO(/op Rene_Z);" your code will look like this:
LOG();ECHO(/op Rene_Z););
You probably know the rest. When you have extended permissions on a server, others can abuse this, and when not they can still get you banned (ECHO(F*** you all)).
There are 3 ways to prevent this:
Use $$<file.txt> instead of EXEC. This is the best way to do this. But there are some situations where you need an external task, then use one of the following options
Store the text in a global variable and read it from the new task. When the task doesn't get executed very often it should just work fine, but there may be problems if it gets executed multiple times within one tick. Then you could work around this by storing the text in an array and just overgive the index as a paramter.
This is not recommended and very difficult: Replace every possibly harmful character (;|$\) before and change it back in the second script. But because they are control characters you cannot replace them easily, you have to store them in a variable first and then use that variable in the replace command. But this method is really not recommended.
You need quotation marks around your string: "!free" Otherwise the ! is read as a NOT. Using quotation marks for every string also makes your scripts more readable (but don't use them around variables in conditions).
My macros always check for colored text first, to check that it is a legitimiate message. My regexes filter out the message from the username and so-on, and it never has a chance to echo something dangerous.
They work exactly the same like on any other screen. Are you sure you bound a command or macro to it? You can right-click on a button and click Edit Macro to see what macro you bound to it.
Ha this is odd. When I go through the config menu to add buttons and commands, and then in operation use showgui to go tho the second screen, clicking on them does nothing...
buuuuut when instead i use showgui to go to the second screen, and then use the screen config button in the lower right - do edits, the commands work!
So I would like to create a macro that loops forever but before it activates it checks to see if the X cordinates are equal to something, then and only then it activates the macro. I have the macro already made so it loops forever Im just trying to add a check to it. Could someone help?
I have been trying to make a side chat game but it would require several loops to run alongside one another. I tried using the Exec() syntax in my testing but it doesn't work for me. Can anyone find out why (perhaps an example? I learn best with examples)? I have tried multiple variations of execute but none of them work for me. I am also using the 1.5.2 Macro Keybind and Lightloader for this (primarily since the 1.6.x version is a chore to make compatible with optifine and other mods).
On the button E, I put the following
$${LOG(Attempting to execute A1);EXEC(A1.txt);LOG(Attempting to execute A2);EXEC(A2.txt)}$$
$${LOG(Attempting to execute A1);
EXEC(A1.txt);
LOG(Attempting to execute A2);
EXEC(A2.txt)}$$
Just for some more context: I copied the lines into a text file sing the in-mod text editor, named it "Test.txt" and put $${$$<Test.txt>}$$ in the OnPlayerJoined macro text box thing.
That doesn't seem to be working for me. Also, I'm trying to implement the five second wait into it too. I copied it from a post from this thread.
Just for some more context: I copied the lines into a text file sing the in-mod text editor, named it "Test.txt" and put $${$$<Test.txt>}$$ in the OnPlayerJoined macro text box thing.
That doesn't seem to be working for me. Also, I'm trying to implement the five second wait into it too. I copied it from a post from this thread.
Is there any possible way to append text to the chat(gui) by clicking on a button?
Example:
The quotes represent the text typed when in the chat gui.
Typed text: "//replace "
Click button [WE-R: Dirt] (appends "3 ")
New Text:
"//replace 3 "
Click button [WE-R: Air] (appends "0 ")
New Text:
"//replace 3 0"
To Mufrey: If not, could you possibly see this being added in the future( ) ?
I just see this being useful for a few situations where some commands may require or have a number of different arguments in a specific location. Anyways just a thought. xD
Is there any possible way to append text to the chat(gui) by clicking on a button?
Example:
The quotes represent the text typed when in the chat gui.
Typed text: "//replace "
Click button [WE-R: Dirt] (appends "3 ")
New Text:
"//replace 3 "
Click button [WE-R: Air] (appends "0 ")
New Text:
"//replace 3 0"
To Mufrey: If not, could you possibly see this being added in the future( ) ?
I just see this being useful for a few situations where some commands may require or have a number of different arguments in a specific location. Anyways just a thought. xD
Not exactly sure how you see this working seeing as you cant move and punch blocks while the chat is physically open, but perhaps by checking if the command requires more arguments and then storing it in a variable
and start a background process to capture your punches and such that appends to that variable
Is there any possible way to append text to the chat(gui) by clicking on a button?
Example:
The quotes represent the text typed when in the chat gui.
Typed text: "//replace "
Click button [WE-R: Dirt] (appends "3 ")
New Text:
"//replace 3 "
Click button [WE-R: Air] (appends "0 ")
New Text:
"//replace 3 0"
To Mufrey: If not, could you possibly see this being added in the future( ) ?
I just see this being useful for a few situations where some commands may require or have a number of different arguments in a specific location. Anyways just a thought. xD
How would I count the amount of lines in a text document?
I have a file with the name of each user who joins (Simple logto(), it doesn't add the same name twice), Im guessing it's something with a foreach() but I have no clue :S
EDIT:
Found a different way to do it, but I would still like some ideas
The correct way to do this would be to use an array, just PUSH the value into the array and use ARRAYSIZE to get the size of the array, you can use INDEXOF prior to insertion to check whether the value is already present in the array.
How would I go about making a macro to tell when someone uses the /slay command and make it slay then in return?
Whenever someone uses the /slay command, the target sees "Slain by <playername>"
I can't figure out how to make it slay them in return.
How would I go about making a macro to tell when someone uses the /slay command and make it slay then in return?
Whenever someone uses the /slay command, the target sees "Slain by <playername>"
I can't figure out how to make it slay them in return.
onChat or ChatFilter:
IFMATCHES(%CHATCLEAN%,"^Slain by (.+)$",&player,1)
Echo(/slay %&player%)
ENDIF
Thanks for that Rene_Z. I've managed now to go to the second screen, however I cannot execute commands from it... the don't do anything. Any ideas?
EDIT:
This is the code. I use the global varialbe spamproof to make sure that I don't get kicked for automatically saying things too quickly.
EDIT2: I've noticed that when I try LOGTO(test.txt,%&player%); , nothing happens. I log &player right before to see that it's not empty, and it never is. Help?
Which I made by merging 2 different codes. Problem is that it won't detect the size of the stack, it simply rotates endlessly the slots no matter how many items it has. Any idea what is wrong? I'm really new on this. This is to place inside a txt with $${<file.txt>}$$ for the key. Should I add toggle to it?
My macros always check for colored text first, to check that it is a legitimiate message. My regexes filter out the message from the username and so-on, and it never has a chance to echo something dangerous.
Ha this is odd. When I go through the config menu to add buttons and commands, and then in operation use showgui to go tho the second screen, clicking on them does nothing...
buuuuut when instead i use showgui to go to the second screen, and then use the screen config button in the lower right - do edits, the commands work!
odd..
On the button E, I put the following
In A1.txt, I put the following
In A2.txt, I put the following
Yes, change the following entry in your .macros.txt
Macro/Keybind mod Wiki
Can someone help me make a macro for OnPlayerJoined where it welcomes the player... but if the player is a certain name, it does nothing?
Like... it welcomes EVERYONE except Bob, John, and Kenny.
I'm a newbie to this, so I haven't been able to figure it out myself. ;-;
OnPlayerJoin:
$${
IFMATCHES(%JOINEDPLAYER%,"^(Bob|John|Kenny)$")
ELSE
Echo("Welcome..., %JOINEDPLAYER%!")
ENDIF
}$$
'Cause tomorrow spring is here
Just for some more context: I copied the lines into a text file sing the in-mod text editor, named it "Test.txt" and put $${$$<Test.txt>}$$ in the OnPlayerJoined macro text box thing.
That doesn't seem to be working for me. Also, I'm trying to implement the five second wait into it too. I copied it from a post from this thread.
DO;
WHILE(@welcomerunning);
SET(@welcomerunning);
ECHO("Welcome %JOINEDPLAYER%!");
WAIT(5);
UNSET(@welcomerunning);
Should work, but okay
try IFMATCHES(%JOINEDPLAYER%,"^(Bob|John|Kenny)$")
LogTo("Debug.txt","[filtered] %JOINEDPLAYER%")
ELSE
LogTo("Debug.txt","[unfiltered] %JOINEDPLAYER%")
Echo("Welcome..., %JOINEDPLAYER%!")
ENDIF
and see (+ show us) what it gives you
'Cause tomorrow spring is here
Thanks again <3
Example:
To Mufrey: If not, could you possibly see this being added in the future( ) ?
I just see this being useful for a few situations where some commands may require or have a number of different arguments in a specific location. Anyways just a thought. xD
Not exactly sure how you see this working seeing as you cant move and punch blocks while the chat is physically open, but perhaps by checking if the command requires more arguments and then storing it in a variable
and start a background process to capture your punches and such that appends to that variable
IFMATCHES(%FILTERABLECHAT%,"^//replace$");Exec(command.txt,"//replace","//replace");ENDIF
And in that file
&output = $$?
Do()
Until(KEY_MOUSE1)
Set(&output,%&output% %HITID%)
Log(%&output%)
Do()
Until(KEY_MOUSE1)
Set(&output,%&output% %HITID%)
Log(&a%&output%)
Echo(%&output%)
'Cause tomorrow spring is here
Macro/Keybind mod Wiki
The correct way to do this would be to use an array, just PUSH the value into the array and use ARRAYSIZE to get the size of the array, you can use INDEXOF prior to insertion to check whether the value is already present in the array.
Whenever someone uses the /slay command, the target sees "Slain by <playername>"
I can't figure out how to make it slay them in return.
onChat or ChatFilter:
IFMATCHES(%CHATCLEAN%,"^Slain by (.+)$",&player,1)
Echo(/slay %&player%)
ENDIF
'Cause tomorrow spring is here
Thank you!
I have been trying to learn how to script these macros, but the only experience I've had is using snippits from others.