Skip to content

Commit

Permalink
Merge branch 'refs/heads/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
4379711 committed Jun 7, 2024
2 parents c3fb549 + f4a19de commit 7206bec
Show file tree
Hide file tree
Showing 29 changed files with 152 additions and 447 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- 修改游戏在线状态(游戏内如果改变状态,会覆盖本工具修改的状态)
- 自动秒选英雄,指定英雄后自动生效,取消指定后失效
- 自动禁用英雄,指定英雄后自动生效,取消指定后失效
- 自动寻找对局
- 自动接受对局(无需点击接受对局,**可以排队时候玩手机了**)
- 自动开始下一局(可以跳过结算等待页面)
- 掉线自动重连(有时候会游戏崩溃意外掉线,这些年很少发生游戏崩溃问题)
Expand Down Expand Up @@ -49,12 +50,13 @@
- 方式二(推荐): 对着图标右键 -> 属性 -> 以管理员身份运行此程序 -> 确定 -> 以后直接双击图标启动程序即可

##### 快捷键说明
- F1:发送队友最近三局战绩和得分到聊天框,可在选择英雄界面使用
- F2:发送对方最近三局战绩和得分到聊天框,只能在游戏内使用,因为选英雄界面看不到对面玩家
- F1:根据队友得分,并选出大神和傻鸟是谁,发送到聊天框,可在选择英雄界面使用
- F2:根据对方得分,并选出大神和傻鸟是谁,发送到聊天框,只能在游戏内使用(因为选英雄界面看不到对面玩家)
- T(或者自定义按键):瞎子光速`眼闪W`(即自动按4DW)
- HOME(问候家人,所以用了home):发送垃圾话(如果修改了垃圾话文件,可以取消勾选,再打开勾选,即可重新加载垃圾话)
- END:发送鼓励的话,自动从网络上获取彩虹屁,并自动发送到聊天框
- DELETE:发送垃圾话时可能会被系统屏蔽,此时标记后会把这个垃圾话打印到结果面板里,方便后续对照修改
- PAUSE:暂停/开启自动操作,例如自动寻找对局,自动跳过结算界面,一键连招等
- 自定义快捷键

##### 安装步骤
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/yalong/site/ClientStarter.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import lombok.extern.slf4j.Slf4j;
import yalong.site.bo.LeagueClientBO;
import yalong.site.cache.AppCache;
import yalong.site.cache.GameDataCache;
import yalong.site.enums.GameStatusEnum;
import yalong.site.exception.NoProcessException;
Expand Down Expand Up @@ -33,19 +34,25 @@ public void initLcu() throws Exception {
public void listenGameStatus() throws InterruptedException, IOException {
while (true) {
TimeUnit.MILLISECONDS.sleep(500);
if(AppCache.stopAuto){
continue;
}
GameStatusContext gameStatusContext = new GameStatusContext();
CalculateScore calculateScore = new CalculateScore(api);
//监听游戏状态
GameStatusEnum gameStatus = api.getGameStatus();
switch (gameStatus) {
case None:
case Lobby:
case Matchmaking:
case WaitingForStats: {
gameStatusContext.setStrategy(new OtherStatusStrategy());
GameDataCache.reset();
break;
}
case Lobby:{
gameStatusContext.setStrategy(new LobbyStrategy(api));
break;
}
case ReadyCheck: {
gameStatusContext.setStrategy(new ReadyCheckStrategy(api));
break;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/yalong/site/cache/AppCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ public class AppCache {
public static ArrayList<String> resultPanelMsgList = new ArrayList<>();
public static Set<Integer> hotKeyCode = new HashSet<>();
public static Set<Integer> commonKeyCode = new HashSet<>();
public static boolean stopAuto = false;

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
* @author yaLong
*/
public class FrameUserSettingPersistence {

/**
* 自动寻找对局
*/
public static boolean autoSearch = true;

/**
* 自动接受对局
*/
Expand Down
24 changes: 0 additions & 24 deletions src/main/java/yalong/site/frame/bo/ComponentBO.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package yalong.site.frame.panel.client;

import yalong.site.cache.FrameUserSettingPersistence;
import yalong.site.frame.bo.ComponentBO;
import yalong.site.frame.panel.base.BaseCheckBox;

import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;

Expand All @@ -19,27 +17,6 @@ public AutoAcceptCheckBox() {
this.addItemListener(listener());
}

/**
* @return 带布局的盒子
*/
public static ComponentBO builder() {
AutoAcceptCheckBox box = new AutoAcceptCheckBox();
GridBagConstraints grid = new GridBagConstraints(
// 第(0, 1)个格子
0, 1,
// 占1列,占1行
1, 1,
//横向占100%长度,纵向占100%长度
1, 1,
//居中,组件小的话就两边铺满窗格
GridBagConstraints.CENTER, GridBagConstraints.NONE,
// 窗格之间的距离
new Insets(0, 0, 0, 0),
// 增加组件的首选宽度和高度
0, 0);
return new ComponentBO(box, grid);
}

private ItemListener listener() {
return e -> FrameUserSettingPersistence.autoAccept = e.getStateChange() == ItemEvent.SELECTED;
}
Expand Down
23 changes: 0 additions & 23 deletions src/main/java/yalong/site/frame/panel/client/AutoKeyCheckBox.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package yalong.site.frame.panel.client;

import yalong.site.cache.FrameUserSettingPersistence;
import yalong.site.frame.bo.ComponentBO;
import yalong.site.frame.panel.base.BaseCheckBox;

import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;

Expand All @@ -20,27 +18,6 @@ public AutoKeyCheckBox() {
this.addItemListener(listener());
}

/**
* @return 带布局的盒子
*/
public static ComponentBO builder() {
AutoKeyCheckBox box = new AutoKeyCheckBox();
GridBagConstraints grid = new GridBagConstraints(
// 第(2,2)个格子
2, 2,
// 占1列,占1行
1, 1,
//横向占100%长度,纵向占100%长度
1, 1,
//居中,组件小的话就两边铺满窗格
GridBagConstraints.CENTER, GridBagConstraints.NONE,
// 窗格之间的距离
new Insets(0, 0, 0, 0),
// 增加组件的首选宽度和高度
0, 0);
return new ComponentBO(box, grid);
}

private ItemListener listener() {
return e -> FrameUserSettingPersistence.autoKey = e.getStateChange() == ItemEvent.SELECTED;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package yalong.site.frame.panel.client;

import yalong.site.cache.FrameUserSettingPersistence;
import yalong.site.frame.bo.ComponentBO;
import yalong.site.frame.panel.base.BaseCheckBox;

import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;

Expand All @@ -19,28 +17,6 @@ public AutoPlayAgainCheckBox() {
this.addItemListener(listener());
}

/**
* @return 带布局的盒子
*/
public static ComponentBO builder() {
AutoPlayAgainCheckBox box = new AutoPlayAgainCheckBox();
GridBagConstraints grid = new GridBagConstraints(
// 第(2,1)个格子
2, 1,
// 占1列,占1行
1, 1,
//横向占100%长度,纵向占100%长度
1, 1,
//居中,组件小的话就两边铺满窗格
GridBagConstraints.CENTER, GridBagConstraints.NONE,
// 窗格之间的距离
new Insets(0, 0, 0, 0),
// 增加组件的首选宽度和高度
0, 0
);
return new ComponentBO(box, grid);
}

private ItemListener listener() {
return e -> FrameUserSettingPersistence.autoPlayAgain = e.getStateChange() == ItemEvent.SELECTED;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package yalong.site.frame.panel.client;

import yalong.site.cache.FrameUserSettingPersistence;
import yalong.site.frame.bo.ComponentBO;
import yalong.site.frame.panel.base.BaseCheckBox;

import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;

Expand All @@ -19,28 +17,6 @@ public AutoReconnectCheckBox() {
this.addItemListener(listener());
}

/**
* @return 带布局的盒子
*/
public static ComponentBO builder() {
AutoReconnectCheckBox box = new AutoReconnectCheckBox();
GridBagConstraints grid = new GridBagConstraints(
// 第(1,1)个格子
1, 1,
// 占1列,占1行
1, 1,
//横向占100%长度,纵向占100%长度
1, 1,
//居中,组件小的话就两边铺满窗格
GridBagConstraints.CENTER, GridBagConstraints.NONE,
// 窗格之间的距离
new Insets(0, 0, 0, 0),
// 增加组件的首选宽度和高度
0, 0
);
return new ComponentBO(box, grid);
}

private ItemListener listener() {
return e -> FrameUserSettingPersistence.autoReconnect = e.getStateChange() == ItemEvent.SELECTED;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package yalong.site.frame.panel.client;

import yalong.site.cache.FrameUserSettingPersistence;
import yalong.site.frame.panel.base.BaseCheckBox;

import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;

/**
* @author yaLong
*/
public class AutoSearchCheckBox extends BaseCheckBox {
public AutoSearchCheckBox() {
this.setText("自动寻找对局");
this.setSelected(FrameUserSettingPersistence.autoSearch);
this.addItemListener(listener());
}

private ItemListener listener() {
return e -> FrameUserSettingPersistence.autoSearch = e.getStateChange() == ItemEvent.SELECTED;
}

}
24 changes: 0 additions & 24 deletions src/main/java/yalong/site/frame/panel/client/BanBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
import yalong.site.bo.ChampionBO;
import yalong.site.cache.FrameUserSetting;
import yalong.site.cache.GameDataCache;
import yalong.site.frame.bo.ComponentBO;
import yalong.site.frame.panel.base.BaseButton;

import java.awt.*;
import java.awt.event.ActionListener;

/**
Expand All @@ -23,28 +21,6 @@ public BanBox() {
this.addActionListener(actionListener());
}

/**
* @return 带布局的盒子
*/
public static ComponentBO builder() {
BanBox box = new BanBox();
GridBagConstraints grid = new GridBagConstraints(
// 第(2,3)个格子
1, 4,
// 占1列,占1行
1, 1,
//横向占100%长度,纵向占100%长度
1, 1,
//居中,组件小的话就两边铺满窗格
GridBagConstraints.CENTER, GridBagConstraints.NONE,
// 窗格之间的距离
new Insets(0, 0, 0, 0),
// 增加组件的首选宽度和高度
0, 0
);
return new ComponentBO(box, grid);
}

private ActionListener actionListener() {
return e -> {
ChampionSelectFrame selectFrame = new ChampionSelectFrame("禁用英雄", (name) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
import yalong.site.bo.ChampionBO;
import yalong.site.cache.FrameUserSetting;
import yalong.site.cache.GameDataCache;
import yalong.site.frame.bo.ComponentBO;
import yalong.site.frame.panel.base.BaseButton;

import java.awt.*;
import java.awt.event.ActionListener;

/**
Expand All @@ -21,28 +19,6 @@ public CareerBackgroundBox() {
this.addActionListener(actionListener());
}

/**
* @return 带布局的盒子
*/
public static ComponentBO builder() {
CareerBackgroundBox box = new CareerBackgroundBox();
GridBagConstraints grid = new GridBagConstraints(
// 第(0,5)个格子
1, 3,
// 占1列,占1行
1, 1,
//横向占100%长度,纵向占100%长度
1, 1,
//居中,组件小的话就两边铺满窗格
GridBagConstraints.CENTER, GridBagConstraints.NONE,
// 窗格之间的距离
new Insets(0, 0, 0, 0),
// 增加组件的首选宽度和高度
0, 0
);
return new ComponentBO(box, grid);
}

private ActionListener actionListener() {
return e -> {
ChampionSelectFrame selectFrame = new ChampionSelectFrame("选择生涯背景英雄", (name) -> {
Expand Down
Loading

0 comments on commit 7206bec

Please sign in to comment.