观看本篇文章前请先跳转至链接:Dice!文档:https://v2docs.kokona.tech/zh/latest/
请先查看《骰娘是什么》
如果对跑团或骰娘感兴趣,想要搭建骰娘,请阅读完《Dice!文档》后,点击下方链接查看搭建指南。
Dice!导航帖:https://forum.kokona.tech/d/150-dice-dao-hang-tie
Mirai Dice 下载及搭建指南:https://forum.kokona.tech/d/448-mirai-dice-xia-zai-ji-da-jian-zhi-nan-zui-hou-geng-xin-20211214
Mirai Dice 搭建骰娘遇到的问题及解决方法:https://www.bilibili.com/read/cv13257089?spm_id_from=333.999.0.0
Mirai 开发文档:https://docs.mirai.mamoe.net/#%E4%BD%BF%E7%94%A8-mirai
【注:本篇教程主要针对在Windows搭建非24h骰娘、在Ubuntu服务器搭建24h骰娘】
【Dice不支持CentOS】
【本文主要参考以上教程,如想顺利搭建请仔细阅读以上教程,本文根据上诉教程只补充ubuntu部分】
其他或许有用的教程,选择查看:
Mirai环境准备:https://docs.mirai.mamoe.net/mirai-login-solver-selenium/
mirai-login-solver-selenium:https://github.com/project-mirai/mirai-login-solver-selenium
Mirai qq机器人ubuntu配置踩坑记录:https://blog.csdn.net/qq_43380015/article/details/108679731
前置Ubuntu要点:
文件操作
touch file
pwd
cd /home
ls
ls -l
chmod 755 ./*
查看ip地址
安装 net-tools 工具后使用 ifconfig
sudo apt install net-tools
ifconfig
(服务器中第一个地址是内网ip地址,第二个是本机地址)
(虚拟机中第一个地址是NAT转换ip地址,第二个地址是桥接ip地址,第三个是本机地址)
vim使用
#用vim打开文件
vim test.txt
#输入
i
#保存并退出
:wq
Ubuntu系统环境部署:
ubuntu安装lua:https://blog.csdn.net/yzf279533105/article/details/125448956
lua下载:
下载好.gz包后解压,进入目录
运行
sudo apt-get install libncurses-dev
apt-get install libreadline-dev
make linux test
java
#更新源
sudo apt-get update
#安装openjdk-11-jre
sudo apt-get install openjdk-11-jre git
正式搭建骰娘
windows、ubuntu下载Mirai
git clone --depth=1 https://github.com/w4123/cd mirai-dice-classic
cd mirai-dice-classic
windows、ubuntu启动Mirai,运行
./LaunchMirai.sh
在windows搭建成功后拷贝文件至Ubuntu服务器
windows搭建教程
擅长使用git可在github下载:https://github.com/w4123/mirai-dice-release-noextra
git安装教程:http://morlvoid.pro/2022/06/12/git/
打开文件夹,点击“启动Mirai.cmd”
windows配置自动登录账号
添加自动登录:autologin add QQ账号 密码
根据提示进入WebUI界面,进行认主
认主后已经是Master,在这之后的其他配置请参考本文开头的Master手册
windows下进行滑块验证
根据提示进行
如果出现报错信息为:Statuslogger Log4j2 could not find a logging implementation.Please ad log4j-core to the classpath. lsing SimpleLoger to log to the console...时
在ubuntu中修改日志文件
vim data/MiraiNative/config.json
将false 改为 true 后重启Mirai
windows向ubuntu拷贝文件
通过Xshell 链接服务器后打开Xftp拷贝文件
Xmanager Enterprise 5安装教程:https://www.xshellcn.com/xmg_column/xshell-hjko.html
将windows配置好的文件复制进服务器的文件中,例如必须拷贝的文件:bots/QQ/device.json
退出Mirai
/stop
如果想要在ubuntu服务器上始终运行,不需要退出命令
windows中关掉窗口即停止骰娘运行(也可运行命令)
ubuntu服务器中后台运行骰娘程序
(以下为可让程序在ubuntu后台运行的三种方式,若一种不成功请更换其他方式)
nohup
ubuntu下让进程在后台运行:https://www.shuzhiduo.com/A/MAzAk6MR59/
(1)输入命令:nohup 你的shell命令 &
nohup ./LaunchMirai.sh &
(2)回车,使终端回到shell命令行
(3)使用第二第三条,完全屏蔽掉信号。用disown -h jobspec
来使某个作业忽略HUP信号。用disown -ah
来使所有的作业都忽略HUP信号。用disown -rh
来使正在运行的作业忽略HUP信号。
ubuntu查看进程和结束进程:https://blog.csdn.net/qq_42257666/article/details/124197052
screen
screen教程:https://blog.csdn.net/RongLin02/article/details/116009949
sudo apt-get install screen
创建 screen 窗口
screen -S name
name可以设置为ssh、ftp,用于标注该 screen 窗口用途
注意,执行 screen -S name
` 之后系统会跳进一个新窗口,这个窗口就是我们创建的新进程,用来执行命令,在新窗口里面进行项目的启动即可
例:
cd mirai-dice-classic
./LaunchMirai.sh
退出保存
exit
#完全退出
#不会进行session保存
CTRL-a+d
使用
screen -r
恢复到原来的工作状态
停止screen:
首先查看screen列表:
screen -ls
如果只有一个 screen 进程,命令行输入
screen -r -d
即可如果有多个screen,可以通过它的 PID 进入screen
screen -r -d PID
进入之后CTRL+C,终止
直接让其再后台运行:screen -d -m -S “名字” “程序名”
screen -d -m -S dice ./LaunchMirai.sh
Tmux
Tmux 使用教程:https://www.ruanyifeng.com/blog/2019/10/tmux.html
安装Tmux
sudo apt-get install tmux
启动与退出
安装完成后,输入
tmux
命令进入 Tmux 窗口
查看后台运行程序
ps -a
显示LaunchMirai.sh表示在后台运行
Comments | NOTHING