Code Monkey home page Code Monkey logo

Comments (5)

kelltom avatar kelltom commented on May 19, 2024

Good find! I was wondering what was causing that.

I'll give this a more thorough look later in the day, but I am curious of one thing regarding shuffling the stop/start logic to the UI side.

OSBC allows you to test your scripts without the UI (see https://github.com/kelltom/OSRS-Bot-COLOR/wiki/Testing-a-Bot-Without-the-UI), and I have a feeling that moving the stop/start logic will render that.. messed up - for lack of a better term.

At the end of the day it's important to go with the cleanest solution, which of course I won't know until I have proper time to check this out. But if you happen to have time to look at what I mentioned and see what the side effects would be, that's definitely a place to start.

Thanks for contributing!

from os-bot-color.

kelltom avatar kelltom commented on May 19, 2024

I've made a branch here for the fix: https://github.com/kelltom/OSRS-Bot-COLOR/tree/Bot-control-keyboard-shortcut-improvements

I've actually managed to fix it with a simple workaround like this:

image

So after the play function finishes, it'll automatically mark the key as released.

While it's a pretty lame solution, and could have some slightly weird behaviour if you hold the key (it starts/stops the bot quickly, once), I think it's better than taking the start/stop logic away from the Model side of the project. That would unfortunately lead to a bunch of other architecture-breaking workarounds down the road.

I think I'm going to change the keyboard shortcut as well, as there have been some complaints with Ctrl.

Thanks for pointing this out! I honestly wouldn't have figured it out myself, so I appreciate it!

from os-bot-color.

kelltom avatar kelltom commented on May 19, 2024

#101 is the current set of changes

from os-bot-color.

gabrielfoo avatar gabrielfoo commented on May 19, 2024

I tested the workaround (with UI) and it works much better than before for sure. There are some instances where I needed to press twice to start, but overall it was more functional and had no side effects on the OS this time (CTRL key pressed down forever).

To really fix the root cause, maybe Window.initialize() can be done async, and the bot main loop can only start once the async function ends?

from os-bot-color.

kelltom avatar kelltom commented on May 19, 2024

Solved in #101

from os-bot-color.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.