我是靠谱客的博主 合适白开水,这篇文章主要介绍抢羽毛球场地脚本,现在分享给大家,希望可以做个参考。

复制代码
1
2
3
4
5
6
7
8
9
10
11
public class WeChatApplication { public static void main(String[] args) throws ParseException, ParseException { System.out.println("Start Success !"); Execute execute = new Execute(); execute.everyday("李进友友哥","07:59:54","我想要8-9点的3号场地"); } }
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
public class WeChatRobot { private Robot bot = null; private Clipboard clip = null; public WeChatRobot() { try { this.clip = Toolkit.getDefaultToolkit().getSystemClipboard(); this.bot = new Robot(); } catch (AWTException e) { e.printStackTrace(); } } public void OpenWeChat() { bot.keyPress(KeyEvent.VK_CONTROL); bot.keyPress(KeyEvent.VK_ALT); bot.keyPress(KeyEvent.VK_W); bot.keyRelease(KeyEvent.VK_CONTROL); bot.keyRelease(KeyEvent.VK_ALT); bot.delay(1000); } public void ChooseFriends(String name) { Transferable text = new StringSelection(name); clip.setContents(text, null); bot.delay(1000); bot.keyPress(KeyEvent.VK_CONTROL); bot.keyPress(KeyEvent.VK_F); bot.keyRelease(KeyEvent.VK_CONTROL); bot.delay(1000); bot.keyPress(KeyEvent.VK_CONTROL); bot.keyPress(KeyEvent.VK_V); bot.keyRelease(KeyEvent.VK_CONTROL); bot.delay(2000); bot.keyPress(KeyEvent.VK_ENTER); } public void SendMessage(String message) { Transferable text = new StringSelection(message); clip.setContents(text, null); bot.delay(1000); bot.keyPress(KeyEvent.VK_CONTROL); bot.keyPress(KeyEvent.VK_V); bot.keyRelease(KeyEvent.VK_CONTROL); bot.delay(1000); bot.keyPress(KeyEvent.VK_ENTER); bot.delay(1000); bot.keyPress(KeyEvent.VK_CONTROL); bot.keyPress(KeyEvent.VK_ALT); bot.keyPress(KeyEvent.VK_W); bot.keyRelease(KeyEvent.VK_CONTROL); bot.keyRelease(KeyEvent.VK_ALT); } }
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
public class Execute { private WeChatRobot robot = new WeChatRobot(); private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); public void everyday(String friendName,String timeStr,String message) throws ParseException { //获取目标时间 Date date = getDate(timeStr); Timer timer = new Timer(); TimerTask timerTask = new TimerTask() { @Override public void run() { printLog(friendName,message); robot.OpenWeChat(); robot.ChooseFriends(friendName); robot.SendMessage(message); } }; timer.schedule(timerTask,date,1000*60*60*24); } private void printLog(String friendName, String message) { System.out.println("-----------------发送消息-----------------"); System.out.println("当前时间: " + sdf.format(new Date())); System.out.println("发送对象: " + friendName); System.out.println("发送内容: " + message); } private Date getDate(String timeStr) throws ParseException { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); //获取当前日期 例如 2020-22-22 String currentDate = sdf.format(new Date()); //组拼 目标时间 2020-22-22 22:22:22 String targetTime = currentDate+" "+timeStr; sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //目标时间 时间戳 long targetTimer= sdf.parse(targetTime).getTime(); //当前时间 时间戳 long currentTimer = new Date().getTime(); //判断是否已过目标时间 if(targetTimer < currentTimer ){ //目标时间加一天 targetTimer += 1000*60*60*24; } //返回目标日期 return new Date(targetTimer); } }

 这份代码有个问题,多次运行后会出现下面的问题:

  

说明你的系统没有剪切板程序

首先: 在开始->运行中输入clipbrd 回车:

 如果系统弹出了剪切板,那你就编辑-删除

 如果提示window 没有文件 clipbrd 那就需要去找一个clipbrd.exe程序 放入到

 C:WINDOWSsystem32目录下面就可以了.....
 

最后

以上就是合适白开水最近收集整理的关于抢羽毛球场地脚本的全部内容,更多相关抢羽毛球场地脚本内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(69)

评论列表共有 0 条评论

立即
投稿
返回
顶部