This repository has been archived by the owner on Jul 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
149 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#更新日志 | ||
|
||
##[0.1.2] - 2021-3-30 | ||
###新增 | ||
* 插件载入时将检查是否正确填写了API Key | ||
###优化 | ||
* 现在API Key以外部文件的方式存储了 | ||
* 请求错误现在将打印更详细的报告 | ||
* 重写了README.md | ||
|
||
##[0.1.1] - 2021-3-29 | ||
###新增 | ||
* API发生请求错误时,将通过Mirai打印相关提示 | ||
###变更 | ||
* Mirai-Console版本更新为2.5.0 | ||
|
||
## [0.1.0] - 2021-3-23 | ||
###新增 | ||
* 完成了核心功能 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,30 @@ | ||
# 塔科夫市场插件 Tarkov Tools | ||
一个Mirai-Console插件,用于从[Tarkov Market](https://tarkov-market.com)上抓取市场价格数据,并响应指令进行价格信息转发 | ||
|
||
A mirai-console plugin used to collect data from [Tarkov Market](https://tarkov-market.com) and forwarding result to QQ groups | ||
A mirai-console plugin used to collect data from [Tarkov Market](https://tarkov-market.com) and forwarding result to QQ groups | ||
|
||
## 环境 | ||
* JRE: 11+ | ||
* Mirai-Console: 2.5.0 | ||
* MCL | ||
|
||
## 构建 | ||
Clone并通过IntelliJ IDEA导入本项目,执行buildPlugin任务即可 | ||
|
||
## 安装 | ||
1. 自行构建本项目或在Releases页面下载预构建的版本 | ||
2. 将插件放入Mirai-Console的plugins目录 | ||
3. 启动Mirai-Console | ||
4. **第一次使用启动后需要在config配置文件中填写[Tarkov Market API](https://tarkov-market.com/dev/api)** KEY | ||
5. 在Mirai-Console中配置命令执行权限 | ||
|
||
## 使用 | ||
目前只有一个主要命令 | ||
### /eft search <搜索关键字>(中文关键字) | ||
|
||
返回[Tarkov Market](https://tarkov-market.com)上前三个搜索结果的市场价格和最高商人收购价格 | ||
|
||
## 关于 | ||
本项目跟随[Mirai](https://github.com/mamoe/mirai) 使用 `AGPLv3` 开源 | ||
|
||
码力不强,献丑了。欢迎提Issue,也欢迎各路大佬优化代码提交Pull Request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ plugins { | |
} | ||
|
||
group 'tech.ezrealc' | ||
version '0.1.1' | ||
version '0.1.2' | ||
|
||
repositories { | ||
mavenCentral() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
rootProject.name = 'TarkovTools' | ||
rootProject.name = 'Mirai-TarkovMarket-Plugin' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
import com.dtflys.forest.exceptions.ForestNetworkException; | ||
import com.dtflys.forest.http.ForestResponse; | ||
|
||
import java.util.ArrayList; | ||
|
||
public class ItemInfo { | ||
|
||
public final ArrayList<ItemBean> itemBeanList; | ||
ItemInfo(String uid){ | ||
|
||
ItemInfo (String apiKey, String uid) { | ||
HttpClient httpClient = Utils.getHttpClient(); | ||
String result = null; | ||
result = httpClient.getByUid("https://tarkov-market.com/api/v1/item?uid=", uid); | ||
String result; | ||
result = httpClient.getByUid(apiKey, "https://tarkov-market.com/api/v1/item?uid=", uid); | ||
itemBeanList = Utils.parseItemBean(result); | ||
} | ||
|
||
ItemInfo(String keyword, String language){ | ||
ItemInfo (String apiKey, String keyword, String language) { | ||
HttpClient httpClient = Utils.getHttpClient(); | ||
String result = null; | ||
result = httpClient.getByKeyword(keyword, language); | ||
String result; | ||
result = httpClient.getByKeyword(apiKey, keyword, language); | ||
itemBeanList = Utils.parseItemBean(result); | ||
} | ||
|
||
public String getNameByIndex(int index){ | ||
public String getNameByIndex (int index) { | ||
return itemBeanList.get(index).getName(); | ||
} | ||
|
||
public int getTraderPriceByIndex(int index){ | ||
public int getTraderPriceByIndex (int index) { | ||
return itemBeanList.get(index).getTraderPrice(); | ||
} | ||
|
||
public String getTraderPriceCurByIndex(int index){ | ||
public String getTraderPriceCurByIndex (int index) { | ||
return itemBeanList.get(index).getTraderPriceCur(); | ||
} | ||
|
||
public int getPriceByIndex(int index){ | ||
public int getPriceByIndex (int index) { | ||
return itemBeanList.get(index).getPrice(); | ||
} | ||
|
||
public String getTraderNameByIndex(int index){ | ||
public String getTraderNameByIndex (int index) { | ||
return itemBeanList.get(index).getTraderName(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import net.mamoe.mirai.console.data.AutoSavePluginConfig | ||
import net.mamoe.mirai.console.data.ValueDescription | ||
import net.mamoe.mirai.console.data.value | ||
|
||
object PluginConfig : AutoSavePluginConfig("config"){ | ||
@ValueDescription("tarkov-market.com提供的API Key") | ||
var apiKey: String by value("") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
id: "tech.ezrealc.tarkov-plugin" | ||
version: "0.1.1" | ||
id: "tech.ezrealc.mirai-tarkovmarket-plugin" | ||
name: "mirai-tarkovmarket-plugin" | ||
version: "0.1.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters