wxyz-abcd / node-haxball

The most powerful and lightweight API that allows you to develop your original Haxball(www.haxball.com) host, client, and standalone applications both on node.js and browser environments and also includes every possible hack and functionality that you can imagine.
MIT License
34 stars 13 forks source link
browser haxball haxball-bot-api javascript nodejs reverse-engineering

GitHub package.json version NPM Version NPM Monthly Downloads Proxy Server Status

License Last Commit Language Most Used Repository Size

Forks Stars Watches

node-haxball

The most powerful and lightweight API that allows you to develop your original Haxball(www.haxball.com) host, client, and standalone applications both on node.js and browser environments and includes every possible functionality that you can imagine.

🔖 Table Of Contents


🤔 How To Use

💻 Installing & importing as a node.js/CommonJS module:

npm install node-haxball
const { OperationType, VariableType, ConnectionState, AllowFlags, Direction, CollisionFlags, CameraFollow, BackgroundType, GamePlayState, BanEntryType, Callback, Utils, Room, Replay, Query, Library, RoomConfig, Plugin, Renderer, Errors, Language, EventFactory, Impl } = require("node-haxball")();
// Use example code here.

💻 Usage on Browser

💻 Example code using the library:

Joining a room:


Utils.generateAuth().then(([authKey, authObj])=>{
  Room.join({
    id: "Olnit_iGRWs",
    authObj: authObj
  }, {
    storage: {
      player_name: "wxyz-abcd",
      avatar: "👽"
    }, 
    onSuccess: (room)=>{
      room.sendChat("Hello " + room.name);
    }
  });
});

Creating a room:


Room.create({
  name: "room123", 
  password: "password", 
  showInRoomList: true, 
  maxPlayerCount: 8,
  token: "thr1.AAAAAGNMOokNqt3forXs_Q.3qQMuLQOS9o"
}, {
  storage: {
    player_name: "wxyz-abcd",
    avatar: "👽"
  }, 
  onSuccess: (room)=>{
    room.sendChat("Hello " + room.name);
    room.onAfterRoomLink = (roomLink)=>{
      console.log("room link:", roomLink);
    };
  }
});

📰 Mini-Documentation

Back To The Top


💡 How To Contribute

Contributions, issues and features requests are welcome!
📮 Submit PRs to help solve issues or add features
🐛 Find and report issues
🌟 Star the project

Back To The Top


🤗 Contributors

- Initial testing environment by mertushka
- %99 of the bot API features by abc
- Lots of testing and various plugins by 0x00
- Lots of testing and various plugins by JerryOldson
- Lots of testing and Portuguese language translation by Juze
- Room.modifyFrameNo by Punisher
- Some links fixed by ChasmSolacer
- Autoplay bot examples improved by K0nfy
- Docs formatted by uzaylı
We will continue to add all contributors to this list.

Back To The Top


🔏 License

MIT License, Copyright © 2022-2023 abc

Absolutely no rights reserved. Do whatever you want with the codes.

We do not take any responsibility on potential harm caused by this code. Use at your own risk, and be creative. :)

Back To The Top