Advertisement
RyzaJr

[AHK] SWBF2 Player List

Dec 30th, 2015
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; This AHK script will type /players into the Chat Reader and Admin Commander.exe every 10 minutes.
  2.  
  3. #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
  4. #Warn  ; Enable warnings to assist with detecting common errors.
  5. SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
  6. SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
  7. #singleinstance force   ;Forces the script to be replaced by the new one if u try to re run a new instance
  8.  
  9. #NoTrayIcon
  10. #Persistent
  11. SetTitleMatchMode, 2
  12.  
  13.  
  14. IP := "127.0.0.1"
  15. PORT := "4658"
  16. PASS := "YOURPASS"
  17. PROCESS := "ahk_exe Chat Reader and Admin Commander.exe"
  18. PROCESS_DIR := "C:\Misc\Programs\Chat Reader and Admin Commander"
  19. ADMIN_COMMAND := "/players"
  20.  
  21. IfWinNotExist %PROCESS%
  22. {
  23.     Start()
  24.     Sleep 5000
  25.     Command()
  26. }
  27. else
  28. {
  29.     Command()
  30. }
  31. exit
  32.    
  33. Start()
  34. {
  35.     global
  36.     Run, Chat Reader and Admin Commander.exe, %PROCESS_DIR%
  37.     Sleep 5000
  38.     ControlSend, Edit2, %IP%, %PROCESS%
  39.     ControlSend, Edit3, %PORT%, %PROCESS%
  40.     ControlSend, Edit4, %PASS%, %PROCESS%
  41.     Sleep 2000
  42.     ControlClick, Button1, %PROCESS%
  43.     return
  44. }
  45.    
  46. Command()
  47. {
  48.     global
  49.     PlayerList:
  50.     IfWinExist %PROCESS%
  51.     {
  52.         Clipboard := ADMIN_COMMAND
  53.         Sleep 100
  54.         ControlSend, Edit6, ^v, %PROCESS%
  55.         ControlClick, Button3, %PROCESS%
  56.     }
  57.     SetTimer, PlayerList, 600000
  58.     return
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement