oh fuck i forgot
This commit is contained in:
19
extension/modules/core.js
Normal file
19
extension/modules/core.js
Normal file
@@ -0,0 +1,19 @@
|
||||
window.MagicBot = {
|
||||
socket: null,
|
||||
events: new EventTarget(),
|
||||
state: {
|
||||
coins: 0,
|
||||
garden: {},
|
||||
inventory: {},
|
||||
playerId: null
|
||||
},
|
||||
// Helper to dispatch events
|
||||
emit: (name, detail) => {
|
||||
window.MagicBot.events.dispatchEvent(new CustomEvent(name, { detail }));
|
||||
},
|
||||
// Helper to listen
|
||||
on: (name, callback) => {
|
||||
window.MagicBot.events.addEventListener(name, (e) => callback(e.detail));
|
||||
}
|
||||
};
|
||||
console.log('[MagicBot] Core loaded.');
|
||||
Reference in New Issue
Block a user