RellaX |
Дата: Понедельник, 22.08.2016, 13:29 | Сообщение # 3
|
Боец
Сообщений: 282
Статус: Offline
|
Разбирайся сам: (Скрипт не мой, автора не знаю)
Код StringCaseSense, Locale Connected := 0 GN3Im := 0 GN1Im := 0 global usdacha := 0 global uprov := 0 global varnext := 0 script_version := "1.4" url_script := "https://drive.google.com/open?id=0BwfYrU5QBG26VUY3U09QbWltNGc" url_version := "https://drive.google.com/uc?id=0BwfYrU5QBG26ZWRDaUFWV29LVEE&export=download" SetTimer GetLastVersionSoftUp, 200 IniRead, EditN1, config.ini, Setup, GNews31, [Фракция] | Строка 1 IniRead, EditN2, config.ini, Setup, GNews32, [Фракция] | Строка 2 IniRead, EditN3, config.ini, Setup, GNews33, [Фракция] | Строка 3 IniRead, EditGN1, config.ini, Setup, GNews1, [Фракция] | Короткая строка IniRead, IntGN3, config.ini, Setup, GNews3Int, 10 IniRead, IntGN1, config.ini, Setup, GNews1Int, 3 IniRead, IntBstr, config.ini, Setup, GNewsIntBstr, 1000 Gui, Add, Button, x60 y300 w80 h43 gGO Default, Управление Gui, Add, Button, x400 y300 w80 h43 gAbout, Об авторе Gui, Add, Text, x10 y10, Gnews 3 строки: Gui, Add, Text, x10 y40, Строка 1 Gui, Add, Edit, x80 y40 w430 vEditN1, %EditN1% Gui, Add, Text, x10 y70 , Строка 2 Gui, Add, Edit, x80 y70 w430 vEditN2, %EditN2% Gui, Add, Text, x10 y100 , Строка 3 Gui, Add, Edit, x80 y100 w430 vEditN3, %EditN3% Gui, Add, Text, x10 y140, Gnews 1 строка: Gui, Add, Edit, x80 y160 w430 vEditGN1, %EditGN1% Gui, Add, Text, x310 y200 h20 , Автоматическое время подачи Gui, Add, Text, x310 y215 h20 , Часы: Минуты: Cекунды: Gui, Add, Edit, x310 y230 w30 h20 vtHour number, %A_Hour% Gui, Add, Edit, x350 y230 w30 h20 vtMin number, %A_Min% Gui, Add, Edit, x390 y230 w30 h20 vtSec number, 00 Gui, Add, Text, x10 y200, Интервал между 3 строками: Gui, Add, Text, x250 y200, (мин.) Gui, Add, Edit, x200 y200 w40 vIntGN3 number, %IntGN3% Gui, Add, Text, x10 y230, Интервал между 1 строкой: Gui, Add, Text, x250 y230, (мин.) Gui, Add, Edit, x200 y230 w40 vIntGN1 number, %IntGN1% Gui, Add, Text, x10 y260, Интервал между строками: Gui, Add, Text, x250 y260, (мсек.) Gui, Add, Edit, x200 y260 w40 vIntBstr number, %IntBstr% Gui, Show, w530 h370, Leader + Gnews Diamond RP %script_version% FileCLog:=% A_MyDocuments "\GTA San Andreas User Files\SAMP\chatlog.txt" Stringhelp := "Напоминалка и автоматическая подача GNews для Diamond RP`n`nF1 - Включение\отключение автоматического GNews`n Ctrl + F1 - Подача 1 строки `n Ctrl + F2 - Подача 3 строк" loop { lastline := GetNewLine(FileCLog) if RegExMatch( lastline, "Connected. Joining the game\.\.\.") Connected := 0 if RegExMatch( lastline, "i).*\[Гос\.Новости\] \w+ \[\d+\]:") { Gui, Submit, NoHide IntGN1 := %IntGN1% * 60 * 1000 IntGN3 := %IntGN3% * 60 * 1000 STime:=% A_Hour ""A_Min ""A_Sec if (NHPTime<STime) { NHPTime:=% A_Hour ""A_Min ""A_Sec NHPTime:=NHPTime+10 GNewsRep:=1 SetTimer, Updategnews, %IntGN1% } else { GNewsRep:=GNewsRep + 1 if (GNewsRep >= 3) SetTimer, Updategnews3, %IntGN3% } if (GNewsRep >= 3) addChatMessage("{FFff00}Таймер GNews на 3 строки запущен.") else if (GNewsRep = 1) addChatMessage("{aaff00}Таймер GNews на 1 строку запущен.") } if !Connected { Gui, Submit, NoHide IntGN1 := IntGN1 * 60 * 1000 IntGN3 := IntGN3 * 60 * 1000 if RegExMatch( lastline, "i).*Добро пожаловать на Diamond Role Play!") or lastline { addChatMessage("Таймеры GNews запущены!") Connected := 1 SetTimer, Updategnews3, %IntGN3% SetTimer, Updategnews, %IntGN1% } } if (varnext = 3) and (GN1Im = 1) if (A_Hour = tHour) and (A_Min => tMin) and (A_Sec >= tSec) { Gui, Submit, NoHide SendChat("/time") SendChat("/gnews " EditGN1) ustav := 0 Send {F8} GN1Im := 0 } if (varnext = 2) and (GN3Im = 1) if (A_Hour = tHour) and (A_Min => tMin) and (A_Sec >= tSec) { Gui, Submit, NoHide SendChat("/time") SendChat("/gnews " EditN1) Sleep %IntBstr% SendChat("/gnews " EditN2) Sleep %IntBstr% SendChat("/gnews " EditN3) Send {F8} Usdacha := 0 GN3Im := 0 } } UpdateGnews3: Gui, Submit, NoHide if !GN3Im { addChatMessage("{FF0000}3 Строки {00FF00} GNews Свободна") GN3Im := 1 } if Usdacha or GN3Im { if (varnext = 0) { SendChat("/time") SendChat("/gnews " EditN1) Sleep %IntBstr% SendChat("/gnews " EditN2) Sleep %IntBstr% SendChat("/gnews " EditN3) Send {F8} Usdacha := 0 GN3Im := 0 } else if (varnext = 2) if (A_Hour = tHour) and (A_Min => tMin) and (A_Sec >= tSec) { SendChat("/time") SendChat("/gnews " EditN1) Sleep %IntBstr% SendChat("/gnews " EditN2) Sleep %IntBstr% SendChat("/gnews " EditN3) Send {F8} Usdacha := 0 GN3Im := 0 } } SetTimer, Updategnews3, Off return UpdateGnews: Gui, Submit, NoHide if !GN1Im { addChatMessage("{FF0000}1 Строка {00FFFF} GNews Свободна") GN1Im := 1 } if uprov or GN1Im { if (varnext = 1) { SendChat("/time") SendChat("/gnews " EditGN1) ustav := 0 Send {F8} GN1Im := 0 } else if (varnext = 3) if (A_Hour = tHour) and (A_Min => tMin) and (A_Sec >= tSec) { SendChat("/time") SendChat("/gnews " EditGN1) ustav := 0 Send {F8} GN1Im := 0 } } SetTimer, Updategnews, Off return ^F1:: GN1Im := 1 Gosub, UpdateGnews return ^F2:: GN3Im := 1 Gosub, UpdateGnews3 Return F1:: Gui, Submit, NoHide if ustav { if (usdacha = 1) if (varnext = 0) or (varnext = 2) { addChatMessage("Подача 3 строки: Выключена") usdacha:=0 } if (uprov = 1) if (varnext = 1) or (varnext = 3) { uprov:=0 addChatMessage("Подача 1 строки: Выключена") } ustav := 0 if (varnext < 3) { varnext +=1 } else varnext :=0 } else { if (usdacha = 0) and (varnext = 0) { addChatMessage("Автоматическая подача 3 строки по интервалу: {FFAA00}Включена") usdacha:=1 } if (uprov = 0) and (varnext = 1) { uprov:=1 addChatMessage("Автоматическая подача 1 строки по интервалу: {FFAA00}Включена") } if (usdacha = 0) and (varnext = 2) { addChatMessage("Автоматическая подача 3 строки по времени (Не раньше " tHour ":" tMin ":" tSec "): {FFAA00}Включена") usdacha:=1 } if (uprov = 0) and (varnext = 3) { uprov:=1 addChatMessage("Автоматическая подача 1 строки по времени (Не раньше " tHour ":" tMin ":" tSec "): {FFAA00}Включена") } ustav := 1 } return GO: MsgBox, 48,,%Stringhelp% return About: Gui, 2:Add, Text,,Другие полезные скрипты для Diamond RP: UrlAHKLinks := "https://drive.google.com/uc?id=0BwfYrU5QBG26UGRpSVllRHh3U1U&export=download" URLDownloadToFile, %UrlAHKLinks%, %A_Temp%/UrlAHKLinks Loop, read, %A_Temp%/UrlAHKLinks { if A_LoopReadLine Gui, 2:Add, Link,,%A_LoopReadLine% } Gui, 2:Add, Text,,Версия %script_version% Gui, 2:Add, Text,, By Godarck Gui, 2:Show return GuiClose: Gui, Submit, NoHide IniWrite, %EditN1%, config.ini, Setup, GNews31 IniWrite, %EditN2%, config.ini, Setup, GNews32 IniWrite, %EditN3%, config.ini, Setup, GNews33 IniWrite, %EditGN1%, config.ini, Setup, GNews1 IniWrite, %IntGN3%, config.ini, Setup, GNews3Int IniWrite, %IntGN1%, config.ini, Setup, GNews1Int IniWrite, %IntBstr%, config.ini, Setup, GNewsIntBstr MsgBox, 48, Успешно, Настройки сохранены. ExitApp return GetNewLine(filename) { static old static new if !old { FileGetSize, old, %filename% new := old } while old = new { sleep 100 FileGetSize, new, %filename% } old := new Loop, read, %filename% if A_LoopReadLine { global lastline11:= last last := A_LoopReadLine } return last } GetLastVersionSoftUp: URLDownloadToFile, %url_version%, %A_Temp%/79124 FileRead, Last_Version, %A_Temp%/79124 FileDelete, %A_Temp%/79124 if (script_version < last_version) { MsgBox, 4 ,Новая версия, Обнаружена новая версия программы! %last_version%`nНажмите "Yes" для перехода к скачиванию. IfMsgBox Yes { Run, %url_script% ExitApp } } SetTimer GetLastVersionSoftUp,off return
https://vk.com/zatkap
|
|
|
|