Giter Club home page Giter Club logo

Comments (2)

RwbyChan avatar RwbyChan commented on August 24, 2024

It seems to disconnect here too, but seems like there is no error:
Create Controller

10.0.2.2 - - [17/Dec/2021 20:50:56] "GET /socket.io/?EIO=4&transport=polling&t=NtAANWw HTTP/1.1" 200 278 0.004319
10.0.2.2 - - [17/Dec/2021 20:50:56] "GET /socket.io/?EIO=4&transport=polling&t=NtAAHvX HTTP/1.1" 200 278 0.00423410.0.2.2 - - [17/Dec/2021 20:50:56] "POST /socket.io/?EIO=4&transport=polling&t=NtAAOGB&sid=wfBH8qzXEb814a3bAAAX HTTP/1.1" 200 219 0.003689
(1400) accepted ('10.0.2.2', 54947)
10.0.2.2 - - [17/Dec/2021 20:50:56] "GET /socket.io/?EIO=4&transport=polling&t=NtAAOGD&sid=wfBH8qzXEb814a3bAAAX HTTP/1.1" 200 213 0.000311
10.0.2.2 - - [17/Dec/2021 20:50:56] "GET /socket.io/?EIO=4&transport=polling&t=NtAAOGU&sid=wfBH8qzXEb814a3bAAAX HTTP/1.1" 200 181 0.000180
10.0.2.2 - - [17/Dec/2021 20:50:56] "POST /socket.io/?EIO=4&transport=polling&t=NtAAOGT&sid=wfBH8qzXEb814a3bAAAX HTTP/1.1" 200 219 0.014735
Disconnected
10.0.2.2 - - [17/Dec/2021 20:50:56] "GET /socket.io/?EIO=4&transport=websocket&sid=YzMa6J338Twl50JmAAAV HTTP/1.1" 200 0 252.563556

from nxbt.

G-Rex2595 avatar G-Rex2595 commented on August 24, 2024

Until this gets actually fixed, you could try something like this.

let statusIndicator = document.getElementById('status-indicator-text');
function watchForDisconnect() {
  let intervalId = window.setInterval(() => {
    if(statusIndicator.innerText !== 'CONNECTED') {
      restartController();
      watchForReconnect();
      window.clearInterval(intervalId);
    }, 100);
}
function watchForReconnect() {
  let intervalId = window.setInterval(() => {
    if(statusIndicator.innerText === 'CONNECTED') {
      watchForDisconnect();
      window.clearInterval(intervalId);
    }
  }, 100);
}

Or you can try what I'm currently doing.

let statusIndicator = document.getElementById('status-indicator-text');
function restartAndRunMacro() {
	restartController();
	let intervalId = window.setInterval(() => {
		if(statusIndicator.innerText === 'CONNECTED') {
			window.clearInterval(intervalId);
			sendMacro();
		}
	}, 100)
}

Less Techy People:

If you don't know how to run those, just F12 and go to the console tab and paste the code. Also, don't run code random people on the internet give you unless you know what the code does. I'm not going to explain this code to you. If you don't understand it, you shouldn't run it, even if I tell you exactly what it does.

from nxbt.

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.