SLOTCLICK has a flaw. Minecraft can't sometimes keep up with the speed of clicks it does. I even put a wait of 1 tick after each SLOTCLICK to help with it but it still fails to click things correctly and items disappear visually sometimes and when that happens Minecraft fails to realize the item is still there until you click it again.
Slot clicks are sent to the server so you're at the mercy of the net connection with respect to keeping things in sync, you are safe to make deterministic actions which is why auto-crafting works, because the server doesn't contradict the client at any point. But for anything else, especially if using GETSLOT you need to wait - I would say - 10 ticks or so as a minimum between actions.
Probably does commands two or more times and then you get items in wrong places and the rest of the slotclicks will mess everything up. Is there any way you could have it make sure the wanted result happens with SLOTCLICK?
Explain wanted result? SLOTCLICK just clicks the slots so how can the mod determine the intended action? The only way to do that kind of thing would be add some commands like SLOTMOVE or such that knew what was needing to happen and could do it and check that it worked.
Edit: After thinking about the issue it might be that the macros are actually fired twice and the previous one doesn't have time to go through within one tick so the second one starts to interfere.
Edit2: I tried to do a workaround for the issue with a flag that is checked if it is not set and sets it and runs the rest of the macro and unsets the flag when done but the flag isn't set before the duplicate macro runs its check for it so that failed.
This duplicate executing is really killing the functionality of my slotclick macros.
Duplicate executing? What exactly are you trying to do?
As a roll-up of bug fixes against 0.9.5, here is the point release 0.9.5.2 for 1.4.2:
Download link
Change Log
Fixed onChat event
Fixed faulty registration of SETLABEL action, now works correctly in release
Removed relative syntax from GETID because it broke the ability to use negative X and Z coordinates!
Added GETIDREL which works the same as GETID but uses relative coordinates
Added new global variables HITX, HITY and HITZ, HITSIDE which correspond to the world coordinates of the hit block.
Added support in MODE variable to return adventure modes => now returns 2 when in adventure
Fixed slight mouse position detection error on macro stop buttons, added highlighting to make it clearer which macro will be stopped
Added additional usage for item parameter, can now insert the selected damage using $$d:
/give Mumfrey $$i $$[amount] $$d
Added experimental command PROMPT with syntax:
PROMPT(&targetvar,"$$u","Prompt message",true);
Parameters 3 and 4 are optional. The fourth flag specifies whether the prompt is allowed to override another GUI if another GUI is open when PROMPT is invoked. Note that this command is experimental at the moment, use with care a please report bugs ITT
I can't get liteloader to work with Modloader. > This liteloader stuff has never worked right for me and really frustrates me. go back to how it was please.
Hello, I am trying to set up an autocraft macro but it is only for the four slot crafter in the inventory. BUT, I was wondering if it would work for the crafting table set up, For example if i wanted it to craft cakes auto.. because the server i use i have access to /craft that opens a crafting table set up. Would it be possible to some how to make a macro where it opens the crafting table using the command then autocrafts something using the autocraft script. If it is not possible, could you think about adding that function? it would be a great addition. Thanks
Okay, so this is a pretty complicated script that I'm requesting. So in the server that I play in /spawn teleports you into a random gamemode every match before the game starts. I was wondering if it was possible to have a macro that continuously used /spawn until it found a swamp, which is ID 6 in biomes.
This would be a really great help to me, but the only problem that I can think of in advance is if there was no swamp biome in the map and the macro would never stop using /spawn. If this IS possible, it would be awesome if somebody could help me with this problem in advance.
Okay, so this is a pretty complicated script that I'm requesting. So in the server that I play in /spawn teleports you into a random gamemode every match before the game starts. I was wondering if it was possible to have a macro that continuously used /spawn until it found a swamp, which is ID 6 in biomes.
This would be a really great help to me, but the only problem that I can think of in advance is if there was no swamp biome in the map and the macro would never stop using /spawn. If this IS possible, it would be awesome if somebody could help me with this problem in advance.
My thanks to you!
Try this
$${
do
if(BIOME == "Swampland")
log(&6Finally "&cSwamp&6"!)
stop
else
echo(/spawn)
log(&6Not "&cSwamp&6" but "&c%BIOME%&6". Try again!)
endif
wait(100ms)
loop
}$$
You can remove the logs they are only for debugging.
I'm quite troubled becaue of my recent problem. In fact, since I updated the mod, the function IFMATCHES doesn't work anymore. Have you this problem too ?
The complete code lines are :
Put on onChat it doesn't work, I write "test" in the chat and nothing happen.
Hope you could help me, thanks for it.
Have a nice day.
EDIT : I tried some more tests and I found that onChat is not working anymore since the last update, I think that's why my script didn't work. Do you know why the onChat event is broken ?
Update to 0.9.5.2 Mumfrey fixed in that update the onChat event.
Memfrey could you revamp sign editing, ie with a better macromod sign editing gui that lets the user do all the things that Mojang never bother improving, like being able to edit a sign line without having to delete what is already written, maybe if required add some extra server component for it into ClientPermissions ....which would make it more worthwhile adding onto a server if it enabled more functionality in Macromod, which I'm more for supporting than just disabling functions.
I can do this if it's simple enough, but I already have a full enough schedule just trying to maintain my existing mods, and of course trying to find some free time to update the documentation. If it's something I can do quickly in an evening then I will do so, if it takes longer then I really ought to concentrate on other things.
Ey! My mouse buttons works now!
Also, did the chat filter function make it into a release or was it just a testing feature? If it made it in, could you quickly explain how to use it?
It's still experimental at this point which is why I haven't added it to the OP, still has some gremlins to work out and possible game-crashing issues to squash. I've decided to make it available as a module though rather than a stand-alone mod, so you can grab the current version here and just drop it into your macros/modules folder. For an explanation of how to use it see this post.
I can't get liteloader to work with Modloader. > This liteloader stuff has never worked right for me and really frustrates me. go back to how it was please.
Then you're not installing it correctly, LiteLoader and ModLoader co-exist quite happily.
Hello, I am trying to set up an autocraft macro but it is only for the four slot crafter in the inventory. BUT, I was wondering if it would work for the crafting table set up, For example if i wanted it to craft cakes auto.. because the server i use i have access to /craft that opens a crafting table set up. Would it be possible to some how to make a macro where it opens the crafting table using the command then autocrafts something using the autocraft script. If it is not possible, could you think about adding that function? it would be a great addition. Thanks
Recipes which require a crafting table will work with autocraft provided that you run the macro with the crafting table GUI already open, or are pointing directly at a crafting table when you run the macro so that it can right-click on it. So basically if you send the /craft command just before calling the autocraft action then it should work fine, maybe add a little delay to give the server time to display the GUI for you.
Yeah so, button presses are duplicated by Minecraft when a lag spike happens and then you get two of the same macro running at the same time and they interfere with each other's slotclicks. But I know you said before that it is a fault of Minecraft and you can't do anything about it. I'm doing all this on single player btw but the server client merge causes "network" lag even in single player.
Anyway, the macro in question, it will place torches but also keep them out of your hotbar:
Yeah it's quite long. Basically there are a bunch of getslots and slotclicks happening. It does work most of the time with the 1 tick waits, would not want to put longer waits because it would defeat the whole point. I also have one for crafting/milking and eating mushroom stew and that also loses the items sometimes. They are either left on the cursor and you are basically cheating an extra inventory slot when the inventory is closed or their slot appears empty but they are there when tried to click on or item tries to place itself there.
You shouldn't need to add the 1 tick waits everywhere, that's just unnecessarily slowing the script down. You can safely remove the waits between the multiple GETSLOTs and stuff.
Basically, anything that's reading state need not wait, and anything that's modifying state need not wait, since those actions happen deterministically and the server won't "argue" with any valid 'move'. Where you do need waits is where reads occur after writes, so for example rather than 1 tick waits everywhere, put a 10 tick wait after crafting actions or between a set of slot clicks and getslots.
Also a slightly neater and easier to read version of your initial IF would be:
IF(HIT != "TILE");
ACHIEVEMENTGET("Can't place torch here",50);
STOP;
ENDIF;
IFMATCHES(%HITID%,"^(2[356]|5[48]|6[1249]|7[17]|84|9[2346]|107|11[678]|122|13[078]|14[35])$");
ACHIEVEMENTGET("Can't place torch here",50);
STOP;
ENDIF;
// Rest of the script here
An option to avoid duplicate events if you're having trouble with lag spikes would be to run this as a daemon task. Basically EXEC your script from onJoinGame and wrap it in a structure like this:
DO; // loop forever
DO;UNTIL(KEY_R); // wait for key press
// rest of script here
LOOP; // go back and wait for key press
The problem from the mod's point of view is that lag-induced key events are indistinguishable from real key events, so I guess what's needed is some kind of enforcable debounce for certain macros.
I can't get liteloader to work with Modloader. > This liteloader stuff has never worked right for me and really frustrates me. go back to how it was please.
Try to do different mods in each place..
I believe this is the correct way for Modloader.
Modloader -> Optifine -> liteloader
In other news.. why is this not working in Chat Filter?
We won't know until Risugami updates. If there are issues with other mods I will try to resolve them. I've already been given some information which has helped to stop Macros breaking other mods when loaded from Magic Launcher. Just bear in mind if reporting issues it's important to know whether you're running a non-standard launcher such as Magic Launcher.
Ok,so
it now will change the spawned mob.But it still does the whole thing with hitting esc where it pulls up the pause menu but at least it works
P.S. its just annoying thats why im telling you lol
NOTE:I installed with magic launcher and normal MC launcher and same result
NOTE:I also have installed optifine,modloader,and too many items
I could not install your mod with magic launcher its self,i had to go in and add your stuff to the jar
when i tried with magic launcher i had modloader at top and lite loader right below and then my other mods then macro mod,and the macro mod said "no mods found"
it now will change the spawned mob.But it still does the whole thing with hitting esc where it pulls up the pause menu but at least it works
P.S. its just annoying thats why im telling you lol
NOTE:I installed with magic launcher and normal MC launcher and same result
NOTE:I also have installed optifine,modloader,and too many items
I could not install your mod with magic launcher its self,i had to go in and add your stuff to the jar
when i tried with magic launcher i had modloader at top and lite loader right below and then my other mods then macro mod,and the macro mod said "no mods found"
Check 1: did you manually add the .litemod file to the mods folder manually?
Check 2: if so, did you put in the correct build into the jar and the folder?
Rollback Post to RevisionRollBack
Thanks to Mumfrey for creating this awesome mod! The Macro / Keybind Mod. If you ever need to contact me asap, go to the server: mc.synapsehlp.com
it now will change the spawned mob.But it still does the whole thing with hitting esc where it pulls up the pause menu but at least it works
If you're describing bugs please try to be descriptive, "does the whole thing with hitting esc where it pulls up the pause menu" assumes I have some prior knowledge of the issue which I do not. If there is a problem please describe it with steps to reproduce etc.
I could not install your mod with magic launcher its self,i had to go in and add your stuff to the jar
when i tried with magic launcher i had modloader at top and lite loader right below and then my other mods then macro mod,and the macro mod said "no mods found"
Magic Launcher doesn't recognise litemod files, you just need to drop the .litemod file in the "mods" directory as described in the installation instructions. You need not put liteloader itself into the .jar if you're using Magic Launcher.
If you're describing bugs please try to be descriptive, "does the whole thing with hitting esc where it pulls up the pause menu" assumes I have some prior knowledge of the issue which I do not. If there is a problem please describe it with steps to reproduce etc.
Magic Launcher doesn't recognise litemod files, you just need to drop the .litemod file in the "mods" directory as described in the installation instructions. You need not put liteloader itself into the .jar if you're using Magic Launcher.
Ugh. . . Someone needs to yell at the magic launcher devs about this. . .
I love this mod! I like the idea overall. But is ther way to only issue part of the command so you can enter the last part of the command? If your wondering why it is because i do not like typeing the same command over and over with a diffrence of 1thing.
Yah I like this idea. When I am on a server I like to message people. Somethimes the people have long and hard names to remember. To private message them I type /msg (players name). Could there be a command were it puts /msg (whatever name you choose for that command) without entering it so that you can enter the message you want after it?
Yah I like this idea. When I am on a server I like to message people. Somethimes the people have long and hard names to remember. To private message them I type /msg (players name). Could there be a command were it puts /msg (whatever name you choose for that command) without entering it so that you can enter the message you want after it?
Here you go:
/msg $$u $$!
Put this on any key.
Explanation:
/msg- the command
$$u-a list on online players you can choose from
$$!-ends the script and puts the text on the chat screen
Example:
I press the key, it comes up with a list of players, I choose the player "kenzierocks".
My chat screen opens with "/msg kenzierocks"
Mumfrey, how does one round a number? I suppose I could use a complicated regex and keep checking that, but is there a simpler way? I'm trying to fire /tp %PLAYER% %XPOS% %YPOS% %ZPOS% but it always fails with commands.generic.double.invalid printed in the chat screen
Call my crazy but I don't like to use stop() if possible, it is basically the equivalent of break in other programming languages and code is considered bad if it has to use breaks to work. I'm kind of studying to become a programmer so I just don't want to use that. Anyway, I did it without stops by nesting ifs and elses a bit more.
A bit more questions about the waits; do you really need 10 tick waits, I have 2 ticks now and it seems fine to me? Also, do you need to wait after getslot or pick that would store a variable you want to check with an if?
No, as he said, waits are only needed when you perform a physical change (moving/crafting items) and then use a command like GetSlot or similar that needs to be aware of the recent change
that's when you give the server some time to catch up, in case it momentarily reverts your action
Basically, if it doesn't make sense without the mod (variables don't), it's updated instantly and in order
And for how long, the same 2 ticks I have which I have already done?
I didn't try the daemon idea yet but wouldn't that cause lag in itself as it would be a constant macro running on every tick? I find the game starts to lag a bit if I have multiple macros running that have loops running on every tick. And I would need to have multiple macro keys checked for, too, and that would most likely lag.
I forgot what you were doing, but to signfificantly reduce lag on daemon tasks, simply add a wait before the end Loop, so it only checks, say, once every second?, two seconds?, ten?
As an extra question/request I ask if it's possible to get entities' other data besides their ID? Like the color of a sheep or the profession of a villager etc.
Check with %HITDATA%
Another extra question, is there a shorter syntax to check if a flag is unset? I'm using IF(flag=0) but can you do IF(!flag) or something as checking for set flags is just IF(flag)?
Yes, IF(!flag) does work
The idea was to prevent multiple executions of macros that run for a while on keypresses and having waits in the loop would mean you would have to hold the key until the loop started again. I'll live with the issue for now, I have too many macros to check for in it.
I'm not sure what you're trying to do, but in case it helps, IF(~KEY_NAME) / IF(~CTRL) / etc. checks if a key was down when the macro started
Another thing that I ran into is how the DURABILITY variable works with PICK. It works with items that use it to determine the actual item but items that have an actual durability won't be picked using that variable. Kind of a blame of how Minecraft handles durability but there should be a variable for the actual damage value.
No time to test it right now, but did you use the exact durability?, i mean, if you're off even by one it won't pick it, i presume
Try using Log(%DURABILITY%) on a tool and then using PICK with that just after
Mumfrey, how does one round a number? I suppose I could use a complicated regex and keep checking that, but is there a simpler way? I'm trying to fire /tp %PLAYER% %XPOS% %YPOS% %ZPOS% but it always fails with commands.generic.double.invalid printed in the chat screen
You can only really round using a regex, but it's not a complicated one:
But the XPOS, YPOS and ZPOS are all integers anyway, in fact all numeric values used by the mod are integers. The macro you posted above would actually just try to teleport you to your own position, well it would provided it was inside an ECHO. If you just put that in as a chat command the server would probably choke on the raw string "/tp %PLAYER% %XPOS% %YPOS% %ZPOS%".
Call my crazy but I don't like to use stop() if possible, it is basically the equivalent of break in other programming languages and code is considered bad if it has to use breaks to work. I'm kind of studying to become a programmer so I just don't want to use that. Anyway, I did it without stops by nesting ifs and elses a bit more.
This would be a sensible idea if this were a programming language, but because the scripts are interpreted you're causing the script parser to read the entire script even if you don't intend to run any of it. The script interpreter still reads every line inside a conditional block which is not executed because it's looking for the corresponding ENDIF and doesn't have a direct pointer to it like a compiled language does.
Programming in reality, despite what they teach you, has to blend pragmatism and mindfulness of performance with idealism, which is why structures like break exist. It's the reason there's a world of difference between:
someValue >> 1
and
someValue / 2
even though they do the same thing.
Breaks and returns aren't always evil either, at least not in the real world, since they can be used to drastically improve readability in certain circumstances. Nesting ifs is fine but in many circumstances it makes sense to test for the failure condition because otherwise exceptions and error condition handling can end up a long way from the test which caused them to be raised. Consider this function:
public int exampleFunction(String param1, String param2)
{
int result;
if (someSanityCheckingFunction(param1))
{
if (someOtherSanityCheckingFunction(param2)
{
//
// A
// whole
// bunch
// of
// code
// which
// is
// indented a tonne just
// because of the sanity functions
}
else
{
throw new Exception("Exception for failure of sanity check function 2 ends up way down here!");
}
}
else
{
// Sanity check for param1 is soft and if it fails we don't care and just return, but look how
// far this return is from the check which causes it to be
return 0;
}
return result;
}
Of course it depends on the length of each branch body, but in the majority of cases error condition handlers are just going to be a return or throw an exception, and it is much more readable (from the point of view of the body of the function as well which doesn't end up stupidly indented) to reverse the check and return instead:
public int exampleFunction(String param1, String param2)
{
int result;
if (!someSanityCheckingFunction(param1))
{
return 0;
}
if (!someOtherSanityCheckingFunction(param2)
{
throw new Exception("Exception for failure of sanity check function 2 which clearly applies to the sanity check");
}
//
// Function body
//
return result;
}
Obviously every situation is different, and that's why rigid adherence to the ideas they teach you when you learn to code sometimes isn't always the best strategy. Going back to the script we were talking about, in this instance - when you take into account the execution scheme of the language you're using - using STOP is much more efficient and actually more readable. Breaking isn't always bad.
A bit more questions about the waits; do you really need 10 tick waits, I have 2 ticks now and it seems fine to me? Also, do you need to wait after getslot or pick that would store a variable you want to check with an if? And for how long, the same 2 ticks I have which I have already done?
You don't need 10 tick waits, but anything which interacts with the server may benefit from breathing room, use whatever works for you. No you don't need to wait after GETSLOT or PICK.
I didn't try the daemon idea yet but wouldn't that cause lag in itself as it would be a constant macro running on every tick? I find the game starts to lag a bit if I have multiple macros running that have loops running on every tick. And I would need to have multiple macro keys checked for, too, and that would most likely lag.
Even on the crummiest PC I own I can run 20+ macros with tight loops so you should be fine unless your PC is powered by steam. IF doesn't have any efficiency hits based on the complexity of the expression, multiple IFs are worse than one but a single IF can be as complex as you like and the efficiency is the same.
As an extra question/request I ask if it's possible to get entities' other data besides their ID? Like the color of a sheep or the profession of a villager etc.
That doesn't help because when the macro starts twice both of the instances clear that check. The keypress is fired twice by Minecraft but the two keypresses happen on the same tick and that makes it impossible to halt the second macro within the macro itself. Am I really the only one with this problem of lag spikes? Can't be, this is the same exact problem as blocks being placed twice when you only clicked once.
It's an issue with LWJGL, there's not much that can be done about it. Like I say I'll try to figure a way to implement debounce for certain keys, or at least some kind of mutex.
Slot clicks are sent to the server so you're at the mercy of the net connection with respect to keeping things in sync, you are safe to make deterministic actions which is why auto-crafting works, because the server doesn't contradict the client at any point. But for anything else, especially if using GETSLOT you need to wait - I would say - 10 ticks or so as a minimum between actions.
?
Explain wanted result? SLOTCLICK just clicks the slots so how can the mod determine the intended action? The only way to do that kind of thing would be add some commands like SLOTMOVE or such that knew what was needing to happen and could do it and check that it worked.
Duplicate executing? What exactly are you trying to do?
Download link
Change Log
Parameters 3 and 4 are optional. The fourth flag specifies whether the prompt is allowed to override another GUI if another GUI is open when PROMPT is invoked.
Note that this command is experimental at the moment, use with care a please report bugs ITT
This would be a really great help to me, but the only problem that I can think of in advance is if there was no swamp biome in the map and the macro would never stop using /spawn. If this IS possible, it would be awesome if somebody could help me with this problem in advance.
My thanks to you!
Try this
You can remove the logs they are only for debugging.
Update to 0.9.5.2 Mumfrey fixed in that update the onChat event.
Macro/Keybind mod Wiki
I can do this if it's simple enough, but I already have a full enough schedule just trying to maintain my existing mods, and of course trying to find some free time to update the documentation. If it's something I can do quickly in an evening then I will do so, if it takes longer then I really ought to concentrate on other things.
It's still experimental at this point which is why I haven't added it to the OP, still has some gremlins to work out and possible game-crashing issues to squash. I've decided to make it available as a module though rather than a stand-alone mod, so you can grab the current version here and just drop it into your macros/modules folder. For an explanation of how to use it see this post.
Then you're not installing it correctly, LiteLoader and ModLoader co-exist quite happily.
Yes it works.
Recipes which require a crafting table will work with autocraft provided that you run the macro with the crafting table GUI already open, or are pointing directly at a crafting table when you run the macro so that it can right-click on it. So basically if you send the /craft command just before calling the autocraft action then it should work fine, maybe add a little delay to give the server time to display the GUI for you.
You shouldn't need to add the 1 tick waits everywhere, that's just unnecessarily slowing the script down. You can safely remove the waits between the multiple GETSLOTs and stuff.
Basically, anything that's reading state need not wait, and anything that's modifying state need not wait, since those actions happen deterministically and the server won't "argue" with any valid 'move'. Where you do need waits is where reads occur after writes, so for example rather than 1 tick waits everywhere, put a 10 tick wait after crafting actions or between a set of slot clicks and getslots.
Also a slightly neater and easier to read version of your initial IF would be:
An option to avoid duplicate events if you're having trouble with lag spikes would be to run this as a daemon task. Basically EXEC your script from onJoinGame and wrap it in a structure like this:
The problem from the mod's point of view is that lag-induced key events are indistinguishable from real key events, so I guess what's needed is some kind of enforcable debounce for certain macros.
Try to do different mods in each place..
I believe this is the correct way for Modloader.
Modloader -> Optifine -> liteloader
In other news.. why is this not working in Chat Filter?
Ok,so
NOTE:I installed with magic launcher and normal MC launcher and same result
NOTE:I also have installed optifine,modloader,and too many items
Check 1: did you manually add the .litemod file to the mods folder manually?
Check 2: if so, did you put in the correct build into the jar and the folder?
If you're describing bugs please try to be descriptive, "does the whole thing with hitting esc where it pulls up the pause menu" assumes I have some prior knowledge of the issue which I do not. If there is a problem please describe it with steps to reproduce etc.
Magic Launcher doesn't recognise litemod files, you just need to drop the .litemod file in the "mods" directory as described in the installation instructions. You need not put liteloader itself into the .jar if you're using Magic Launcher.
Ugh. . . Someone needs to yell at the magic launcher devs about this. . .
Yah I like this idea. When I am on a server I like to message people. Somethimes the people have long and hard names to remember. To private message them I type /msg (players name). Could there be a command were it puts /msg (whatever name you choose for that command) without entering it so that you can enter the message you want after it?
Here you go:
Put this on any key.
Explanation:
/msg- the command
$$u-a list on online players you can choose from
$$!-ends the script and puts the text on the chat screen
Example:
I press the key, it comes up with a list of players, I choose the player "kenzierocks".
My chat screen opens with "/msg kenzierocks"
Mumfrey, how does one round a number? I suppose I could use a complicated regex and keep checking that, but is there a simpler way? I'm trying to fire /tp %PLAYER% %XPOS% %YPOS% %ZPOS% but it always fails with commands.generic.double.invalid printed in the chat screen
'Cause tomorrow spring is here
I'm not sure what you're trying to do, but in case it helps, IF(~KEY_NAME) / IF(~CTRL) / etc. checks if a key was down when the macro started
No time to test it right now, but did you use the exact durability?, i mean, if you're off even by one it won't pick it, i presume
Try using Log(%DURABILITY%) on a tool and then using PICK with that just after
'Cause tomorrow spring is here
If I do I want to make sure it has a different syntax to normal assignments. What about something like:
or the Pascal-style:
Either of those sound okay?
You can only really round using a regex, but it's not a complicated one:
But the XPOS, YPOS and ZPOS are all integers anyway, in fact all numeric values used by the mod are integers. The macro you posted above would actually just try to teleport you to your own position, well it would provided it was inside an ECHO. If you just put that in as a chat command the server would probably choke on the raw string "/tp %PLAYER% %XPOS% %YPOS% %ZPOS%".
It outputs N,S,E,W,T,B or ? if no tile was hit.
It's not currently possible by I may add it.
This would be a sensible idea if this were a programming language, but because the scripts are interpreted you're causing the script parser to read the entire script even if you don't intend to run any of it. The script interpreter still reads every line inside a conditional block which is not executed because it's looking for the corresponding ENDIF and doesn't have a direct pointer to it like a compiled language does.
Programming in reality, despite what they teach you, has to blend pragmatism and mindfulness of performance with idealism, which is why structures like break exist. It's the reason there's a world of difference between:
and
even though they do the same thing.
Breaks and returns aren't always evil either, at least not in the real world, since they can be used to drastically improve readability in certain circumstances. Nesting ifs is fine but in many circumstances it makes sense to test for the failure condition because otherwise exceptions and error condition handling can end up a long way from the test which caused them to be raised. Consider this function:
You don't need 10 tick waits, but anything which interacts with the server may benefit from breathing room, use whatever works for you. No you don't need to wait after GETSLOT or PICK.
Even on the crummiest PC I own I can run 20+ macros with tight loops so you should be fine unless your PC is powered by steam. IF doesn't have any efficiency hits based on the complexity of the expression, multiple IFs are worse than one but a single IF can be as complex as you like and the efficiency is the same.
Not yet.
Added to wish list.
It's an issue with LWJGL, there's not much that can be done about it. Like I say I'll try to figure a way to implement debounce for certain keys, or at least some kind of mutex.