Haha, unicorns ;P
This mod just isn't a vanilla type mod..lol.
I love this mod and can't live w/o it, but it doesn't belong in vanilla
Nothing else to do? Don't you work with some voxel stuff? .-.
Well, yes, but I mean I wouldn't have anything to do apart from all the other things I have to do, in that I wouldn't have to do that, therefore I'd just have to do any one of the other things that I have to do, or something else, but not that, unless I chose to do it anyway, in which case I'd still do it, in addition to all the other things that I may or may not do. I hope that's clear?
This crashes my game at the second IF statement can you help me get the code working? Its purpose is to check if chainmail armor is equipped, if not it will check the inventory for the piece and equip, if it is not in the inventory, it will use the command to spawn the corresponding piece and then equip it.
Oh derp! SLOTCLICK doesn't validate its input, so it's clicking slot -1 which is not a valid slot. I shall fix this, thanks for the report!
EDIT:: Incidentally, I'm impressed, this combination of GETSLOT and SLOTCLICK is exactly what I had in mind when providing those functions, so it's really nice to see someone experimenting with them
With this mod is it possible to write a script where it takes or uses an item from inside your inventory. (for example if hit takes sword out of inventory or eats food out of inventory) And if yes then could someone help me with the code to write a script using this.
No problem, it wasn't hard to add but it's worth noting that the way Minecraft applies damage to armour is that all worn armour takes a share of all damage taken (at least as far as I can tell), so this event is designed to only raise for each time damage is applied across any item, rather than once for each damaged item (if that makes sense). In other words if you take damage wearing all 4 pieces of armour it will be raised once, not four times.
Thats fine, one event triggering a check for all 4 armours is probably a better solution then an event for each anyway. Each armour type has a different total durability, so it's not like it'll be spamming all 4 no matter what. Helms and Boots will break first for example. Plus if one has Prot IV on it, it'll die quicker than the others, and so on.
Oh derp! SLOTCLICK doesn't validate its input, so it's clicking slot -1 which is not a valid slot. I shall fix this, thanks for the report!
EDIT:: Incidentally, I'm impressed, this combination of GETSLOT and SLOTCLICK is exactly what I had in mind when providing those functions, so it's really nice to see someone experimenting with them
The crashing was a bug? Didn't even realize it. I figured it was a error in my scripting. Hope to see a beta 3 fix to finish that script then!
Also thanks I plan to do a lot of things with GETSLOT and SLOTCLICK like grabbing food to get full health and putting it back in the same slot it was in and basing all the food from the points that it gives. The armor one is going to automate me having my "preset" armor for the fun of it. Oh and I am impressed with the new things we can do and that post.
Oh and there may be a bug with the creative 1.3.1 inventories it shows the survival inventory as 0 slots.
EDIT:
Just crashed:
java.lang.StringIndexOutOfBoundsException: String index out of range: 5
at java.lang.String.charAt(Unknown Source)
at java.util.regex.Matcher.appendReplacement(Unknown Source)
at java.util.regex.Matcher.replaceAll(Unknown Source)
at net.eq2online.macros.core.Macro.ReplaceHome(Macro.java:1265)
at net.eq2online.macros.core.Macro.Replace(Macro.java:1074)
at net.eq2online.macros.gui.screens.GuiMacroParam.Submit(GuiMacroParam.java:887)
at net.eq2online.macros.gui.screens.GuiMacroParam.a(GuiMacroParam.java:813)
at apm.n(SourceFile:126)
at apm.m(SourceFile:104)
at net.eq2online.macros.gui.shared.GuiScreenEx.m(GuiScreenEx.java:470)
at net.minecraft.client.Minecraft.l(SourceFile:1077)
at net.minecraft.client.Minecraft.J(SourceFile:583)
at net.minecraft.client.Minecraft.run(SourceFile:535)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 585bb102 ----------
I set /home $$h to "\" and it crashes upon going home.
The crashing was a bug? Didn't even realize it. I figured it was a error in my scripting. Hope to see a beta 3 fix to finish that script then!
Also thanks I plan to do a lot of things with GETSLOT and SLOTCLICK like grabbing food to get full health and putting it back in the same slot it was in and basing all the food from the points that it gives. The armor one is going to automate me having my "preset" armor for the fun of it. Oh and I am impressed with the new things we can do and that post.
In general I aim for there to be virtually no way for script actions to crash the game, they should just crash the script in the worst case, however there's now such a big codebase that stuff slips through on occasion. Getting this kind of feedback is useful and allows me to squash as many of the serious bugs as I realistically can.
Oh and there may be a bug with the creative 1.3.1 inventories it shows the survival inventory as 0 slots.
Yes the new creative inventory is a bit of an interesting animal, it may have to wait for a post-0.9 update before I can properly support it because it's unlike the other GUI's.
java.lang.StringIndexOutOfBoundsException: String index out of range: 5
at java.lang.String.charAt(Unknown Source)
at java.util.regex.Matcher.appendReplacement(Unknown Source)
at java.util.regex.Matcher.replaceAll(Unknown Source)
at net.eq2online.macros.core.Macro.ReplaceHome(Macro.java:1265)
at net.eq2online.macros.core.Macro.Replace(Macro.java:1074)
at net.eq2online.macros.gui.screens.GuiMacroParam.Submit(GuiMacroParam.java:887)
at net.eq2online.macros.gui.screens.GuiMacroParam.a(GuiMacroParam.java:813)
at apm.n(SourceFile:126)
at apm.m(SourceFile:104)
at net.eq2online.macros.gui.shared.GuiScreenEx.m(GuiScreenEx.java:470)
at net.minecraft.client.Minecraft.l(SourceFile:1077)
at net.minecraft.client.Minecraft.J(SourceFile:583)
at net.minecraft.client.Minecraft.run(SourceFile:535)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 585bb102 ----------
I set /home $$h to "\" and it crashes upon going home.
I'll look into this, looks like an issue with the escaping code, \ can be used to escape $ in macros to make it not treat it as a parameter, so it's possible it's reading off the end of the macro when a \ apppears at the end.
It's been fine so far, does seem to conflict with inventory-tweaks though, it macromod wouldn't run with inv tweaks.
Doesn't really surprise me, in the absence of modloader everyone that's released so far is using their own hooking method and the chances of conflicts is quite likely, I've coded my hook with a view to any conflict just causing the mod to not load rather than cause any kind of catastrophic failure.
I set /home $$h to "\" and it crashes upon going home.
Now I look at the cause of this I'm absolutely stunned that nobody has come across this before because by my calculations this bug has existed since version 0.6! It's now fixed though
Now I look at the cause of this I'm absolutely stunned that nobody has come across this before because by my calculations this bug has existed since version 0.6! It's now fixed though
Sweet glad i could help! I have also noticed another crash bug with a chat script it reads some digits repeatedly and crashes, i have to remove it in my .global_vars file to fix it. Next time it happens I will send the error to you.
Hey Mumfrey I love this mod and have been very good at it... until now.
With the new crafting update, I have been experimenting according to your example changelog 2 pages back.
I have successfuly been able to craft items with and without a workbench, as well as have the events work properly. I do, however, have a request as to my current issues.
Could you make a video explaining how to properly make items switch slots, halve a stack and move it, or even select a slot with shift clicking (using SLOTCLICK)? I can't manage to do anything pertaining to clicking slots, or even detecting a block in a slot with GETSLOT. And could you add another global variable for onCraftComplete for success or failure (1/0) so I may have things such as exiting my GUI without a Press(ESCAPE)? With escape, a failure forces me into the pause menue and I do not like. And an example of selecting an armor piece with specific multiple enchantments and equiping it would be nice too.
One last thing. Is it possible without using wait commands, to craft things in order so I do not need to find the right wait timing? I attempted to use $${CRAFT(297);Next;CRAFT(35);Next;CRAFT(278)}$$ but it went in reverse order but I had to press it 3 times
I feel like I am asking for much but most of my time with macros has been experimenting and some things took a while without a video.
EDIT- I just recieved a few crashes attempting to do any form of TEXTUREPACK(texture-here).
The Meaning of Life, the Universe, and Everything.
Join Date:
3/20/2012
Posts:
1,541
Member Details
Hi , The mod is great.
Is it posable to generate a macro from a .schematic file , then running the macro would cause player steve to build the schematic.
Sweet glad i could help! I have also noticed another crash bug with a chat script it reads some digits repeatedly and crashes, i have to remove it in my .global_vars file to fix it. Next time it happens I will send the error to you.
Hmm, I thought I'd cured this one, there was a bug where the mod would attempt to parse long strings of numbers to Integer but would overflow if the number was too large (too many digits). I'll have to have another look at VariableProviderGlobal to see if I can spot the problem.
Hey Mumfrey I love this mod and have been very good at it... until now.
With the new crafting update, I have been experimenting according to your example changelog 2 pages back.
I have successfuly been able to craft items with and without a workbench, as well as have the events work properly. I do, however, have a request as to my current issues.
Could you make a video explaining how to properly make items switch slots, halve a stack and move it, or even select a slot with shift clicking (using SLOTCLICK)? I can't manage to do anything pertaining to clicking slots, or even detecting a block in a slot with GETSLOT.
Yes, I'll see about making some tutorials for this since it's pretty involved. SLOTCLICK is actually a pretty low-level kind of function and doesn't necessarily do what you'd expect. Once the full release is out I'll do some how-to's.
And could you add another global variable for onCraftComplete for success or failure (1/0) so I may have things such as exiting my GUI without a Press(ESCAPE)? With escape, a failure forces me into the pause menue and I do not like. And an example of selecting an armor piece with specific multiple enchantments and equiping it would be nice too.
Well you can use GUI() to close the gui instead of PRESS(escape) which is probably more reliable. Also I realise the help got messed up for that event but there is an event variable REASON which contains the reason crafting finished (eg. if it didn't even start or if it completed or if it errored).
One last thing. Is it possible without using wait commands, to craft things in order so I do not need to find the right wait timing? I attempted to use $${CRAFT(297);Next;CRAFT(35);Next;CRAFT(278)}$$ but it went in reverse order but I had to press it 3 times
No, crafting happens asynchronously to the script so to make it synchronous you'd need to implement a system of callbacks, probably the easiest way would be to have a global state variable and a script with each possible step in it:
Hi , The mod is great.
Is it posable to generate a macro from a .schematic file , then running the macro would cause player steve to build the schematic.
No that's not possible, I think you're probably looking for something like MinePrinter.
Doesn't really surprise me, in the absence of modloader everyone that's released so far is using their own hooking method and the chances of conflicts is quite likely, I've coded my hook with a view to any conflict just causing the mod to not load rather than cause any kind of catastrophic failure.
Good to hear! I double checked files when installing mods, to make sure there weren't conflicts, and macro keybind was the only mod left I was trying to get in, and couldn't make it work. I thought I was just doing it wrong. :/ Inventory Tweaks provided a no mod-loader version, which overwrites
aqg.class
ayr.class
ni.class
So some part of their update must conflict with yours, even though your update doesn't require a change to these files. I'll stop banging my head against the wall now.
The first part of the macro is so when I use my auto welcome for when I join a server I don't spam everyone saying Hi *Username* Hi*Username* Hi*Username*. Here is my macro for onPlayerJoined
Way off. You're using too many script tags, only one set can be used. I'm not sure why you SET the joined flag again, but this script won't work because your syntax is broken. Scripts are contained within $${STUFF(goeshere);}$$, and only one set of open/close tags can be used. Closing with "}" does nothing, and (my guess is) breaks the script at that point. Please take some time to read the mod documentation!
Hey! I love this mod and cant play without it anymore! But im not very good with the scripting yet.So basically, ive been using a xp farm very much. So i was wondering if there is any way to make it like punch 10 times by the press of a button?
Yeah,
$${Do(10);Key(Attack);Wait(20ms);Loop}$$
$${ }$$ - Script tags
Do...Loop - loops back from the "Loop" line to the "Do", 10 times in this example
Key - Presses a button, see controls menu for names
Wait - Stops the macro for an amount of time before continuing
At least i hope it was "Press"..., maybe it was "Key"
Way off. You're using too many script tags, only one set can be used. I'm not sure why you SET the joined flag again, but this script won't work because your syntax is broken. Scripts are contained within $${STUFF(goeshere);}$$, and only one set of open/close tags can be used. Closing with "}" does nothing, and (my guess is) breaks the script at that point. Please take some time to read the mod documentation!
Just to clarify, you can use as many opening/closing sets in a macro as you like, they just have to be paired, so
is fine, the script tags just tell the macro compiler that that part of the macro should be treated as script. You're right about the rest though.
However I should mention that the whole @justjoined malarkey shouldn't be needed any more if you're using 0.9, since I basically do exactly that but just internally to the mod, the event should basically not be raised within 10 seconds of joining a server.
I see that this exposed a bug, which Mumfrey has found and fixed. But... I find myself wondering if the following line of code...
is coded correctly? Is this assigning the value of -1, or comparing? In other words, is a double equal sign (==) required, as in java/c/etc?
Its assigning the value of -1. If the item is not in the inventory the value appears to be -1 which in my script it would for example spawn the item to equip it.
How would I go about adding multiple welcomes to the following script, new to this whole scripting business
IFMATCHES(%CHAT%,"§dWelcome §[a-f0-9](.+?)§f§d to the Server!");
MATCH(%CHAT%,"§dWelcome §[a-f0-9](.+?)§f§d to the Server!",&newplayer,1);
WAIT(3)
ECHO("Welcome &c%&newplayer%&f!");
ENDIF;
Way off. You're using too many script tags, only one set can be used. I'm not sure why you SET the joined flag again, but this script won't work because your syntax is broken. Scripts are contained within $${STUFF(goeshere);}$$, and only one set of open/close tags can be used. Closing with "}" does nothing, and (my guess is) breaks the script at that point. Please take some time to read the mod documentation!
Well, yes, but I mean I wouldn't have anything to do apart from all the other things I have to do, in that I wouldn't have to do that, therefore I'd just have to do any one of the other things that I have to do, or something else, but not that, unless I chose to do it anyway, in which case I'd still do it, in addition to all the other things that I may or may not do. I hope that's clear?
Oh derp! SLOTCLICK doesn't validate its input, so it's clicking slot -1 which is not a valid slot. I shall fix this, thanks for the report!
EDIT:: Incidentally, I'm impressed, this combination of GETSLOT and SLOTCLICK is exactly what I had in mind when providing those functions, so it's really nice to see someone experimenting with them
Thats fine, one event triggering a check for all 4 armours is probably a better solution then an event for each anyway. Each armour type has a different total durability, so it's not like it'll be spamming all 4 no matter what. Helms and Boots will break first for example. Plus if one has Prot IV on it, it'll die quicker than the others, and so on.
The crashing was a bug? Didn't even realize it. I figured it was a error in my scripting. Hope to see a beta 3 fix to finish that script then!
Also thanks I plan to do a lot of things with GETSLOT and SLOTCLICK like grabbing food to get full health and putting it back in the same slot it was in and basing all the food from the points that it gives. The armor one is going to automate me having my "preset" armor for the fun of it. Oh and I am impressed with the new things we can do and that post.
Oh and there may be a bug with the creative 1.3.1 inventories it shows the survival inventory as 0 slots.
EDIT:
Just crashed:
I set /home $$h to "\" and it crashes upon going home.
In general I aim for there to be virtually no way for script actions to crash the game, they should just crash the script in the worst case, however there's now such a big codebase that stuff slips through on occasion. Getting this kind of feedback is useful and allows me to squash as many of the serious bugs as I realistically can.
Yes the new creative inventory is a bit of an interesting animal, it may have to wait for a post-0.9 update before I can properly support it because it's unlike the other GUI's.
I'll look into this, looks like an issue with the escaping code, \ can be used to escape $ in macros to make it not treat it as a parameter, so it's possible it's reading off the end of the macro when a \ apppears at the end.
Just bear in mind it's a beta, and as such may
format your hard drivecause small inconsequential problems.Doesn't really surprise me, in the absence of modloader everyone that's released so far is using their own hooking method and the chances of conflicts is quite likely, I've coded my hook with a view to any conflict just causing the mod to not load rather than cause any kind of catastrophic failure.
Now I look at the cause of this I'm absolutely stunned that nobody has come across this before because by my calculations this bug has existed since version 0.6! It's now fixed though
Sweet glad i could help! I have also noticed another crash bug with a chat script it reads some digits repeatedly and crashes, i have to remove it in my .global_vars file to fix it. Next time it happens I will send the error to you.
With the new crafting update, I have been experimenting according to your example changelog 2 pages back.
I have successfuly been able to craft items with and without a workbench, as well as have the events work properly. I do, however, have a request as to my current issues.
Could you make a video explaining how to properly make items switch slots, halve a stack and move it, or even select a slot with shift clicking (using SLOTCLICK)? I can't manage to do anything pertaining to clicking slots, or even detecting a block in a slot with GETSLOT. And could you add another global variable for onCraftComplete for success or failure (1/0) so I may have things such as exiting my GUI without a Press(ESCAPE)? With escape, a failure forces me into the pause menue and I do not like. And an example of selecting an armor piece with specific multiple enchantments and equiping it would be nice too.
One last thing. Is it possible without using wait commands, to craft things in order so I do not need to find the right wait timing? I attempted to use $${CRAFT(297);Next;CRAFT(35);Next;CRAFT(278)}$$ but it went in reverse order but I had to press it 3 times
I feel like I am asking for much but most of my time with macros has been experimenting and some things took a while without a video.
EDIT- I just recieved a few crashes attempting to do any form of TEXTUREPACK(texture-here).
Is it posable to generate a macro from a .schematic file , then running the macro would cause player steve to build the schematic.
Thanks for the mod
Hmm, I thought I'd cured this one, there was a bug where the mod would attempt to parse long strings of numbers to Integer but would overflow if the number was too large (too many digits). I'll have to have another look at VariableProviderGlobal to see if I can spot the problem.
Yes, I'll see about making some tutorials for this since it's pretty involved. SLOTCLICK is actually a pretty low-level kind of function and doesn't necessarily do what you'd expect. Once the full release is out I'll do some how-to's.
Well you can use GUI() to close the gui instead of PRESS(escape) which is probably more reliable. Also I realise the help got messed up for that event but there is an event variable REASON which contains the reason crafting finished (eg. if it didn't even start or if it completed or if it errored).
No, crafting happens asynchronously to the script so to make it synchronous you'd need to implement a system of callbacks, probably the easiest way would be to have a global state variable and a script with each possible step in it:
makearmour.txt
Bound to a key
onAutoCraftingComplete
So the key initialises the variable and calls the script, then the completed event calls the script again, etc. etc.
Ok I'll look into that.
No that's not possible, I think you're probably looking for something like MinePrinter.
is coded correctly? Is this assigning the value of -1, or comparing? In other words, is a double equal sign (==) required, as in java/c/etc?
Good to hear! I double checked files when installing mods, to make sure there weren't conflicts, and macro keybind was the only mod left I was trying to get in, and couldn't make it work. I thought I was just doing it wrong. :/ Inventory Tweaks provided a no mod-loader version, which overwrites
$${SET(@justjoined);WAIT(5);UNSET(@justjoined);} | $${SET(@justjoined);ECHO(Hi everyone!)}$$
The first part of the macro is so when I use my auto welcome for when I join a server I don't spam everyone saying Hi *Username* Hi*Username* Hi*Username*. Here is my macro for onPlayerJoined
$${IF([email protected]);ECHO(Hi,%JOINEDPLAYER%!);ENDIF;}$$
That is so when a player joins my game I say Hi, *username*!. However, it doesn't work. How can I fix that?
Way off. You're using too many script tags, only one set can be used. I'm not sure why you SET the joined flag again, but this script won't work because your syntax is broken. Scripts are contained within $${STUFF(goeshere);}$$, and only one set of open/close tags can be used. Closing with "}" does nothing, and (my guess is) breaks the script at that point. Please take some time to read the mod documentation!
OnJoinGame:
$${SET(@justjoined);WAIT(5);UNSET(@justjoined);}$$
OnPlayerJoin:
$${IF([email protected]);ECHO(Hi, %JOINEDPLAYER%!);LOG("Greeting active");ENDIF;}$$
Optional Keybind toggle:
$${TOGGLE(@justjoined);}$$
A single equals sign works fine, IF always compares
Yeah,
$${Do(10);Key(Attack);Wait(20ms);Loop}$$
$${ }$$ - Script tags
Do...Loop - loops back from the "Loop" line to the "Do", 10 times in this example
Key - Presses a button, see controls menu for names
Wait - Stops the macro for an amount of time before continuing
At least i hope it was "Press"..., maybe it was "Key"It was "Key"
'Cause tomorrow spring is here
Just to clarify, you can use as many opening/closing sets in a macro as you like, they just have to be paired, so
won't work but
is fine, the script tags just tell the macro compiler that that part of the macro should be treated as script. You're right about the rest though.
However I should mention that the whole @justjoined malarkey shouldn't be needed any more if you're using 0.9, since I basically do exactly that but just internally to the mod, the event should basically not be raised within 10 seconds of joining a server.
It's KEY to activate a bind, press pumps the raw event into the buffer, which is often not necessary.
Its assigning the value of -1. If the item is not in the inventory the value appears to be -1 which in my script it would for example spawn the item to equip it.
Probably a bug but for some reason that doesn't work. I read the help file last night also scribble!
Yep, I'm on the case!