haxball / haxball-issues

115 stars 43 forks source link

Ban someone in the room from discord #1471

Open Ponnd opened 3 years ago

Ponnd commented 3 years ago

For example, I wrote a command from discord for ban someone in the room, this can be the command such as banIt(player.id,roomNumber) Is this possible? How can i do that?

ghost commented 3 years ago
class Room {
      constructor(path, token, isHeadless) {
            this.isHeadless = isHeadless;
            this.token = token;
            this.path = path;
      }
      async start() {
            const browser = await puppeteer.launch({
                  headless: this.isHeadless,
            });
            const page = await browser.newPage();
            await page.goto('https://haxball.com/headless', {
                  waitUntil: 'networkidle2',
            });
            await page.addScriptTag({ path: this.path });
            return page;
      }
}

You can go on of this code to develop your script

Ponnd commented 3 years ago
class Room {
      constructor(path, token, isHeadless) {
            this.isHeadless = isHeadless;
            this.token = token;
            this.path = path;
      }
      async start() {
            const browser = await puppeteer.launch({
                  headless: this.isHeadless,
            });
            const page = await browser.newPage();
            await page.goto('https://haxball.com/headless', {
                  waitUntil: 'networkidle2',
            });
            await page.addScriptTag({ path: this.path });
            return page;
      }
}

You can go on of this code to develop your script

Thank you

hakosfer commented 2 years ago

is that still possible ? Can you tell more descriptive if possible? @ikramimamoglu