forked from opq-osc/OPQ
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGamesDemo.lua
More file actions
1509 lines (1415 loc) · 106 KB
/
GamesDemo.lua
File metadata and controls
1509 lines (1415 loc) · 106 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
local log = require("log")
local json = require("json")
local Api = require("coreApi")
local http = require("http")
local mysql = require("mysql")
--[[
在数据库中建立2个表
CREATE TABLE `invites_info` (
`ID` bigint(20) NOT NULL AUTO_INCREMENT,
`Gid` varchar(50) DEFAULT NULL COMMENT '群ID',
`GidName` varchar(100) DEFAULT NULL COMMENT '群昵称',
`InviteUid` varchar(50) DEFAULT NULL COMMENT '邀请人ID',
`InviteNick` varchar(100) DEFAULT NULL COMMENT '邀请人昵称',
`MemberUid` varchar(50) DEFAULT NULL COMMENT '被邀请人ID',
`MemberNick` varchar(100) DEFAULT NULL COMMENT '被邀请人ID',
`InviteTime` int(11) DEFAULT NULL COMMENT '邀请进群时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4;
CREATE TABLE `users_info` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`Uid` varchar(50) DEFAULT NULL COMMENT '用户ID',
`Gid` varchar(50) DEFAULT NULL COMMENT '所在群组',
`OpCode` int(11) DEFAULT NULL COMMENT '签到分数',
`SignTime` int(11) DEFAULT NULL COMMENT '签到时间',
`RealDays` int(11) DEFAULT NULL COMMENT '连续签到',
`SignDays` int(11) DEFAULT NULL COMMENT '累计签到',
`Balance` int(11) DEFAULT NULL COMMENT '余额',
`DiceTime` int(11) DEFAULT NULL COMMENT '骰子游戏时间',
`CreateTime` int(11) DEFAULT NULL COMMENT '入库时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4;
CREATE TABLE `games_info` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`Uid` varchar(50) DEFAULT NULL COMMENT '用户ID',
`Gid` varchar(50) DEFAULT NULL COMMENT '所在群组',
`IsIn` tinyint(1) DEFAULT NULL COMMENT '是否入狱',
`InTime` int(11) DEFAULT NULL COMMENT '入狱时间',
`IsInHp` tinyint(1) DEFAULT NULL COMMENT '是否在医院',
`HpTime` int(11) DEFAULT NULL COMMENT '在医院时间',
`BoxCount` int(11) DEFAULT NULL COMMENT '宝箱个数',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4;
]]
MYSQL_IP = "127.0.0.1"
MYSQL_PORT = 3306
function ReceiveWeChatMsg(CurrentWxid, data)
if data.FromUserName == CurrentWxid then
ToUserName = data.ToUserName
else
ToUserName = data.FromUserName
end
if string.find(data.Content, "娇喘") or string.find(data.Content, "唱歌") then
math.randomseed(os.time())
num = math.random(1, 19)
keyWord = data.Content:gsub("娇喘", "")
file = string.format("./Voice/%d.silk", num)
Api.SendVoice(
CurrentWxid,
{
ToUserName = ToUserName,
VoicePath = file
}
)
return 1
end
wxid = ""
if string.find(ToUserName, "@chatroom") then
wxid = data.ActionUserName
if wxid == "" then
wxid = data.FromUserName
end
else
wxid = data.FromUserName
end
if data.Content == "帮助" then
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[[天啊]RST娱乐机器人[天啊]\n[Emm]指令如下[Emm]\n[旺柴]签到----每日签到🉐️积分\n[旺柴]信息----查询用户积分\n[旺柴]启用----群里启用\n[旺柴]停用----群里停用\n[旺柴]出狱----刑满释放\n[旺柴]出院----康复出院\n[旺柴]越狱----尝试越狱\n[旺柴]打劫@好友----打劫群友\n[旺柴]劫狱@好友----解救狱中好友\n[旺柴]保释@好友----保释入狱群友\n[机智]拉人进群都会🈶️积分奖励的哟\n[红包]提现----100:1/ 10积分就可以兑换\n]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
if data.Content == "启用" then
GetUserNick(CurrentWxid, data)
if CheckAdmin(wxid) == nil then
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n😯您不是管理员,无权操作😯]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
SetChatRoom(ToUserName)
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n😯启用成功😯]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
if data.Content == "停用" then
GetUserNick(CurrentWxid, data)
--SetChatRoom(ToUserName)
if CheckAdmin(wxid) == nil then
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n😯您不是管理员,无权操作😯]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
file = string.format("./Plugins/Games/%s.dat", ToUserName)
os.remove(file)
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n😂停用成功😂]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
if GetChatRoom(ToUserName) == nil then
return 1
end
if data.Content == "签到" then
GetConn()
Sign(CurrentWxid, data)
c.close(c)
return 1
end
if data.Content == "提现" then
GetConn()
TiXian(CurrentWxid, data)
c.close(c)
return 1
end
if data.Content == "信息" then
GetConn()
XinXi(CurrentWxid, data)
c.close(c)
return 1
end
if data.Content == "出院" then
GetConn()
OutHP(CurrentWxid, data)
c.close(c)
return 1
end
if data.Content == "出狱" then
GetConn()
OutCY(CurrentWxid, data)
c.close(c)
return 1
end
if data.Content == "越狱" then
GetConn()
OutYY(CurrentWxid, data)
c.close(c)
return 1
end
if data.Content == "积分排行" then
GetConn()
c.close(c)
return 1
end
if string.find(data.Content, "打劫") then
GetConn()
DaJie(CurrentWxid, data)
c.close(c)
return 1
end
if string.find(data.Content, "劫狱") then
GetConn()
InJY(CurrentWxid, data)
c.close(c)
return 1
end
if string.find(data.Content, "保释") then
GetConn()
OutBS(CurrentWxid, data)
c.close(c)
return 1
end
if string.find(data.Content, "转账") then
GetConn()
c.close(c)
return 1
end
ParseShiPin(CurrentWxid, data)
return 1
end
function GetUserNick(CurrentWxid, data)
Nick = data.ActionNickName
if Nick == "" then
UserTable =
Api.GetContact(
CurrentWxid,
{
ChatroomID = ToUserName,
Wxid = {wxid}
}
)
if UserTable ~= nil then
Nick = UserTable[1].NickName
end
end
end
function GetWxidNick(CurrentWxid, UserID)
User_Table =
Api.GetContact(
CurrentWxid,
{
ChatroomID = ToUserName,
Wxid = {UserID}
}
)
if User_Table ~= nil then
return User_Table[1].NickName
end
return ""
end
function SendJiXi(CurrentWxid, ToUserName, OpCode)
xmlStr =
string.format(
'<appmsg appid="%s" sdkver="0"><title>%s集</title><des>剩余积分%d</des><action /><type>4</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname /><messageext /><messageaction /><content /><contentattr>0</contentattr><url><![CDATA[%s]]></url><lowurl /><dataurl /><lowdataurl /><songalbumurl /><songlyric /><appattach><totallen>0</totallen><attachid /><emoticonmd5 /><fileext /><cdnthumburl>305c0201000450304e02010002044e38148202032f4f5502045972512a02045f7b3d8b0429777875706c6f61645f777869645f74366f723332343234676174323231365f313630313931323230330204010400030201000405004c52ad00</cdnthumburl><cdnthumbmd5>08a3e35b7973326e297e56a09213cd5a</cdnthumbmd5><cdnthumblength>3669</cdnthumblength><cdnthumbwidth>135</cdnthumbwidth><cdnthumbheight>135</cdnthumbheight><cdnthumbaeskey>766d879a4e598be7f2d629bfc4452aed</cdnthumbaeskey><aeskey>766d879a4e598be7f2d629bfc4452aed</aeskey><encryver>0</encryver><filekey>wxid_p503caafko2f12297_1601995606</filekey></appattach><extinfo /><sourceusername /><sourcedisplayname /><thumburl /><md5 /><statextstr>GhQKEnd4Y2E5NDJiYmZmMjJlMGU1MQ==</statextstr><directshare>0</directshare></appmsg>',
appid,
title,
OpCode,
string.format("https://vip.66parse.club/?url=%s", url)
)
--log.error("urlurl %s", xmlStr)
--log.error("CurrentWxid %s", CurrentWxid)
--log.error("ToUserName %s", ToUserName)
--https://jiexi.q-q.wang/?url=
--https://jx.ljtv365.com/?url= guanggao
--https://jx.baikeclub.com/?url=
--https://vip.66parse.club/?url=
--https://jx.618g.com/
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 49, Content = XmlStr})
end
function ReceiveWeChatEvents(CurrentWxid, data)
if data.EventName == "ON_EVENT_FRIEND_REQ" then
baseResonse, wxid =
Api.VerifyUser(
CurrentWxid,
{
VerifyType = 3, --同意好友请求
V1Username = "",
V2Ticket = "",
Content = "",
Sence = 0,
XmlStr = data.Content --会自动解析xml里的参数
}
)
str =
string.format("baseResonse.Ret %d baseResonse.ErrMsg %s Wxid %s", baseResonse.Ret, baseResonse.ErrMsg, wxid)
log.notice("From ReceiveWeChatEvents Log\n%s", str)
end
if data.EventName == "ON_EVENT_CHATROOM_INVITE" then
if CurrentWxid == data.FromUserName then
return 1
end
Url = data.Content:match([[<url><!%[CDATA%[(.+)%]%]></url>]])
if Url == nil then
Url = data.Content:match([[<url>(.+)</url]])
end
baseResonse, resp =
Api.GetA8Key(
CurrentWxid,
{
FromUserName = data.FromUserName,
Sence = 2,
Url = Url
}
)
str =
string.format(
"baseResonse.Ret %d baseResonse.ErrMsg %s Url %s",
baseResonse.Ret,
baseResonse.ErrMsg,
resp.Url
)
log.error("From ReceiveWeChatEvents Log\n%s", str)
response, error_message = http.request("GET", resp.Url)
local html = response.body
str = string.format("当前群人数 %s", html:match("(%d+)人"))
log.info(" %s", str)
response, error_message =
http.request(
"POST",
resp.Url,
{
body = ""
}
)
if error_message ~= nil then
--resp Post weixin://jump/mainframe/12028215877@chatroom: unsupported protocol scheme "weixin
log.notice("info %s", "进群成功" .. error_message)
else
log.error(" resp %s", response.body)
end
end
if data.EventName == "ON_EVENT_CHATROOM_INVITE_OTHER" then
xmlStr =
string.format(
"ChatRoom %s 邀请人 %s 邀请人昵称 %s 被邀请人 %s 被邀请人昵称 %s",
data.FromUserName,
data.InviteUserName,
data.InviteNickName,
data.InvitedUserName,
data.InvitedNickName
)
log.error("%s", xmlStr)
if GetChatRoom(data.FromUserName) == nil then
--log.error("room %s", data.FromUserName)
return 1
end
GetConn()
sqlstr =
string.format(
[[select * from invites_info where `Gid`= "%s" and `InviteUid` = "%s" and `MemberUid` = "%s"]],
data.FromUserName,
data.InviteUserName,
data.InvitedUserName
)
res, err = c:query(sqlstr) --判断一下被邀请人是否存在 不存在则发红包奖励 排除重复进群退群
if #res == 0 then --不存在记录
UserTable =
Api.GetContact(
CurrentWxid,
{
ChatroomID = data.FromUserName
}
)
GidName = UserTable[1].NickName
sqlstr =
string.format(
[[INSERT INTO invites_info (Gid, GidName, InviteUid,InviteNick,MemberUid,MemberNick,InviteTime)VALUES ("%s","%s","%s","%s","%s","%s",%d)]],
data.FromUserName,
GidName,
data.InviteUserName,
data.InviteNickName,
data.InvitedUserName,
data.InvitedNickName,
os.time()
)
res, err = c:query(sqlstr) --插入邀请信息
sqlstr = string.format([[select * from users_info where `Uid`= "%s"]], data.InviteUserName)
res, err = c:query(sqlstr) --存在
if #res ~= 0 then
OpCode = res[1].OpCode
sqlstr =
string.format(
[[UPDATE `users_info` SET `OpCode` = OpCode + 10 WHERE `Uid` = "%s" and `Gid`="%s"]],
data.InviteUserName,
data.FromUserName
)
c:query(sqlstr)
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[ @%s\n[哇]邀请好友进群获🉐️积分10/人\n[哇]剩余积分:%d\n(新人请回复帮助试试吧~)\n还有[红包]奖励嗷]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
data.InviteNickName,
OpCode + 10
)
--Api.SendAppMsg(CurrentWxid, data.FromUserName, 57, XmlStr)
Api.SendAppMsg(CurrentWxid, {ToUserName = data.FromUserName, MsgType = 57, Content = XmlStr})
end
hourNow = os.date("%H", os.time())
if hourNow > 18 or hourNow < 9 then
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n该时段已经暂停提现业务\n🈺️业时间早9点-晚18点]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
if err == nil then
end
end
end
return 1
end
function ParseShiPin(CurrentWxid, data)
bFlag = false
if string.find(data.Content, "wxa75efa648b60994b") then
bFlag = true
end
if string.find(data.Content, "wxcd10170e55a1f55d") then
bFlag = true
end
if string.find(data.Content, "wxd09e2d4fceafe6e3") then
bFlag = true
end
if string.find(data.Content, "wx5de0c309a1472da6") then
bFlag = true
end
if data.MsgType == 49 and bFlag then
--Sleep(sTime)
GetUserNick(CurrentWxid, data)
GetConn()
appid = data.Content:match([[<appid><!%[CDATA%[(.+)%]%]></appid>]])
if appid == nil then
appid = data.Content:match([[<appid>(.+)</appid>]])
end
title = data.Content:match([[<title><!%[CDATA%[(.+)%]%]></title>]])
if title == nil then
title = data.Content:match([[<title>(.+)集</title>]])
end
if title == nil then
title = data.Content:match([[<title>(.+)话</title>]])
end
url = data.Content:match([[<url><!%[CDATA%[(.+)%]%]></url>]])
if url == nil then
url = data.Content:match([[<url>(.+)</url>]])
end
--log.error("url %s", url)
if appid == "wxa75efa648b60994b" then --腾讯视频
appid = "wxca942bbff22e0e51"
if string.find(url, "m.v.qq.com") then
else
vid = data.Content:match("vid=(.+)%]%]></pagepath>")
url = string.format("https://v.qq.com/x/page/%s.html", vid)
end
end
if appid == "wxcd10170e55a1f55d" then --爱奇艺视频
appid = "wx2fab8a9063c8c6d0"
end
if appid == "wx5de0c309a1472da6" then --优酷
appid = "wx2fab8a9063c8c6d0"
--https://v.youku.com/v_show/id_XNDU0Mjc0NjA0MA%3D%3D.html?
if string.find(url, "v.youku.com") then
else
id = data.Content:match("videoId=(.+)&picUrl=")
url = string.format("https://v.youku.com/v_show/id_%s.html", id)
end
end
if appid == "wxd09e2d4fceafe6e3" then --芒果视频
appid = "wxbbc6e0adf8944632"
if string.find(url, "m.mgtv.com") then
else
--log.error("url %s", url)
--<pagepath><![CDATA[pages/player/player.html?id=9697951]]></pagepath>
id = data.Content:match("player.html%?id=(.+)%]%]></pagepath>")
url = string.format("https://www.mgtv.com/b/340679/%s.html", id)
end
end
if ok then
sqlstr = string.format([[select * from users_info where `Uid`= "%s" and `Gid`="%s"]], wxid, ToUserName)
res, err = c:query(sqlstr)
if #res == 0 then --说明不存在记录
sqlstr =
string.format(
[[INSERT INTO users_info (Uid,Gid,OpCode,SignTime,RealDays,SignDays,Balance,DiceTime,CreateTime)VALUES ("%s","%s",%d,%d,%d,%d,%d,0,%d)]],
wxid,
ToUserName,
12,
os.time(),
1,
1,
0,
os.time()
)
c:query(sqlstr) --插入邀请信息
GetUserNick(CurrentWxid, data)
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n首次开户成功获得积分10点]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
Sleep(1)
end
sqlstr = string.format([[select * from users_info where `Uid`= "%s" and `Gid`="%s"]], wxid, ToUserName)
res, err = c:query(sqlstr) --判断一下被邀请人是否存在 不存在则发红包奖励 排除重复进群退群
OpCode = tonumber(res[1].OpCode)
if OpCode > 0 then
--log.error("url2 %s", url)
OpCode = OpCode - 2 --每次解析-2分
SendJiXi(CurrentWxid, ToUserName, OpCode)
sqlstr =
string.format(
[[UPDATE `users_info` SET `OpCode` = %d WHERE `Uid` = "%s" and `Gid`="%s"]],
OpCode,
wxid,
ToUserName
)
c:query(sqlstr)
else --积分不足
log.error("url3 %s", url)
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n积分不足请做任务\n1⃣️ 每日签到获🉐️积分2-8/天\n2⃣️ 邀请好友进群获🉐️积分10/人]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
end
c.close(c)
end
end
end
--检测是否入狱
function GetSQLGame(checkWxid)
sqlstr = string.format([[select * from games_info where `Uid`= "%s" and `Gid`="%s"]], checkWxid, ToUserName)
res, err = c:query(sqlstr) --存在
if #res ~= 0 then
return res
end
return nil
end
--越狱
function OutYY(CurrentWxid, data)
GetUserNick(CurrentWxid, data)
resSQL = GetSQLGame(wxid) --发消息者
if resSQL ~= nil then
if tonumber(resSQL[1].IsIn) == 1 then
if tonumber(resSQL[1].InTime) - os.time() >= 0 then
maybe = GenRandInt(1, 100)
--local fdNick = GetWxidNick(CurrentWxid, atuserlist)
--print(maybe)
if 10 < maybe and maybe <= 20 then --入狱
local MyINTipsStr = {
"@%s\n[社会社会]哇塞竟然金刚🐺附体了,一破冲天,成功逃离💨了监狱",
"@%s\n[旺柴]辛辛苦苦挖了好半天🕳️地洞弄🉐️自己满头大汉,差点被👮发现吓得尿了裤子爬出洞来,成功逃离了监狱全靠一股仙气儿",
"@%s\n[哇]可能是越狱电影看多了,竟然凭着运气逃离了出来[耶]"
}
local str = string.format(MyINTipsStr[GenRandInt(1, 3)], Nick)
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
str
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
sqlstr =
string.format(
[[UPDATE `games_info` SET `IsIn` = %d ,`InTime` = %d WHERE `Uid` = "%s" and `Gid`="%s"]],
0,
0,
wxid,
ToUserName
)
c:query(sqlstr)
return 1
end
if tonumber(resSQL[1].InTime) - os.time() > 7200 * 3 then
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n[打脸][打脸]被拉入越狱黑名单[打脸][打脸]\n[打脸][打脸]运气太差3次都没成功[打脸][打脸]\n[打脸][打脸]剩余时间:%s]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick,
SubUnix(tonumber(resSQL[1].InTime), os.time())
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
sqlstr =
string.format(
[[UPDATE `games_info` SET `InTime` = InTime+ %d WHERE `Uid` = "%s" and `Gid`="%s"]],
7200,
wxid,
ToUserName
)
c:query(sqlstr)
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n[打脸]越狱失败,被巡逻👮一顿电炮罪加一等,剩余时间:%s]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick,
SubUnix(tonumber(resSQL[1].InTime) + 7200, os.time())
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
end
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n你不在监狱里啊?[捂脸]越狱是什么能吃吗?[吃瓜]]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n[惊讶]怎么你想上演越狱电影🎬吗,去去去这不适合你[再见]]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
--保释
function OutBS(CurrentWxid, data)
GetUserNick(CurrentWxid, data)
local atuserlist = data.MsgSource:match([[<atuserlist><!%[CDATA%[(.+)%]%]></atuserlist>]])
if atuserlist == nil then
atuserlist = data.MsgSource:match([[<atuserlist>(.+)</atuserlist>]])
end
local resSQL = GetSQLGame(wxid) --发消息者
if resSQL ~= nil then
if tonumber(resSQL[1].IsIn) == 1 then --自己在监狱不能保释别人
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n💔自身都难保还想保释别人?[旺柴]老实在监狱里给我待着吧]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
if tonumber(resSQL[1].IsInHp) == 1 then --自己在医院不能保释别人
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n💔在医院里的人都有妄想症?真是体残+智残+脑残还是先保自己吧[机智]\n[旺柴]老实在医院里给我好好养病吧!真是病都不轻]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
end
local resSQL = GetSQLGame(atuserlist) --获取好友
if resSQL ~= nil then
if tonumber(resSQL[1].IsIn) == 1 then --好友在监狱 可以保释
local myCode = GetSQLCode(wxid)
if myCode == nil then --黑户
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n💔你竟然是本群的黑户💔\n😭快回复签到试试😭]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
return 1
end
OpCode = tonumber(myCode[1].OpCode)
--查询一下自己的积分
if tonumber(resSQL[1].InTime) - os.time() > 7200 * 3 then --保费50
if OpCode < 50 then
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n😭你的积分不足50啊😭\n💔想从越狱黑名单里捞人可不是一件容易的事💔]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n[社会社会][社会社会]花费了巨额保费50保出了此人,可见二人关系不一样般[Emm]都说三对情侣两对基]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
--扣出自己积分
sqlstr =
string.format(
[[UPDATE `users_info` SET `OpCode` = OpCode - 50 WHERE `Uid` = "%s" and `Gid`="%s"]],
wxid,
ToUserName
)
c:query(sqlstr)
--设置对方正常状态
sqlstr =
string.format(
[[UPDATE `games_info` SET `IsIn` = %d ,`InTime` = %d WHERE `Uid` = "%s" and `Gid`="%s"]],
0,
0,
atuserlist,
ToUserName
)
c:query(sqlstr)
return 1
end
--保费30
if OpCode < 30 then
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n😭你的积分不足30啊😭\n💔穷光蛋还想做慈善家💔\n[机智]我看你是勇气可家吧[机智]]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n[加油]花费了30积分保释了对方、乐于助人也无常不是好事,希望他出狱后做个良好市民[机智]]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
--扣出自己积分
sqlstr =
string.format(
[[UPDATE `users_info` SET `OpCode` = OpCode - 30 WHERE `Uid` = "%s" and `Gid`="%s"]],
wxid,
ToUserName
)
c:query(sqlstr)
--设置对方正常状态
sqlstr =
string.format(
[[UPDATE `games_info` SET `IsIn` = %d ,`InTime` = %d WHERE `Uid` = "%s" and `Gid`="%s"]],
0,
0,
atuserlist,
ToUserName
)
c:query(sqlstr)
return 1
end
--好友不在监狱
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n你要被保释的对象不在监狱里,他早就改过自新了[拳头],某人一定会铭记在❤️]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n你要被保释的对象没有任何违规记录,已经被评选为本群的三好市民[好的]]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
--劫狱
function InJY(CurrentWxid, data)
GetUserNick(CurrentWxid, data)
local atuserlist = data.MsgSource:match([[<atuserlist><!%[CDATA%[(.+)%]%]></atuserlist>]])
if atuserlist == nil then
atuserlist = data.MsgSource:match([[<atuserlist>(.+)</atuserlist>]])
end
local resSQL = GetSQLGame(wxid) --发消息者
if resSQL ~= nil then
if tonumber(resSQL[1].IsIn) == 1 then --自己在监狱 不能劫狱
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n[机智]还想在监狱里劫狱?[打脸]这是要造反吗[打脸]谁给你勇气]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
end
local resSQL = GetSQLGame(atuserlist)
if resSQL ~= nil then
if tonumber(resSQL[1].IsIn) == 1 then --对方在监狱 可以劫狱
maybe = GenRandInt(1, 100)
if 50 < maybe and maybe <= 80 then --自己进了监狱
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n万万没想到劫狱被发现了👀,把自己搞进去了,二人在狱里团聚了😄\n刑期:%s]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick,
SubUnix(os.time() + 7200, os.time())
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
sqlstr =
string.format(
[[UPDATE `games_info` SET `IsIn` = %d ,`InTime` = %d WHERE `Uid` = "%s" and `Gid`="%s"]],
1,
os.time() + 7200,
wxid,
ToUserName
)
c:query(sqlstr)
return 1
end
if maybe < 30 then --劫狱成功
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n真是人品大爆发💥,竟然劫狱成功了,顺利将好友解救出来[耶]]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
sqlstr =
string.format(
[[UPDATE `games_info` SET `IsIn` = %d ,`InTime` = %d WHERE `Uid` = "%s" and `Gid`="%s"]],
0,
0,
atuserlist,
ToUserName
)
c:query(sqlstr)
return 1
end
if maybe > 80 then --劫狱没成功
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n[衰]好像什么都没发生一样,尽管没劫狱成功,自己却躲了一劫[汗]]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
end
return 1
end
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n你要被劫狱的对象不在监狱里,他早就改过自新了[拳头],某人一定会铭记在❤️]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n这么想劫狱啊[捂脸]动作电影看多了吧]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
--出狱
function OutCY(CurrentWxid, data)
GetUserNick(CurrentWxid, data)
resSQL = GetSQLGame(wxid) --发消息者
if resSQL ~= nil then
if tonumber(resSQL[1].IsIn) == 1 then
if tonumber(resSQL[1].InTime) - os.time() >= 0 then
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n[打脸]正在监狱服役中,🈲️止任何娱乐活动,剩余时间:%s]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick,
SubUnix(tonumber(resSQL[1].InTime), os.time())
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
sqlstr =
string.format(
[[UPDATE `games_info` SET `IsIn` = %d ,`InTime` = %d WHERE `Uid` = "%s" and `Gid`="%s"]],
0,
0,
wxid,
ToUserName
)
c:query(sqlstr)
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n❤️出狱成功,[机智]老老实实做个良好市民吧[加油]]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n你不在监狱里啊?[捂脸]这是来探亲来了吗]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n没有任何违规记录,有望评选本群的三好市民[拳头]]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
--出院
function OutHP(CurrentWxid, data)
GetUserNick(CurrentWxid, data)
resSQL = GetSQLGame(wxid) --发消息者
if resSQL ~= nil then
if tonumber(resSQL[1].IsInHp) == 1 then
if tonumber(resSQL[1].HpTime) - os.time() >= 0 then
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n[打脸]正在医院康复中,禁止多人游戏等👥运动,剩余时间:%s]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick,
SubUnix(tonumber(resSQL[1].HpTime), os.time())
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
sqlstr =
string.format(
[[UPDATE `games_info` SET `IsInHp` = %d ,`HpTime` = %d WHERE `Uid` = "%s" and `Gid`="%s"]],
0,
0,
wxid,
ToUserName
)
c:query(sqlstr)
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n❤️出院成功,下次做什么事都要认真点避免意外伤害😯]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n早就痊愈出院了,😯,没事来医院瞎溜达什么?]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n精神病院😯还没有你这位病号啊?去去去,一边去[捂脸]]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
--获取用户积分等信息
function GetSQLCode(checkWxid)
sqlstr = string.format([[select * from users_info where `Uid`= "%s" and `Gid`="%s"]], checkWxid, ToUserName)
res, err = c:query(sqlstr) --存在
if #res ~= 0 then
return res
end -- 不存在
return nil
end
function CheckGame(CurrentWxid, data)
local atuserlist = data.MsgSource:match([[<atuserlist><!%[CDATA%[(.+)%]%]></atuserlist>]])
if atuserlist == nil then
atuserlist = data.MsgSource:match([[<atuserlist>(.+)</atuserlist>]])
end
GetUserNick(CurrentWxid, data)
local resUser = GetSQLCode(wxid)
if resUser == nil then
XmlStr =
string.format(
'<appmsg appid="" sdkver="0"><title><![CDATA[@%s\n💔你竟然是本群的黑户💔\n😭快回复签到试试😭]]></title><des></des><action></action><type>57</type><showtype>0</showtype><soundtype>0</soundtype><mediatagname></mediatagname><messageext></messageext><messageaction></messageaction><content></content><contentattr>0</contentattr><url></url><lowurl></lowurl><dataurl></dataurl><lowdataurl></lowdataurl><songalbumurl></songalbumurl><songlyric></songlyric><appattach><totallen>0</totallen><attachid></attachid><emoticonmd5></emoticonmd5><fileext></fileext><cdnthumbaeskey></cdnthumbaeskey><aeskey></aeskey></appattach><extinfo></extinfo><sourceusername></sourceusername><sourcedisplayname></sourcedisplayname><thumburl></thumburl><md5></md5><statextstr></statextstr><directshare>0</directshare><refermsg><type>1</type><svrid>413279805977715132</svrid><fromusr></fromusr><chatusr></chatusr><displayname>消息来自:IPhone 12 X Max 1024GB📱</displayname><content>😄</content><msgsource></msgsource></refermsg></appmsg><fromusername></fromusername>',
Nick
)
Api.SendAppMsg(CurrentWxid, {ToUserName = ToUserName, MsgType = 57, Content = XmlStr})
return 1
end
local resUser = GetSQLCode(atuserlist)
if resUser == nil then