>Is there a way to interract with inventory slots (above the 9 one) without having to open the Inventory GUI ?
It's not possible to access those slots with the inventory screen closed.
>@Mumphrey : is there any chance that you would implement new features like sliders into a minecraft 1.8 compatible version ? (for those who prefer to stay on this one for their server
IT wouldn't really be feasible to back-port those features, and the amount of time required would be huge when you consider I have very little free time anyway and need to prioritise. Newer features and newer versions are always going to take priority.
>@Mumphrey : Could you implement the ability to control button's text and apprearance ? (ex : I click on a green button called "activate" then it turns red and it's text changes to "Unactivate") in other terms a kind of mix between buttons and labels
Use SETPROPERTY you can change any aspect of a control, inlcuding colour and text.
no?, that would be a very odd feature if it did
But you have full control of your variables, so you can always just make sure to set it to false whereever your script can exit..., with some kind of backup in case of power loss
Can you help me out with this. I would like a global variable to be set false anytime the script is not running. So if I cancel the script from the GRAVE(~) menu or if minecraft is exited while the script is running.
How do I make it so if someone says the word "people" in chat, it will Log("test123"). I want it so even if a player were to say asdfasdpeople, peopleasdfasdf, asdfspeople, It would still Log("test123). As long as the word "people" is somewhere in chat, it would Log.
This mostly works, but be aware that it will also log for EVERY message by any user with "people" in their username - as well as any server message wjtb "people" in it
Can you help me out with this. I would like a global variable to be set false anytime the script is not running. So if I cancel the script from the GRAVE(~) menu or if minecraft is exited while the script is running.
Hello. I am creating a modified modular chat, but i can't include more 10 files in chat filter. How can i do this?
As mart said, if you're hitting the limit then you should probably re-think how you're organising your scripts. However if you want to increase the hard include limit then you can just alter the compiler.maxincludes setting in the config file. However bear in mind that if you want to share you macro then other people will need to do the same, and thus it's usually better to just stay under the cap.
Ok, Thanks for your answers !
SETPROPERTY is really great it gives a lot of possibilities for GUIs
>Is there a way to list the exact attributes names of controls or labels ? (I tryed first "visibility" then "display" and finally found "visible" to set a button's visibility)
I'm building a kind of "config" GUI on which player can activate or desactivate functions like "hunger alert", "Durability alert", "Autoswitch" etc... and because each button has to do several actions (like switching the button's text, conditionnally display labels on ingame GUI, etc) I'm trying to do a kind of "generic script" to which I send the "function" name as a &function variable and which does all the actions with builded names... :
The buttons are named "B_myfunctionname" their action is :
It works pretty well but the problem is that it looks like it is impossible to launch a script using this "builded names" method...
(of course if I replace the last line by $$<Potof_myfunctionname.txt> it works but then my "generic" script is not generic anymore...)
>Is there an error in my syntax ?
Thanks
It is impossible to include files dynamically because replacing file includes is the first step.., executing the script only happens once all files are included
(It's trying to include %&scriptname% and failing because no such file exists)
I think Exec() is acceptable here =P, all you're doing is starting a single script and exiting, whether it's syncronous or asyncronous should make little difference as long as you keep it in mind
Note, however, that Exec'd scripts start in a new, temporary namespace.., so you won't be able to access variables of the parent, and its' variables (probably?) won't persist if called again
If you do need persistence, you must use global variables (in which case i strongly recommend including the name of the script in the variable name to prevent conflicts, and move those to the beginning and end of the file
So I finally toggle the specific global flag of a fonction into the specific button before to launch the generic script.
would there be different ways to do it ?
What is the purpose of the flag?, can you not set it in the Exec()'d script itself?
Is your function name all lowercase!?
user defined variables must be all lowercase (and probably only contain alphanumerics and underscores), so if the function name is not it will resolve to an illegal variable name and it won't work
Idea: What if you simply had a global string array and put the 'names' inside of that?
To set:
Push(@&running_scripts_or_something,%&scriptname%)
To unset:
DO(99); // Upper bound of 99 just in case
IndexOf(@&running_scripts_or_something,#i,%&scriptname%); // Find scriptname in array
IF(#i < 0); Break; Endif; // If not found, stop searching
UnSet(@&running_scripts_or_something[%#i%]); // If found, remove scriptname from array
Loop;
--------
@Mumfrey: Feature request(ish)
How difficult would it be to have a "strict mode" for scripts where the script engine throws an error whenever it encounters something it does not understand?
comments not starting with //
Trying to expand or set mixed case variables
too many/not enough parameters
parameters of invalid type
Are these errors already 'detected' but simply ignored or would you have to write special cases for all of these?
Whats the best way to do it then. Because all I have is if I run the script it's true, and I'm STOP() the script, it's set the false.
I don't know.., that depends on what the two scripts are and all the different ways that they could be stopped
For example, one script that uses a "running" flag might be something that takes a while and must not be started twice, so it checks if it is running first and ignores further keypresses
except that makes it unusable after an external stop
A solution for that specific case would be simply to have the second keypress not ignored, but rather have it stop the script
This way, if it was stopped externally, the first press would do nothing and then it would return to normal
@Mumfrey: Feature request(ish)
How difficult would it be to have a "strict mode" for scripts where the script engine throws an error whenever it encounters something it does not understand?
comments not starting with //
Trying to expand or set mixed case variables
too many/not enough parameters
parameters of invalid type
Are these errors already 'detected' but simply ignored or would you have to write special cases for all of these?
These conditions aren't currently detected, so to raise an error condition would require handling for each case. In general, an action attempts to consume its parameters from the script but if the parameters are invalid then they're either coerced to a relevant type (eg. String -> false) or the action simply has no effect.
Comments is next to impossible because // doesn't actually have any special meaning. Any line which can't be parsed as a script action is basically ignored, // just "formally" states this.
Setting mixed-case variables would be the easiest situation to trap, expansion less so because expansion happens by demand and so it's difficult to detect a "failure" state for expansion. But SET and ASSIGN could certainly be enhanced to raise a warning when an invalid variable name is provided.
Parameters of invalid type would require literally every single action to be modified to trap this scenario. Parameters are not parsed at the compile phase, only during execution (to allow expansion to work) so this would not be fail-fast either. The same thing is trye for not enough parameters. The general pattern of script actions is they attempt to consume parameters as they need them and if not enough are available then the action does nothing. Too many is not handled either, you can pass an unlimited number of parameters to most script actions and any extra will be ignored. The exception being actions like LOG and ECHO which consume all their parameters.
Basically it's possible, but not really straightforward because I built the thing to be a forgiving macro language rather than a strict programming language. About the only one that would be straightforward to add is checking the names of variables in SET and ASSIGN.
Ok. Other question: How do you put items (including armour) in a chest? And: How does this whole variable thing work?
Open the chest with Key(use), then use SlotClick() (probably with parameters (slotnr,l,true) (l - left, true - shift-click))
For example
For(#i = 27 to 53);
SlotClick(%#i%,l,true);
Next;
For variables, see this post and ask if anything is still unclear ^^
These conditions aren't currently detected, so to raise an error condition would require handling for each case. In general, an action attempts to consume its parameters from the script but if the parameters are invalid then they're either coerced to a relevant type (eg. String -> false) or the action simply has no effect.
Comments is next to impossible because // doesn't actually have any special meaning. Any line which can't be parsed as a script action is basically ignored, // just "formally" states this.
Setting mixed-case variables would be the easiest situation to trap, expansion less so because expansion happens by demand and so it's difficult to detect a "failure" state for expansion. But SET and ASSIGN could certainly be enhanced to raise a warning when an invalid variable name is provided.
Parameters of invalid type would require literally every single action to be modified to trap this scenario. Parameters are not parsed at the compile phase, only during execution (to allow expansion to work) so this would not be fail-fast either. The same thing is trye for not enough parameters. The general pattern of script actions is they attempt to consume parameters as they need them and if not enough are available then the action does nothing. Too many is not handled either, you can pass an unlimited number of parameters to most script actions and any extra will be ignored. The exception being actions like LOG and ECHO which consume all their parameters.
Basically it's possible, but not really straightforward because I built the thing to be a forgiving macro language rather than a strict programming language. About the only one that would be straightforward to add is checking the names of variables in SET and ASSIGN.
Fair enough - probably not worth it then ^^
Thanks for the insight
sometimes i wish i could just look under the hood and see how this whole thing works =P
It's not possible to access those slots with the inventory screen closed.
IT wouldn't really be feasible to back-port those features, and the amount of time required would be huge when you consider I have very little free time anyway and need to prioritise. Newer features and newer versions are always going to take priority.
Use SETPROPERTY you can change any aspect of a control, inlcuding colour and text.
Can you help me out with this. I would like a global variable to be set false anytime the script is not running. So if I cancel the script from the GRAVE(~) menu or if minecraft is exited while the script is running.
This mostly works, but be aware that it will also log for EVERY message by any user with "people" in their username - as well as any server message wjtb "people" in it
There is no foolproof way to do this..
'Cause tomorrow spring is here
Hello. I am creating a modified modular chat, but i can't include more 10 files in chat filter. How can i do this?
Unfortunately you can't have over 10 file includes.., no
You'll have to put all your code in one/two file(s) and include that
If you really need more file includes for the sake of organizing your code - you could write your own compiler/preprocessor
But perhaps that is not necessary...
Can you tell me a little bit more about what you're making and what are all the files you have now?
'Cause tomorrow spring is here
As mart said, if you're hitting the limit then you should probably re-think how you're organising your scripts. However if you want to increase the hard include limit then you can just alter the compiler.maxincludes setting in the config file. However bear in mind that if you want to share you macro then other people will need to do the same, and thus it's usually better to just stay under the cap.
It is impossible to include files dynamically because replacing file includes is the first step.., executing the script only happens once all files are included
(It's trying to include %&scriptname% and failing because no such file exists)
I think Exec() is acceptable here =P, all you're doing is starting a single script and exiting, whether it's syncronous or asyncronous should make little difference as long as you keep it in mind
Note, however, that Exec'd scripts start in a new, temporary namespace.., so you won't be able to access variables of the parent, and its' variables (probably?) won't persist if called again
If you do need persistence, you must use global variables (in which case i strongly recommend including the name of the script in the variable name to prevent conflicts, and move those to the beginning and end of the file
&example = %@&name_of_this_script_local_example%
#example2 = %@#name_of_this_script_local_example%
// Script that uses and modifies the above variables
Set(@&name_of_this_script_local_example,%&example%)
Set(@&name_of_this_script_local_example2,%&example2%)
'Cause tomorrow spring is here
What is the purpose of the flag?, can you not set it in the Exec()'d script itself?
Is your function name all lowercase!?
user defined variables must be all lowercase (and probably only contain alphanumerics and underscores), so if the function name is not it will resolve to an illegal variable name and it won't work
Push(@&running_scripts_or_something,%&scriptname%)
To unset:
DO(99); // Upper bound of 99 just in case
IF(#i < 0); Break; Endif; // If not found, stop searching
--------
@Mumfrey: Feature request(ish)
How difficult would it be to have a "strict mode" for scripts where the script engine throws an error whenever it encounters something it does not understand?
'Cause tomorrow spring is here
For CRAFT, can you click a stack of 64 items to put in the crafting slot or can it only go one at a time?
CRAFT does not - you can write such behaviour with SlotClick and related commands manually
'Cause tomorrow spring is here
Is there a way to drop the whole inventory on the ground?
Whats the best way to do it then. Because all I have is if I run the script it's true, and I'm STOP() the script, it's set the false.
I don't know.., that depends on what the two scripts are and all the different ways that they could be stopped
For example, one script that uses a "running" flag might be something that takes a while and must not be started twice, so it checks if it is running first and ignores further keypresses
except that makes it unusable after an external stop
A solution for that specific case would be simply to have the second keypress not ignored, but rather have it stop the script
This way, if it was stopped externally, the first press would do nothing and then it would return to normal
'Cause tomorrow spring is here
Ok. Other question: How do you put items (including armour) in a chest? And: How does this whole variable thing work?
These conditions aren't currently detected, so to raise an error condition would require handling for each case. In general, an action attempts to consume its parameters from the script but if the parameters are invalid then they're either coerced to a relevant type (eg. String -> false) or the action simply has no effect.
Comments is next to impossible because // doesn't actually have any special meaning. Any line which can't be parsed as a script action is basically ignored, // just "formally" states this.
Setting mixed-case variables would be the easiest situation to trap, expansion less so because expansion happens by demand and so it's difficult to detect a "failure" state for expansion. But SET and ASSIGN could certainly be enhanced to raise a warning when an invalid variable name is provided.
Parameters of invalid type would require literally every single action to be modified to trap this scenario. Parameters are not parsed at the compile phase, only during execution (to allow expansion to work) so this would not be fail-fast either. The same thing is trye for not enough parameters. The general pattern of script actions is they attempt to consume parameters as they need them and if not enough are available then the action does nothing. Too many is not handled either, you can pass an unlimited number of parameters to most script actions and any extra will be ignored. The exception being actions like LOG and ECHO which consume all their parameters.
Basically it's possible, but not really straightforward because I built the thing to be a forgiving macro language rather than a strict programming language. About the only one that would be straightforward to add is checking the names of variables in SET and ASSIGN.
Open the chest with Key(use), then use SlotClick() (probably with parameters (slotnr,l,true) (l - left, true - shift-click))
For example
For(#i = 27 to 53);
For variables, see this post and ask if anything is still unclear ^^
Fair enough - probably not worth it then ^^
Thanks for the insight
sometimes i wish i could just look under the hood and see how this whole thing works =P
'Cause tomorrow spring is here
How do I make so if I'm in the same position (xyz) for 30 seconds in a row, it will log("Afk much");
do;
#x = %XPOS%;
#y = %YPOS%;
#z = %ZPOS%;
wait(30);
if( (#x = %XPOS%) && (#y = %YPOS%) && (#z = %ZPOS%) );
log("Afk much");
endif;
loop;
My conditional macros are slowly failing. 1.10.2 I haven't updated or added any mods, They used to work, a few still do.
This one did a day or 2 ago.
I //pos1 and //pos2 planks in mineshafts, then run SHIFT H below
SHIFT H
Condition TRUE
IF TRUE //shift 1 d|outset -h 1|//replace air glass - I strip all the planks then run the second half of SHIFT H
I don't need to //pos anything, it's already set, I just hit the H key and the glass goes away.
IF FALSE //replace glass air.
Links to pdf format, downloadable, command lists for (these often clarify/expand descriptions, and where possible link to the author's posting):
MoreCommands: http://www.mediafire.com/view/qjc9c6klcnp660e/CmdLstMoreCommands.pdf
WorldEdit: http://www.mediafire.com/view/bi7r00xd9rgxrrt/WE_Commands.pdf
Did you mean condition is SHIFT?