-
Notifications
You must be signed in to change notification settings - Fork 5
Feat ref/HackerScripts #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9416e96
2ec541d
6ec837a
d64d6a6
c841f1e
4b54353
cb591e1
46b3623
54c2ff2
3c10014
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| # HackerScripts (黑客脚本) | ||
| HackerScript 用于描述黑客行为, 比如入侵, 文件操作等等. 它可以通过行为标签`<LaunchHackScript>`执行. | ||
|
|
||
| HackerScript 的执行具有实时性. HackerScript内的任何间隔与行为标签的`delay`原理不同. 因此退出重进Hacknet将会使正在执行中的HackerScript停止. HackerScript被执行后的效果与玩家有部分相似之处, 比如会留下日志. | ||
|
|
||
| 以下为HackerScript的大致结构: | ||
| ~~~ | ||
| # 指定目标 | ||
| config playerComp advExamplePC 0.2 $#%#$ | ||
|
|
||
| # 行为 | ||
| connect $#%#$ | ||
| disconnect $#%#$ | ||
|
|
||
| # 这里的"注释"是不规范写法, 因为没有对应命令不会被执行. 官方没有为HackerScript提供注释 | ||
| ~~~ | ||
|
|
||
| HackerScript的内容可以大致分为: | ||
| - 指定目标 | ||
| - 行为 | ||
|
|
||
| # 指定目标 | ||
| config用于指定了目标,源电脑,每一行执行之间的间隔,格式如下如下: | ||
| ~~~ | ||
| config [目标电脑ID] [源电脑ID] [每一行执行的延迟] $#%#$ | ||
| ~~~ | ||
| 如果你想要通过标签来选择目标于源电脑的话, 可以原封不动这么写ID, 然后在标签中声明相应属性: | ||
| ~~~ | ||
| config [TARGET_COMP] [SOURCE_COMP] 0 $#%#$ | ||
| ~~~ | ||
|
|
||
| 一个HackerScript可以指定多个目标, 但是不是同时攻击. | ||
| ~~~ | ||
| config TARGET_COMP1 SOURCE_COMP1 0 $#%#$ | ||
| ... | ||
| config TARGET_COMP2 SOURCE_COMP1 0 $#%#$ | ||
| ... | ||
| ~~~ | ||
| # 行为 | ||
| 可以使用行为语句来描述行为, 行为语句相应的行为将会被执行. | ||
|
|
||
| 行为语句大致如下: | ||
| ~~~ | ||
| [行为类型] [...参数] $#%#$ | ||
| ~~~ | ||
| 行为类型与`$#%#$`为必须内容, 部分行为不需要参数. | ||
|
|
||
| 行为类型如下: | ||
|
|
||
| | 行为类型 | 功能 | 参数个数 | 参数用途 | | ||
| | --- | --- | --- | --- | | ||
| | `connect` | 源电脑向目标电脑建立连接 | 无 | | | ||
| | `delay` | 用来延迟一段时间 | 一个 | 延迟时间,单位为秒 | | ||
| | `openPort` | 打开目标电脑的端口 | 一个 | 要开启的端口 | | ||
| | `clearTerminal` | 清屏目标电脑终端 | 无 | | | ||
| | `hideNetMap` | 隐藏目标电脑的netmap网络地图 | 无 | | | ||
| | `hideRam` | 隐藏目标电脑的RAM区域 | 无 | | | ||
| | `hideDisplay` | 隐藏目标电脑的显示Display区域 | 无 | | | ||
| | `hideTerminal` | 隐藏目标电脑的终端 | 无 | | | ||
| | `showNetMap` | 显示目标电脑的netmap网络地图 | 无 | | | ||
| | `showRam` | 显示目标电脑的RAM区域 | 无 | | | ||
| | `showDisplay` | 显示目标电脑的显示Display区域 | 无 | | | ||
| | `showTerminal` | 显示目标电脑的终端 | 无 | | | ||
|
Comment on lines
+55
to
+63
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- target excerpt ---'
sed -n '1,90p' docs/reference/HackerScripts.md
printf '%s\n' '--- related identifiers ---'
rg -n -C 3 'clearTerminal|hideNetMap|hideRam|hideDisplay|hideTerminal|showNetMap|showRam|showDisplay|showTerminal|instanttrace|flash|openCDTray|closeCDTray|write_silent|stopMusic|startMusic' docs README.md 2>/dev/null || trueRepository: UnHacknet/hacknet-wiki Length of output: 4141 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- repository files that may define or document HackerScript behavior ---'
git ls-files | rg -i 'hack|script|extension|command|reference' | head -200
printf '%s\n' '--- exact documentation references ---'
rg -n -i -C 3 'openCDTray|closeCDTray|instanttrace|flash|write_silent|stopMusic|startMusic|clearTerminal|hideNetMap|showNetMap' . --glob '!node_modules' --glob '!dist' --glob '!build' 2>/dev/null | head -300Repository: UnHacknet/hacknet-wiki Length of output: 3253 🌐 Web query:
💡 Result: In Hacknet, many of the terms you listed belong to the Hacker Scripts system used in game extensions or as specific terminal commands [1][2][3][4]. Hacker Scripts (Extensions) Hacker scripts are specialized sequences or tools used primarily when creating or running custom Extensions [1][5]. They are typically executed via the Citations:
🌐 Web query:
💡 Result: The terms clearTerminal, openCDTray, and instanttrace are associated with scripts or extensions used in the game Hacknet [1]. clearTerminal is a command that clears the text from the terminal window [1]. openCDTray is a command intended to open the CD tray of the computer or laptop running the game, provided the hardware supports it [1]. instanttrace is listed among the hacker scripts or extensions in the game context, though its specific functional mechanics are not detailed in the available documentation [1]. Citations: 🌐 Web query:
💡 Result: The commands hideNetMap, hideRam, hideDisplay, hideTerminal, showNetMap, and flash are specific functions used within Hacknet, a hacking simulation game [1]. These commands are part of the game's scripting system, particularly within its extensions, and are used to control the visibility of UI modules on the player's screen [1]. The hide commands (hideNetMap, hideRam, hideDisplay, hideTerminal) are used to remove specific modules from the player's view, while the corresponding show commands (showNetMap, showRam, showDisplay, showTerminal) are used to make them reappear [1]. The flash command is also associated with these UI control scripting actions [1]. These commands generally only function when the player is the target of the script [1]. Citations: 修正 HackerScript 行为的实际作用域。
🤖 Prompt for AI Agents |
||
| | `trackseq` | 改变玩家被forkbomb成功的结果 | 无 | 如果有CSEC flag并且没有防御成功forkbomb,则进入紧急恢复模式(不会蓝屏) | | ||
| | `instanttrace` | 立即使目标电脑进入紧急恢复模式 | 无 | | | ||
| | `forkbomb` | 为目标电脑执行forkbomb | 无 | | | ||
| | `flash` | 让目标电脑的UI闪烁一下 | 无 | | | ||
| | `delete` | 删除目标电脑上的文件 | 两个 | 目标文件所在路径和目标文件名 | | ||
| | `setAdminPass` | 设置目标电脑上的管理员密码 | 一个 | 要设定的新管理员密码 | | ||
| | `makeFile` | 在目标电脑上新建一个文件 | 三个 | 1.要创建的文件所在目录,2.要创建的文件名,3.文件内容 | | ||
| | `openCDTray` | 打开目标电脑的光驱 | 无 | | | ||
| | `closeCDTray` | 关闭目标电脑上的光驱 | 无 | | | ||
| | `disconnect` | 断开目标电脑 | 无 | | | ||
| | `write` | 在目标电脑终端中输出字符,但不换行 | 一个 | 要输出的字符串 | | ||
| | `writel` | 在目标电脑终端中输出字符并换行 | 一个 | 要输出的字符串 | | ||
| | `writel_silent` | 在目标电脑终端中输出字符并换行,但不会使目标UI变红闪烁一下 | 一个 | 要输出的字符串 | | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: UnHacknet/hacknet-wiki
Length of output: 7047
🌐 Web query:
Hacknet HackerScript write_silent stopMusic startMusic official example💡 Result:
In Hacknet HackerScripts, the commands stopMusic and startMusic are used to control the audio playback on the player's computer when they are the target [1][2]. The command write_silent is used to print text to the terminal without triggering the standard typing sound or sound effects [3][1]. Each line in a HackerScript must end with the sequence$#%#$ followed by a Windows-style line ending (\r\n) [2]. Example usage: stopMusic $#%#$ writel_silent Music has been disabled. $#%#$ write_silent This text makes no sound. $#%#$ startMusic $#%#$ writel Music has been re-enabled. $#%#$ Note: The stopMusic and startMusic commands primarily affect the player's music if they are the target of the script [1][2]. Use write_silent or writel_silent when you want to output text to the terminal without the auditory beeps associated with the standard write or writel commands [3][1].
Citations:
🌐 Web query:
site:github.com/UnHacknet/OpenHacknet HackerScript write_silent writel_silent stopMusic startMusic💡 Result:
Relevant results:
cbluoss/OpenHacknet, includingHackerScriptExecuter.cs. [1] (github.com)write_silent <text>— writes without beeps/flashes.writel_silent <text>— writes a line without beeps/flashes.stopMusic— stops music.startMusic— resumes music. [2] (github.com)Citations:
补齐 HackerScript 行为类型表。
表格已有
writel_silent,但缺少独立的write_silent、stopMusic和startMusic。请补充这些行为的参数、用途和目标作用域;若本文只覆盖特定 Hacknet 版本,请标明版本范围。🤖 Prompt for AI Agents