I mean like save a bunch of arrays to file name specified, then possibility load them at later time after closing minecraft.
You can use LOGTO() to save to a file in the logs folder. That folder isn't readable by the mod though so you'd have to move the file out of there to "import" or run it.
Reading the code, I decided to modify it a bit.
I changed the saving process so that all of the code is saved in a single array. However, I am currently modifying it further because IfMatches() gives playback lag when recording. Any Feedback?
What are you trying to accomplish by storing it in a single array?
also, not sure if you've seen my latest version.
If you're trying to save it to a file for later use, you could just create an export function to log all of the data to a text file, and then an import function to read it all back into the arrays.
Not sure exactly how you'd go about that, I haven't noticed a lot of string manipulation support in the mod yet. (it may be there, i don't know)
If you could export the data from the keypresses into a "binary" string, you may be able to create a function to compress that string to BASE64. From there, you could probably whisper it easily to a bot and have that bot uncompress it and play it back =)
I've done something similar before in javascript:
function exportData(x){
//create or reset the temp variables
var data = "";
var temp = "";
//loop through rows
for (i = 0; i < query['h']; i++){
//loop through columns
for (j = 0; j < query['w']; j++){
//the unique id of the cell
var id = j + "x" + i;
if (document.getElementById(id).style.backgroundColor == "gray"){
temp+="1";
} else {
temp+="0"
}
if (temp.length == 6){
//convert the temp variable
data+=key[temp];
//reset the temp variable
temp = "";
}
}
}
//finish off the last temp variable with bogus data so we don't lose the last few blocks.
//the import function doesn't care about extra data.
if (temp.length < 6 && temp.length > 0) {
while (temp.length < 6) {
temp+="0"
}
data+=key[temp];
}
//get the current URL
url = document.location.href;
//remove any search string that may be there.
if (url.indexOf("?") != -1){
url = url.slice(0, url.indexOf("?"));
}
//add the data that we need to the url.
url += "?w=" + query['w'] + "&h=" + query['h'] + "&data=" + data;
//output the url.
document.getElementById("directlink").innerHTML = url;
//ask is.gd for a short url!
if (x == "short"){
url = encodeURIComponent(url);
document.getElementById("directlinkshort").src = "http://is.gd/create.php?format=simple&url=" + url;
}
}
That is my goal, and after about an hour, I thought of using prime numbers as individual identities. I'm just beginning again, so I'll get back when I do that.
Edit: Numbers hate me. Lack of decimals is hard to use absolute division with.
Instead, I just removed some spaces in my original code. Should double its speed.
This will do it cleanly:
//Let user know
LOG(Saving to file\, this could take awhile.);
//get array size so we know when to stop
ARRAYSIZE(@#yawlog,#countmax);
#countmax = #countmax - 1;
//the first line should clear the arrays
LOGTO(SavedRecording.txt,EXEC(DeleteRecordings.txt));
FOR(#counter,0,%#countmax%);
LOGTO(SavedRecording.txt,PUSH(@#yawlog[]\,%@#yawlog[%#counter%]%));
LOGTO(SavedRecording.txt,PUSH(@#pitchlog[]\,%@#pitchlog[%#counter%]%));
LOGTO(SavedRecording.txt,PUSH(@#wlog[]\,%@#wlog[%#counter%]%));
LOGTO(SavedRecording.txt,PUSH(@#alog[]\,%@#alog[%#counter%]%));
LOGTO(SavedRecording.txt,PUSH(@#slog[]\,%@#slog[%#counter%]%));
LOGTO(SavedRecording.txt,PUSH(@#dlog[]\,%@#dlog[%#counter%]%));
LOGTO(SavedRecording.txt,PUSH(@#qlog[]\,%@#qlog[%#counter%]%));
LOGTO(SavedRecording.txt,PUSH(@#spacelog[]\,%@#spacelog[%#counter%]%));
LOGTO(SavedRecording.txt,PUSH(@#lmouselog[]\,%@#lmouselog[%#counter%]%));
LOGTO(SavedRecording.txt,PUSH(@#rmouselog[]\,%@#rmouselog[%#counter%]%));
LOGTO(SavedRecording.txt,PUSH(@#lshiftlog[]\,%@#lshiftlog[%#counter%]%));
NEXT;
LOG(Saved in log folder as SavedRecording.txt);
If you wanna help improve the accuracy for the recording process, after using /sethome, just use /home before you start recording. Awesome script btw. Cheers!
If you wanna help improve the accuracy for the recording process, after using /sethome, just use /home before you start recording. Awesome script btw. Cheers!
That was just a preview. I've added a lot more functinoality including sethome and home commands. Details are in this video and it's description.
Hey guys, you look pretty helpful and I'm hoping you could help me. I'm pretty new and I got stuck on this. I'm wanting to take the playername from 3 different types of chat messages and turn it into a variable, but it needs to check that the message has the color codes in front of it so I know it's a legit message and not a player typing something to fool my mod. I'm hoping this can be done with regular expressions and MATCH
§7[§f2§7]§dOMGMMORPGFTW§r: Test
Above, the 2 after the f is a floor number and can be anywhere from 1 to 6 and can be ignored. The player name should always be colored a, b, or d. Basically, I need a script that checks to make sure that there is a color before the name, and then put the name in a variable.
§7[WHISPER]OMGMMORPGFTW§f: Test
Here is the same thing, it just needs to make sure that the name is preceded by "§7[WHISPER]" and then put the name in a variable.
§dOMGMMORPGFTW§e sent you §a0 mBTC
This one needs to check to make sure it has "§e sent you" somewhere in it, then take the player name and also the number before mBTC as two different variables. So a &name and #amount variable persay.
I hope i'm not asking too much of you guys and really appreciate any help I get! Thanks a bunch!
That was just a preview. I've added a lot more functinoality including sethome and home commands. Details are in this video and it's description.
that's the video from the post I quoted in the first place.
No my point was that if you use /home immediately after using /sethome it will shift your position to the proper spot. /home will bring you to the same spot every time but it's not in the exact same spot you are standing in when you use /sethome. So your block which ended up being placed in a different spot will be placed in the same spot the first time this way. Try it out.
If you wanna help improve the accuracy for the recording process, after using /sethome, just use /home before you start recording. Awesome script btw. Cheers!
Edit: AH... WAIT, I get it. The very first part of the video i didn't /home at all.. Thanks. I'll definately add /home anywhere after /sethome is used the the scripts. =)
I think the remaining inaccuracy mostly stems from the fact that the yaw and pitch don't record any decimal places so you can't get more finely tuned movement than 1 degree increments.
You'll also notice that when your yaw passes over exactly south, you actually face north for a split second. I think that stems from how the look command works and having to add 180 to yaw to make it work properly.
I'll probably add a way to tp a bot to your exact current position and viewing angle, maybe even have that have the bots /sethome and /home quickly to make sure all starting point variances are gone.
Anybody have advice on taking a string like this:
0101000101011001000001111000011
or this:
321|321|322|22|22|31|320
and parsing it so I can handle either 1 character or 1 delimited value at a time?
Anybody have advice on taking a string like this:
0101000101011001000001111000011
or this:
321|321|322|22|22|31|320
and parsing it so I can handle either 1 character or 1 delimited value at a time?
Edit: AH... WAIT, I get it. The very first part of the video i didn't /home at all.. Thanks. I'll definately add /home anywhere after /sethome is used the the scripts. =)
I think the remaining inaccuracy mostly stems from the fact that the yaw and pitch don't record any decimal places so you can't get more finely tuned movement than 1 degree increments.
You'll also notice that when your yaw passes over exactly south, you actually face north for a split second. I think that stems from how the look command works and having to add 180 to yaw to make it work properly.
I'll probably add a way to tp a bot to your exact current position and viewing angle, maybe even have that have the bots /sethome and /home quickly to make sure all starting point variances are gone.
Anybody have advice on taking a string like this:
0101000101011001000001111000011
or this:
321|321|322|22|22|31|320
and parsing it so I can handle either 1 character or 1 delimited value at a time?
Might have a bug though, I wasn't able to get it to work with "|" as the delimiter, after spending like 2 hours on it i switched it to a "-" and it worked first thing.
On the plus side, spending those hours on this taught me a lot about regular expressions lol.
Hey guys, you look pretty helpful and I'm hoping you could help me. I'm pretty new and I got stuck on this. I'm wanting to take the playername from 3 different types of chat messages and turn it into a variable, but it needs to check that the message has the color codes in front of it so I know it's a legit message and not a player typing something to fool my mod. I'm hoping this can be done with regular expressions and MATCH
§7[§f2§7]§dOMGMMORPGFTW§r: Test
Above, the 2 after the f is a floor number and can be anywhere from 1 to 6 and can be ignored. The player name should always be colored a, b, or d. Basically, I need a script that checks to make sure that there is a color before the name, and then put the name in a variable.
§7[WHISPER]OMGMMORPGFTW§f: Test
Here is the same thing, it just needs to make sure that the name is preceded by "§7[WHISPER]" and then put the name in a variable.
§dOMGMMORPGFTW§e sent you §a0 mBTC
This one needs to check to make sure it has "§e sent you" somewhere in it, then take the player name and also the number before mBTC as two different variables. So a &name and #amount variable persay.
I hope i'm not asking too much of you guys and really appreciate any help I get! Thanks a bunch!
Absolutely not, and thank you for providing all the appropriate information up front =P, i don't remember the last time anyone did that
Mumfrey, I must say that this mod is amazing. I do not remember when I played Minecraft without it, and now I depend on it. Release the update when you can, I am not asking you to rush. I am just saying that this is the best mood I have ever used and I have felt crippled without it. Thanks for making it!
New question: Is it possible to use EXEC to pass parameters to scripts? Like if I wanted to execute a script with the information gathered from that filter, how do I pass it to the next script?
If you feel like trying to find a way to qualify just how huge Mod Macros's is, I'd imagine every release to macros is akin to a major version release of a major programming language.
Like for instance, Java.
For instance, it may be comparable amounts of effort to the step from say, Java 6 ( aka: jdk1.6 ) to Java 7 ( aka: jdk1.7 ) and to Java 8 ( aka:jdk1.8 )
Given Java only makes a major release every few years, macros making a major release every few months is on the scale of "heroic efforts", especially considering Java only have to worry about new features, and bug fixes, not like Macros, where every release has to track running on top of Minecraft which rips out all the you'd built your code on and gives you a new one, basically requiring you to start over at least a significant chunk of your code.
And given the depth which macros lets you augment minecraft, I'd imagine it would require to change a lot more things under the hood than your average mod does to keep up.
I Love the goat droppings out of macros, and I won't play without it, so I don't want to get on the bad side of the awesome dude who makes it, because if he gets goated off, he might* burn out and stop doing it entirely. And that would be bad. =)
*pure conjecture on my part, but it does happen, people burn out. Fortunately, Its usually not permanent.
If i wanted to create a script that stops a loop script does a command and starts the script again how would i do that?
basicall what i have is a script that runs and jumps forward for a while(i am making a video dont ask lol) then I just need it to stop running after a certain amount of time turn right break a block then turn back and continue the looped running and jumping.
I appreciate the help
If you feel like trying to find a way to qualify just how huge Mod Macros's is, I'd imagine every release to macros is akin to a major version release of a major programming language.
Like for instance, Java.
Heh, probably a bit overkill but yes, it's a big mod and doing as much as it does without touching a single base class is bloody difficult, there are several abstraction layers working together to create a coherent system which presents itself to the outside observer as a simple mod.
But it's like an iceberg, 90% of the mod isn't event apparent that it exists until invoked either via a script command or via hooking the more esoteric features built in to the macro preprocessor such as recursive compilation or pre-compilation conditionals.
Some of the most advanced parts of the internals don't need much tweaking, because they're stand-alone subsystems in their own right, such as:
The script executive: which is the "core" of the mod and what crunches all the numbers when all's said and done. One of the most complex bits of the mod but one of the easiest to maintain because everything else revolves around it
The jinput subsystem: one of the cleverest parts and the one people are least likely to even know it exists, this subsystem literally decompiles the raw input buffers every frame in order to inject or supress keypresses, and capture the key and mouse driven macro triggers. This also has the ability to capture input from any device supported by jinput, such as joysticks and joypads, yes you could actually use this to provide native joypad control from minecraft if you really wanted to, if I could be bothered to document how.
The designable GUI system: this just sits on top of everything and minds its own business, it talks to macros core as its base API, but doesn't really give a flying stuff about anything else.
Whereas conversely, some of the "simple" parts are the trickiest to maintain because they interface directly with the minecraft engine and are reliant on a lot of reflection magic to make them work at all, such as
The environment variable providers: these hook directly onto the game engine and such are easily broken when anything small changes
The icon managers: I've given up counting how many times Mojang have changed their minds about how textures are managed in the engine, meaning this all needs to be re-written. The transition to resource packs has been a real doozy because I've had to write resource providers for anything which needs to do clever things with textures or sounds, like the thumbnail manager, text editor and PLAYSOUND command.
Packet-triggered events: don't even get me started.
The biggest thing to realise is that there are parts buried in this mod which would make pretty good stand-alone mods by themselves! Honestly the number of times I'm reading through the "mods" section of the forums and think, "hmm, you could do that with macros". Unfortunately it's all let down by the documentation, which is why I'm (trying) to make that a priority at the moment. You'll note that there aren't any new features in this next release and that's the main reason why.
So yeah, a lot of things take care of themselves, but testing every corner of the mod is nigh impossible, especially when there's stuff that I've forgotten exists!
I like talking about it though, this has been a labour of love for over two years now, and the scale it's reached has far surpassed my original plans but I'm very pleased with where it's gone and where it's going and it's good that people enjoy my work and appreciate the time I spend, that's the pay-off of course.
Still reading? Good, that was a test of your resolve. As a reward you get the beta. I'll put the changelog in the spoiler below. Some new features aren't ready for prime time so they've been dropped so rather than 0.10.0 this is 0.9.10 and 0.10 will follow when I've finished the current improvements. In a nutshell this is 0.9.9 with some bug fixes and updated to 1.6.2. As ever, report any bugs you find in this thread. Test as much as you can.
Changes for 0.9.10
Updated for Minecraft 1.6.2, and believe me this was no picnic
Kick/disconnect now properly triggers onJoinGame when rejoining
Improvements to macro enqueue/dequeue which should prevent CoModificationException when calling STOP inside an EXEC'd task
Fixed ECHO not working inside UNSAFE when flood protection is enabled (still prevented when flood protection is off)
Improved escaping for | inside script actions, \| should now work as expected in regex and ECHO
Fixed issue with array iterator position var
Improved SETRES to work more reliably than the old version
Added RESOURCEPACK command as an alias of TEXTUREPACK, both versions work for compatibility purposes
If i wanted to create a script that stops a loop script does a command and starts the script again how would i do that?
basicall what i have is a script that runs and jumps forward for a while(i am making a video dont ask lol) then I just need it to stop running after a certain amount of time turn right break a block then turn back and continue the looped running and jumping.
I appreciate the help
If you use EXEC(script.txt,name); to launch the script containing the loop, you can stop that specific script by using STOP(name); from anywhere else.
You can use LOGTO() to save to a file in the logs folder. That folder isn't readable by the mod though so you'd have to move the file out of there to "import" or run it.
What are you trying to accomplish by storing it in a single array?
also, not sure if you've seen my latest version.
If you're trying to save it to a file for later use, you could just create an export function to log all of the data to a text file, and then an import function to read it all back into the arrays.
Not sure exactly how you'd go about that, I haven't noticed a lot of string manipulation support in the mod yet. (it may be there, i don't know)
If you could export the data from the keypresses into a "binary" string, you may be able to create a function to compress that string to BASE64. From there, you could probably whisper it easily to a bot and have that bot uncompress it and play it back =)
I've done something similar before in javascript:
The "key" array was this:
Demonstration Video: Youtube Link
This will do it cleanly:
It will output a file like this:
Takes a bit to save, but imports lightning quick. Not the most efficient use of storage space, but it will work.
Demonstration Video: Youtube Link
That was just a preview. I've added a lot more functinoality including sethome and home commands. Details are in this video and it's description.
Demonstration Video: Youtube Link
§7[§f2§7]§dOMGMMORPGFTW§r: Test
Above, the 2 after the f is a floor number and can be anywhere from 1 to 6 and can be ignored. The player name should always be colored a, b, or d. Basically, I need a script that checks to make sure that there is a color before the name, and then put the name in a variable.
§7[WHISPER]OMGMMORPGFTW§f: Test
Here is the same thing, it just needs to make sure that the name is preceded by "§7[WHISPER]" and then put the name in a variable.
§dOMGMMORPGFTW§e sent you §a0 mBTC
This one needs to check to make sure it has "§e sent you" somewhere in it, then take the player name and also the number before mBTC as two different variables. So a &name and #amount variable persay.
I hope i'm not asking too much of you guys and really appreciate any help I get! Thanks a bunch!
No my point was that if you use /home immediately after using /sethome it will shift your position to the proper spot. /home will bring you to the same spot every time but it's not in the exact same spot you are standing in when you use /sethome. So your block which ended up being placed in a different spot will be placed in the same spot the first time this way. Try it out.
Edit: AH... WAIT, I get it. The very first part of the video i didn't /home at all.. Thanks. I'll definately add /home anywhere after /sethome is used the the scripts. =)
I think the remaining inaccuracy mostly stems from the fact that the yaw and pitch don't record any decimal places so you can't get more finely tuned movement than 1 degree increments.
You'll also notice that when your yaw passes over exactly south, you actually face north for a split second. I think that stems from how the look command works and having to add 180 to yaw to make it work properly.
I'll probably add a way to tp a bot to your exact current position and viewing angle, maybe even have that have the bots /sethome and /home quickly to make sure all starting point variances are gone.
Anybody have advice on taking a string like this:
0101000101011001000001111000011
or this:
321|321|322|22|22|31|320
and parsing it so I can handle either 1 character or 1 delimited value at a time?
Demonstration Video: Youtube Link
You can regular-expression it:
Signature for IFMATCHES is:
Thank you.
Might have a bug though, I wasn't able to get it to work with "|" as the delimiter, after spending like 2 hours on it i switched it to a "-" and it worked first thing.
On the plus side, spending those hours on this taught me a lot about regular expressions lol.
Demonstration Video: Youtube Link
Absolutely not, and thank you for providing all the appropriate information up front =P, i don't remember the last time anyone did that
ChatFilter
and make sure any scripts check the messagetype first, of course =P
so for example
IF(%&messagetype% = mBTCreveice)
Set(filter)
LogTo(debug,"%&amount% received from %&name%)
ENDIF
IF(filter);Filter();ENDIF
'Cause tomorrow spring is here
Wow, thank you so much! That was so helpful!
If you feel like trying to find a way to qualify just how huge Mod Macros's is, I'd imagine every release to macros is akin to a major version release of a major programming language.
Like for instance, Java.
For instance, it may be comparable amounts of effort to the step from say, Java 6 ( aka: jdk1.6 ) to Java 7 ( aka: jdk1.7 ) and to Java 8 ( aka:jdk1.8 )
Given Java only makes a major release every few years, macros making a major release every few months is on the scale of "heroic efforts", especially considering Java only have to worry about new features, and bug fixes, not like Macros, where every release has to track running on top of Minecraft which rips out all the you'd built your code on and gives you a new one, basically requiring you to start over at least a significant chunk of your code.
And given the depth which macros lets you augment minecraft, I'd imagine it would require to change a lot more things under the hood than your average mod does to keep up.
I Love the goat droppings out of macros, and I won't play without it, so I don't want to get on the bad side of the awesome dude who makes it, because if he gets goated off, he might* burn out and stop doing it entirely. And that would be bad. =)
*pure conjecture on my part, but it does happen, people burn out. Fortunately, Its usually not permanent.
basicall what i have is a script that runs and jumps forward for a while(i am making a video dont ask lol) then I just need it to stop running after a certain amount of time turn right break a block then turn back and continue the looped running and jumping.
I appreciate the help
Heh, probably a bit overkill but yes, it's a big mod and doing as much as it does without touching a single base class is bloody difficult, there are several abstraction layers working together to create a coherent system which presents itself to the outside observer as a simple mod.
But it's like an iceberg, 90% of the mod isn't event apparent that it exists until invoked either via a script command or via hooking the more esoteric features built in to the macro preprocessor such as recursive compilation or pre-compilation conditionals.
Some of the most advanced parts of the internals don't need much tweaking, because they're stand-alone subsystems in their own right, such as:
So yeah, a lot of things take care of themselves, but testing every corner of the mod is nigh impossible, especially when there's stuff that I've forgotten exists!
I like talking about it though, this has been a labour of love for over two years now, and the scale it's reached has far surpassed my original plans but I'm very pleased with where it's gone and where it's going and it's good that people enjoy my work and appreciate the time I spend, that's the pay-off of course.
Still reading? Good, that was a test of your resolve. As a reward you get the beta. I'll put the changelog in the spoiler below. Some new features aren't ready for prime time so they've been dropped so rather than 0.10.0 this is 0.9.10 and 0.10 will follow when I've finished the current improvements. In a nutshell this is 0.9.9 with some bug fixes and updated to 1.6.2. As ever, report any bugs you find in this thread. Test as much as you can.
If you use EXEC(script.txt,name); to launch the script containing the loop, you can stop that specific script by using STOP(name); from anywhere else.
Demonstration Video: Youtube Link