bitburner-src/markdown/bitburner.singularity.workforcompany.md
Olivier Gagnon 2b79871c02 doc
2021-11-03 00:27:21 -04:00

51 lines
1.6 KiB
Markdown

<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Singularity](./bitburner.singularity.md) &gt; [workForCompany](./bitburner.singularity.workforcompany.md)
## Singularity.workForCompany() method
Work for a company.
<b>Signature:</b>
```typescript
workForCompany(companyName?: string): boolean;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| companyName | string | Name of company to work for. Must be an exact match. Optional. If not specified, this argument defaults to the last job that you worked |
<b>Returns:</b>
boolean
True if the player starts working, and false otherwise.
## Remarks
RAM cost: 3 GB
Singularity - Level 2
This function will automatically set you to start working at the company at which you are employed. If you are already in the middle of some “working” action (such as working for a faction, training at a gym, or creating a program), then running this function will automatically cancel that action and give you your earnings.
This function will return true if the player starts working, and false otherwise.
Note that when you are working for a company, you will not actually receive your earnings (reputation, money, experience) until you FINISH the action.
## Example
```ts
//If you only want to work until you get 100,000 company reputation. One small hack to get around this is to continuously restart the action to receive your earnings:
while (getCompanyRep(COMPANY HERE) < VALUE) {
workForCompany();
sleep(60000);
}
//This way, your company reputation will be updated every minute.
```