Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Help with simple DDO script, very simple, but beats me B)



  • Please log in to reply
50 replies to this topic
Temil2008
  • Members
  • 364 posts
  • Last active: Jun 14 2015 09:02 PM
  • Joined: 10 Dec 2012

Would adding else if turbine isn't running to the "send z" part stop Z from being sent at the end of the cycle in game?

 

Almost good tongue.png you've gotten me alot more progress than I had the night before.

Next step is figuring out a way to add in cooldown timers for each letter (example: wait 10 secs before a is available, wait 5 secs before B, wait 15 secs for C, wait 0.5 for D) so on so forth.

 

Awesome help from all of you guys, Thank you!!

 

nah, z would still send it.

varlist = a|b|c|d|e|f|g

Loop, parse, varlist, |
	var%A_Index% := A_LoopField

num = 1

#IfWinActive, ahk_class Turbine Device Class
z::
If(var%Num% != "")
{
	Send , % var%Num%
	num++
}
else
{
	num = 2
	Send , % var%Num%
}
return

btw, I removed the "winget" command. the Notepad in that was also suposted to be replaced with the game class name, that's why the controlsend wasn't workin for ya =) lol.

 

try the above, and let us know.

 

now, about the cooldowns... do you mean ...

send a >> wait Asec >> send b >> wait Bsec >> send c >> wait Csec .. etc? 

 

or do you mean ....

send all buttons (a through g) .. then check for all button timers and see if they are ready... only fire off each button, if they are ready.. (not being in order, like the previous example? )

 

or something else..


________________________________________________________________

Did a solution provided fix your issue? please mark as "Answered" if so. thank you!


jessebarbier
  • Members
  • 49 posts
  • Last active: Nov 16 2013 06:01 AM
  • Joined: 25 Sep 2013

or do you mean ....

send all buttons (a through g) .. then check for all button timers and see if they are ready... only fire off each button, if they are ready.. (not being in order, like the previous example? )

 

or something else..

Basically this ^ first time around all 1-7 (a-g) would fire off in order, second time around would check for button timers, then firing off the available ones, in order.

so say b, c, e, had no timer, and all the rest had a 5 second timer, first it would fire off all 7, second time it'd only fire off the other 3 (b, c, e) until their timers went away.

 

This part of the script isn't "ESSENTIAL" but it would help alot, cause I would't have to press the button x amount of times to skip the unavailable skills.

 

Also sorry the winget part flew over my head :p first time I ran the script I just copypasta'd it into notepad and changed notpad to turbine class xD



jessebarbier
  • Members
  • 49 posts
  • Last active: Nov 16 2013 06:01 AM
  • Joined: 25 Sep 2013

Also, tried the last script you posted (the one where you removed the winget I missed) works perfectly, except for one difference.

before it cycled (a/b/c/d/e/f/g/Z) and now it cycles (a/b/c/d/e/f/g) so now the Z is gone, except on the 2nd, 3rd, so on loop, A is removed from the cycle, so other than first try it is b-g

 

Looked at the code and noticed the (num = __) changed from 1 to 2. I changed it back, and fixed back to a-g

varlist = a|b|c|d|e|f|g

Loop, parse, varlist, |
	var%A_Index% := A_LoopField

num = 1

#IfWinActive, ahk_class Turbine Device Class
z::
If(var%Num% != "")
{
	Send , % var%Num%
	num++
}
else
{
	num = 1                           ; this one
	Send , % var%Num%
}
return

current script I'm running ^



Temil2008
  • Members
  • 364 posts
  • Last active: Jun 14 2015 09:02 PM
  • Joined: 10 Dec 2012

Also, tried the last script you posted (the one where you removed the winget I missed) works perfectly, except for one difference.

before it cycled (a/b/c/d/e/f/g/Z) and now it cycles (a/b/c/d/e/f/g) so now the Z is gone, except on the 2nd, 3rd, so on loop, A is removed from the cycle, so other than first try it is b-g

 

Looked at the code and noticed the (num = __) changed from 1 to 2. I changed it back, and fixed back to a-g

varlist = a|b|c|d|e|f|g

Loop, parse, varlist, |
	var%A_Index% := A_LoopField

num = 1

#IfWinActive, ahk_class Turbine Device Class
z::
If(var%Num% != "")
{
	Send , % var%Num%
	num++
}
else
{
	num = 1                           ; this one
	Send , % var%Num%
}
return

current script I'm running ^

 

question, is there a "cast time" for the skills a-g ? .. meaning.. does there need to be a slight pause between each skill firing off.. or is having them fire off that quickly work if you did it manualy?


________________________________________________________________

Did a solution provided fix your issue? please mark as "Answered" if so. thank you!


jessebarbier
  • Members
  • 49 posts
  • Last active: Nov 16 2013 06:01 AM
  • Joined: 25 Sep 2013

Yeah there is a little animation, of the "swing" of the weapon. But there wouldn't be a need to script in the wait time, because it should wait for me to hit the button to fire off the next one.

 

As with how the current script is, the 2nd, 3rd, (next) button isn't pressed until I press it. Not automating the burst of skills, just cycling through them with one button.

Like pressing 1 2 3 4 5 6 7 8 9 in a row, but instead hitting Z 9 times and getting the 1-9 input tongue.png

 

Although I could code another one to burst all of them in a row, and a 0.2 "cast" or wait time would suffice, the main focus is the cooldown time ( time after skill is used that it can't be used again )

 

Thank you so much for all your replies xD helping me a ton



jessebarbier
  • Members
  • 49 posts
  • Last active: Nov 16 2013 06:01 AM
  • Joined: 25 Sep 2013

By the way, the current script, is perfect 100% for my "buffs" (drinking about 6 potions in a row) and I'm already implementing it to another button that I had previously set for just 1 potion grin.png

 

Also again, sorry for a triple post. "holding" the button down could be an acceptable deviation from pressing 7 times in a row. Just don't want all 7 to go off from a single press of the key, would feel too much like cheating to me xD



Temil2008
  • Members
  • 364 posts
  • Last active: Jun 14 2015 09:02 PM
  • Joined: 10 Dec 2012

umm.. well, I started coding up what i thought you wanted, and then i read your post about "feeling like cheating" .. opps, lol

Let me know what you think of what i got. If you really, really want to have it changed to file 1 key at a time, instead of looping it, we can change it, it was just easier to do with a loop command is all.

varlist = a|b|c|d|e|f|g
VarRecast = 1000|2000|3000|4000|5000|6000|7000
PauseSec = 500

Loop, parse, varlist, |
{
	CurrentIndex := A_Index
	var%A_Index%_key := A_LoopField
	Loop, parse, VarRecast, |
	{
		if (A_Index = CurrentIndex)
			var%A_Index%_recast := A_LoopField
	}
}

#IfWinActive, ahk_class Turbine Device Class
z::
Loop, parse, varlist, |
{
	if (Start%A_Index% = "")
	{
		Send , % var%A_Index%_key
		Start%A_Index% := A_TickCount
		Sleep, %PauseSec%
	}
	else
	{
		Elapsed%A_Index% := A_TickCount - Start%A_Index%
		if (Elapsed%A_Index% >= Var%A_Index%_recast)
		{
			
			Send , % var%A_Index%_key
			Start%A_Index% := A_TickCount
			Sleep, %PauseSec%
		}		
	}
}
return

EDIT: forgot to add. you will need to change the numbers in VarRecast. each each area between the pipe char is number of second you want to wait before that skills will be ready again. first section is for a. second section is for b. etc


________________________________________________________________

Did a solution provided fix your issue? please mark as "Answered" if so. thank you!


jessebarbier
  • Members
  • 49 posts
  • Last active: Nov 16 2013 06:01 AM
  • Joined: 25 Sep 2013

That is epic!!! Perfect for bursting out attacks all at once, or for buffing before fights.

 

As far as really really wanting it to be one key at a time. One key is kind of essential. At times in the game the enemies are spread out, so you wouldn't want to waste all 7 skills at once. But at times when you have a mob of them, the burst is exactly what I'd need. So basically, now that you've made a bursting script I would want both :D

 

If you don't want to spend the extra time scripting up the alternate for no burst, thats fine, but if you are willing I would greatly appreciate it. Definitely have helped me out trillion-fold so far. Sorry about not being clear on the burst vs non-burst though. Thanks a bunch!



jessebarbier
  • Members
  • 49 posts
  • Last active: Nov 16 2013 06:01 AM
  • Joined: 25 Sep 2013

Also, for some reason the scripts started working without needing to be compiled (even the one I was writing before you blew me away with epicness)



Temil2008
  • Members
  • 364 posts
  • Last active: Jun 14 2015 09:02 PM
  • Joined: 10 Dec 2012

That is epic!!! Perfect for bursting out attacks all at once, or for buffing before fights.

 

As far as really really wanting it to be one key at a time. One key is kind of essential. At times in the game the enemies are spread out, so you wouldn't want to waste all 7 skills at once. But at times when you have a mob of them, the burst is exactly what I'd need. So basically, now that you've made a bursting script I would want both 

 

If you don't want to spend the extra time scripting up the alternate for no burst, thats fine, but if you are willing I would greatly appreciate it. Definitely have helped me out trillion-fold so far. Sorry about not being clear on the burst vs non-burst though. Thanks a bunch!

 

lol, I don't mind, but going to be a little bit, just sat down to watch a movie with the wife, so i'll get it done after that. 

 

oh, btw. what key would you like each to be? what key for burst and what key for non-burst.. (we can also combine ALT+ and CTRL+ and so on)


________________________________________________________________

Did a solution provided fix your issue? please mark as "Answered" if so. thank you!


jessebarbier
  • Members
  • 49 posts
  • Last active: Nov 16 2013 06:01 AM
  • Joined: 25 Sep 2013

No problem grin.png thanks a bunch

also for adding / removing keys is all I'd need to add them to the two variable lists at the top? (with the cool down of course)



Temil2008
  • Members
  • 364 posts
  • Last active: Jun 14 2015 09:02 PM
  • Joined: 10 Dec 2012

I think this is what you are looking for. 

Z is first hotkey and X is the 2nd one.

varlist = a|b|c|d|e|f|g
VarRecast = 1000|2000|3000|4000|5000|6000|7000
PauseSec = 500

num = 1

Loop, parse, varlist, |
{
	CurrentIndex := A_Index
	MaxNum := A_Index+1
	var%A_Index%_key := A_LoopField
	Loop, parse, VarRecast, |
	{
		if (A_Index = CurrentIndex)
			var%A_Index%_recast := A_LoopField
	}
}

#IfWinActive, ahk_class Notepad
z::
Loop, parse, varlist, |
{
	Num = 1
	if (Start%A_Index% = "")
	{
		Send , % var%A_Index%_key
		Start%A_Index% := A_TickCount
		Sleep, %PauseSec%
	}
	else
	{
		Elapsed%A_Index% := A_TickCount - Start%A_Index%
		if (Elapsed%A_Index% >= Var%A_Index%_recast)
		{
			
			Send , % var%A_Index%_key
			Start%A_Index% := A_TickCount
			Sleep, %PauseSec%
		}		
	}
}
return

x::
{
	if(Num >= MaxNum)
		Num = 1
	if (Start%Num% = "")
	{
		Send , % var%Num%_key
		Start%Num% := A_TickCount
		Sleep, %PauseSec%
		Num++
	}
	else
	{
		Elapsed%Num% := A_TickCount - Start%Num%
		if (Elapsed%Num% >= Var%Num%_recast)
		{
			Send , % var%Num%_key
			Start%Num% := A_TickCount
			Sleep, %PauseSec%
			Num++
		}		
	}
}
return

________________________________________________________________

Did a solution provided fix your issue? please mark as "Answered" if so. thank you!


jessebarbier
  • Members
  • 49 posts
  • Last active: Nov 16 2013 06:01 AM
  • Joined: 25 Sep 2013

Thank you soooo much :D Your in the top 3 most helpful people I've ever encountered over internet forums :p

 

Just a couple questions and I'm completely 100% good :p and this is just for future reference.

varlist = a|b|c|d|e|f|g
VarRecast = 1000|2000|3000|4000|5000|6000|7000
PauseSec = 500

if I wanted to add a couple or remove a couple, are these the only changes I'd need to make?

varlist = a|b|c|d|e|f|g|h|i        OR      a|b|c|d|e
VarRecast = 5000|5000|5000|5000|5000|5000|5000|5000|5000      OR     5000|5000|5000|5000|5000
PauseSec = 500

Or is there anything else in the script that needed to be changed? From what I could see was it looked like everything is fed by variables from below there



jessebarbier
  • Members
  • 49 posts
  • Last active: Nov 16 2013 06:01 AM
  • Joined: 25 Sep 2013

Once again, EPIC, thank you!! thought I'd be testing code for weeks xD and I'm 99% positive my script would've been 20x times longer, with way less smarts involved.



jessebarbier
  • Members
  • 49 posts
  • Last active: Nov 16 2013 06:01 AM
  • Joined: 25 Sep 2013

Okay, figured out the adding / removing question myself :D and it worked fine that way.

 

One more concern, which isn't very major. On the "X" button, it cycles just like I intended, except when a skill is "cooling down" instead of skipping that letter and going to the next / or back to the beginning, it waits for that timer to count down before I can press it again. This wouldn't be an issue at all, except one of the better skills is on a 30 second timer. But if there is no fix for it, I can just remove that one and it will work good enough.

 

This is what I could see from my limited knowledge.

x::
{
	if(Num >= MaxNum)
		Num = 1
	if (Start%Num% = "")
	{
		Send , % var%Num%_key        ; Seems like here is where the true condition would fire the key (note1)
		Start%Num% := A_TickCount
		Sleep, %PauseSec%
		Num++
	}
	else
	{
		Elapsed%Num% := A_TickCount - Start%Num%
		if (Elapsed%Num% >= Var%Num%_recast)     
		{                             ; Seems like here is where a false statement would tell it to skip a key (note2)
			Send , % var%Num%_key
			Start%Num% := A_TickCount
			Sleep, %PauseSec%
			Num++
		}		
	}
}
return

If I'm wrong, sorry for being dumb :p But it seems that where the "else if" or false statment (note 2 area) is just telling it to fire the same key as the first "if" (note 1 area)  I'll continue to mess around with it some while I'm still up tonight to see if I can get it to skip like the Z script does (skips around to the next button perfectly on Z)  Sorry that what I thought was a simple script turned out to be complicated B) Thanks again for all the help.