Advertisement
Guest User

Untitled

a guest
Feb 8th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 3.58 KB | None | 0 0
  1. ;ReadLine3.au3
  2. #include <File.au3>
  3. #include <FileConstants.au3>
  4.  
  5. ; Setup Guide
  6. ; 1. Setup Configuration below
  7. ; 2. Setup UI - Download uifile
  8. ;       we need to fix that UI Combat Icon.
  9. ;       https://1drv.ms/u/s!ApRBDeRyfdy7gdcNKXrbyn9_R1UTtg
  10. ;       Download that into your ui folder that you use.
  11. ;       Changes In Combat icon to Red Box instead of Shield graphic
  12. ; 3. Setup UI - Find the position of that Combat Icon
  13. ;       Start -> AutoIt v3 -> AutoIt v3 Window Info -> Click and drag Target Icon onto your Shield graphic we just patched.
  14. ;       Update $xIcon, $yIcon (position of your In-Combat icon
  15.  
  16. ; ---------- Start CONFIGURATION ------------
  17. $s_EQPath           = "D:\Games\Everquest\"
  18. $s_CharName         = "Fiido"                   ; not implemented
  19. $s_ServerName       = "coirnav"
  20.  
  21. $xIcon              = 2740;180
  22. $yIcon              = 50
  23.  
  24.  
  25. ; This word will set AE stuns to start
  26. $s_StunTrigger      = "STUN NOW"
  27. $s_GateTrigger      = "Gate GoGoGo"
  28. ; Blank->Anyone or Define Trigger Person
  29. $s_TriggerPerson    = ""
  30. ; Wait <X> seconds to start
  31. $s_TriggerDelay     = 5
  32. ; Do at least <X> stuns before checking for in-combat
  33. $s_FinishDelay      = 3
  34.  
  35. ; Enchanter Hotkeys
  36. $s_ColorShift       = "!1"      ; e.g. !1 = Alt+1
  37. $s_ColorSkew        = "!2"      ; e.g. {NUMPAD1}
  38. $s_ColorSlant       = "!3"      ; e.g. 1    = 1
  39. $s_ColorFlux        = "!4"      ; e.g. ^1   = Ctrl+1
  40.  
  41. ; Parse the Log every X millisec
  42. ;   lower it if you want to check log more often
  43. ;   raise it if it's lagging you
  44. $s_Delay            = 10
  45. ; ---------- End CONFIGURATION ------------
  46.  
  47.  
  48. ; ---------- NOT CONFIGURATION ----------
  49. Local $s_FileName   = $s_EQPath & "Logs\eqlog_" & $s_CharName & "_" & $s_ServerName & ".txt"
  50. Local $inCombat     = False
  51. Local $stunContinue = True
  52.  
  53. HotKeySet("{ESC}", "HotKeyPressed")
  54.  
  55. ; Open the File
  56. $h_File = FileOpen( $s_Filename )
  57. FileSetPos( $h_File, 0, 2 )
  58.  
  59. ; ---------- Main Loop ----------
  60. While 1
  61.    ; Parse Chat
  62.    WaitAndParse()
  63.    ; Start if done waiting
  64.    StartStun()
  65. WEnd
  66.  
  67. ; ---------- Phase 1 : Wait for a trigger from Chat ----------
  68. Func WaitAndParse()
  69.    While 1
  70.       $line = FileReadLine( $h_File )
  71.       If $line <> "" Then
  72.          ConsoleWrite( $line & @LF )
  73.          If StringInStr( $line, $s_StunTrigger )>0 Then
  74.             Return 1
  75.          EndIf
  76.       EndIf
  77.       Sleep( $s_Delay )
  78.    WEnd
  79. EndFunc
  80.  
  81.  
  82. Func StartStun()
  83.    ; variable
  84.    $stunContinue = True
  85.    $s_FinishDelay2 = $s_FinishDelay
  86.  
  87.    ; enchanter delay
  88.    If $s_TriggerDelay > 0 Then
  89.       Sleep( $s_TriggerDelay * 1000 )
  90.    EndIf
  91.  
  92.    While $stunContinue
  93.       SendStun( "!1", 9 )
  94.       If CheckStop()=1 Then
  95.          $stunContinue = False
  96.          ContinueLoop
  97.       EndIf
  98.  
  99.       SendStun( "!2", 15 )
  100.       If CheckStop()=1 Then
  101.          $stunContinue = False
  102.          ContinueLoop
  103.       EndIf
  104.  
  105.       SendStun( "!3", 14 )
  106.       If CheckStop()=1 Then
  107.          $stunContinue = False
  108.          ContinueLoop
  109.       EndIf
  110.    WEnd
  111. EndFunc
  112.  
  113. Func HotKeyPressed()
  114.    Switch @HotKeyPressed ; The last hotkey pressed.
  115.       Case "{ESC}" ; String is the {ESC} hotkey.
  116.       Exit
  117.    EndSwitch
  118. EndFunc   ;==>HotKeyPressed
  119.  
  120. Func CheckStop()
  121.    If Not $inCombat Then
  122.       ; Delay counter
  123.       If $s_FinishDelay2 > 0 Then
  124.          $s_FinishDelay2 = $s_FinishDelay2 - 1
  125.          Return 0
  126.       Else
  127.          ; Combat check
  128.          If PixelGetColor( $xIcon, $yIcon ) = 0xFF0000 Then
  129.             $inCombat = True
  130.          Else
  131.             Sleep( 2000 )
  132.             Send( "x" )
  133.             Return 1
  134.          EndIf
  135.       EndIf
  136.    Else
  137.       If PixelGetColor( $xIcon, $yIcon ) <> 0xFF0000 Then
  138.          Sleep( 2000 )
  139.          Send( "x" )
  140.          Return 1
  141.       EndIf
  142.    EndIf
  143.    Return 0
  144. EndFunc
  145.  
  146. ; $num = duration
  147. Func SendStun( $key, $num )
  148.    WinActivate( "EverQuest" )
  149.    $times = Int($num * 1000 / 500)
  150.    For $i = 1 to $num
  151.       Send( $key )
  152.       Sleep( 500 )
  153.    Next
  154. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement