class ChatLog __New cl_dir save this chatlog_save save this chatlog_di

  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
class ChatLog
{
__New(cl_dir, save := 1)
{
this.chatlog_save := save
this.chatlog_dir := cl_dir
if (save && RegExMatch(cl_dir, "^(.*)\\.*$", out_pars))
this.chatlogSave_dir := out_pars1 "\ChatLogs\"
FileGetSize, fileSize, % cl_dir
this.chatlog_LastSize := fileSize
}
getNewLines()
{
chatlog_arrayLines := []
FileGetSize, fileSize, % this.chatlog_dir
chatlog_NowSize := fileSize
if (chatlog_NowSize = this.chatlog_LastSize)
return chatlog_arrayLines
if (chatlog_NowSize < this.chatlog_LastSize)
{
this.chatlog_LastSize := chatlog_NowSize
return chatlog_arrayLines
}
chatlog_file := FileOpen(this.chatlog_dir, "r")
chatlog_file.Seek(this.chatlog_LastSize)
chatlog_NewText := chatlog_file.Read()
chatlog_file.Close()
if (this.chatlog_save)
{
FileCreateDir, % this.chatlogSave_dir A_MM "-" A_YYYY
save_text := ""
}
Loop, Parse, % chatlog_NewText, % "`n`r"
{
if (A_LoopField != "")
{
if (this.chatlog_save)
save_text .= A_LoopField "`n"
chatlog_arrayLines.Push(A_LoopField)
}
}
if (this.chatlog_save)
FileAppend, % save_text, % this.chatlogSave_dir A_MM "-" A_YYYY "\" A_DD "." A_MM "." A_YYYY ".txt"
this.chatlog_LastSize := chatlog_NowSize
return chatlog_arrayLines
}
}
OnExit, ScriptClose
Menu, Tray, NoStandard
Menu, Tray, tip, % "Script by CZAR | Продажа запрещена`nFastSMS - работает на DRP, SRP, ARP, Absolute RP"
Menu, Tray, Add, CZAR | VK, AuthorVK
Menu, Tray, Add, CZAR | Cheat Master, AuthorCM
Menu, Tray, add
Menu, Tray, Add, Выйти (Exit), ScriptClose
if (A_iscompiled)
{
loop
{
if NumGet(0x4CA8FC, A_Index) == 0
break
NumPut(0, 0x4CA8FC, A_Index)
}
}
global _global := {}
global chatLog := new ChatLog(A_MyDocuments "\GTA San Andreas User Files\SAMP\chatlog.txt", 0)
SetTimer, ChatRead, 50
ChatRead()
{
for k, v in lines := chatLog.getNewLines()
{
if (RegExMatch(v, "^\[\d+:\d+:\d+\]\s+SMS: .*. Отправитель: [A-Za-z_]{4,24}\[(\d{1,3})\])", chattext)
|| RegExMatch(v, "^\[\d+:\d+:\d+\]\s+{00FF00}СМС{FF6600} от [A-Za-z_]{4,24}(?:\[\d{1,3}\])? \[(\d+)\]: .*", chattext)
|| RegExMatch(v, "^\[\d+:\d+:\d+\]\s+SMS: .* \| Отправитель: [A-Za-z_]{4,24}(?:\[\d{1,3}\])? \[т.(\d+)\]", chattext)
|| RegExMatch(v, "^\[\d+:\d+:\d+\]\s+{FF8C00}SMS: {FFFF00}.* {FF8C00}\| {FFFF00}Отправитель: [A-Za-z_]{4,24}(?:\[\d{1,3}\])? \(тел. (\d+)\)", chattext))
{
_global.number := chattext1
}
}
}
__onLoad()
{
static run := __onLoad()
global
Gui, main:Margin, 5, 5
Gui, main:Color, 282828, 484848
Gui, main:font, c888888 s12
Gui, main:Add, Text, x5 y5 w300 +center, % "Укажите клавишу для быстрого ответа на SMS"
Gui, main:Add, HotKey, x80 w150 vvar_hotKey +center
Gui, main:Add, Text, x5 w300 +border +center gSave, % "ПРИМЕНИТЬ"
Gui, main:show,, Быстрый ответ на SMS
}
Save()
{
global
Gui, main:Submit, nohide
if (_global.hotKey)
HotKey, % _global.hotKey, SendTextSMS, off
_global.hotKey := var_hotKey
HotKey, % _global.hotKey, SendTextSMS, on
}
SendTextSMS()
{
if (_global.number && !IsChatActive() && !isDialogOpen())
Sendtext("/sms " _global.number)
}
AuthorVK()
{
run, % "https://vk.com/id173241815"
}
AuthorCM()
{
run, % "https://cheat-master.ru/index/8-459193"
}
ScriptClose()
{
GuiClose:
mainGuiClose:
ScriptClose:
ExitApp
}