Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //### REQUIREMENTS »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
- const SteamID = require('steamid');
- const SteamUser = require("steam-user");
- //### GLOBAL VARIABLES »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
- const client = new SteamUser({});
- const cfg = {
- botNickName: 'Lethiems Bot',
- botUsername: 'flameup5',
- botPassword: 'BlankitiBlank1',
- }
- const commands = {
- help: 'I can not help you.',
- owner: 'My owners name is jimbo',
- saysomething: 'Whatever mate!'
- }
- //### STARTUP »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
- logOn();
- //### LISTENERS »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
- client.on('loggedOn', (details) => {
- console.log("[LOGON]: LOGGED IN");
- client.setPersona(1,cfg.botNickName);
- client.gamesPlayed([730]);
- client.setUIMode(1);
- });
- client.on('disconnected', (emsg, msg) => {
- console.log("[DISCONNECT]: " + emsg + " : "+msg);
- process.exit();
- });
- client.on('error', (err) => {
- console.log("[ERROR]: " + err);
- });
- client.on('friendMessage', function(steamID, message) {
- rxMsg(steamID.toString(), message);
- client.chatMessage(steamID, commands[message.trim()]);
- });
- client.on('friendRelationship', function(steamID, relationship) {
- switch (relationship) {
- case 0: console.log("[FRIEND]: DELETED " + steamID); return true; break;
- case 2: client.addFriend(steamID); return true; break;
- case 3: console.log("[FRIEND]: ADDED " + steamID);
- client.chatMessage(steamID, "Welcome!"); return true; break;
- case 4: console.log("[FRIEND]: INVITED " + steamID); return true; break;
- case 5: console.log("[FRIEND]: BLOCKED " + steamID); return true; break;
- default: console.log("[FRIEND]: CHANGED " + relationship); return true;
- }
- });
- //### FUNCTIONS »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
- function logOn(){
- console.log("[LOGON]: TRYING")
- client.logOn({
- "accountName": cfg.botUsername,
- "password": cfg.botPassword
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement