Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export function settings() {
- return {
- minSecurityLevelOffset: 2,
- maxMoneyMultiplayer: 0.9,
- minSecurityWeight: 100,
- mapRefreshInterval: 24 * 60 * 60 * 1000,
- keys: {
- serverMap: 'BB_SERVER_MAP',
- hackTarget: 'BB_HACK_TARGET',
- action: 'BB_ACTION',
- },
- changes: {
- hack: 0.002,
- grow: 0.004,
- weaken: 0.05,
- },
- }
- }
- /** @param {NS} ns **/
- export function createUUID() {
- var dt = new Date().getTime()
- var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
- var r = (dt + Math.random() * 16) % 16 | 0
- dt = Math.floor(dt / 16)
- return (c == 'x' ? r : (r & 0x3) | 0x8).toString(16)
- })
- return uuid
- }
- /** @param {NS} ns **/
- export function getItem(key) {
- let item = localStorage.getItem(key)
- return item ? JSON.parse(item) : undefined
- }
- /** @param {NS} ns **/
- export function setItem(key, value) {
- localStorage.setItem(key, JSON.stringify(value))
- }
- /** @param {NS} ns **/
- export function convertMSToHHMMSS(ms = 0) {
- if (ms <= 0) {
- return '00:00:00'
- }
- if (!ms) {
- ms = new Date().getTime()
- }
- return new Date(ms).toISOString().substr(11, 8)
- }
- /** @param {NS} ns **/
- export function localeHHMMSS(ms = 0) {
- if (!ms) {
- ms = new Date().getTime()
- }
- return new Date(ms).toLocaleTimeString()
- }
- /** @param {NS} ns **/
- export const hackPrograms = ['BruteSSH.exe', 'FTPCrack.exe', 'relaySMTP.exe', 'HTTPWorm.exe', 'SQLInject.exe']
- /** @param {NS} ns **/
- export const hackScripts = ['hack.js', 'grow.js', 'weaken.js', '/newserver/grow.js', '/newserver/weaken.js', '/newserver/hack.js', '/newserver/OP.js', '/newserver/xs.js']
- /** @param {NS} ns **/
- export async function main(ns) {
- return {
- settings,
- getItem,
- setItem,
- createUUID,
- localeHHMMSS,
- convertMSToHHMMSS,
- hackPrograms,
- hackScripts,
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement