<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CodingContract](./bitburner.codingcontract.md) &gt; [getNumTriesRemaining](./bitburner.codingcontract.getnumtriesremaining.md)

## CodingContract.getNumTriesRemaining() method

Get the number of attempts remaining.

**Signature:**

```typescript
getNumTriesRemaining(filename: string, host?: string): number;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

filename


</td><td>

string


</td><td>

Filename of the contract.


</td></tr>
<tr><td>

host


</td><td>

string


</td><td>

_(Optional)_ Hostname/IP of the server containing the contract. Optional. Defaults to current server if not provided.


</td></tr>
</tbody></table>

**Returns:**

number

How many attempts are remaining for the contract.

## Remarks

RAM cost: 2 GB

Get the number of tries remaining on the contract before it self-destructs.

