The Meaning of Life, the Universe, and Everything.
Join Date:
5/1/2011
Posts:
46
Member Details
Just tested the %TICKS% bit in a single log message, but it doesn't work. Also tried it with "%TICKS%".
Also, it seems that the time message script I posted to you is still rapid fire repeating messages, and I can't fathom why. I just loaded up what you have there as the most recent edition, so I'm pretty sure it's not on your end.
Just tested the %TICKS% bit in a single log message, but it doesn't work. Also tried it with "%TICKS%".
Also, it seems that the time message script I posted to you is still rapid fire repeating messages, and I can't fathom why. I just loaded up what you have there as the most recent edition, so I'm pretty sure it's not on your end.
Make absolutely sure that you don't have 0.7 still floating around somewhere, the easiest way to be 100% sure which version it's actually loading is to enable the debug mode in the options (right near the bottom of the options list), the options display should say version 0.8.1.1 at the top. Bear in mind that if you got 0.7 via a modpack then most modpack installers put the mod into the .jar, in which case the only way to remove it is to force update and then reinstall said modpack without macros.
The Meaning of Life, the Universe, and Everything.
Join Date:
5/1/2011
Posts:
46
Member Details
Oddly enough, I'm not seeing the debug. I'm gonna go ahead and redo the modpack without the macro so I can make sure to get the new version. Thanks for that.
The Meaning of Life, the Universe, and Everything.
Join Date:
5/1/2011
Posts:
46
Member Details
What does the dimension variable return? "NETHER" and "WORLD"? Also, I chanced upon the wiki, so whenever it's ready for contributors let me know in a PM or something and I'll start editing.
What does the dimension variable return? "NETHER" and "WORLD"? Also, I chanced upon the wiki, so whenever it's ready for contributors let me know in a PM or something and I'll start editing.
It returns SURFACE, NETHER, END or UNKNOWN. The wiki I got fed up with using the crappy online text editor so I'm doing everything in a word processor now until I have all the content, then I can upload it in one hit. I'll let you know when it's ready for contributions and the structure I'd like to create.
It returns SURFACE, NETHER, END or UNKNOWN. The wiki I got fed up with using the crappy online text editor so I'm doing everything in a word processor now until I have all the content, then I can upload it in one hit. I'll let you know when it's ready for contributions and the structure I'd like to create.
Is the UNKNOWN to deal with mod worlds like the Aether, so it doesn't royally derp? And okay, I'll try to be ready with a few things once it's ready.
The Meaning of Life, the Universe, and Everything.
Join Date:
5/1/2011
Posts:
46
Member Details
Found another issue. I'll post the script in a spoiler this time, because it's less necessary I think, but could still be useful...
Basically, stacked scripts do not function. Shot me the error: "Script terminated with uncollapsed stack, check your script syntax". If you're wondering about the changes, I'm merely preparing to increase the scope of the script once I have access to counters. ;p
$${
DO;
IF(DIMENSION = SURFACE);
$${
IF((TICKS >= 0) && (TICKS < 6000) && !morning);
LOG("The sun is rising.");
LOG("The monsters are burning, and it is safe outside.");
UNSET(night);
SET(morning);
ENDIF;
IF((TICKS >= 6000) && (TICKS < 12000) && !day);
LOG("The sun is at its zenith.");
UNSET(morning);
SET(day);
ENDIF;
IF((TICKS >= 12000) && (TICKS < 18000) && !dusk);
LOG("Night is falling.");
LOG("The monsters are coming out to roam.");
LOG("You should probably get inside.");
UNSET(day);
SET(dusk);
ENDIF;
IF((TICKS >= 18000) && (TICKS <= 24000) && !night);
LOG("It is the witching hour.");
LOG("The monsters are on the hunt.");
UNSET(dusk);
SET(night);
ENDIF;
}$$
ENDIF;
WAIT(5);
LOOP
}$$
Edit:
Now that I think about it, I could probably call the interior script as a separate file and get away with it, but I still don't think this is what you intended to happen with stacked scripts, (is it?), and I'd prefer to have it all in one text file.
Found another issue. I'll post the script in a spoiler this time, because it's less necessary I think, but could still be useful...
Basically, stacked scripts do not function. Shot me the error: "Script terminated with uncollapsed stack, check your script syntax". If you're wondering about the changes, I'm merely preparing to increase the scope of the script once I have access to counters. ;p
$${
DO;
IF(DIMENSION = SURFACE);
$${
IF((TICKS >= 0) && (TICKS < 6000) && !morning);
LOG("The sun is rising.");
LOG("The monsters are burning, and it is safe outside.");
UNSET(night);
SET(morning);
ENDIF;
IF((TICKS >= 6000) && (TICKS < 12000) && !day);
LOG("The sun is at its zenith.");
UNSET(morning);
SET(day);
ENDIF;
IF((TICKS >= 12000) && (TICKS < 18000) && !dusk);
LOG("Night is falling.");
LOG("The monsters are coming out to roam.");
LOG("You should probably get inside.");
UNSET(day);
SET(dusk);
ENDIF;
IF((TICKS >= 18000) && (TICKS <= 24000) && !night);
LOG("It is the witching hour.");
LOG("The monsters are on the hunt.");
UNSET(dusk);
SET(night);
ENDIF;
}$$
ENDIF;
WAIT(5);
LOOP
}$$
That is completely by design, you're getting stack corruption because the second $${ is being ignored as an invalid script command, then the first }$$ is being treated as the end escape and therefore everything after will be parsed as text. Try doing the same thing with PHP or ASP and you'll experience the same error. Just remove the inner set of script tags as you are already inside the script parser at that point so cannot re-enter it.
Also
IF(DIMENSION = SURFACE);
will always return false because it's comparing a global variable DIMENSION with a non-existent global called SURFACE. You need to compare with a string literal "SURFACE":
That is completely by design, you're getting stack corruption because the second $${ is being ignored as an invalid script command, then the first }$$ is being treated as the end escape and therefore everything after will be parsed as text. Try doing the same thing with PHP or ASP and you'll experience the same error. Just remove the inner set of script tags as you are already inside the script parser at that point so cannot re-enter it.
Also
IF(DIMENSION = SURFACE);
will always return false because it's comparing a global variable DIMENSION with a non-existent global called SURFACE. You need to compare with a string literal "SURFACE":
IF(DIMENSION == "SURFACE");
Thanks for the Dimension tip.
As for the interior script, I see what I can do now, by just putting the entire other script in an IF statement, and not trying to re-enter the script parser. Thanks for pointing this out to me, and I should be able to get my stuff working now.
Edit:
I feel a bit stupid after looking at this again. I had somehow associated $${ with starting a loop rather than entering the script parser. How silly of me.
Hey Mumfrey i fricking love your mod i've been searching for a macro mod for a long time and those external macro programs such as : macrogamer don't seem to be compatible with minecraft. so to my question i'm new to scripting so i'm a bit confused but i think it has lots of potential, i was working on an auto miner but I've run into a problem, first i'll explain my concept a put in 2 toggle key lines 1 for sneak to prevent falling when digging and 1 for forward, but when i try to add the (attack) to break blocks it doesn't seem to work i even tried using the left click's key code which is -100 but that didn't work either, but when i changed the button used for (attack) to a different key and used it's key code it worked any advice on how i could keep left click as my (attack) control?
Hey Mumfrey i fricking love your mod i've been searching for a macro mod for a long time and those external macro programs such as : macrogamer don't seem to be compatible with minecraft. so to my question i'm new to scripting so i'm a bit confused but i think it has lots of potential, i was working on an auto miner but I've run into a problem, first i'll explain my concept a put in 2 toggle key lines 1 for sneak to prevent falling when digging and 1 for forward, but when i try to add the (attack) to break blocks it doesn't seem to work i even tried using the left click's key code which is -100 but that didn't work either, but when i changed the button used for (attack) to a different key and used it's key code it worked any advice on how i could keep left click as my (attack) control?
Hey Mumfrey i fricking love your mod i've been searching for a macro mod for a long time and those external macro programs such as : macrogamer don't seem to be compatible with minecraft. so to my question i'm new to scripting so i'm a bit confused but i think it has lots of potential, i was working on an auto miner but I've run into a problem, first i'll explain my concept a put in 2 toggle key lines 1 for sneak to prevent falling when digging and 1 for forward, but when i try to add the (attack) to break blocks it doesn't seem to work i even tried using the left click's key code which is -100 but that didn't work either, but when i changed the button used for (attack) to a different key and used it's key code it worked any advice on how i could keep left click as my (attack) control?
togglekey(forward)|
togglekey(sneak)|
togglekey(34)| - btw 34 is G -
Hi, what you're trying to do is totally possible, however it's due to a foible of the way Minecraft handles different types of key press. Basically there are 3 types of key, those which only work based on being held down (like the movement keys); those which only care about being pressed once (like the switch slot key an chat key), and those which have a combination of both (like attack and use).
KEYUP, KEYDOWN and TOGGLEKEY work with the first type of keybind and thus are perfect for holding down sneak, move, jump etc. during your macro. However for keys which require a key "event" (the 'being pressed' action) you have to instead use the KEY action which sends a key down event for 1 tick. If you're not sure which type of key a particular bind is, then check through the readme.
Anyhow, your movement part is working fine because you're using the correct type of command, however to make a continuous attack you need to send the event key in a loop:
DO(20);KEY(attack);LOOP
will send the attack key for 20 consecutive ticks (1 second, there are 20 ticks per second in minecraft). The nice part about using the key name rather than the code is that it doesn't matter what key the function is actually bound to, the mod will send the correct code (in the normal case attack is bound to LMB).
Automine has come up before, check out my previous post here where I post an example script. The nice thing about this example is that it shows how to use flags to make your automine key into a toggle function :smile.gif:
If you're not interested in the previous post I'll post the code again here, modified to include sneak for you:
Change the WAIT values and the DO value to alter the mining speed. It defaults to mining for 0.75 seconds (15 ticks) and moving forward for 0.1 seconds (100ms).
I set this as NUMPAD1 for the key, but just put the key name where I have <key>.
Actually if you just use STOP() with no parameters then it stops any macros on the current key, this is useful as you can move the macro around without having to worry about editing the key.
I set this as NUMPAD1 for the key, but just put the key name where I have <key>.
so where it says 'IF (mine);' does that mean if the function (mine) is toggled 'ON' it will activate the script and when it says 'ENDIF; IF(!mine); does that mean stop the script is the function (mine) is toggled 'OFF' basically does '!' tell wether its on or off?
so where it says 'IF (mine);' does that mean if the function (mine) is toggled 'ON' it will activate the script and when it says 'ENDIF; IF(!mine); does that mean stop the script is the function (mine) is toggled 'OFF' basically does '!' tell wether its on or off?
"mine" is a flag that is used in the script. Basically, when the script is started the flag is off. The flag is toggled, and that activates the infinite Do loop of the attack. When you press the key again, it actually starts another instance of the script, so you have 2 running for an instant. Then it toggles forward and sneak, turning them off, and toggles the 'mine' flag back off. In the original instance, it is still running the infinite loop of attack. However, the second instance has turned off the 'mine' flag, meaning it skips over the if where it enters the loop, and instead goes into the other if. The '!' is something used in coding which means "not". Basically, the second if is checking if the flag 'mine' is off, and since it is it stops all scripts running on <key>, which stops both instances of the script, stopping the auto mine. Does that make sense? I'm working on tutorials for scripting now, and I might need to work on my explanations. ;p
so where it says 'IF (mine);' does that mean if the function (mine) is toggled 'ON' it will activate the script and when it says 'ENDIF; IF(!mine); does that mean stop the script is the function (mine) is toggled 'OFF' basically does '!' tell wether its on or off?
"mine" is an arbitrary flag name, it could be called "derp" or anything really. You're correct though, "!" means NOT so you can read "!mine" as "not mine".
The Meaning of Life, the Universe, and Everything.
Join Date:
5/1/2011
Posts:
46
Member Details
EDIT:: Ninja edit by nukes327
Actually if you just use STOP() with no parameters then it stops any macros on the current key, this is useful as you can move the macro around without having to worry about editing the key.
I'm a master ninja lol. I'll have to remember the STOP without parameters. I keep forgetting to use it, cause I have a dedicated key with STOP($$?) to stop any runaway scripts I write.
I'm a master ninja lol. I'll have to remember the STOP without parameters. I keep forgetting to use it, cause I have a dedicated key with STOP($$?) to stop any runaway scripts I write.
Master ninja is right, I always hit reply whenever I get an email notification and somehow you must be getting them before me. Don't forget you can also stop runaway scripts by pressing the playback key and just clicking the little X.
Master ninja is right, I always hit reply whenever I get an email notification and somehow you must be getting them before me. Don't forget you can also stop runaway scripts by pressing the playback key and just clicking the little X.
I'll need to remember that in the future. ;p I have the current $$? set to my world messages script, so it's a bit faster than the 'x', but thanks.
"mine" is a flag that is used in the script. Basically, when the script is started the flag is off. The flag is toggled, and that activates the infinite Do loop of the attack. When you press the key again, it actually starts another instance of the script, so you have 2 running for an instant. Then it toggles forward and sneak, turning them off, and toggles the 'mine' flag back off. In the original instance, it is still running the infinite loop of attack. However, the second instance has turned off the 'mine' flag, meaning it skips over the if where it enters the loop, and instead goes into the other if. The '!' is something used in coding which means "not". Basically, the second if is checking if the flag 'mine' is off, and since it is it stops all scripts running on <key>, which stops both instances of the script, stopping the auto mine. Does that make sense? I'm working on tutorials for scripting now, and I might need to work on my explanations. ;p
that was a good explanation btw, but i have some problems when i try to run the script:
1. the (attack) doesn't actually break any blocks
2. when i push my key again to stop the macro, the movement stops but the 2 macros running on (G is set for my key) don't stop so i keep attacking but i stop moving
that was a good explanation btw, but i have some problems when i try to run the script:
1. the (attack) doesn't actually break any blocks
2. when i push my key again to stop the macro, the movement stops but the 2 macros running on (G is set for my key) don't stop so i keep attacking but i stop moving
Are you using the latest version, there was a bug where ATTACK wouldn't always break blocks in some circumstances that was present in version 0.6. If you're using minecraft 1.8.1 then there isn't a version which will allow you to do this I'm afraid.
Also, it seems that the time message script I posted to you is still rapid fire repeating messages, and I can't fathom why. I just loaded up what you have there as the most recent edition, so I'm pretty sure it's not on your end.
Make absolutely sure that you don't have 0.7 still floating around somewhere, the easiest way to be 100% sure which version it's actually loading is to enable the debug mode in the options (right near the bottom of the options list), the options display should say version 0.8.1.1 at the top. Bear in mind that if you got 0.7 via a modpack then most modpack installers put the mod into the .jar, in which case the only way to remove it is to force update and then reinstall said modpack without macros.
Edit:
Thanks, the fix worked.
It returns SURFACE, NETHER, END or UNKNOWN. The wiki I got fed up with using the crappy online text editor so I'm doing everything in a word processor now until I have all the content, then I can upload it in one hit. I'll let you know when it's ready for contributions and the structure I'd like to create.
Is the UNKNOWN to deal with mod worlds like the Aether, so it doesn't royally derp? And okay, I'll try to be ready with a few things once it's ready.
Basically, stacked scripts do not function. Shot me the error: "Script terminated with uncollapsed stack, check your script syntax". If you're wondering about the changes, I'm merely preparing to increase the scope of the script once I have access to counters. ;p
Edit:
Now that I think about it, I could probably call the interior script as a separate file and get away with it, but I still don't think this is what you intended to happen with stacked scripts, (is it?), and I'd prefer to have it all in one text file.
That is completely by design, you're getting stack corruption because the second $${ is being ignored as an invalid script command, then the first }$$ is being treated as the end escape and therefore everything after will be parsed as text. Try doing the same thing with PHP or ASP and you'll experience the same error. Just remove the inner set of script tags as you are already inside the script parser at that point so cannot re-enter it.
Also
will always return false because it's comparing a global variable DIMENSION with a non-existent global called SURFACE. You need to compare with a string literal "SURFACE":
Thanks for the Dimension tip.
As for the interior script, I see what I can do now, by just putting the entire other script in an IF statement, and not trying to re-enter the script parser. Thanks for pointing this out to me, and I should be able to get my stuff working now.
Edit:
I feel a bit stupid after looking at this again. I had somehow associated $${ with starting a loop rather than entering the script parser. How silly of me.
My script:
togglekey(forward)|
togglekey(sneak)|
togglekey(-100)|
The script that works:
togglekey(forward)|
togglekey(sneak)|
togglekey(34)| - btw 34 is G -
Just tested one that works with regular attack click. I'll post it here once you can stop it by pressing the key again.
Edit:
Here goes...
I set this as NUMPAD1 for the key, but just put the key name where I have <key>.
Hi, what you're trying to do is totally possible, however it's due to a foible of the way Minecraft handles different types of key press. Basically there are 3 types of key, those which only work based on being held down (like the movement keys); those which only care about being pressed once (like the switch slot key an chat key), and those which have a combination of both (like attack and use).
KEYUP, KEYDOWN and TOGGLEKEY work with the first type of keybind and thus are perfect for holding down sneak, move, jump etc. during your macro. However for keys which require a key "event" (the 'being pressed' action) you have to instead use the KEY action which sends a key down event for 1 tick. If you're not sure which type of key a particular bind is, then check through the readme.
Anyhow, your movement part is working fine because you're using the correct type of command, however to make a continuous attack you need to send the event key in a loop:
will send the attack key for 20 consecutive ticks (1 second, there are 20 ticks per second in minecraft). The nice part about using the key name rather than the code is that it doesn't matter what key the function is actually bound to, the mod will send the correct code (in the normal case attack is bound to LMB).
Automine has come up before, check out my previous post here where I post an example script. The nice thing about this example is that it shows how to use flags to make your automine key into a toggle function :smile.gif:
If you're not interested in the previous post I'll post the code again here, modified to include sneak for you:
Change the WAIT values and the DO value to alter the mining speed. It defaults to mining for 0.75 seconds (15 ticks) and moving forward for 0.1 seconds (100ms).
EDIT:: Ninja edit by nukes327
Actually if you just use STOP() with no parameters then it stops any macros on the current key, this is useful as you can move the macro around without having to worry about editing the key.
so where it says 'IF (mine);' does that mean if the function (mine) is toggled 'ON' it will activate the script and when it says 'ENDIF; IF(!mine); does that mean stop the script is the function (mine) is toggled 'OFF' basically does '!' tell wether its on or off?
"mine" is a flag that is used in the script. Basically, when the script is started the flag is off. The flag is toggled, and that activates the infinite Do loop of the attack. When you press the key again, it actually starts another instance of the script, so you have 2 running for an instant. Then it toggles forward and sneak, turning them off, and toggles the 'mine' flag back off. In the original instance, it is still running the infinite loop of attack. However, the second instance has turned off the 'mine' flag, meaning it skips over the if where it enters the loop, and instead goes into the other if. The '!' is something used in coding which means "not". Basically, the second if is checking if the flag 'mine' is off, and since it is it stops all scripts running on <key>, which stops both instances of the script, stopping the auto mine. Does that make sense? I'm working on tutorials for scripting now, and I might need to work on my explanations. ;p
"mine" is an arbitrary flag name, it could be called "derp" or anything really. You're correct though, "!" means NOT so you can read "!mine" as "not mine".
I'm a master ninja lol. I'll have to remember the STOP without parameters. I keep forgetting to use it, cause I have a dedicated key with STOP($$?) to stop any runaway scripts I write.
Master ninja is right, I always hit reply whenever I get an email notification and somehow you must be getting them before me. Don't forget you can also stop runaway scripts by pressing the playback key and just clicking the little X.
I'll need to remember that in the future. ;p I have the current $$? set to my world messages script, so it's a bit faster than the 'x', but thanks.
that was a good explanation btw, but i have some problems when i try to run the script:
1. the (attack) doesn't actually break any blocks
2. when i push my key again to stop the macro, the movement stops but the 2 macros running on (G is set for my key) don't stop so i keep attacking but i stop moving
Are you using the latest version, there was a bug where ATTACK wouldn't always break blocks in some circumstances that was present in version 0.6. If you're using minecraft 1.8.1 then there isn't a version which will allow you to do this I'm afraid.