Hey, is it be possible to make it so that rather than mapping a key to a position of the inventory, it maps the key to a tool/item? That way when switching to mining mode, chosen keys would always be weapon/pick/bomb regardless of how inventory is sorted.
Good point! I'm actually implementing it. Use item name instead of position. The only problem now is which one to use if there are more than one item with the same name. In next release, it may choose the first one found in sequence by default.
For items with same name I'd suggest using lowest quality as default setting as you would likely want to save highest quality for gifting or selling. For tools, probably the most upgraded one found For bombs, probably a different key for each as i wouldn't want to use a mega bomb to blow only 5~6 rocks.
Just finished "use item by name" function. Currently it will search from beginning and use the first item that matches the name. I'm still working on condition and order parameter so that we can specify like "use the one that restore at least 20 health with lowest quality". That also might be useful when two different groups of foods are in bag, expensive ones for emergency recovery which restore lot of health and cheap ones for regular restore.
Finally got around testing a bit but the find item method doesn't seem to be working. Here's the log: https://log.smapi.io/aFUdPWVn Error happens with right mouse button trying to use pickaxe. This is the config: { "modifyKey": "None", "key": "MouseRight", "cmd": "UseItem", "par": { "ItemName": "PickAxe", "IsContinuous": "true" } },
Using the sword on left button worked althought it did raise the question about how to set the special action of weapon to some other key.
Thank you for testing, I'll try to fix the bug and see if special action is possible.
Update: Fixed the bug and still looking at special actions. Update: Now you can use special action of weapon by setting SpecialAction parameter to true under UseItem command.
7 comments
Error happens with right mouse button trying to use pickaxe.
This is the config:
{
"modifyKey": "None",
"key": "MouseRight",
"cmd": "UseItem",
"par": {
"ItemName": "PickAxe",
"IsContinuous": "true"
}
},
Using the sword on left button worked althought it did raise the question about how to set the special action of weapon to some other key.
Update: Fixed the bug and still looking at special actions.
Update: Now you can use special action of weapon by setting SpecialAction parameter to true under UseItem command.