I've been trying to make a script that automagically destroys wheat when looking at and automatically places a seed when looking at farmland(holding seeds), however, it's not working:
The Meaning of Life, the Universe, and Everything.
Join Date:
10/10/2011
Posts:
63
Location:
I'm everywhere
Minecraft:
Tiamarth
Member Details
Hello again!
I seem to have discovered a bug in the macro mod. Unless it's a known bug, in which case I apologize.
But, I was attempting a script that would issue a certain command if other buttons were pressed. Literally if CTRL and A are pressed, I wanted it to change my gamemode to survival.
IF(CTRL);
IF(KEY_A);
ECHO(/gm 0);
ENDIF;
ENDIF;
I'll place the code in a spoiler here for the sake of total clarity, but it will likely be irrelevant as I know that the script works.
An explanation of the bug is simple. When I open chat (or, it would seem, almost literally any GUI menu screen) if I press those buttons, the command is entered in complete disregard of the open GUI.
This is annoying, because I also have commands bound to CTRL+C and CTRL+V. If I need to copy something, I'll also end up issuing commands that I don't want to issue at those moments.
Edit moments later:
It's something I can bare with for now. It's not really a huge problem because I don't often use the keys to which I'm assigning the commands. Hence why I've bound them to those in the first place.
in the most basic terms, If/can you describe how I can make a Label that will tell me how many 351:1 (Red Dye) 351:2 (Cactus Green) 351:4 (Lapis) 351:5 (Purple Dye) I have within my inventory? :3
You can't check it without opening your inventory, but in most cases your inventory shouldn't change unless you actually open it, so you can onGuiChange to count them every time you open the inventory (and remember to reopen and close it after you change things?)
or have it constantly check and recheck while it is open
The hotbar can be tracked with GetSlotItem(n) where n is 1-9, so dropping from and picking up to there is fine
picking up to the inventory you can keep track of by onPickupItem
I've been trying to make a script that automagically destroys wheat when looking at and automatically places a seed when looking at farmland(holding seeds), however, it's not working: $${ TOGGLE(wheatfarm) IF(wheatfarm) DO IF( (HITNAME = "Crops") ECHO(HITNAME) KEY(attack) ENDIF IF(HITID = "farmland") KEY(use) ENDIF LOOP ENDIF }$$ Currently if i'm looking at farmland it will work, but if looking at wheat, nothing happens. Any ideas?
You have two opening parentheses in that IF.., not sure if that's a problem
is "Crops" the exact hitname for wheat?, i'm assuming it didn't echo either
Hello again! I seem to have discovered a bug in the macro mod. Unless it's a known bug, in which case I apologize. But, I was attempting a script that would issue a certain command if other buttons were pressed. Literally if CTRL and A are pressed, I wanted it to change my gamemode to survival.
IF(CTRL); IF(KEY_A); ECHO(/gm 0); ENDIF; ENDIF;
I'll place the code in a spoiler here for the sake of total clarity, but it will likely be irrelevant as I know that the script works. An explanation of the bug is simple. When I open chat (or, it would seem, almost literally any GUI menu screen) if I press those buttons, the command is entered in complete disregard of the open GUI. This is annoying, because I also have commands bound to CTRL+C and CTRL+V. If I need to copy something, I'll also end up issuing commands that I don't want to issue at those moments. Edit moments later: It's something I can bare with for now. It's not really a huge problem because I don't often use the keys to which I'm assigning the commands. Hence why I've bound them to those in the first place.
I don't really understand what you mean by that, but as a hacky solution, you could add an IF(GUI = "something") if you want to limit it to certain GUI's
But i feel like you're going about it in a really hacky way..., could you explain all the hotkeys you want and how you want to use them (like, if you want them not to work in certain GUI screens and stuff)
I seem to have discovered a bug in the macro mod. Unless it's a known bug, in which case I apologize.
But, I was attempting a script that would issue a certain command if other buttons were pressed. Literally if CTRL and A are pressed, I wanted it to change my gamemode to survival.
IF(CTRL);
IF(KEY_A);
ECHO(/gm 0);
ENDIF;
ENDIF;
I'll place the code in a spoiler here for the sake of total clarity, but it will likely be irrelevant as I know that the script works.
An explanation of the bug is simple. When I open chat (or, it would seem, almost literally any GUI menu screen) if I press those buttons, the command is entered in complete disregard of the open GUI.
This is annoying, because I also have commands bound to CTRL+C and CTRL+V. If I need to copy something, I'll also end up issuing commands that I don't want to issue at those moments.
Edit moments later:
It's something I can bare with for now. It's not really a huge problem because I don't often use the keys to which I'm assigning the commands. Hence why I've bound them to those in the first place.
I would guess that your override key is CTRL. Normally scripts shouldn't execute in the chat except when the override key is held down.
I don't really understand what you mean by that, but as a hacky solution, you could add an IF(GUI = "something") if you want to limit it to certain GUI's
But i feel like you're going about it in a really hacky way..., could you explain all the hotkeys you want and how you want to use them (like, if you want them not to work in certain GUI screens and stuff)
I did experiment with the GUI variable a bit when I discovered the issue.
I don't have any of that code saved, so I can't post it here. But I can show what I remember. Which is something like:
IF(GUI=chat);
[insert chat specific hotkeys which would all LOG(Negative!);]
ELSE;
[insert what I wanted to happen without chat here]
As for my hotkeys, there are a lot | here are some (the most relevant):
I would guess that your override key is CTRL. Normally scripts shouldn't execute in the chat except when the override key is held down.
Nop! My override key is TAB.
I would have thought that they wouldn't trigger if I had any menu open, just as you said. Simple logic would deem us to be correct, no?
Until/unless someone fixes this script to not run in chat or other menus, or unless Mumfrey says otherwise, I'll equate this to a bug and deal with it until it's solved in a future release.
I'm confused why you're doing this the way you are, the reason it's happening is because it looks like you're running this as a daemon script and detecting keys, which is of course state-agnostic unlike regular binds which won't trigger in a GUI without an override.
This is not a bug at all, those variables are supposed to give you the state of the key regardless of context and don't affect the triggers at all.
What I'm saying is why do you have:
IF(CTRL);
IF(KEY_F);
ECHO(/fly);
ENDIF;
ENDIF;
Rather than just binding /fly to a key and setting the "require CTRL" modifier on the bind?
Maybe if you explained what trigger you're using it would make more sense to us, but as it is all I can assume is that you either:
Have all your binds linked to the same script, and for some reason then try to detect the keys which are held down inside that script. or
Are running this script as a daemon (perpetual loop) in which case the behaviour isn't a bug, those vars as I already mentioned are supposed to contain the current state of the key, which is context-insensitive
Are hooking this script on an event trigger... because, um... reasons?
I don't see any bug here, what I see is a very peculiar usage scenario outside what the mod was intended to handle.
Not sure why it wouldn't work actually.., everything else looks fine to me
is the control name exactly the same as well?
does it work if you use a number instead? as in SETPROPERTY(MyProgressBar,max,5)
Yes. The control name is the same. Matter of fact, I copied that line from another line that sets the expression...
As a test, I set up a couple of test macro keybinds so I could just play around with setting this value using various methods. I bound the following...
CTRL+ALT+U
$${SETPROPERTY(MyProgressBar,max,30)}$$
CTRL+ALT+I
$${SETPROPERTY(MyProgressBar,max,60)}$$
CTRL+ALT+O
$${SETPROPERTY(MyProgressBar,max,@#myvalue)}$$
...the value of [myvalue] being 30.
None of these key bindings changed the maximum value of the Progress Bar. I'm guessing this is a bug, or just not implemented?
Apologies for accusing the mod of a bug, when I simply didn't understand what I was doing, then
But, yes, I'm running it on a constant loop. I'm doing this because I have way too many bindings that I want to use but can't because limited keyboard space (I'm very lazy). So I've been using one key for multiple commands. I'd post my entire script, but it's immensely long as I want it to do several things based on whatever it is I'm doing/the world's doing/what I'm pressing.
Is there a way, then, (that I don't currently understand) to stop the script from issuing the command if I have chat open and press those keys?
Apologies for accusing the mod of a bug, when I simply didn't understand what I was doing, then
But, yes, I'm running it on a constant loop. I'm doing this because I have way too many bindings that I want to use but can't because limited keyboard space (I'm very lazy). So I've been using one key for multiple commands. I'd post my entire script, but it's immensely long as I want it to do several things based on whatever it is I'm doing/the world's doing/what I'm pressing.
Is there a way, then, (that I don't currently understand) to stop the script from issuing the command if I have chat open and press those keys?
It would be better to bind them as separate binds to be honest. You can still use scripts and there are a lot of shortcuts you can use such as IIF. But as a quick and dirty way of stopping your current script executing when you don't want it to you can check the value of the GUI variable (which will be "" if no GUI is active). However I strongly recommend actually using proper binds because your levels-of-nested IF's will be super-slow because of the macros executive's pre-emption, which will likely mean that it's easy for key presses to be missed. IIF doesn't suffer from pre-emption lag so you can happily:
None of these key bindings changed the maximum value of the Progress Bar. I'm guessing this is a bug, or just not implemented?
Yeah, i can't figure these out either, you're probably right
As a workaround, you can tick the [expr] checkbox and use global variables @#progressmin and @#progressmax for your bar (or just max, if that's the only side you change), then Set() those instead
that works fine for me
[/font] Apologies for accusing the mod of a bug, when I simply didn't understand what I was doing, then But, yes, I'm running it on a constant loop. I'm doing this because I have way too many bindings that I want to use but can't because limited keyboard space (I'm very lazy). So I've been using one key for multiple commands. I'd post my entire script, but it's immensely long as I want it to do several things based on whatever it is I'm doing/the world's doing/what I'm pressing. Is there a way, then, (that I don't currently understand) to stop the script from issuing the command if I have chat open and press those keys?
Yes, IF(GUI != chat)?
But really, you should be binding the keys instead.., you can bind several commands to a key by putting the condition IN the key
think of it like events.., you only want to do something when a button is pressed, so you should make the script only run when a button is pressed
then you can check IF(CTRL);Echo(/ctrlaction);ELSEIF(shift);Echo(/shift action);ELSE;KeyDown(forward);ENDIF and stuff like that
a background process is a VERY bad idea.., even just making sure that it only runs once per keypress would be a ton more code, and you're already running it a thousand times more often than you need to
Edit: Better option already above.., didn't notice because mcforums is weird =P
so if I'm in a game I can instantly quit MC by just pressing a key.
of course, i could use "alt+F4" but I like it with a keybind more.
maybe some ppls know the game "Teeworlds".
Open Source game. This game also has the function "Quit".
It's useful cause if you're online and want to quit mc very fast and quickly a keybind would be sick.
Sometimes it happens to me that I want to press my keybind of "teeworlds" to quit MC, but not possible to, cause the command doesn't exist.
While most likely possible, it seems kinda out of the scope of macros, being built as a mod that runs strictly ingame, and exits out ( Disconnect() ) to just outside that
Perhaps a module? well, again, if it's possible, it might be, but i wouldn't say for sure =P
As a more extensible solution, have you considered using third party applications to just send an alt-f4 to the system when you press that combination of yours?
I have one program like that i use sometimes, and another for my mouse that i use constantly (my lmb is borderline broken, i click with my mouse4)
Hello! I need a bind to the flint and steel survival games. I mean, if I press "R" to take me directly to slot 4, and when I look down I put my direct fire, and when I press one to take me on slot 1. Thanks in advance!
Hello! I need a bind to the flint and steel survival games. I mean, if I press "R" to take me directly to slot 4, and when I look down I put my direct fire, and when I press one to take me on slot 1. Thanks in advance!
No. I'm on slot 1 and press R, I want to take the slot 5 and when I look down I automatically put flint and steel.
Try pressing 5 to go to slot five?
As for looking down to automatically place flint and steel, that involves having a loop constantly running in the background.
Try pressing 5 to go to slot five? As for looking down to automatically place flint and steel, that involves having a loop constantly running in the background.
I still don't understand what this part means D=>
look down and light yourself on fire?
wait until you're looking down and then light yourself on fire?
what is the use case, what do you want to do with it?, i'm very confused
Does anybody know how to make a command that when a player joins it will say:
Welcome Back *Players Variable Name*
I've been trying all night so I need some help. thanks!
putting "Welcome back %JOINEDPLAYER%" in the onPlayerJoined Event Macro Bind should do what you ask
For anyone that knows more about this mod than I do, what are the names of all the different GUIs? I have a script that starts an automated crafting cycle (CRAFTANDWAIT) and asks for the item with $$i and an amount with $$?. I want to add something to the end that will close the crafting GUI. Thanks
putting "Welcome back %JOINEDPLAYER%" in the onPlayerJoined Event Macro Bind should do what you ask
For anyone that knows more about this mod than I do, what are the names of all the different GUIs? I have a script that starts an automated crafting cycle (CRAFTANDWAIT) and asks for the item with $$i and an amount with $$?. I want to add something to the end that will close the crafting GUI. Thanks
I don't think variables work in straight up bindings.., try $${Echo(Welcome back %JOINEDPLAYER%)}$$ instead
You can use Gui("") to close out and go back into the game
for the names of any other GUIs, bind a key to $${Log(%GUI%)}$$ and use it with macro override in whatever GUI you're wondering about
$${
TOGGLE(wheatfarm)
IF(wheatfarm)
DO
IF( (HITNAME = "Crops")
ECHO(HITNAME)
KEY(attack)
ENDIF
IF(HITID = "farmland")
KEY(use)
ENDIF
LOOP
ENDIF
}$$
Currently if i'm looking at farmland it will work, but if looking at wheat, nothing happens.
Any ideas?
I seem to have discovered a bug in the macro mod. Unless it's a known bug, in which case I apologize.
But, I was attempting a script that would issue a certain command if other buttons were pressed. Literally if CTRL and A are pressed, I wanted it to change my gamemode to survival.
I'll place the code in a spoiler here for the sake of total clarity, but it will likely be irrelevant as I know that the script works.
An explanation of the bug is simple. When I open chat (or, it would seem, almost literally any GUI menu screen) if I press those buttons, the command is entered in complete disregard of the open GUI.
This is annoying, because I also have commands bound to CTRL+C and CTRL+V. If I need to copy something, I'll also end up issuing commands that I don't want to issue at those moments.
Edit moments later:
It's something I can bare with for now. It's not really a huge problem because I don't often use the keys to which I'm assigning the commands. Hence why I've bound them to those in the first place.
Because every hero needs a villain.
You can't check it without opening your inventory, but in most cases your inventory shouldn't change unless you actually open it, so you can onGuiChange to count them every time you open the inventory (and remember to reopen and close it after you change things?)
or have it constantly check and recheck while it is open
The hotbar can be tracked with GetSlotItem(n) where n is 1-9, so dropping from and picking up to there is fine
picking up to the inventory you can keep track of by onPickupItem
You have two opening parentheses in that IF.., not sure if that's a problem
is "Crops" the exact hitname for wheat?, i'm assuming it didn't echo either
I don't really understand what you mean by that, but as a hacky solution, you could add an IF(GUI = "something") if you want to limit it to certain GUI's
But i feel like you're going about it in a really hacky way..., could you explain all the hotkeys you want and how you want to use them (like, if you want them not to work in certain GUI screens and stuff)
'Cause tomorrow spring is here
I would guess that your override key is CTRL. Normally scripts shouldn't execute in the chat except when the override key is held down.
Macro/Keybind mod Wiki
I did experiment with the GUI variable a bit when I discovered the issue.
I don't have any of that code saved, so I can't post it here. But I can show what I remember. Which is something like:
As for my hotkeys, there are a lot | here are some (the most relevant):
Nop! My override key is TAB.
I would have thought that they wouldn't trigger if I had any menu open, just as you said. Simple logic would deem us to be correct, no?
Until/unless someone fixes this script to not run in chat or other menus, or unless Mumfrey says otherwise, I'll equate this to a bug and deal with it until it's solved in a future release.
Because every hero needs a villain.
I'm confused why you're doing this the way you are, the reason it's happening is because it looks like you're running this as a daemon script and detecting keys, which is of course state-agnostic unlike regular binds which won't trigger in a GUI without an override.
This is not a bug at all, those variables are supposed to give you the state of the key regardless of context and don't affect the triggers at all.
What I'm saying is why do you have:
Rather than just binding /fly to a key and setting the "require CTRL" modifier on the bind?
Maybe if you explained what trigger you're using it would make more sense to us, but as it is all I can assume is that you either:
Don't cheat.
Not necessary. My mistake in the post here caused the confusion.
Yes. The control name is the same. Matter of fact, I copied that line from another line that sets the expression...
As a test, I set up a couple of test macro keybinds so I could just play around with setting this value using various methods. I bound the following...
CTRL+ALT+U
CTRL+ALT+I
CTRL+ALT+O
...the value of [myvalue] being 30.
None of these key bindings changed the maximum value of the Progress Bar. I'm guessing this is a bug, or just not implemented?
Apologies for accusing the mod of a bug, when I simply didn't understand what I was doing, then
But, yes, I'm running it on a constant loop. I'm doing this because I have way too many bindings that I want to use but can't because limited keyboard space (I'm very lazy). So I've been using one key for multiple commands. I'd post my entire script, but it's immensely long as I want it to do several things based on whatever it is I'm doing/the world's doing/what I'm pressing.
Is there a way, then, (that I don't currently understand) to stop the script from issuing the command if I have chat open and press those keys?
Because every hero needs a villain.
It would be better to bind them as separate binds to be honest. You can still use scripts and there are a lot of shortcuts you can use such as IIF. But as a quick and dirty way of stopping your current script executing when you don't want it to you can check the value of the GUI variable (which will be "" if no GUI is active). However I strongly recommend actually using proper binds because your levels-of-nested IF's will be super-slow because of the macros executive's pre-emption, which will likely mean that it's easy for key presses to be missed. IIF doesn't suffer from pre-emption lag so you can happily:
Using the tilde prefix uses the invoke-time value of the key not the current value of the key.
Yeah, i can't figure these out either, you're probably right
As a workaround, you can tick the [expr] checkbox and use global variables @#progressmin and @#progressmax for your bar (or just max, if that's the only side you change), then Set() those instead
that works fine for me
'Cause tomorrow spring is here
Yes, IF(GUI != chat)?
But really, you should be binding the keys instead.., you can bind several commands to a key by putting the condition IN the key
think of it like events.., you only want to do something when a button is pressed, so you should make the script only run when a button is pressed
then you can check IF(CTRL);Echo(/ctrlaction);ELSEIF(shift);Echo(/shift action);ELSE;KeyDown(forward);ENDIF and stuff like that
a background process is a VERY bad idea.., even just making sure that it only runs once per keypress would be a ton more code, and you're already running it a thousand times more often than you need to
Edit: Better option already above.., didn't notice because mcforums is weird =P
'Cause tomorrow spring is here
While most likely possible, it seems kinda out of the scope of macros, being built as a mod that runs strictly ingame, and exits out ( Disconnect() ) to just outside that
Perhaps a module? well, again, if it's possible, it might be, but i wouldn't say for sure =P
As a more extensible solution, have you considered using third party applications to just send an alt-f4 to the system when you press that combination of yours?
I have one program like that i use sometimes, and another for my mouse that i use constantly (my lmb is borderline broken, i click with my mouse4)
'Cause tomorrow spring is here
$${Slot(4);#x = %YAW%;#y = %PITCH%;Look(0,0);Key(use);Look(%#x%,%#y%);Slot(1)}$$
'Cause tomorrow spring is here
No. I'm on slot 1 and press R, I want to take the slot 5 and when I look down I automatically put flint and steel.
Try pressing 5 to go to slot five?
As for looking down to automatically place flint and steel, that involves having a loop constantly running in the background.
I still don't understand what this part means D=>
look down and light yourself on fire?
wait until you're looking down and then light yourself on fire?
what is the use case, what do you want to do with it?, i'm very confused
'Cause tomorrow spring is here
putting "Welcome back %JOINEDPLAYER%" in the onPlayerJoined Event Macro Bind should do what you ask
For anyone that knows more about this mod than I do, what are the names of all the different GUIs? I have a script that starts an automated crafting cycle (CRAFTANDWAIT) and asks for the item with $$i and an amount with $$?. I want to add something to the end that will close the crafting GUI. Thanks
I don't think variables work in straight up bindings.., try $${Echo(Welcome back %JOINEDPLAYER%)}$$ instead
You can use Gui("") to close out and go back into the game
for the names of any other GUIs, bind a key to $${Log(%GUI%)}$$ and use it with macro override in whatever GUI you're wondering about
'Cause tomorrow spring is here