Advertisement
Guest User

Untitled

a guest
May 29th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. :O?:/copstats::
  2. myarrests := 0
  3. doublearrests := 0
  4. kills := 0
  5. licenses := 0
  6. drugsReceived := 0
  7. drugsDelivered := 0
  8. username := "Lewis_Flow"
  9. FileRead, log, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog\weeks\%A_YWeek%.log
  10. if WinExist("GTA:SA:MP")
  11. {
  12.     FileRead, chatlog, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt
  13.     StringReplace, chatlog, chatlog, `r`n, `n, All
  14.     log := log chatlog
  15. }
  16. log := StrSplit(log, "`n")
  17. for i, el in log
  18. {
  19.     if InStr(el, "[ARREST]", true)
  20.     {
  21.         if RegExMatch(el, "^\[\d{2}:\d{2}:\d{2}\] \*\[ARREST\] Офицер " username " посадил\(а\) на нары .*? \(срок\: \d+ мин\)")
  22.         {
  23.             myarrests++
  24.         }
  25.         if RegExMatch(el, "^\[\d{2}:\d{2}:\d{2}\] \*\[ARREST\] Офицеры (.*?) и (.*?) посадили на нары .*? \(срок\: \d+ мин\)", match)
  26.         {
  27.             if (match1 == username || match2 == username)
  28.             {
  29.                 doublearrests++
  30.             }
  31.         }
  32.     }
  33.     if InStr(el, "арестован и посажен", true)
  34.     {
  35.         if RegExMatch(el, "^\[\d{2}:\d{2}:\d{2}\] \* Преступник .*? арестован и посажен на \d+ секунд\. Вы получили \$\d+\.")
  36.         {
  37.             kills++
  38.         }
  39.     }
  40.     if InStr(el, "[LIC]", true)
  41.     {
  42.         if RegExMatch(el, "^\[\d{2}:\d{2}:\d{2}\] \* \[LIC\] .* " username " изъял\(а\) .* у .*")
  43.         {
  44.             licenses++
  45.         }
  46.     }
  47.     if InStr(el, "[DRUGS]", true)
  48.     {
  49.         if RegExMatch(el, "^\[\d{2}:\d{2}:\d{2}\] \[DRUGS\] Сотрудник FBI " username " сдал\(а\) конфискованные наркотики \((.*) гр\)\.", match)
  50.         {
  51.             t := match1
  52.             t += 0
  53.             drugsDelivered += t
  54.         }
  55.     }
  56.     if InStr(el, "Вы конфисковали", true)
  57.     {
  58.         if RegExMatch(el, "^\[\d{2}:\d{2}:\d{2}\] \* Вы конфисковали (.*?)г всех наркотиков у .*?\[\d+\]\. Доставьте конфискат в офис FBI\.", match)
  59.         {
  60.             t := match1
  61.             t += 0
  62.             drugsReceived += t
  63.         }
  64.     }
  65. }
  66. addBindMessage(COLOR_GREEN, "Статистика за " A_YWeek ":")
  67. addBindMessage(COLOR_WHITE, "Аресты(свои): " COLOR_ORANGE myarrests)
  68. addBindMessage(COLOR_WHITE, "Аресты(с напарниками): " COLOR_ORANGE doublearrests)
  69. addBindMessage(COLOR_WHITE, "Аресты(всего): " COLOR_ORANGE myarrests + doublearrests)
  70. addBindMessage(COLOR_WHITE, "НонРП аресты: " COLOR_ORANGE kills)
  71. addBindMessage(COLOR_WHITE, "Наркотики: " COLOR_ORANGE drugsDelivered COLOR_WHITE " / " COLOR_ORANGE drugsReceived)
  72. addBindMessage(COLOR_WHITE, "Лицензии: " COLOR_ORANGE licenses)
  73. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement