Hi. I'm not sure how to do this (I've attempted it with no success so far). I want a macro which when I click a button, it toggles on a timer, which sends a message in chat every 2 minutes. And when the button is clicked again the message is toggled off. Thanks!
toggle(flag)
if(!flag)
stop
endif
do
echo("message")
wait(120)
loop
1. Is there an official docs other than this readme.txt? I can't for the life of me figure out the syntax for FOREACH and thus can't even simply figure out how to print online players to the console. Let alone populate a label with it. Also I can't even find any documentation on the iterator "players", so I don't know how I would have even known that iterator existed.
I can't seem to find documentation to see if it's possible to see how many mobs are nearby, or a count, or the mobs in the area.
Do you know if this is a feature?
I have a spare account standing near a mob farm, it would be nice to notify me and other players in chat when it reaches a certain level, or by command
Since I don't know the exact formatting, I can only check that the text was displayed. The downside to this is, if a player types the server welcome message, your script would also trigger. To fix this, you would check for a colored message instead of the plain text. If you can provide the formatting with symbols, then I can help with a colored version. Otherwise, the stuff below should work for now - put the code into a text file, then type $${$$<yourtextfilename.txt>}$$ in the onChat event.
IFMATCHES(%CHATCLEAN%,"Welcome \[Vagabond] (.+?) to Golden Sands!");
MATCH("%CHATCLEAN%,"Welcome \[Vagabond] (.+?) to Golden Sands!",{&player});
WAIT(2);
ECHO("Welcome %&player%!");
ENDIF;
You could also prepend the regex pattern with ^ and append it with $. That should make sure that there is nothing in front and nothing after.
Like so:
Is there a limit to how many text files the mod can run, or maybe specifically that onCHAT can run? I have a config that tries to use 7 text files but it only runs the first 5. I have a main script file that onCHAT uses. This script file looks like this:
$${$$<File1.txt>}$$|
$${$$<File2.txt>}$$|
$${$$<File3.txt>}$$|
$${$$<File4.txt>}$$|
$${$$<File5.txt>}$$|
$${$$<File6.txt>}$$|
$${$$<File7.txt>}$$|
The problem is not with the script files themselves; if I switch them around, the top 5 will be run and not the bottom 2.
Any way to get around this?
I think it runs the first 10 by default. it should be changeable in .minecraft/liteconfig/common/macros/.macros.txt under compiler.maxinclude
Has the way INDEXOF interacts with the Friends list changed? I'm having trouble with previously working code now not. I'm also having the same problem with PLAYSOUND.
I'm pretty sure the array FRIENDS[] is not available in macros. But I made a module with that array a while back, which you probably used. Sadly I didn't have time to update that module.
This happens when an outdated version of LWJGL ends up on the classpath. This was (in the past) caused because the liteloader dev POM file on my maven had a reference to Mixin, which in its POM file had a reference to launchwrapper 1.11 (not 1.12) and launchwrapper 1.12 has a reference to LWJGL 2.9.1. Because ForgeGradle puts deobf artefacts higher in the classpath than other gradle dependencies, the version of LWJGL indirectly linked via deobf was placed higher in the classpath than the (correct) 2.9.4.
Basically this is resolved at the liteloader maven end now, but can be caused if:
You have an outdated liteloader POM anywhere in your dependency tree
You have a (cached by ForgeGradle) outdated liteloader versions.json in your dependency tree
You have added any artefact to the compile dependencies which indirectly causes launchwrapper 1.11 to be referenced.
To resolve it
You can fix it temporarily (eg. every time you run gradle eclipse you will need to redo) by just editing the project properties and removing LWJGL 2.9.1 from the libraries
You can fix it for good by:
cleaning out cached versions.json (in .gradle/caches/minecraft/com)
cleaning out cached liteloader versions in your .m2 or .gradle caches
It's easy to determine when this is going to happen because you can just run gradle dependencies and grep it for LWJGL 2.9.1, if you see it appear in the list then something is broken, you can walk the POM tree (via gradle dependencies) and see where it's coming from, you can also use gradle's dependencyInsight to find out more.
I cleared the .gradle/caches/com folder and now it works. Thanks
So I finally got a chance to properly create a Macros Module SDK. The SDK takes the form of an example ForgeGradle project which you can use as a template for your own modules. It has the following features:
Stand-alone ForgeGradle project which automatically fetches:
LiteLoader
Macros Mod (dev version)
Macros API
Currently supports only Eclipse, if you want to use a different IDE it'll be up to you to customise the gradle script
Provides a test environment for your module and builds a compatible artefact with no customisation required
Only supports 0.14.0 for 1.11 currently, as new versions are released in the future I will now always provide a compatible dev artefact on the maven
You can download the SDK zip from here:
The SDK works just like any other ForgeGradle project, you will need Eclipse installed on your system. To use the module SDK:
Extract the zip file to your eclipse workspace directory
Import the project using File -> Import -> Gradle -> Project
In the gradle tasks tab run the setupDecompWorkspace task
In the gradle tasks tab run the eclipse task
Right-click the project and choose Gradle -> Refresh Gradle Project
The SDK project can be configured by the gradle.properties file. If making any changes to the file run the eclipse task again and then refresh the gradle project. The source code for the ExampleModule is available here as well, if you prefer to checkout from git.
I have set up everything accordingly, but I have some issues with launching minecraft from eclipse.
Basically after launching the minecraft window is very small, like this:
And after resizing it looks like this:
I'm not really sure what could be the problem. I hope you can help me
Already had protection set up and just needed a way to actually read and execute the chat.
"notices the sayAfterMe command, and echoes what is after it into the chat"
I dont know how to do that is my problem.
Thanks for giving a warning though. Could have been bad for someone else :p.
Since you seem experienced, it actually is possible to execute scripts from the chat.
Basically you have to create another .txt file which should only contain $$[1]
If you now want to execute some script just start the file with exec and the script as the third parameter EXEC(file.txt,file,<script here>)
You don't need to add $${ and }$$
0
What is your expected behaviour and what happens?
0
There is still a problem with the item type hint for user-defined custom params.
All items are display twice.
I'm using v0.15.4
Example:
$$[[gold_ingot,gold_block,gold_nugget]i]
0
0
As a shortcut you can use TOGGLE([flag]) combined with IIF(<condition>,<truetext>,[falsetext])
0
GUI() works with minecrafts builtin screens.
SHOWGUI() should work with macros custom gui screens.
0
There is http://mkb.gorlem.ml/wiki/commands but it is not up to date.
0
No currently there is no such feature
Currently not
0
I have a few bugs which I think were not already reported:
CRAFT Action: Seems to give you two items while you are in creative and don't already have the item.
PICK Action: Doesn't seem to work with enchanted or named tools.
VEHICLE Variable: Returns entity.MinecartRideable.name for Minecarts.
SEED Variable: Returns 0 even in Single Player.
1
You could also prepend the regex pattern with ^ and append it with $. That should make sure that there is nothing in front and nothing after.
Like so:
0
I think it runs the first 10 by default. it should be changeable in .minecraft/liteconfig/common/macros/.macros.txt under compiler.maxinclude
0
Yes, IFMATCHES uses regex. That means you can use "\+give me diamond armou?r" which should match armor and armour
0
I'm pretty sure the array FRIENDS[] is not available in macros. But I made a module with that array a while back, which you probably used. Sadly I didn't have time to update that module.
0
I cleared the .gradle/caches/com folder and now it works. Thanks
0
I have set up everything accordingly, but I have some issues with launching minecraft from eclipse.
Basically after launching the minecraft window is very small, like this:
And after resizing it looks like this:
I'm not really sure what could be the problem. I hope you can help me
1
Since you seem experienced, it actually is possible to execute scripts from the chat.
Basically you have to create another .txt file which should only contain $$[1]
If you now want to execute some script just start the file with exec and the script as the third parameter EXEC(file.txt,file,<script here>)
You don't need to add $${ and }$$