Repository navigation
1.1 Start from Hello World
欢迎来到 HimDSL 的世界!本节将带你编写第一个程序。
Welcome to the world of HimDSL! This section will guide you through writing your first program.
确保你已经安装了 [HimDSL] 插件并重启了服务器。 Make sure HimDSL has enabled.
在HimDSL\文件夹下创建hello.dsl并写入以下内容。
int main(){
runcmd("CONSOLE","say Hello,world!");
}
在服务器控制台输入 Input in Console:
himdsl run hello.dsl
或者由玩家输入 Input from player:
/himdsl run hello.dsl
控制台将会打印 Console will print: [Server] [Not Secure] Hello,world!
main()函数是代码的入口点。在完成了函数表的扫描之后会尝试从main()函数开始执行。文件名和main()无关。
runcmd()是一个内置的函数。该函数有两个参数,第一个是执行者,第二个是命令。
The main() function is the entry point of the code. After scanning the function table, it will attempt to execute starting from the main() function. The file name has nothing to do with main(). runcmd() is a built - in function. This function has two parameters. The first one is the executor, and the second one is the command.
- 首页 / Home
- 安装与快速开始 / Installation & Quick Start
- 第一个脚本 / Your First Script
- 命令速查 / Command Reference
- 自动执行脚本 / Auto-run Scripts
- 定义函数 / Defining Functions
- 函数重载 / Function Overloading
- Lambda 表达式 / Lambda Expressions
- 函数式接口 / Functional Interfaces
- 选择器总览 / Selectors Overview
- 选择器过滤器 / Selector Filters
- EntityRef 引用 / EntityRef
- 占位符参考 / Placeholders Reference
- PlaceholderAPI 桥接 / PAPI Bridge
- 创建 GUI / Creating a GUI
- GUISlot 槽位 / GUISlot
- 点击回调 / Click Callbacks
- onClose 回调 / onClose Callback
- GUI 刷新 / GUI Refresh
- 数学函数 / Math Built-ins
- 高精度计算 / BigDecimal Built-ins
- 字符串函数 / String Built-ins
- 集合函数 / Collection Built-ins
- 文件 I/O / File I/O
- 命令与 sleep / Commands & sleep