-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAccountSwitcher.js
48 lines (37 loc) · 1.24 KB
/
AccountSwitcher.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
const WidgetManager = Java.type('org.openosrs.api.WidgetManager');
const ScriptAPI = Java.type('org.openosrs.api.ScriptAPI');
const File = Java.type('java.io.File');
const FileReader = Java.type('java.io.FileReader');
const FileWriter = Java.type('java.io.FileWriter');
const JsonReader = Java.type('com.google.gson.JsonReader');
const JsonWriter = Java.type('com.google.gson.JsonWriter');
const FILE_NAME = 'accounts.json';
// Initiate plugin
function init() {
const settingsWidget = WidgetManager.createWidget(50, 50);
settingsWidget.setHidden(true);
createSettingsMenu(settingsWidget);
createLoginMenu(settingsWidget);
loadAccounts();
}
function createSettingsMenu(settingsWidget) {
// create UI for adding and removing accounts
}
function createLoginMenu(settingsWidget) {
// create UI for logging in with an existing account
}
function addAccount(account) {
// add a new account to the JSON file
}
function removeAccount(account) {
// remove an account from the JSON file
}
function loadAccounts() {
// load existing accounts from the JSON file
}
function saveAccounts() {
// save the current list of accounts to the JSON file
}
function login(username, password) {
// log in to the game with the provided username and password
}