HttpChat Python聊天, Linux聊天

HttpChat Python聊天, Linux聊天

一个模组,允许从任何编程语言或控制台代表玩家向聊天发送消息或命令。

基础库

本模组旨在从游戏外部向聊天框写入内容,借助此模组你可以创建令人惊叹的项目。

以下是使用示例:

Linux、Windows CMD:

curl -X POST http://localhost:6789 -d "Greetings from the TenshiBunny!"
curl -X POST http://localhost:6789 -d "/tp 0 10 0"

Windows PowerShell:

Invoke-WebRequest -Uri http://localhost:6789 -Method POST -Body "Greetings from the TenshiBunny!"
Invoke-RestMethod -Uri http://localhost:6789 -Method POST -Body "/tp 0 10 0"

Python:

import requests

response1 = requests.post('http://localhost:6789', data='Greetings from the TenshiBunny!')
print(f'Статус: {response1.status_code}')
print(f'Ответ: {response1.text}')

response2 = requests.post('http://localhost:6789', data='/tp 0 10 0')
print(f'Статус: {response2.status_code}')
print(f'Ответ: {response2.text}')

Linux: