How it works: This script open your inventory when the durability of the tool that you are holding is under the number you put. In this way you are forced to stop working If your item is almost gone. Where to put it: The perfect place to put the script is in "Macro Bindings: Events / onItemDurabilityChange", so when the durability changes the script runs. Screen: Spoiler The script: Code: $${IF(DURABILITY < 30);KEY(inventory);ENDIF}$$ This script will open your inventory if your tool durability is below 30. You can easily change that number for wathever you want BUT BE CAREFULL, if you are working with that tool very fast and the durability limit is too low maybe it will broke before the script turns on. I think the safe zone is 30+ Screen: Spoiler Do you have Extcommands+?: Then Why Stop?! just pust this script and your item will be repaired automatically when its durability is below the number: (Thanks Jakeyray18) Code: $${ If(arepairing) ECHO("") ELSE If(DURABILITY < 50) SET(arepairing) ECHO("/Repair all") Wait(4) UNSET(arepairing) ENDIF ENDIF }$$ Tested and working. I made a video to show you how to put it: Do you have already other script? If you have other script you can use this symbol | to separate them, for example: Script1|Script2 Important: Remember that the script will only works every time there is a change in the durability of the tool that you are currently holding so don't expect the script to work if you put in your hand a low durability tool withought using it. The script only will work if this 2 conditions met: The durability of the item changed AND that durability is below the number you put in the script. So, everytime you use the tool and the its durability is below the number you put the script will open your inventory (or repair the item if you have extcommands+ and used the second script). If you continue using that tool the script will open the inventory again when the durability change so you will have several oportinities to change the item until it breaks.
Code: $${ IF(DURABILITY < 30) LOG(&cYour tool is about to break, I suggest changing it or getting it repaired) ENDIF }$$ Or you could simply make it log something to alert the user.
As Lee said, maybe you arn't cheking the chat or the durability label if you have it and the item may break. That happened to me once and is when I think in this script. Since then i never break a tool. My script is mainly usefull when the durability drops fast, for example farming pumpkins/melons, dirt, sand... or any eff7 tool. in this way you will never have to worry about check the durability of your item.
Well personally I have a progress bar and the durability number on my screen and have only ever broken one enchanted tool, but it was worth like $300. I suppose the inventory screen is a lot more visual.
leingen This script needs to be adjusted, users using tools like pumpkin axes running through pumpkins at high speed trigger multiple Durability change events a second, and even with the slightest amount of lag it can cause the user to spam the command multiple times causing them to get kicked form the server and temporarily denied access, I suggest something more like this. It will prevent the command being spammed, I am also implementing the "/Repair all" command just to be more thorough: Code: $${ IF(Arepairing) STOP() ELSE IF(DURABILITY < 50) SET(Arepairing) ECHO("/Repair all") WAIT(5) UNSET(Arepairing) ENDIF ENDIF }$$ Mind you it is untested but much more thorough and will prevent the commands being spammed. ~Jakey
I don't know too much about this languaje but I think the variable "Arepairing" is useless. That variable is set On and off in the same level when the durability condition met so the first condition "IF(Arepairing)" will never be true. Based on your code I would write this: Code: $${ IF(DURABILITY < 50) ECHO("/Repair all") WAIT(1) ENDIF }$$ Also I need to mention that I'm not english native so it's hard to me to explain myself as I would like but I hope you understand what I'm trying to say here.
I understand the changes that you made but the way you have it laid out will still be triggered with every durability change event, using the Arepairing flag gives me a way to cancel additions events if the macro is at the time still doing an auto repair event. The reason the flag is both set and unset in the same if statement is so that it will set it when it starts to do a repair and cancel any addition repair events that are triggered until after the repair has been done, So stopping the user possibly spamming the "/repair" command.
My script only leaves the opportunity for it to trigger one repair event therefore guaranteed no spam of the "/repair" command.
I just adquired extcommands and tested both scripts, sadly none of them is usefull due both spams the command and this makes the server kick you. The only solution I found is making 2 scripts in 2 different keybinds. For example, using keys "I" and "O": In key "I": $${DO;ECHO(/repair all);Wait(60);LOOP}$$ In key "O": $${STOP(All)}$$ Key I initiates a loop that makes a repair all every 60 second infinitedly (you can chage the seconds simply changing the numer 60 to wathever you want). Then the key "O" stops all current scripts running, including this loop. I hope you can find a better way to solve this problem
I find out the script errors and how to fix them. The first problem was that the flags don't recognise Upercases in conditionals so "Arepairing" must be change to "arepairing". The second problem is that "STOP()" makes the script to stop, If it is triggered while the script was in "Wait()" it would never unset the flag so the durability condition will never met again. Here is the code fixed and working: Code: $${ If(arepairing) WAIT(3) ELSE If(DURABILITY < 50) SET(arepairing) ECHO("/Repair all") Wait(4) UNSET(arepairing) ENDIF ENDIF }$$
Well technically now it just going to keep executing every /repair 3 seconds later if that is the way you wish to go I would simply make the ones triggered while already repairing do absolutely nothing like so: Code: $${ If(arepairing) ELSE If(DURABILITY < 50) SET(arepairing) ECHO("/Repair all") Wait(4) UNSET(arepairing) ENDIF ENDIF }$$ That should solve all the problems.
Works fine for me in all my other scripts, if you have to make the script do something you could simply put: Code: $${ If(arepairing) ECHO("") ELSE If(DURABILITY < 50) SET(arepairing) ECHO("/Repair all") Wait(4) UNSET(arepairing) ENDIF ENDIF }$$
That is what i was looking for. This language seems to need something after a conditions so I added a Wait (I tested it and it worked fine) but i was looking to add something that did nothing but i didn't know a command for that. I'm going to test it, I'll comment the results in a moment.
Insane necro, but who cares it's a relevant post. Well... it's probably because, you know, it's illegal and/or impossible. Ever heard of extcommands++? Buy it.
This is neither illegal or impossible all it does it check the durability of a item and automatically repairs it if you have extcommands.