Hacker Scripts (Extensions)

**Hacker Scripts** are a core element of Extensions.

## Description

Hacker Scripts are unique actions that can be performed by other nodes, simulating rival or ally hackers.

Most Hacker Scripts can be triggered via action or faction systems.

## Launching Hacker Scripts

Hacker Scripts are launched via the `LaunchHackScript` action:

```
<LaunchHackScript Filepath="HackerScripts/ExampleHack.txt" SourceComp="ExampleNode" TargetComp="playerComp" RequireLogsOnSource="false" RequireSourceIntact="true" />
```

The example above makes the computer with the ID `ExampleNode` attack the player computer only if the source computer has all `~/sys` files intact.

### `TrackSequence.txt`

This is a unique Hacker Script that requires the node to have the `<tracker />` tag. The default file is located in the `Contents\HackerScripts` folder of the game. It can be copied to the `HackerScripts` folder of the extension and modified to change the passive trace attack.

## Hacker Script structure

A Hacker Script begins with the defined config:

```
config [TARGET_COMP] [SOURCE_COMP] 1.5 $#%#$
```

* `[TARGET_COMP]` is the node that gets attacked by the `[SOURCE_COMP]`, as defined in the `LaunchHackScript` action.
* The third attribute is the delay (in seconds) between each script action.

`COMP` attributes can be changed to existing node IDs or IP addresses. In this case, `TargetComp` and `SourceComp` attributes of the `LaunchHackScript` action can be removed.

```
config playerComp ExampleNode 1.0 $#%#$
```

```
config playerComp 192.168.0.1 0.5 $#%#$
```

## Hacker Script actions

Actions are added below the `config` line.

### System

```
connect $#%#$
```

Connects the source computer to the target computer. If the target computer is `playerComp` a large warning appears in the middle of the screen.

```
openPort [PORT_NUMBER] $#%#$
```

Opens a specific port on the target computer.

```
setAdminPass [PASSWORD] $#%#$
```

Sets a new admin password to the target computer.

```
delete /[PATH] [FILE_NAME] $#%#$
```

Deletes a specific file, e.g. `delete /sys x-server.sys`. Also allows to delete all files from the computer, e.g. `delete /log *`

```
makeFile [FOLDER] [FILE_NAME] [FILE_CONTENTS] $#%#$
```

Creates a specific file in a specific folder (subfolders cannot be used) with a specific content. Useful for creating executables, e.g. `makeFile bin SSHCrack.exe #SSH_CRACK# $#%#$`

```
reboot $#%#$
```

Reboots the target computer.

```
forkbomb $#%#$
```

Launches forkbomb on the target computer. The target that is not the player's computer will crash instantly.

```
trackseq $#%#$
```

Flags the player to make them do the ETAS if the player fails the next forkbomb.

```
instanttrace $#%#$
```

Starts ETAS instantly for the player, if they are the target.

```
disconnect $#%#$
```

Disconnects the source computer from the target computer.

### Terminal

```
write [TEXT] $#%#$
```

Prints text in the terminal without newlines. Makes a sound whenever the text appears.

```
writel [TEXT] $#%#$
```

Prints text in the terminal on a newline. Makes a sound whenever the text appears.

```
write_silent [TEXT] $#%#$
```

Prints text in the terminal without newlines. Does not make a sound whenever the text appears.

```
writel_silent [TEXT] $#%#$
```

Prints text in the terminal on a newline. Does not make a sound whenever the text appears.

```
clearTerminal $#%#$
```

Clears the terminal.

### UI and SFX

These actions work only if the player is the target.

```
hideNetMap $#%#$
hideRam $#%#$
hideDisplay $#%#$
hideTerminal $#%#$

```

Hides specific modules from the player's screen.

```
showNetMap $#%#$
showRam $#%#$
showDisplay $#%#$
showTerminal $#%#$

```

Shows specific modules on the player's screen.

```
flash $#%#$
```

Flashes the UI.

```
stopMusic $#%#$
```

Stops the music.

```
startMusic $#%#$
```

Starts the music.

### Misc

```
delay [NUM_OF_SECONDS] $#%#$
```

Creates a delay between specific actions.

```
openCDTray $#%#$
```

Opens a CD tray of the player's real computer/laptop, if it exists.

```
closeCDTray $#%#$
```

Closes a CD tray of the player's real computer/laptop, if it exists.

```
systakeover $#%#$
```

Used in *Labyrinths* during Striker's attack. In Extensions, creates a visual distortion effect and crashes the computer permanently.

## Example Hacker Script

```
config playerComp ExampleNode 1.5 $#%#$
connect $#%#$
openPort 22 $#%#$
openPort 21 $#%#$
openPort 25 $#%#$
openPort 80 $#%#$
trackseq $#%#$
forkbomb $#%#$
disconnect $#%#$

```