This is as far as I've gotten Topic is solved

Ask gaming related questions
TheThirdEye
Posts: 9
Joined: 15 Sep 2020, 16:35

This is as far as I've gotten

Post by TheThirdEye » 15 Sep 2020, 16:56

I've been up for hours trying to coax this thing to work the way I want with little success. I'd like to have the script activate using potions when I have the mouse button pressed down and to stop doing so when I let got of the button. So far I've accomplished that much but I end up drinking all of three of my potions. Feel kinda silly drinking another potion after I'm out of combat. What I'd like to have it do is detect if I'm still pressing the mouse button after drinking each potion and have it stop triggering them if I have. This is what I have so far, it's pretty rough but it half ass works :D

Code: Select all

#IfWinActive, ahk_class ;InsertGameHere
#SingleInstance force

!F11::Pause

~Rbutton::

   SetTimer, Combat, 3000

   return

 

~Rbutton up::

   SetTimer, Combat, Off

   return


Combat:
FirstPot := 3500
SecondPot := 4300
ThirdPot := 4900
random, delay, -99, 99

{
	
	SendInput, 1
	sleep, FirstPot + delay
		
	SendInput, 2
	sleep, SecondPot + delay
	
	SendInput, 4
	sleep, ThirdPot + delay

}	
return

User avatar
Xtra
Posts: 1919
Joined: 02 Oct 2015, 12:15

Re: This is as far as I've gotten  Topic is solved

Post by Xtra » 15 Sep 2020, 18:10

Code: Select all

#IfWinActive, ahk_class ;InsertGameHere
#SingleInstance force

!F11::Pause

~Rbutton::

   SetTimer, Combat, 3000
   inCombat := true
   return

~Rbutton up::

   SetTimer, Combat, Off
   inCombat := false
   return

Combat:
    FirstPot := 3500
    SecondPot := 4300
    ThirdPot := 4900
    random, delay, -99, 99
    
	if (inCombat) {
		SendInput, 1
		sleep, FirstPot + delay
	}
	else
		return

	if (inCombat) {
		SendInput, 2
		sleep, SecondPot + delay
    }
	else
		return

	if (inCombat) {
		SendInput, 4
		sleep, ThirdPot + delay
    }
return
inCombat flag should help prevent wasted pots

TheThirdEye
Posts: 9
Joined: 15 Sep 2020, 16:35

Re: This is as far as I've gotten

Post by TheThirdEye » 15 Sep 2020, 19:16

Just took it for a test drive and it's a thing of beauty! Thanks for your help. I sincerely appreciate it!

Post Reply

Return to “Gaming”