bitburner-src/markdown/bitburner.singularity.workforcompany.md

51 lines
1.6 KiB
Markdown
Raw Normal View History

2021-10-30 18:34:14 +02:00
<!-- 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
2021-11-03 05:27:21 +01:00
Work for a company.
2021-10-30 18:34:14 +02:00
<b>Signature:</b>
```typescript
2021-11-03 05:27:21 +01:00
workForCompany(companyName?: string): boolean;
2021-10-30 18:34:14 +02:00
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
2021-11-03 05:27:21 +01:00
| 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 |
2021-10-30 18:34:14 +02:00
<b>Returns:</b>
boolean
True if the player starts working, and false otherwise.
## Remarks
2021-11-03 05:27:21 +01:00
RAM cost: 3 GB
2021-10-30 21:46:34 +02:00
Singularity - Level 2
2021-10-30 18:34:14 +02:00
2021-11-03 05:27:21 +01:00
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.
2021-10-30 18:34:14 +02:00
## Example
2021-10-30 21:46:34 +02:00
```ts
2021-10-30 18:34:14 +02:00
//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.
```