当前位置:网站首页>虎牙自动发弹幕换牌子
虎牙自动发弹幕换牌子
2022-08-10 22:23:00 【noobmantest】
虎牙自动发弹幕换牌子
弹幕不受虎牙限制
温馨提示:需要电脑上安装Chrome浏览器
联系我:QQ2039808149 (欢迎讨论交流)
运行截图

运行流程:
- 输入主播房间号
- 输入想要发送的弹幕
- 进入同时切换牌子
- 点击开始发送弹幕,在弹幕框中随机选择一条弹幕发送。速度大概是1条/s。可设置发送不受虎牙限制
- 点击发送停止即可停止。
使用selenium模拟点击,物理脚本,比较可靠。缺点就是比较消耗电脑资源,多个账号同时登录比比较卡顿
部分代码:
@Slf4j
public class MainGUI {
/* * * 管理员端的界面 */
JFrame mainFrame = new JFrame();
JTable userTable;
Object[] usersTableTitle = {
"编号", "标记", "是否可用", "cookie"};
Object[][] users;
// 主播和直播间信息
ArrayList<String> anchorsMessage = new ArrayList<>();
ArrayList<BarrageAndRoomNum> barrageAndRoomNumList = Init.barrageAndRoomNumList;
JPanel rightContent, leftContent;
JButton addUserButton, startSend, enterAnchorRoom, stopSend, safeStatus, safeUsers, delCurStatus, delUser;
Box leftBox;
JTextField anchorNum, delUserNum;
JTextArea barrages;
public JComboBox<String> changeAnchor;
public MainGUI() {
init();
addListener();
mainFrame.setVisible(true);
mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);// 关闭窗口退出程序
mainFrame.setBounds(500, 200, 700, 490);
mainFrame.setTitle("管理员界面");
updateUserInfo();
updateAnchorAndMessage();
}
void init() {
// 左侧菜单栏
leftBox = Box.createVerticalBox();
// 主播信息
changeAnchor = new JComboBox(anchorsMessage.toArray());
leftBox.add(changeAnchor);
leftBox.add(Box.createVerticalStrut(30));
addUserButton = new JButton("录入用户");
addUserButton.setFont(new Font("宋体", Font.BOLD, 15));
leftBox.add(addUserButton);
leftBox.add(Box.createVerticalStrut(30));
JLabel anchorLabel = new JLabel("主播房间号:");
anchorLabel.setFont(new Font("宋体", Font.BOLD, 15));
anchorNum = new JTextField();
anchorNum.setPreferredSize(new Dimension(30, 50));
anchorNum.setFont(new Font("宋体", Font.BOLD, 25));
leftBox.add(anchorLabel);
leftBox.add(anchorNum);
leftBox.add(Box.createVerticalStrut(30));
enterAnchorRoom = new JButton("进入&切换牌子");
enterAnchorRoom.setFont(new Font("宋体", Font.BOLD, 15));
leftBox.add(enterAnchorRoom);
leftBox.add(Box.createVerticalStrut(30));
startSend = new JButton("开始发送弹幕");
startSend.setFont(new Font("宋体", Font.BOLD, 15));
leftBox.add(startSend);
leftBox.add(Box.createVerticalStrut(30));
stopSend = new JButton("停止发送弹幕");
stopSend.setFont(new Font("宋体", Font.BOLD, 15));
leftBox.add(stopSend);
leftBox.add(Box.createVerticalStrut(30));
Box box2 = Box.createHorizontalBox();
box2.add(Box.createHorizontalStrut(8));
box2.add(leftBox); //左边的按钮部分用 box布局
leftContent = new JPanel();
// leftContent.setPreferredSize(new Dimension(250, 0)); //使用该方法
leftContent.setLayout(new BorderLayout());
leftContent.add(box2, BorderLayout.NORTH);
// 右侧表格
users = new Object[10][usersTableTitle.length];
userTable = new JTable(users, usersTableTitle);//组件的创建
// userTable.setEnabled(false);
JScrollPane scrollPane = new JScrollPane(userTable);
rightContent = new JPanel();
rightContent.setLayout(new BorderLayout());
rightContent.add(new JLabel("用户列表"), BorderLayout.BEFORE_FIRST_LINE);
rightContent.add(scrollPane, BorderLayout.CENTER);//把表格 放jpanel5里
// 右下弹幕输入
barrages = new JTextArea(10, 40);
barrages.setLineWrap(true);
barrages.setFont(new Font("宋体", Font.BOLD, 15));
barrages.setText("666");
JScrollPane barragesScrollPane = new JScrollPane(barrages);
barragesScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);// 设置滚动条
barragesScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);// 设置滚动条
Box rightBottomBox = Box.createHorizontalBox();
safeStatus = new JButton("保存弹幕");
safeStatus.setFont(new Font("宋体", Font.BOLD, 15));
rightBottomBox.add(safeStatus);
delCurStatus = new JButton("删除当前弹幕");
delCurStatus.setFont(new Font("宋体", Font.BOLD, 15));
rightBottomBox.add(delCurStatus);
delUserNum = new JTextField();
delUserNum.setPreferredSize(new Dimension(10, 20));
delUserNum.setFont(new Font("宋体", Font.BOLD, 15));
rightBottomBox.add(delUserNum);
delUser = new JButton("删除用户");
delUser.setFont(new Font("宋体", Font.BOLD, 15));
rightBottomBox.add(delUser);
safeUsers = new JButton("保存用户");
safeUsers.setFont(new Font("宋体", Font.BOLD, 15));
rightBottomBox.add(safeUsers);
Box barragesBox = Box.createVerticalBox();
barragesBox.add(barragesScrollPane, BorderLayout.SOUTH);
barragesBox.add(rightBottomBox);
rightContent.add(barragesBox, BorderLayout.SOUTH);
mainFrame.setLayout(new BorderLayout());
mainFrame.add(rightContent, BorderLayout.EAST);
mainFrame.add(leftContent, BorderLayout.WEST);//把两个大的panel放到窗口里面
}
}
联系我QQ 2039808149 欢迎讨论交流
边栏推荐
猜你喜欢

如何利用fiddler连接手机抓包APP

2021 IDEA creates web projects

QT笔记——vs + qt 创建一个带界面的 dll 和 调用带界面的dll

Merge k sorted linked lists

阿里云架构师金云龙:基于云XR平台的视觉计算应用部署

实例051:按位与

虚拟地址空间

配电网络扩展规划:考虑使用概率性能源生产和消费概况的决策(Matlab代码实现)

QT笔记——用VS + qt 生成dll 和 调用生成的dll

Power system power flow calculation (Newton-Raphson method, Gauss-Seidel method, fast decoupling method) (Matlab code implementation)
随机推荐
pytorch tear CNN
LeetCode Daily 2 Questions 01: Reverse Strings (both 1200) Method: Double Pointer
常用代码扩展点设计方式
August 10, 2022: Building Web Applications for Beginners with ASP.NET Core -- Creating Web UIs with ASP.NET Core
web项目访问引用jar内部的静态资源
Detailed installation steps and environment configuration of geemap
ArcGIS中的坐标系统和投影变换
LeetCode每日两题02:反转字符串中的单词 (均1200道)
爬虫request.get()出现错误
QT笔记——用VS + qt 生成dll 和 调用生成的dll
BM7 list entry in central
Distribution Network Expansion Planning: Consider Decisions Using Probabilistic Energy Production and Consumption Profiles (Matlab Code Implementation)
What is Jmeter? What are the principle steps used by Jmeter?
文件IO-缓冲区
HanLP词性表
ArcGIS应用基础知识
自学软件测试不知道该如何学起,【软件测试技能图谱|自学测试路线图】
12 Recurrent Neural Network RNN2 of Deep Learning
VLAN huawei 三种模式
MySQL: MySQL Cluster - Principle and Configuration of Master-Slave Replication