Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ### Environment setup (dont touch this) ###
- #SingleInstance,Force
- #MaxThreadsPerHotkey 2
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- ; ### Variables ###
- ;Ray Script
- ;Set the number of rays you have here
- num_rays = 6
- ;Set your binds here
- k_1 = +{f11} ;Insect Swarm
- k_2 = +{f8} ;Unholy Caress
- k_3 = +{f9} ;Dragonbreath
- k_4 = +{f10} ;Frostbite
- k_5 = +{f7} ;Impale
- k_6 = +{f12} ;Lightening Bolt
- ;Tweak cooldowns here
- cd_1 = 15000 ;Insect Swarm
- cd_2 = 15000 ;Unholy Caress
- cd_3 = 15000 ;Dragonbreath
- cd_4 = 9000 ;Frostbite
- cd_5 = 6500 ;Impale
- cd_6 = 9000 ;Lightening Bolt
- ;Set ray priority here, 1 being highest, 6 being lowest
- p_1 = 5 ;Insect Swarm
- p_2 = 2 ;Unholy Caress
- p_3 = 3 ;Dragonbreath
- p_4 = 4 ;Frostbite
- p_5 = 1 ;Impale
- p_6 = 6 ;Lightening Bolt
- ;Initializes ray availability array to 1 (off cooldown)
- While A_Index <= num_rays
- {
- r_%A_Index% = 1
- }
- ; ### Utils ###
- isMouseShown()
- {
- InfoStruct := ""
- StructSize := A_PtrSize + 16
- VarSetCapacity(InfoStruct, StructSize)
- NumPut(StructSize, InfoStruct)
- DllCall("GetCursorInfo", UInt, &InfoStruct)
- Result := NumGet(InfoStruct, 8)
- if Result
- return 1
- else
- return 0
- }
- ; ### Macro Code ###
- #If !isMouseShown() and #If WinActive( "Darkfall Online" )
- ;Set your ray HotKey here (currently set to e)
- e::
- cur_ray := RayLogic(cur_ray, cur_key, cur_cool)
- Send , %cur_key%
- Send e
- While (ErrorLevel = 1)
- {
- If (GetKeyState("W", "P") = 1)
- Return
- KeyWait, F, T.1
- }
- r_%cur_ray% = 0
- neg_cur_cool := -cur_cool
- SetTimer, %cur_ray%, %neg_cur_cool%
- Return
- ;Subroutine group to reset ray cds
- 1:
- 2:
- 3:
- 4:
- 5:
- 6:
- r_%A_ThisLabel% = 1
- Return
- RayLogic(cur_ray, ByRef cur_key, ByRef cur_cool)
- {
- global
- /*Initiates cur_ray to your highest priority ray
- in the case of all rays being off cooldown
- */
- cur_ray := p_1
- /*Assigns the value of cur_ray to the first available
- ray according to priority
- */
- While A_Index <= num_rays
- {
- ray_number := p_%A_Index%
- if (r_%ray_number% = 1)
- {
- cur_ray := ray_number
- Break
- }
- }
- ;Sets the ray's corresponding key and cooldown
- cur_key := k_%cur_ray%
- cur_cool := cd_%cur_ray%
- Return cur_ray
- }
- ;End Ray Script
- ~l::
- if (fiftycycle = "0")
- {
- sendinput {f9}
- fiftycycle = 1
- SetTimer, KeyWinl, 4000
- } ELSE if (fiftycycle = "1")
- {
- sendinput {f10}
- fiftycycle = 0
- } ELSE {
- fiftycycle = 0
- }
- return
- KeyWinl:
- SetTimer, KeyWinl, off
- If (fiftycycle = "1")
- {
- fiftycycle = 0
- }ELSE IF (fiftycycle > 1)
- {
- fiftycycle = 0
- }ELSE{
- fiftycycle = 0
- }
- return
- ~j::
- if (healcycle = "0")
- {
- sendinput {f11}
- healcycle = 1
- SetTimer, KeyWinj, 4000
- } ELSE if (healcycle = "1")
- {
- sendinput {f12}
- healcycle = 0
- } ELSE {
- healcycle = 0
- }
- return
- KeyWinj:
- SetTimer, KeyWinj, off
- If (healcycle = "1")
- {
- healcycle = 0
- }ELSE IF (healcycle > 1)
- {
- healcycle = 0
- }ELSE{
- healcycle = 0
- }
- return
- ~numpad2::
- if (debuffcycle = "0")
- {
- sendinput {f7}
- debuffcycle = 1
- SetTimer, KeyWinnumpad2, 7000
- } ELSE if (debuffcycle = "1")
- {
- sendinput {f8}
- debuffcycle = 0
- } ELSE {
- debuffcycle = 0
- }
- return
- KeyWinnumpad2:
- SetTimer, KeyWinnumpad2, off
- If (debuffcycle = "1")
- {
- debuffcycle = 0
- }ELSE IF (debuffcycle > 1)
- {
- debuffcycle = 0
- }ELSE{
- debuffcycle = 0
- }
- return
- ~numpad3::
- if (debufffcycle = "0")
- {
- sendinput +{[}
- debufffcycle = 1
- SetTimer, KeyWinnumpad3, 7000
- } ELSE if (debufffcycle = "1")
- {
- sendinput +{]}
- debufffcycle = 0
- } ELSE {
- debufffcycle = 0
- }
- return
- KeyWinnumpad3:
- SetTimer, KeyWinnumpad3, off
- If (debufffcycle = "1")
- {
- debufffcycle = 0
- }ELSE IF (debufffcycle > 1)
- {
- debufffcycle = 0
- }ELSE{
- debufffcycle = 0
- }
- return
- k::
- Send {numpad7}
- Sleep 500
- Send {numpad8}
- return
- ; leave this as last line
- #IfWinActive6
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement