Advertisement
EiEich

Untitled

Nov 1st, 2018
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. #Include samp.ahk
  2. #SingleInstance force
  3. ComObjError(False)
  4. hObject := ComObjCreate("WinHttp.WinHttpRequest.5.1")
  5. F10::
  6. Loop, 10
  7. {
  8. GetChatLine(A_index-1, c%A_Index%)
  9. If c%A_Index% contains getip
  10. {
  11. lastchatlog := c%A_index%
  12. break
  13. }
  14. }
  15. If (RegExMatch(lastchatlog, "\] \[(?<name>[A-z_]+)\] IP\: (?<fIP>[0-9.]+) \| REG IP\: (?<sIP>[0-9.]+)", Out_))
  16. {
  17. hObject.Open("GET", "http://ip-api.com/json/" Out_fIP "?lang=ru")
  18. hObject.Send
  19. firstInfo := hObject.ResponseText
  20. hObject.Open("Get", "http://ip-api.com/json/" Out_sIP "?lang=ru")
  21. hObject.Send
  22. secondInfo := hObject.ResponseText
  23. }
  24. htmldoc := ComObjCreate("htmlfile")
  25. Script := htmldoc.Script
  26. Script.execScript(" ", "JScript")
  27. firstInfo := Script.eval("(" . firstInfo . ")")
  28. secondInfo := Script.eval("(" . secondInfo . ")")
  29. AddChatMessage("Страна регистрации: " firstInfo.country )
  30. AddChatMessage("Город регистрации: " firstInfo.city )
  31. AddChatMessage("Провайдер на момент регистрации: " firstInfo.isp )
  32. AddChatMessage("Текущая страна: " secondInfo.country )
  33. AddChatMessage("Текущий город: " secondInfo.city )
  34. AddChatMessage("Текущий провайдер: " secondInfo.isp )
  35. return
  36. unBlockInput() {
  37. if(!checkHandles())
  38. return false
  39. VarSetCapacity(nop, 2, 0)
  40. dwFunc := dwSAMP + FUNC_SAMP_SENDSAY
  41. NumPut(0xA164,nop,0,"Short")
  42. writeRaw(hGTA, dwFunc, &nop, 2)
  43. dwFunc := dwSAMP + FUNC_SAMP_SENDCMD
  44. writeRaw(hGTA, dwFunc, &nop, 2)
  45.  
  46. return true
  47. }
  48.  
  49. blockInput() {
  50. if(!checkHandles())
  51. return false
  52. VarSetCapacity(nop, 2, 0)
  53. dwFunc := dwSAMP + FUNC_SAMP_SENDSAY
  54. NumPut(0x04C2,nop,0,"Short")
  55. writeRaw(hGTA, dwFunc, &nop, 2)
  56. dwFunc := dwSAMP + FUNC_SAMP_SENDCMD
  57. writeRaw(hGTA, dwFunc, &nop, 2)
  58.  
  59. return true
  60. }
  61. ReadChatInput() {
  62. If (!checkHandles())
  63. return false
  64. blockInput()
  65. Sleep, 170
  66. dwAddress := dwSAMP + 0x12D8F8
  67. chatInput := readString(hGTA, dwAddress, 256)
  68. Sleep, 30
  69. unBlockInput()
  70. return chatInput
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement