Baritone AI pathfinder

Baritone AI pathfinder

72.7k Downloads

Add setting to resume player control with keypress

StealthyPony opened this issue ยท 7 comments

commented

Describe your suggestion

The setting, named something like "resumeControl", would cancel the current task as if #stop was used when the attack button or a movement key is pressed

Settings

Toggle (true/false)

Context

Currently Baritone requires the player to type #stop before they can contol the player character again.
This can lead to dangerous situations with mobs such as creepers, skeletons, drowned with tridents etc.
The feature would allow the player to react to these events faster than before which gives them a better chance to survive the encounter.

Final checklist

  • I know how to properly use check boxes
  • I have not used any OwO's or UwU's in this issue.
  • I understand the point of the checklist section.
commented

Duplicate of #2580

commented

Also note that #pause, #resume and #cancel are aliased to #p, #r and #c and if chatControl or chatControlAnyway is enabled you can even ommit the prefix so they become p, r and c which you usually can type fast enough (it's 3 buttons so not quite as fast as a hotkey).

commented

Also note that #pause, #resume and #cancel are aliased to #p, #r and #c and if chatControl or chatControlAnyway is enabled you can even ommit the prefix so they become p, r and c which you usually can type fast enough (it's 3 buttons so not quite as fast as a hotkey).

That is true, but the inspiration for this came from a situation where during mining a creeper snuck up and killed me before I could move away.
Even the shortest of commands take too long to type to avoid a creeper, and a chat macro is not responsive enough for the situation.

commented

there are a couple problems with actually being able to implement this...

  1. there is no common way to register custom keybinds between forge/fabric/vanilla
  2. which commands should be a key shortcut or should it be configurable
  3. doing this feels kinda scope-creep

as a suggestion until/unless this is implemented,
I would suggest using a mod that provides configurable key-based macros for interacting with chat,
several options in that nature can be found by searching "macro" on curseforge or it is included as a feature in several "utility" clients

commented

Even an easier way: get a Command Macros mod and bind #pause and #resume to any keys on your keyboard.

commented

Commenting on closed issue for feedback/other future users.

I was wondering about this same thing. I would prefer if the mod had keybind functionality built in. Last I saw the builds were already specific to forge/fabric/vanilla, but understandably it may not be a simple feature upgrade. (#1)
Question 2 is a good one. I think just starting with a toggleable pause/resume would be a start, and add others upon popular request.
I would respectfully disagree with 3, IMHO keybinds (specifically pause/resume) would be a strong feature, something that any player can use to immediately toggle automation state in the case of emergency. In my personal use just last night, I took to keeping the chat open and scrolling back to the last #pause or #resume command because I was battle-building a blaze farm and needed to take control as fast as possible. One keypress versus T, Shift #p(ause) can make a big difference. IMO just a major QOL improvement.

Regarding using a macro mod, I considered that, but it seemed like a really hacky way of doing it. But it's not a bad suggestion. I found a pretty powerful macro/hotkey mod here, for future users:
JsMacros: https://modrinth.com/mod/jsmacros (Fabric/Forge, compatible up to 1.19.2 at the time of writing)

For anyone else looking for a drop in place solution, the following keybound achieves exactly what I'm looking for.

// pauseResume.js
// For use with Bariton mod. Allows for a single keybind to toggle pause/resume of any action.
// For the first run this is false, so the first keypress results in #resume
const isRunning = GlobalVars.getBoolean("isRunning"); 
GlobalVars.toggleBoolean("isRunning");
if (isRunning) {
    Chat.say("#pause");
} else {
    Chat.say("#resume");
}

@wagyourtail Friendly suggestion: It could be helpful to end users to include some simple scripts like this in a section of the docs, as well as a link to this great macro tool I just found. Nothing wrong with a bit of shameless plugging. ๐Ÿ˜€ This is the solution I was looking for and I dug through closed issues until I found enough to figure it out.

commented

there are examples and such in the creations channel on the jsmacros discord. Even a way to get all the baritone events into jsmacros which would allow you to get the state for paused state easier