Hi, is it possible to use the content of an array as parameterstring for a prompt?
It depends what you mean by the "content of an array", if you just want to use a single term from the array then you can just expand it with % signs. If you want to use all of the array then you will need to first JOIN the array into a string.
Well, lets say i have a list of values such as player names in an array, i would like to use this in a prompt, so that i get a choosable list, which is kind of dynamic. Hope this makes it clearer what i want, im german so excuse my english
Well, lets say i have a list of values such as player names in an array, i would like to use this in a prompt, so that i get a choosable list, which is kind of dynamic. Hope this makes it clearer what i want, im german so excuse my english
Then use JOIN with comma to join them into a list, then expand them into place using $[Name[%&yourvar%]u]
found_a_non_item_slot = False
For(#i,0,44); //Replace 0 and 44 with the numbers of the first and last slot you actually want to search
GetSlotItem(%#i%,&id); IF(&id != "stone"); found_a_non_item_slot = True;
Break ENDIF NEXT;
IF(!found_a_non_slot_item);
Log("Inventory is full i guess?") Endif
Even when I have nothing in my inventory, it still says Inventory is full i guess?
For(#i,0,44);
GetSlotItem(%#i%,&id);
Ifmatches(%&id%,"stone");
found_stone = true;
Break;
ENDIF;
NEXT;
IF(found_stone);
Log("Inventory is full i guess? %TIME%")
Endif;
It reacts already if there's just 1 stone, but I didn't know how to really do it.
For this script, I want it so if any item is filled in all 44 slots, it will Log("Inventory full"); If one spot is still empty with no items left, it will keep checking until there are no open spots left. I don't know what "stone" is for.
so it resets for me all time. I do everything a little bit different :T
Not sure what that script is supposed to say but here's a simple test
$${Log("Before setting, flag is %m31%");Set(m31,true);Log("After setting, %m31%");}$$
First time you run this, it will say False, then True
Every single time after that it will be True, True
Yes, if you use Exec() it runs in a new, temporary context.., but your scripts shouldn't rely on being run with Exec() just to work correctly..., Exec brings with it its' own dangers.., no reason to use it if you don't need it (most people don't)
For example, why not just use a file include in your script?
Updated for Minecraft 1.10.2, also supports Minecraft 1.10
Updated russian translation thanks to LastLife919
Fixed localisations for event help and scripting help not being loaded
Added slider gui control
Added border option for label control
Fixed PLAYSOUND for sounds which have underscores in their name
Added option to suppress macro override functionality in command block gui
Fixed pickup item amount always registering zero in single player
Display rubberband when resizing gui controls to improve visual feedback
Improved behaviour of right-click context menus in custom gui hosts
Playback Status can now be added as a control, doing so disables the normal playback status overlay
Fixed arrowheads not drawing on some control widgets
Added new iterator CONTROLS to iterate over existing controls, provides CONTROLID, CONTROLNAME and CONTROLTYPE variables
A note about the CONTROLS iterator. CONTROLS is the first ever parameterised iterator in macros. The parameter is specified in parentheses following the iterator name, and allows you to filter controls by layout or by type (or both).
It's easiest to illustrate how this works with some examples:
FOREACH(controls) // Iterate over all controls everywhere
FOREACH(controls(ingame)) // Iterate over all controls in the layout "ingame"
FOREACH(controls(:button)) // Iterate over all button controls
FOREACH(controls(ingame:button)) // Iterate over all button controls in "ingame"
// Example usage, set all labels to blue
FOREACH(controls(default:label));
SETPROPERTY("%CONTROLNAME%","colour","#FF0000FF");
NEXT;
This version will work with both 1.10 and 1.10.2 but only with recent builds of liteloader, if it doesn't load update liteloader first.
What is the pitch for looking straight up? Like looking down is Look(0,90). It isn't -90 because that changes it by -90, I'm wondering what is the actually number.
Hi, is it possible to use the content of an array as parameterstring for a prompt?
It depends what you mean by the "content of an array", if you just want to use a single term from the array then you can just expand it with % signs. If you want to use all of the array then you will need to first JOIN the array into a string.
Well, lets say i have a list of values such as player names in an array, i would like to use this in a prompt, so that i get a choosable list, which is kind of dynamic. Hope this makes it clearer what i want, im german so excuse my english
Then use JOIN with comma to join them into a list, then expand them into place using $[Name[%&yourvar%]u]
Nice, works perfect, thx a lot
Is there a way to check if all 44 slots are filled with a some item and if it is, it would Log("Inventory is full");
found_a_non_item_slot = False
For(#i,0,44); //Replace 0 and 44 with the numbers of the first and last slot you actually want to search
Break
IF(!found_a_non_slot_item);
'Cause tomorrow spring is here
Even when I have nothing in my inventory, it still says Inventory is full i guess?
I know how to run macros.
I know how to run macros.
I know how to run macros.
Maybe you should try the macro for yourself instead of asking the same question over and over.
For this script, I want it so if any item is filled in all 44 slots, it will Log("Inventory full"); If one spot is still empty with no items left, it will keep checking until there are no open spots left. I don't know what "stone" is for.
I still can't figure out how to a way were if all inventory slots have at least 1 item in it, it will Log("Inventory is full");
This is the code I'm using.
Gui(inventory);
Invfull = false;
For(#i,9,44);
GetSlotItem(%#i%,&id);
Log(%#i% %&id%);
If(&id = "air");
Invfull = true;
Break;
Endif;
Next;
Press(ESCAPE);
If(!Invfull);
Log(1)
Else;
Log(2)
Endif;
And if the inventory is full or not, it only logs "1".
Variables persist.., you never set foundclear to false, so if you run it with a non-full inventory, it will never again report a full one
User variables must be fully lowercase
'Cause tomorrow spring is here
Not sure what that script is supposed to say but here's a simple test
$${Log("Before setting, flag is %m31%");Set(m31,true);Log("After setting, %m31%");}$$
First time you run this, it will say False, then True
Every single time after that it will be True, True
Yes, if you use Exec() it runs in a new, temporary context.., but your scripts shouldn't rely on being run with Exec() just to work correctly..., Exec brings with it its' own dangers.., no reason to use it if you don't need it (most people don't)
For example, why not just use a file include in your script?
'Cause tomorrow spring is here
ah, thank you.
If you want to check if you inventory is full, here is the correct code.
Is there a way so if a certain player or any player gets within 5 blocks from me, it will log something.
A release candidate for 0.13.2 is available:
Changes in this version:
A note about the CONTROLS iterator. CONTROLS is the first ever parameterised iterator in macros. The parameter is specified in parentheses following the iterator name, and allows you to filter controls by layout or by type (or both).
It's easiest to illustrate how this works with some examples:
This version will work with both 1.10 and 1.10.2 but only with recent builds of liteloader, if it doesn't load update liteloader first.
What is the pitch for looking straight up? Like looking down is Look(0,90). It isn't -90 because that changes it by -90, I'm wondering what is the actually number.