mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-18 12:15:44 +01:00
few more api break
This commit is contained in:
commit
ef42ee7232
4
dist/main.bundle.js
vendored
4
dist/main.bundle.js
vendored
File diff suppressed because one or more lines are too long
2
dist/main.bundle.js.map
vendored
2
dist/main.bundle.js.map
vendored
File diff suppressed because one or more lines are too long
@ -263,6 +263,11 @@ v2.0.0 - 2022-07-19 Work rework
|
|||||||
* commitCrime now has 'focus' optional parameter
|
* commitCrime now has 'focus' optional parameter
|
||||||
* using getScriptIncome to get total income has been separated to getTotalScriptIncome.
|
* using getScriptIncome to get total income has been separated to getTotalScriptIncome.
|
||||||
* using getScriptExpGain to get total income has been separated to getTotalScriptExpGain.
|
* using getScriptExpGain to get total income has been separated to getTotalScriptExpGain.
|
||||||
|
* scp has it's 2 last argument reversed, the signature is now (files, destination, optional_source)
|
||||||
|
* ns.connect and other singularity function are no longer available at the top level.
|
||||||
|
They were already hidden from documentation but now they're gone.
|
||||||
|
* stock.buy and stock.sell were renamed to stock.buyStock and stock.sellStock because 'buy' and 'sell'
|
||||||
|
are very common tokens.
|
||||||
|
|
||||||
Multipliers
|
Multipliers
|
||||||
|
|
||||||
|
@ -84,12 +84,12 @@ export function LevelUpgrade(corporation: ICorporation, upgrade: CorporationUpgr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function IssueDividends(corporation: ICorporation, percent: number): void {
|
export function IssueDividends(corporation: ICorporation, rate: number): void {
|
||||||
if (isNaN(percent) || percent < 0 || percent > CorporationConstants.DividendMaxPercentage) {
|
if (isNaN(rate) || rate < 0 || rate > CorporationConstants.DividendMaxRate) {
|
||||||
throw new Error(`Invalid value. Must be an integer between 0 and ${CorporationConstants.DividendMaxPercentage}`);
|
throw new Error(`Invalid value. Must be an number between 0 and ${CorporationConstants.DividendMaxRate}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
corporation.dividendPercentage = percent * 100;
|
corporation.dividendRate = rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function SellMaterial(mat: Material, amt: string, price: string): void {
|
export function SellMaterial(mat: Material, amt: string, price: string): void {
|
||||||
|
@ -35,8 +35,8 @@ export class Corporation {
|
|||||||
shareSalesUntilPriceUpdate = CorporationConstants.SHARESPERPRICEUPDATE;
|
shareSalesUntilPriceUpdate = CorporationConstants.SHARESPERPRICEUPDATE;
|
||||||
shareSaleCooldown = 0; // Game cycles until player can sell shares again
|
shareSaleCooldown = 0; // Game cycles until player can sell shares again
|
||||||
issueNewSharesCooldown = 0; // Game cycles until player can issue shares again
|
issueNewSharesCooldown = 0; // Game cycles until player can issue shares again
|
||||||
dividendPercentage = 0;
|
dividendRate = 0;
|
||||||
dividendTaxPercentage = 50;
|
dividendTax = 1 - BitNodeMultipliers.CorporationSoftcap + 0.15;
|
||||||
issuedShares = 0;
|
issuedShares = 0;
|
||||||
sharePrice = 0;
|
sharePrice = 0;
|
||||||
storedCycles = 0;
|
storedCycles = 0;
|
||||||
@ -121,18 +121,19 @@ export class Corporation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Process dividends
|
// Process dividends
|
||||||
if (this.dividendPercentage > 0 && cycleProfit > 0) {
|
this.updateDividendTax();
|
||||||
|
if (this.dividendRate > 0 && cycleProfit > 0) {
|
||||||
// Validate input again, just to be safe
|
// Validate input again, just to be safe
|
||||||
if (
|
if (
|
||||||
isNaN(this.dividendPercentage) ||
|
isNaN(this.dividendRate) ||
|
||||||
this.dividendPercentage < 0 ||
|
this.dividendRate < 0 ||
|
||||||
this.dividendPercentage > CorporationConstants.DividendMaxPercentage * 100
|
this.dividendRate > CorporationConstants.DividendMaxRate
|
||||||
) {
|
) {
|
||||||
console.error(`Invalid Corporation dividend percentage: ${this.dividendPercentage}`);
|
console.error(`Invalid Corporation dividend rate: ${this.dividendRate}`);
|
||||||
} else {
|
} else {
|
||||||
const totalDividends = (this.dividendPercentage / 100) * cycleProfit;
|
const totalDividends = this.dividendRate * cycleProfit;
|
||||||
const retainedEarnings = cycleProfit - totalDividends;
|
const retainedEarnings = cycleProfit - totalDividends;
|
||||||
player.gainMoney(this.getDividends(), "corporation");
|
player.gainMoney(this.getCycleDividends(), "corporation");
|
||||||
this.addFunds(retainedEarnings);
|
this.addFunds(retainedEarnings);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -146,20 +147,23 @@ export class Corporation {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getDividends(): number {
|
updateDividendTax(): void {
|
||||||
const profit = this.revenue - this.expenses;
|
this.dividendTax = 1 - BitNodeMultipliers.CorporationSoftcap + 0.15;
|
||||||
const cycleProfit = profit * CorporationConstants.SecsPerMarketCycle;
|
|
||||||
const totalDividends = (this.dividendPercentage / 100) * cycleProfit;
|
|
||||||
const dividendsPerShare = totalDividends / this.totalShares;
|
|
||||||
const dividends = this.numShares * dividendsPerShare;
|
|
||||||
let upgrades = -0.15;
|
|
||||||
if (this.unlockUpgrades[5] === 1) {
|
if (this.unlockUpgrades[5] === 1) {
|
||||||
upgrades += 0.05;
|
this.dividendTax -= 0.05;
|
||||||
}
|
}
|
||||||
if (this.unlockUpgrades[6] === 1) {
|
if (this.unlockUpgrades[6] === 1) {
|
||||||
upgrades += 0.1;
|
this.dividendTax -= 0.1;
|
||||||
}
|
}
|
||||||
return Math.pow(dividends, BitNodeMultipliers.CorporationSoftcap + upgrades);
|
}
|
||||||
|
|
||||||
|
getCycleDividends(): number {
|
||||||
|
const profit = this.revenue - this.expenses;
|
||||||
|
const cycleProfit = profit * CorporationConstants.SecsPerMarketCycle;
|
||||||
|
const totalDividends = this.dividendRate * cycleProfit;
|
||||||
|
const dividendsPerShare = totalDividends / this.totalShares;
|
||||||
|
const dividends = this.numShares * dividendsPerShare;
|
||||||
|
return Math.pow(dividends, 1 - this.dividendTax);
|
||||||
}
|
}
|
||||||
|
|
||||||
determineValuation(): number {
|
determineValuation(): number {
|
||||||
@ -167,8 +171,8 @@ export class Corporation {
|
|||||||
profit = this.avgProfit;
|
profit = this.avgProfit;
|
||||||
if (this.public) {
|
if (this.public) {
|
||||||
// Account for dividends
|
// Account for dividends
|
||||||
if (this.dividendPercentage > 0) {
|
if (this.dividendRate > 0) {
|
||||||
profit *= (100 - this.dividendPercentage) / 100;
|
profit *= 1 - this.dividendRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
val = this.funds + profit * 85e3;
|
val = this.funds + profit * 85e3;
|
||||||
@ -277,11 +281,7 @@ export class Corporation {
|
|||||||
this.funds = this.funds - price;
|
this.funds = this.funds - price;
|
||||||
|
|
||||||
// Apply effects for one-time upgrades
|
// Apply effects for one-time upgrades
|
||||||
if (upgN === 5) {
|
this.updateDividendTax();
|
||||||
this.dividendTaxPercentage -= 5;
|
|
||||||
} else if (upgN === 6) {
|
|
||||||
this.dividendTaxPercentage -= 10;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Levelable upgrades
|
//Levelable upgrades
|
||||||
|
@ -20,8 +20,8 @@ export interface ICorporation {
|
|||||||
shareSalesUntilPriceUpdate: number;
|
shareSalesUntilPriceUpdate: number;
|
||||||
shareSaleCooldown: number;
|
shareSaleCooldown: number;
|
||||||
issueNewSharesCooldown: number;
|
issueNewSharesCooldown: number;
|
||||||
dividendPercentage: number;
|
dividendRate: number;
|
||||||
dividendTaxPercentage: number;
|
dividendTax: number;
|
||||||
issuedShares: number;
|
issuedShares: number;
|
||||||
sharePrice: number;
|
sharePrice: number;
|
||||||
storedCycles: number;
|
storedCycles: number;
|
||||||
@ -55,6 +55,7 @@ export interface ICorporation {
|
|||||||
getSalesMultiplier(): number;
|
getSalesMultiplier(): number;
|
||||||
getScientificResearchMultiplier(): number;
|
getScientificResearchMultiplier(): number;
|
||||||
getStarterGuide(player: IPlayer): void;
|
getStarterGuide(player: IPlayer): void;
|
||||||
|
updateDividendTax(): void;
|
||||||
|
getCycleDividends(): number;
|
||||||
toJSON(): IReviverValue;
|
toJSON(): IReviverValue;
|
||||||
getDividends(): number;
|
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ export const CorporationConstants: {
|
|||||||
BribeThreshold: number;
|
BribeThreshold: number;
|
||||||
BribeToRepRatio: number;
|
BribeToRepRatio: number;
|
||||||
ProductProductionCostRatio: number;
|
ProductProductionCostRatio: number;
|
||||||
DividendMaxPercentage: number;
|
DividendMaxRate: number;
|
||||||
EmployeeSalaryMultiplier: number;
|
EmployeeSalaryMultiplier: number;
|
||||||
CyclesPerEmployeeRaise: number;
|
CyclesPerEmployeeRaise: number;
|
||||||
EmployeeRaiseAmount: number;
|
EmployeeRaiseAmount: number;
|
||||||
@ -61,7 +61,7 @@ export const CorporationConstants: {
|
|||||||
|
|
||||||
ProductProductionCostRatio: 5, //Ratio of material cost of a product to its production cost
|
ProductProductionCostRatio: 5, //Ratio of material cost of a product to its production cost
|
||||||
|
|
||||||
DividendMaxPercentage: 1,
|
DividendMaxRate: 1,
|
||||||
|
|
||||||
EmployeeSalaryMultiplier: 3, // Employee stats multiplied by this to determine initial salary
|
EmployeeSalaryMultiplier: 3, // Employee stats multiplied by this to determine initial salary
|
||||||
CyclesPerEmployeeRaise: 400, // All employees get a raise every X market cycles
|
CyclesPerEmployeeRaise: 400, // All employees get a raise every X market cycles
|
||||||
|
@ -275,17 +275,18 @@ interface IDividendsStatsProps {
|
|||||||
}
|
}
|
||||||
function DividendsStats({ profit }: IDividendsStatsProps): React.ReactElement {
|
function DividendsStats({ profit }: IDividendsStatsProps): React.ReactElement {
|
||||||
const corp = useCorporation();
|
const corp = useCorporation();
|
||||||
if (corp.dividendPercentage <= 0 || profit <= 0) return <></>;
|
if (corp.dividendRate <= 0 || profit <= 0) return <></>;
|
||||||
const totalDividends = (corp.dividendPercentage / 100) * profit;
|
const totalDividends = corp.dividendRate * profit;
|
||||||
const retainedEarnings = profit - totalDividends;
|
const retainedEarnings = profit - totalDividends;
|
||||||
const dividendsPerShare = totalDividends / corp.totalShares;
|
const dividendsPerShare = totalDividends / corp.totalShares;
|
||||||
|
const playerEarnings = corp.getCycleDividends() / CorporationConstants.SecsPerMarketCycle;
|
||||||
return (
|
return (
|
||||||
<StatsTable
|
<StatsTable
|
||||||
rows={[
|
rows={[
|
||||||
["Retained Profits (after dividends):", <MoneyRate money={retainedEarnings} />],
|
["Retained Profits (after dividends):", <MoneyRate money={retainedEarnings} />],
|
||||||
["Dividend Percentage:", numeralWrapper.format(corp.dividendPercentage / 100, "0%")],
|
["Dividend Percentage:", numeralWrapper.format(corp.dividendRate, "0%")],
|
||||||
["Dividends per share:", <MoneyRate money={dividendsPerShare} />],
|
["Dividends per share:", <MoneyRate money={dividendsPerShare} />],
|
||||||
["Your earnings as a shareholder:", <MoneyRate money={corp.getDividends()} />],
|
["Your earnings as a shareholder:", <MoneyRate money={playerEarnings} />],
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
@ -19,7 +19,7 @@ export function IssueDividendsModal(props: IProps): React.ReactElement {
|
|||||||
const corp = useCorporation();
|
const corp = useCorporation();
|
||||||
const [percent, setPercent] = useState(0);
|
const [percent, setPercent] = useState(0);
|
||||||
|
|
||||||
const canIssue = !isNaN(percent) && percent >= 0 && percent <= CorporationConstants.DividendMaxPercentage * 100;
|
const canIssue = !isNaN(percent) && percent >= 0 && percent <= CorporationConstants.DividendMaxRate * 100;
|
||||||
function issueDividends(): void {
|
function issueDividends(): void {
|
||||||
if (!canIssue) return;
|
if (!canIssue) return;
|
||||||
if (percent === null) return;
|
if (percent === null) return;
|
||||||
|
@ -1,8 +1 @@
|
|||||||
- getScriptExp
|
|
||||||
- getScriptIncome
|
|
||||||
- commitCrime
|
|
||||||
- Change scp to be (files, destination, source)
|
|
||||||
- Remove top level sing
|
|
||||||
- Rename stock.buy and stock.sell
|
|
||||||
- https://github.com/danielyxie/bitburner/pull/3802
|
|
||||||
- https://github.com/danielyxie/bitburner/pull/3812
|
- https://github.com/danielyxie/bitburner/pull/3812
|
@ -135,8 +135,8 @@ const stock = {
|
|||||||
getMaxShares: RamCostConstants.ScriptGetStockRamCost,
|
getMaxShares: RamCostConstants.ScriptGetStockRamCost,
|
||||||
getPurchaseCost: RamCostConstants.ScriptGetStockRamCost,
|
getPurchaseCost: RamCostConstants.ScriptGetStockRamCost,
|
||||||
getSaleGain: RamCostConstants.ScriptGetStockRamCost,
|
getSaleGain: RamCostConstants.ScriptGetStockRamCost,
|
||||||
buy: RamCostConstants.ScriptBuySellStockRamCost,
|
buyStock: RamCostConstants.ScriptBuySellStockRamCost,
|
||||||
sell: RamCostConstants.ScriptBuySellStockRamCost,
|
sellStock: RamCostConstants.ScriptBuySellStockRamCost,
|
||||||
short: RamCostConstants.ScriptBuySellStockRamCost,
|
short: RamCostConstants.ScriptBuySellStockRamCost,
|
||||||
sellShort: RamCostConstants.ScriptBuySellStockRamCost,
|
sellShort: RamCostConstants.ScriptBuySellStockRamCost,
|
||||||
placeOrder: RamCostConstants.ScriptBuySellStockRamCost,
|
placeOrder: RamCostConstants.ScriptBuySellStockRamCost,
|
||||||
|
@ -922,14 +922,15 @@ export function NetscriptCorporation(player: IPlayer, workerScript: WorkerScript
|
|||||||
},
|
},
|
||||||
issueDividends:
|
issueDividends:
|
||||||
(ctx: NetscriptContext) =>
|
(ctx: NetscriptContext) =>
|
||||||
(_percent: unknown): void => {
|
(_rate: unknown): void => {
|
||||||
checkAccess(ctx);
|
checkAccess(ctx);
|
||||||
const percent = ctx.helper.number("percent", _percent);
|
const rate = ctx.helper.number("rate", _rate);
|
||||||
if (percent < 0 || percent > 100)
|
const max = CorporationConstants.DividendMaxRate;
|
||||||
throw new Error("Invalid value for percent field! Must be numeric, greater than 0, and less than 100");
|
if (rate < 0 || rate > max)
|
||||||
|
throw new Error(`Invalid value for rate field! Must be numeric, greater than 0, and less than ${max}`);
|
||||||
const corporation = getCorporation();
|
const corporation = getCorporation();
|
||||||
if (!corporation.public) throw ctx.makeRuntimeErrorMsg(`Your company has not gone public!`);
|
if (!corporation.public) throw ctx.makeRuntimeErrorMsg(`Your company has not gone public!`);
|
||||||
IssueDividends(corporation, percent);
|
IssueDividends(corporation, rate);
|
||||||
},
|
},
|
||||||
|
|
||||||
// If you modify these objects you will affect them for real, it's not
|
// If you modify these objects you will affect them for real, it's not
|
||||||
@ -956,6 +957,9 @@ export function NetscriptCorporation(player: IPlayer, workerScript: WorkerScript
|
|||||||
shareSaleCooldown: corporation.shareSaleCooldown,
|
shareSaleCooldown: corporation.shareSaleCooldown,
|
||||||
issuedShares: corporation.issuedShares,
|
issuedShares: corporation.issuedShares,
|
||||||
sharePrice: corporation.sharePrice,
|
sharePrice: corporation.sharePrice,
|
||||||
|
dividendRate: corporation.dividendRate,
|
||||||
|
dividendTax: corporation.dividendTax,
|
||||||
|
dividendEarnings: corporation.getCycleDividends() / CorporationConstants.SecsPerMarketCycle,
|
||||||
state: corporation.state.getState(),
|
state: corporation.state.getState(),
|
||||||
divisions: corporation.divisions.map((division): NSDivision => getSafeDivision(division)),
|
divisions: corporation.divisions.map((division): NSDivision => getSafeDivision(division)),
|
||||||
};
|
};
|
||||||
|
@ -144,7 +144,7 @@ export function NetscriptStockMarket(player: IPlayer, workerScript: WorkerScript
|
|||||||
|
|
||||||
return res;
|
return res;
|
||||||
},
|
},
|
||||||
buy:
|
buyStock:
|
||||||
(ctx: NetscriptContext) =>
|
(ctx: NetscriptContext) =>
|
||||||
(_symbol: unknown, _shares: unknown): number => {
|
(_symbol: unknown, _shares: unknown): number => {
|
||||||
const symbol = ctx.helper.string("symbol", _symbol);
|
const symbol = ctx.helper.string("symbol", _symbol);
|
||||||
@ -154,7 +154,7 @@ export function NetscriptStockMarket(player: IPlayer, workerScript: WorkerScript
|
|||||||
const res = buyStock(stock, shares, workerScript, {});
|
const res = buyStock(stock, shares, workerScript, {});
|
||||||
return res ? stock.getAskPrice() : 0;
|
return res ? stock.getAskPrice() : 0;
|
||||||
},
|
},
|
||||||
sell:
|
sellStock:
|
||||||
(ctx: NetscriptContext) =>
|
(ctx: NetscriptContext) =>
|
||||||
(_symbol: unknown, _shares: unknown): number => {
|
(_symbol: unknown, _shares: unknown): number => {
|
||||||
const symbol = ctx.helper.string("symbol", _symbol);
|
const symbol = ctx.helper.string("symbol", _symbol);
|
||||||
|
58
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
58
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@ -1304,7 +1304,7 @@ export interface TIX {
|
|||||||
* @param shares - Number of shares to purchased. Must be positive. Will be rounded to nearest integer.
|
* @param shares - Number of shares to purchased. Must be positive. Will be rounded to nearest integer.
|
||||||
* @returns The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased.
|
* @returns The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased.
|
||||||
*/
|
*/
|
||||||
buy(sym: string, shares: number): number;
|
buyStock(sym: string, shares: number): number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sell stocks.
|
* Sell stocks.
|
||||||
@ -1328,7 +1328,7 @@ export interface TIX {
|
|||||||
* @param shares - Number of shares to sell. Must be positive. Will be rounded to nearest integer.
|
* @param shares - Number of shares to sell. Must be positive. Will be rounded to nearest integer.
|
||||||
* @returns The stock price at which each share was sold, otherwise 0 if the shares weren't sold.
|
* @returns The stock price at which each share was sold, otherwise 0 if the shares weren't sold.
|
||||||
*/
|
*/
|
||||||
sell(sym: string, shares: number): number;
|
sellStock(sym: string, shares: number): number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Short stocks.
|
* Short stocks.
|
||||||
@ -5399,67 +5399,35 @@ export interface NS {
|
|||||||
* ```ts
|
* ```ts
|
||||||
* // NS1:
|
* // NS1:
|
||||||
* //Copies foo.lit from the helios server to the home computer:
|
* //Copies foo.lit from the helios server to the home computer:
|
||||||
* scp("foo.lit", "helios", "home");
|
* scp("foo.lit", "home", "helios");
|
||||||
*
|
*
|
||||||
* //Tries to copy three files from rothman-uni to home computer:
|
* //Tries to copy three files from rothman-uni to home computer:
|
||||||
* files = ["foo1.lit", "foo2.script", "foo3.script"];
|
* files = ["foo1.lit", "foo2.script", "foo3.script"];
|
||||||
* scp(files, "rothman-uni", "home");
|
* scp(files, "home", "rothman-uni");
|
||||||
* ```
|
* ```
|
||||||
* @example
|
* @example
|
||||||
* ```ts
|
* ```ts
|
||||||
* // NS2:
|
* // NS2:
|
||||||
* //Copies foo.lit from the helios server to the home computer:
|
* //Copies foo.lit from the helios server to the home computer:
|
||||||
* await ns.scp("foo.lit", "helios", "home");
|
* await ns.scp("foo.lit", "home", "helios" );
|
||||||
*
|
*
|
||||||
* //Tries to copy three files from rothman-uni to home computer:
|
* //Tries to copy three files from rothman-uni to home computer:
|
||||||
* files = ["foo1.lit", "foo2.script", "foo3.script"];
|
* files = ["foo1.lit", "foo2.script", "foo3.script"];
|
||||||
* await ns.scp(files, "rothman-uni", "home");
|
* await ns.scp(files, "home", "rothman-uni");
|
||||||
* ```
|
* ```
|
||||||
* @example
|
* @example
|
||||||
* ```ts
|
* ```ts
|
||||||
* //ns2, copies files from home to a target server
|
* //ns2, copies files from home to a target server
|
||||||
* const server = ns.args[0];
|
* const server = ns.args[0];
|
||||||
* const files = ["hack.js","weaken.js","grow.js"];
|
* const files = ["hack.js","weaken.js","grow.js"];
|
||||||
* await ns.scp(files, "home", server);
|
* await ns.scp(files, server, "home");
|
||||||
* ```
|
* ```
|
||||||
* @param files - Filename or an array of filenames of script/literature files to copy.
|
* @param files - Filename or an array of filenames of script/literature files to copy.
|
||||||
* @param source - Host of the source server, which is the server from which the file will be copied. This argument is optional and if it’s omitted the source will be the current server.
|
* @param source - Host of the source server, which is the server from which the file will be copied. This argument is optional and if it’s omitted the source will be the current server.
|
||||||
* @param destination - Host of the destination server, which is the server to which the file will be copied.
|
* @param destination - Host of the destination server, which is the server to which the file will be copied.
|
||||||
* @returns True if the script/literature file is successfully copied over and false otherwise. If the files argument is an array then this function will return true if at least one of the files in the array is successfully copied.
|
* @returns True if the script/literature file is successfully copied over and false otherwise. If the files argument is an array then this function will return true if at least one of the files in the array is successfully copied.
|
||||||
*/
|
*/
|
||||||
scp(files: string | string[], destination: string): Promise<boolean>;
|
scp(files: string | string[], destination: string, source?: string): Promise<boolean>;
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc NS.(scp:1)}
|
|
||||||
* @example
|
|
||||||
* ```ts
|
|
||||||
* // NS1:
|
|
||||||
* //Copies foo.lit from the helios server to the home computer:
|
|
||||||
* scp("foo.lit", "helios", "home");
|
|
||||||
*
|
|
||||||
* //Tries to copy three files from rothman-uni to home computer:
|
|
||||||
* files = ["foo1.lit", "foo2.script", "foo3.script"];
|
|
||||||
* scp(files, "rothman-uni", "home");
|
|
||||||
* ```
|
|
||||||
* @example
|
|
||||||
* ```ts
|
|
||||||
* // NS2:
|
|
||||||
* //Copies foo.lit from the helios server to the home computer:
|
|
||||||
* await ns.scp("foo.lit", "helios", "home");
|
|
||||||
*
|
|
||||||
* //Tries to copy three files from rothman-uni to home computer:
|
|
||||||
* files = ["foo1.lit", "foo2.script", "foo3.script"];
|
|
||||||
* await ns.scp(files, "rothman-uni", "home");
|
|
||||||
* ```
|
|
||||||
* @example
|
|
||||||
* ```ts
|
|
||||||
* //ns2, copies files from home to a target server
|
|
||||||
* const server = ns.args[0];
|
|
||||||
* const files = ["hack.js","weaken.js","grow.js"];
|
|
||||||
* await ns.scp(files, "home", server);
|
|
||||||
* ```
|
|
||||||
*/
|
|
||||||
scp(files: string | string[], source: string, destination: string): Promise<boolean>;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List files on a server.
|
* List files on a server.
|
||||||
@ -7051,9 +7019,9 @@ export interface Corporation extends WarehouseAPI, OfficeAPI {
|
|||||||
levelUpgrade(upgradeName: string): void;
|
levelUpgrade(upgradeName: string): void;
|
||||||
/**
|
/**
|
||||||
* Issue dividends
|
* Issue dividends
|
||||||
* @param percent - Percent of profit to issue as dividends.
|
* @param rate - Fraction of profit to issue as dividends.
|
||||||
*/
|
*/
|
||||||
issueDividends(percent: number): void;
|
issueDividends(rate: number): void;
|
||||||
/**
|
/**
|
||||||
* Buyback Shares
|
* Buyback Shares
|
||||||
* @param amount - Amount of shares to buy back.
|
* @param amount - Amount of shares to buy back.
|
||||||
@ -7103,6 +7071,12 @@ interface CorporationInfo {
|
|||||||
issuedShares: number;
|
issuedShares: number;
|
||||||
/** Price of the shares */
|
/** Price of the shares */
|
||||||
sharePrice: number;
|
sharePrice: number;
|
||||||
|
/** Fraction of profits issued as dividends */
|
||||||
|
dividendRate: number;
|
||||||
|
/** Tax applied on your earnings as a shareholder */
|
||||||
|
dividendTax: number;
|
||||||
|
/** Your earnings as a shareholder per second this cycle */
|
||||||
|
dividendEarnings: number;
|
||||||
/** State of the corporation. Possible states are START, PURCHASE, PRODUCTION, SALE, EXPORT. */
|
/** State of the corporation. Possible states are START, PURCHASE, PRODUCTION, SALE, EXPORT. */
|
||||||
state: string;
|
state: string;
|
||||||
/** Array of all divisions */
|
/** Array of all divisions */
|
||||||
|
Loading…
Reference in New Issue
Block a user