Hello mumfrey and good day to you, First of all i would like to thank you for this incredible mod. I certainly can't play Minecraft without it, however there is one thing that is really bothering me about this mod.
so Basically, It's really hard to understand. A lot of the times i want to use the commands that are in the mod, but i don't know anything about the iterators or complete info about the commands. I have to search for it in this page, sometimes in the change logs and sometimes in the tutorial link you have provided.
It would be perfect if you could implement a separate part in the mod similar to the "cmd help" section where you can list all available Iterators and Variables, Commands they relate to, and possibly some slightly more detailed info about each Command so that people like me can get more efficient with this mod.
I hope you implement these features when you have the time and energy, and again, thank you for this amazing work. This mod still has very great potentials..
Hello mumfrey and good day to you, First of all i would like to thank you for this incredible mod. I certainly can't play Minecraft without it, however there is one thing that is really bothering me about this mod.
so Basically, It's really hard to understand. A lot of the times i want to use the commands that are in the mod, but i don't know anything about the iterators or complete info about the commands. I have to search for it in this page, sometimes in the change logs and sometimes in the tutorial link you have provided.
It would be perfect if you could implement a separate part in the mod similar to the "cmd help" section where you can list all available Iterators and Variables, Commands they relate to, and possibly some slightly more detailed info about each Command so that people like me can get more efficient with this mod.
I hope you implement these features when you have the time and energy, and again, thank you for this amazing work. This mod still has very great potentials..
Fleshing out the in-game help is certainly something I've had in my mind for a long time. Variables are tricky because the variables available will vary by scope but I could probably at least have the top-level so-called "environment" variables available somewhere. Creating the initial batch of in-game documentation took a pretty long time and I have to be mindful of the translations too, but I do still want to expand it where possible. We're approaching the time of year where I actually have a measurable amount of free time, so I will be looking to work on the mod more actively over the next couple of months, I'll certainly keep the documentation situation in mind.
Sometimes while I'm typing in chat if I use a key which has a macro it runs the macro. sorry if this isn't how I am intended to report bugs.
Just in case.., are you sure you're not accidentally hitting the "macro activate" or "macro override" buttons?
Especially if one of those is shift or another modifier key you use while typing..
Currently on 1.8 liteloader-macros due to how it doesn't have stuff like the annoying automatic shield on multiplayer servers. This doesn't appear to be a thing in 1.8 macros, is there any other way?
I looked up lwjgl key codes and apparently the code for LMB(left mouse button) is 0.
When i try either of these commands, they don't register 0 as a valid key code and it doesn't have any effect(even though the it should detect any valid lwjgl code).
KEWDOWN(0);
BIND(ATTACK,0);
am i doing it wrong? I've already tested with keyboard codes and it works perfectly, but mouse codes don't work entirely.
That wouldn't work for what i'm doing, basically my script NEEDS me to use the KEYDOWN and BIND keys for mouse buttons.
You cannot use key codes in Key/KeyDown/KeyUp because those actions do NOT simulate keys themselves, they activate the binding (action) directly
That is why you write the name of the action, not the key (forward instead of w, attack instead of mouse0, etc)
Now, the reason KeyDown(attack) does not work is because attack is a trigger binding, and trigger bindings work with Key(), not KeyDown and KeyUp
Stateful bindings only react to KeyDown(), KeyUp() - while trigger bindings only react to Key()
Anyway, to simulate "holding mouse0, assuming that is bound to attack", you simply need to call Key(attack) every tick, for example $${Do(100);Key(attack);Loop}$$
Just assign it to an integer variable, for example
Set(#value,%&value%);
or
#value = %&value%;
How to get a message from chat
First of all your script needs to be in onChat (so you can do logic to the line of chat that arrived - you can't programmatically "read chat" from the past)
In onChat you have two environment variables, CHAT and CHATCLEAN. They contain the message that triggered the script, with and without color codes, respectively
For example they might be
CHAT: "§6Dslyecxi: §r§fSetInteger 5"
CHATCLEAN: "Dslyecxi: SetInteger 5"
How to extract a part of a string
use the IFMATCHES;ENDIF command - first argument is the message, and the second is a regular expression to check for
IFMATCHES("example","xamp") // IF(true)
// more code
ENDIF;
You can also extract one capturing group into a variable by specifiying a variable name and group number
IFMATCHES("first second third","(\w+) (\w+) (\w+),&var2,2)
// more code
// &var2 is "second"
ENDIF;
If you want to get more groups without lots of IFMATCHES, you can use MATCH's alternate syntax
MATCH(subject,pattern,{&group1,&group2,...})
Full examples
For the sake of example, let's assume the messages you expect to receive look like the following:
Dslyecxi: SetInteger 5
Ghostboots: setinteger 15
and messages with extra text should be ignored (so you can, for example, talk about the syntax in chat without triggering it)
Dslyecxi: You just have to type something like "SetInteger 15" to do the thing
How do I get the block ID at a specific coordinate? I have attempted using GETID() and GETIDREL(), but they always give me a value of 0.
How do I use arrays in a macro? I already know that # is for integer, and & might be for string. Not sure if there is such for floats, but I do know there is some way to get arrays, based on some commands provided. What do I do?
__________________________
I want to create an A* pathfinder into a macro, and the Readme (readme.txt) isn't giving me any answers to my questions. Intended game version: 1.11.2
@chillerrrK not atm but mumfrey is working on it
@WhitePaw2002
I think what you are doing wrong with the getid is , that you are trying to get an integer value aus output as it is said in the documentary ingame however getid and getidrel will return strings
getid(0,50,0,&id,#data)
To use arrays you don't essentially need to use special commands. Just add [] behind the varname.
Example:
$${
&var[] = "hi" //adds hi at the end of the array
pop(&var[],&store) //removes the last entry from the tail and stores it in &store
push(&var[],"hi") //adds hi at the end of the array
put(&var[],"hi") //inserts hi at the first empty place in the array
log(%&var[1]%) //logs the 2. element of the array
arraysize(&var[],#size)
dec(#size,1)
for(#i,0,%#size%)
log(%&var[%#i%]%)
next // logs all elements - arraysize returns the size of an array
UNSET(&var[]) //deletes every element of the array
}$$
How do I get the block ID at a specific coordinate? I have attempted using GETID() and GETIDREL(), but they always give me a value of 0.
How do I use arrays in a macro? I already know that # is for integer, and & might be for string. Not sure if there is such for floats, but I do know there is some way to get arrays, based on some commands provided. What do I do?
__________________________
I want to create an A* pathfinder into a macro, and the Readme (readme.txt) isn't giving me any answers to my questions. Intended game version: 1.11.2
Please reply as soon as possible
GetId(Rel)
Are you trying to load the ID into an integer variable? Minecraft changed to string ID's quite a while ago...
Other things to check for are: are you giving it coordinates?, are you making sure not to put spaces after commas?, are the blocks you're asking for loaded?? (you can't check a block that your game does not know about after all..)
Example use:
GetID(0,64,0,&block_at_origin_64);
GetIDRel(0,-2,0,&block_below_you);
Log("Origin 64: %&block_at_origin_64%")
Log("Below you: %&block_below_you")
Arrays
In order to get an array variable, simply put [] at the end of your variable name
Commands that expect an array variable will also understand if you omit the brackets but it's better to be explicit so you don't accidentally use two different variables
aside from commands that work on arrays, you can also read/modify it directly as follows
Push (add to the end)
&myarray[] = "value"
Put (change a specific index)
&myarray[0] = "firstValue"
read a specifix index
&second = &myarray[1]
Empty (clear) an array
UnSet(&myarray[]); //unset is not specifically an array command so the brackets are necessary or it will unset the wrong variable
I am having some trouble with opening the inventory, I have an automation macro so I can level mineration skill. I'm currently on the 1.7.2 minecraft version and tried both the 1.7.2 and 1.7.10 macro/liteloader versions and both present this problem.
The macro consists in breaking/placing ore blocks and checking the inventory after a while so it can store the items in chests if inventory nearly full. The thing is, if the macro is running on an instance of minecraft that is running on the background (alt+tab or wathever), after you use the command GUI(inventory) [I also tried key(inventory) and press(E)] and then close it with gui(), press(E) or press(escape), when you go back to breaking blocks you hit it but it doesn't count, and the block doesn't break.
I tried a lot of things but I don't understand enought about the mod so I came asking for help.
Hello mumfrey and good day to you, First of all i would like to thank you for this incredible mod. I certainly can't play Minecraft without it, however there is one thing that is really bothering me about this mod.
so Basically, It's really hard to understand. A lot of the times i want to use the commands that are in the mod, but i don't know anything about the iterators or complete info about the commands. I have to search for it in this page, sometimes in the change logs and sometimes in the tutorial link you have provided.
It would be perfect if you could implement a separate part in the mod similar to the "cmd help" section where you can list all available Iterators and Variables, Commands they relate to, and possibly some slightly more detailed info about each Command so that people like me can get more efficient with this mod.
I hope you implement these features when you have the time and energy, and again, thank you for this amazing work. This mod still has very great potentials..
Fleshing out the in-game help is certainly something I've had in my mind for a long time. Variables are tricky because the variables available will vary by scope but I could probably at least have the top-level so-called "environment" variables available somewhere. Creating the initial batch of in-game documentation took a pretty long time and I have to be mindful of the translations too, but I do still want to expand it where possible. We're approaching the time of year where I actually have a measurable amount of free time, so I will be looking to work on the mod more actively over the next couple of months, I'll certainly keep the documentation situation in mind.
Sometimes while I'm typing in chat if I use a key which has a macro it runs the macro. sorry if this isn't how I am intended to report bugs.
Seems mart was right and I was accidentally bumping ctrl, terribly sorry for wasting you're time with this.
Just in case.., are you sure you're not accidentally hitting the "macro activate" or "macro override" buttons?
Especially if one of those is shift or another modifier key you use while typing..
'Cause tomorrow spring is here
Any ideas?
Some CloudClient dude. Also some CloudPack dude.
can you test that, because it doesn't work at all for me.
I have a problem:
I looked up lwjgl key codes and apparently the code for LMB(left mouse button) is 0.
When i try either of these commands, they don't register 0 as a valid key code and it doesn't have any effect(even though the it should detect any valid lwjgl code).
am i doing it wrong? I've already tested with keyboard codes and it works perfectly, but mouse codes don't work entirely.
@Im_Papa I did. Could you tell me where you put it and how do you activate the script?
@supers0lar just use key(attack)
That wouldn't work for what i'm doing, basically my script NEEDS me to use the KEYDOWN and BIND keys for mouse buttons.
How to get a integer from chat?
in a txt file, all it returns is %PLAYERNAME%
Does this work for 1.8.9? If so, which one do i download?
@TheBlueKingLP then I can't help you with that sry
@Im_Papa gonna take a small clip in a sec
http://i.imgur.com/EZi3dgV.gifv there you go
@TokkieX no it does not only 1.8.0- & 1.9+
You cannot use key codes in Key/KeyDown/KeyUp because those actions do NOT simulate keys themselves, they activate the binding (action) directly
That is why you write the name of the action, not the key (forward instead of w, attack instead of mouse0, etc)
Now, the reason KeyDown(attack) does not work is because attack is a trigger binding, and trigger bindings work with Key(), not KeyDown and KeyUp
Stateful bindings only react to KeyDown(), KeyUp() - while trigger bindings only react to Key()
See THIS POST for a more in-depth explanation
Anyway, to simulate "holding mouse0, assuming that is bound to attack", you simply need to call Key(attack) every tick, for example $${Do(100);Key(attack);Loop}$$
How to turn a string into an integer
Just assign it to an integer variable, for example
Set(#value,%&value%);
or
#value = %&value%;
How to get a message from chat
First of all your script needs to be in onChat (so you can do logic to the line of chat that arrived - you can't programmatically "read chat" from the past)For example they might be
CHAT: "§6Dslyecxi: §r§fSetInteger 5"
CHATCLEAN: "Dslyecxi: SetInteger 5"
How to extract a part of a string
use the IFMATCHES;ENDIF command - first argument is the message, and the second is a regular expression to check forIFMATCHES("example","xamp") // IF(true)
// more code
ENDIF;
You can also extract one capturing group into a variable by specifiying a variable name and group number
IFMATCHES("first second third","(\w+) (\w+) (\w+),&var2,2)
If you want to get more groups without lots of IFMATCHES, you can use MATCH's alternate syntax
MATCH(subject,pattern,{&group1,&group2,...})
Full examples
For the sake of example, let's assume the messages you expect to receive look like the following:Dslyecxi: SetInteger 5
Ghostboots: setinteger 15
and messages with extra text should be ignored (so you can, for example, talk about the syntax in chat without triggering it)
Dslyecxi: You just have to type something like "SetInteger 15" to do the thing
Chat filter style
Short style
'Cause tomorrow spring is here
i dont think this works on 1.12 tho
I have a few questions, again.
__________________________
How do I get the block ID at a specific coordinate? I have attempted using GETID() and GETIDREL(), but they always give me a value of 0.
How do I use arrays in a macro? I already know that # is for integer, and & might be for string. Not sure if there is such for floats, but I do know there is some way to get arrays, based on some commands provided. What do I do?
__________________________
I want to create an A* pathfinder into a macro, and the Readme (readme.txt) isn't giving me any answers to my questions. Intended game version: 1.11.2
Please reply as soon as possible
I think too much.
I am working on the TerraTech Mod Manager, Click this link to get to it
Also, I mod. Including operating systems.
I think what you are doing wrong with the getid is , that you are trying to get an integer value aus output as it is said in the documentary ingame however getid and getidrel will return strings
To use arrays you don't essentially need to use special commands. Just add [] behind the varname. Example:
GetId(Rel)
Are you trying to load the ID into an integer variable? Minecraft changed to string ID's quite a while ago...Other things to check for are: are you giving it coordinates?, are you making sure not to put spaces after commas?, are the blocks you're asking for loaded?? (you can't check a block that your game does not know about after all..)
Example use:
GetID(0,64,0,&block_at_origin_64);
GetIDRel(0,-2,0,&block_below_you);
Log("Origin 64: %&block_at_origin_64%")
Log("Below you: %&block_below_you")
Arrays
In order to get an array variable, simply put [] at the end of your variable name
Commands that expect an array variable will also understand if you omit the brackets but it's better to be explicit so you don't accidentally use two different variables
aside from commands that work on arrays, you can also read/modify it directly as follows
Push (add to the end)
&myarray[] = "value"
Put (change a specific index)
&myarray[0] = "firstValue"
read a specifix index
&second = &myarray[1]
Empty (clear) an array
UnSet(&myarray[]); //unset is not specifically an array command so the brackets are necessary or it will unset the wrong variable
'Cause tomorrow spring is here
Thanks fellow humans:
For the GETID and GETIDREL, I was using the in-game Cmd help. It stated to use # instead of &. I fixed my problem with this:
GETIDREL(%#x%,%#y%,%#z%,&id); #id=TILEID(%&id%);
Thank you also for telling me about how arrays work for this form of script. I kind-of got used to other formats.
Off I go to create a pathfinder.
I think too much.
I am working on the TerraTech Mod Manager, Click this link to get to it
Also, I mod. Including operating systems.
Hi,
I am having some trouble with opening the inventory, I have an automation macro so I can level mineration skill. I'm currently on the 1.7.2 minecraft version and tried both the 1.7.2 and 1.7.10 macro/liteloader versions and both present this problem.
The macro consists in breaking/placing ore blocks and checking the inventory after a while so it can store the items in chests if inventory nearly full. The thing is, if the macro is running on an instance of minecraft that is running on the background (alt+tab or wathever), after you use the command GUI(inventory) [I also tried key(inventory) and press(E)] and then close it with gui(), press(E) or press(escape), when you go back to breaking blocks you hit it but it doesn't count, and the block doesn't break.
I tried a lot of things but I don't understand enought about the mod so I came asking for help.
Thanks,