Unsafe(100) // Pick the valid foods in reverse order
For(#i,%#valid_to[%HUNGER%]%,0);
Pick(%&foods[%#i%]%);
Next;
ENDUNSAFE;
#index = IndexOf(&foods[],,%ITEM%);
IF(#index = -1); #index = IndexOf(&foods[],,%ITEMIDDMG%); ENDIF;
IF((#index != -1) && (#index <= #valid_to[%HUNGER%])); // If the food is valid, keep eating
DO(); // until either the food runs out
Key(use); // Or you have regen back
Until((ITEM = "air") || ((HUNGER >= 18)));
ENDIF;
Log("Restoring slot num as %#slotnum%");
Slot(%#slotnum%);
DO();WHILE(HUNGER = #hunger); // Wait until hunger changes, don't keep scanning for food all of the time
UNTIL(stopping);
I want to make a script that attacks with my sword until it gets to 10% durability, then makes me do a /fix command and then keeps attacking, and does that until I stop the script. I'm not good at coding at all so could someone help me with this?
I want to make a script that attacks with my sword until it gets to 10% durability, then makes me do a /fix command and then keeps attacking, and does that until I stop the script. I'm not good at coding at all so could someone help me with this?
P.S. I'm on 1.8 if that makes any difference.
Step 1: Figure out the simplest possible script that gets you one step closer to your goal
This is probably a script that attacks with your sword
a bit of reading the changelogs or gorlem's unofficial wiki finds us the Key() command, usable with "attack" $${Key(attack)}$$
After testing this we see that it punches once
Note: In future steps i will omit the script tags ($${ and }$$) for brevity - i'm assuming you know to always put them around your script before binding it
I will also not worry about semicolons.., if you're copy-pasting, make sure you put semicolons between lines if you're not using a file include
A file include takes the form of $${$$<filename.txt>}$$, and includes files in .minecraft/liteconfig/common/macros
Step 2: Get another step closer
As mentioned, the script currently only does one punch..., but we wanted to be able to keep punching.., so let's find out how to do that
Another quick search should find us DO();Loop, DO;Until, and DO;While, as well as For;Next and ForEach;Next
In this case, we already know we want to repeat until some condition, so DO();Until() seems perfect
But what is the condition? - Well, 10% DURABILITY
Unfortunately, durability is not measured in percent.., but rather uses, and it differs with items
I will assume that the percentage isn't that important and you're okay with something like "30 uses remaining" instead - that is easier to make (but percentages are possible too if you really want)
Okay, so Do;Until.., 30 uses remaining, and the thing we do is attack
Do()
Key(attack)
UNTIL(DURABILITY < 31)
Note2: If you need to stop a script, press the macro activate button.. - all running scripts will be listed on the top left of your screen and you can press the red X icons to stop each one
Alternatively you can bind ${Stop(*)}$ to a key and press that to stop all running scripts (i have that on my backspace)
Step 3: Fix command, then repeat
We want another repeat, infinite this time, so we can use DO();Loop
Inside that loop we want to send a server command and wait until the durability comes back
To send commands (well, messages really), the command is Echo(msg)
DO
DO;
Key(attack);
UNTIL(DURABILITY < 31);
Echo("/fix")
DO;
// nothing, essentially just waiting for the condition to become true
Note: At the moment this can only be stopped by leaving the game or stopping it manually from the macro activate menu - pressing it multiple times simply creates multiple scripts trying to do the same thing at the same time
If you want some kind of toggle functionality, look around the thread - there's plenty of examples (like 80% of scripts here are toggleable background tasks)
hint: useful commands for a toggle: IF;ELSE;ENDIF, Stop, Toggle, Set, Unset
Step 1: Figure out the simplest possible script that gets you one step closer to your goal
This is probably a script that attacks with your sword
a bit of reading the changelogs or gorlem's unofficial wiki finds us the Key() command, usable with "attack" $${Key(attack)}$$
After testing this we see that it punches once
Note: In future steps i will omit the script tags (${ and }$) for brevity - i'm assuming you know to always put them around your script before binding it
I will also not worry about semicolons.., if you're copy-pasting, make sure you put semicolons between lines if you're not using a file include
A file include takes the form of $${$$<filename.txt>}$$, and includes files in .minecraft/liteconfig/common/macros
Step 2: Get another step closer
As mentioned, the script currently only does one punch..., but we wanted to be able to keep punching.., so let's find out how to do that
Another quick search should find us DO();Loop, DO;Until, and DO;While, as well as For;Next and ForEach;Next
In this case, we already know we want to repeat until some condition, so DO();Until() seems perfect
But what is the condition? - Well, 10% DURABILITY
Unfortunately, durability is not measured in percent.., but rather uses, and it differs with items
I will assume that the percentage isn't that important and you're okay with something like "30 uses remaining" instead - that is easier to make (but percentages are possible too if you really want)
Okay, so Do;Until.., 30 uses remaining, and the thing we do is attack
Do()
Key(attack)
UNTIL(DURABILITY < 31)
Note2: If you need to stop a script, press the macro activate button.. - all running scripts will be listed on the top left of your screen and you can press the red X icons to stop each one
Alternatively you can bind ${Stop(*)}$ to a key and press that to stop all running scripts (i have that on my backspace)
Step 3: Fix command, then repeat
We want another repeat, infinite this time, so we can use DO();Loop
Inside that loop we want to send a server command and wait until the durability comes back
To send commands (well, messages really), the command is Echo(msg)
DO
DO; Key(attack); UNTIL(DURABILITY < 31); Echo("/fix") DO; // nothing, essentially just waiting for the condition to become true UNTIL(DURABILITY > 30)
Note: At the moment this can only be stopped by leaving the game or stopping it manually from the macro activate menu - pressing it multiple times simply creates multiple scripts trying to do the same thing at the same time
If you want some kind of toggle functionality, look around the thread - there's plenty of examples (like 80% of scripts here are toggleable background tasks)
hint: useful commands for a toggle: IF;ELSE;ENDIF, Stop, Toggle, Set, Unset
Thanks a lot!
There's just one problem:
It'll hit the blazes for a few seconds, but then it just swings and doesn't hit anything. Is this just server side or...?
The Meaning of Life, the Universe, and Everything.
Join Date:
9/21/2010
Posts:
63
Minecraft:
Rabbittt
Member Details
Hi, very impressed with this mod and how well it works but I'm having trouble finding a way to change Minecraft's options menu features with binds (Namely Skin Customization features on and off and possibly Autojump on/off) I can't seem to figure out the calls for these. I'm feeling kinda stupid cause it's probably obvious but any help would be greatly appreciated!
Unsafe(100) // Pick the valid foods in reverse order
For(#i,%#valid_to[%HUNGER%]%,0);
Pick(%&foods[%#i%]%);
Next;
ENDUNSAFE;
#index = IndexOf(&foods[],,%ITEM%);
IF(#index = -1); #index = IndexOf(&foods[],,%ITEMIDDMG%); ENDIF;
IF((#index != -1) && (#index <= #valid_to[%HUNGER%])); // If the food is valid, keep eating
DO(); // until either the food runs out
Key(use); // Or you have regen back
Until((ITEM = "air") || ((HUNGER >= 18)));
ENDIF;
Log("Restoring slot num as %#slotnum%");
Slot(%#slotnum%);
DO();WHILE(HUNGER = #hunger); // Wait until hunger changes, don't keep scanning for food all of the time
UNTIL(stopping);
It switches to food and then switches back, without actually eating it.
Hi, very impressed with this mod and how well it works but I'm having trouble finding a way to change Minecraft's options menu features with binds (Namely Skin Customization features on and off and possibly Autojump on/off) I can't seem to figure out the calls for these. I'm feeling kinda stupid cause it's probably obvious but any help would be greatly appreciated!
Please Read This All
So, I got the keybind macro mod and Im trying to make an automine script.
I dont know how the /pvpmine commands will work, this is all ive got:
keydown(forward);
wait(800ms);
keydown(jump)
wait(10ms)
keyup(jump)
keyup(forward);
look(90,90,30ms);
wait(2s);
key(attack);
wait(10ms);
key(attack);
wait(1t);
("/pvpmine");
wait(5ms);
look(190,1,30ms);
keydown(forward);
wait(20ms);
keyup(forward);
key(attack);
wait(5ms);
how do i make the /pvpmine command work?
edit: doublepost (sorry)
Yeah, A is Local and B is Global, I think. It's useful if you have different macros on different servers.
Is /pvpmine a command on the server you are playing? If it is you need to use ECHO("/pvpmine");
when i use echo, it does not do the rest of the script under that
It worked, thanks man, now how do i repeat the whole script?
@2marko
I want to repeat the script like 500 times, is there a repeat(500)?
@XxGoldGuyGamesxX u probably don't need to write in thoose big blue letters an hour after you write it the first time, it wont change anything
it is as 2marko said
That should do the trick:
The above script has multiple issues.
such as?
IF(CTRL || !loaded)
Log("Loading data...");
UNSAFE(100)
UnSet(&foods[]);
UnSet(#valid_to[]);
For(#i,0,20); #valid_to[%#i%] = -1; Next;
;&foods[] = "fish:2"; For(#i,0,19); Inc(#valid_to[%#i%]); Next;
;&foods[] = "potato"; For(#i,0,19); Inc(#valid_to[%#i%]); Next;
;&foods[] = "fish:3"; For(#i,0,19); Inc(#valid_to[%#i%]); Next;
;&foods[] = "rabbit"; For(#i,0,18); Inc(#valid_to[%#i%]); Next;
;&foods[] = "melon"; For(#i,0,18); Inc(#valid_to[%#i%]); Next;
;&foods[] = "poisonous_potato"; For(#i,0,18); Inc(#valid_to[%#i%]); Next;
;&foods[] = "chicken"; For(#i,0,18); Inc(#valid_to[%#i%]); Next;
;&foods[] = "mutton"; For(#i,0,18); Inc(#valid_to[%#i%]); Next;
;&foods[] = "rabbit"; For(#i,0,18); Inc(#valid_to[%#i%]); Next;
;&foods[] = "cookie"; For(#i,0,18); Inc(#valid_to[%#i%]); Next;
;&foods[] = "fish:0"; For(#i,0,18); Inc(#valid_to[%#i%]); Next;
;&foods[] = "fish:1"; For(#i,0,18); Inc(#valid_to[%#i%]); Next;
;&foods[] = "carrot"; For(#i,0,17); Inc(#valid_to[%#i%]); Next;
;&foods[] = "beef"; For(#i,0,17); Inc(#valid_to[%#i%]); Next;
;&foods[] = "porkchop"; For(#i,0,17); Inc(#valid_to[%#i%]); Next;
;&foods[] = "golden_apple"; For(#i,0,16); Inc(#valid_to[%#i%]); Next;
;&foods[] = "apple"; For(#i,0,16); Inc(#valid_to[%#i%]); Next;
;&foods[] = "rotten_flesh"; For(#i,0,16); Inc(#valid_to[%#i%]); Next;
;&foods[] = "cooked_rabbit"; For(#i,0,15); Inc(#valid_to[%#i%]); Next;
;&foods[] = "cooked_fish:0"; For(#i,0,15); Inc(#valid_to[%#i%]); Next;
;&foods[] = "baked_potato"; For(#i,0,15); Inc(#valid_to[%#i%]); Next;
;&foods[] = "bread"; For(#i,0,15); Inc(#valid_to[%#i%]); Next;
;&foods[] = "golden_carrot"; For(#i,0,14); Inc(#valid_to[%#i%]); Next;
;&foods[] = "cooked_mutton"; For(#i,0,14); Inc(#valid_to[%#i%]); Next;
;&foods[] = "cooked_fish:1"; For(#i,0,14); Inc(#valid_to[%#i%]); Next;
;&foods[] = "cooked_chicken"; For(#i,0,14); Inc(#valid_to[%#i%]); Next;
;&foods[] = "mushroom_stew"; For(#i,0,14); Inc(#valid_to[%#i%]); Next;
;&foods[] = "cooked_porkchop"; For(#i,0,12); Inc(#valid_to[%#i%]); Next;
;&foods[] = "cooked_beef"; For(#i,0,12); Inc(#valid_to[%#i%]); Next;
;&foods[] = "pumpkin_pie"; For(#i,0,12); Inc(#valid_to[%#i%]); Next;
;&foods[] = "rabbit_stew"; For(#i,0,10); Inc(#valid_to[%#i%]); Next;
ENDUNSAFE
Log("...Data reloaded");
#j = -1;
For(#i,20,0);
IF(#valid_to[%#i%] != #j);
Inc(#j);
Log("&aAt hunger %#i% or less i will eat the following");
For(#j,%#j%,%#valid_to[%#i%]%);
Log("&a → &b%&foods[%#j%]%");
Next;
ENDIF;
Next;
Set(loaded);
Stop();
ENDIF
TOGGLE(stopping); IF(stopping);
LOG("Autoeat Disabled")
KeyUp(sneak);
Stop();
ENDIF
LOG("Autoeat Enabled")
DO;
#hunger = HUNGER;
Set(#slotnum,%INVSLOT%);
Unsafe(100) // Pick the valid foods in reverse order
For(#i,%#valid_to[%HUNGER%]%,0);
Pick(%&foods[%#i%]%);
Next;
ENDUNSAFE;
#index = IndexOf(&foods[],,%ITEM%);
IF(#index = -1); #index = IndexOf(&foods[],,%ITEMIDDMG%); ENDIF;
IF((#index != -1) && (#index <= #valid_to[%HUNGER%])); // If the food is valid, keep eating
DO(); // until either the food runs out
Key(use); // Or you have regen back
Until((ITEM = "air") || ((HUNGER >= 18)));
ENDIF;
Log("Restoring slot num as %#slotnum%");
Slot(%#slotnum%);
DO();WHILE(HUNGER = #hunger); // Wait until hunger changes, don't keep scanning for food all of the time
UNTIL(stopping);
'Cause tomorrow spring is here
I want to make a script that attacks with my sword until it gets to 10% durability, then makes me do a /fix command and then keeps attacking, and does that until I stop the script. I'm not good at coding at all so could someone help me with this?
P.S. I'm on 1.8 if that makes any difference.
Step 1: Figure out the simplest possible script that gets you one step closer to your goal
This is probably a script that attacks with your sword
a bit of reading the changelogs or gorlem's unofficial wiki finds us the Key() command, usable with "attack"
$${Key(attack)}$$
After testing this we see that it punches once
Note: In future steps i will omit the script tags ($${ and }$$) for brevity - i'm assuming you know to always put them around your script before binding it
I will also not worry about semicolons.., if you're copy-pasting, make sure you put semicolons between lines if you're not using a file include
A file include takes the form of $${$$<filename.txt>}$$, and includes files in .minecraft/liteconfig/common/macros
Step 2: Get another step closer
As mentioned, the script currently only does one punch..., but we wanted to be able to keep punching.., so let's find out how to do that
Another quick search should find us DO();Loop, DO;Until, and DO;While, as well as For;Next and ForEach;Next
In this case, we already know we want to repeat until some condition, so DO();Until() seems perfect
But what is the condition? - Well, 10% DURABILITY
Unfortunately, durability is not measured in percent.., but rather uses, and it differs with items
I will assume that the percentage isn't that important and you're okay with something like "30 uses remaining" instead - that is easier to make (but percentages are possible too if you really want)
Okay, so Do;Until.., 30 uses remaining, and the thing we do is attack
Do()
UNTIL(DURABILITY < 31)
Note2: If you need to stop a script, press the macro activate button.. - all running scripts will be listed on the top left of your screen and you can press the red X icons to stop each one
Alternatively you can bind ${Stop(*)}$ to a key and press that to stop all running scripts (i have that on my backspace)
Step 3: Fix command, then repeat
We want another repeat, infinite this time, so we can use DO();Loop
Inside that loop we want to send a server command and wait until the durability comes back
To send commands (well, messages really), the command is Echo(msg)
DO
LOOP;
Final binding, if not using a file:
$${DO;DO;Key(attack);UNTIL(DURABILITY < 31);Echo("/fix");DO;UNTIL(DURABILITY > 30);LOOP;}$$
Note: At the moment this can only be stopped by leaving the game or stopping it manually from the macro activate menu - pressing it multiple times simply creates multiple scripts trying to do the same thing at the same time
If you want some kind of toggle functionality, look around the thread - there's plenty of examples (like 80% of scripts here are toggleable background tasks)
hint: useful commands for a toggle: IF;ELSE;ENDIF, Stop, Toggle, Set, Unset
'Cause tomorrow spring is here
Thanks a lot!
There's just one problem:
It'll hit the blazes for a few seconds, but then it just swings and doesn't hit anything. Is this just server side or...?
Hi, very impressed with this mod and how well it works but I'm having trouble finding a way to change Minecraft's options menu features with binds (Namely Skin Customization features on and off and possibly Autojump on/off) I can't seem to figure out the calls for these. I'm feeling kinda stupid cause it's probably obvious but any help would be greatly appreciated!
It switches to food and then switches back, without actually eating it.
Which food did you test it with?
The only problem i can see is that damage-valued food might not be detected correctly (cooked fish, fish)
'Cause tomorrow spring is here
I don't think there's a command for that =(
'Cause tomorrow spring is here
Hey is there a way to read .txt documents for variables? If not please add it @Mumfrey
What is the use case exactly?
Most likely file includes work for this..
And technically variables are already read from a txt file, namely .macros.txt
'Cause tomorrow spring is here