What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal
RebornBuddy Forums

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Cass

New Member
Joined
Jan 24, 2014
Messages
98
Hello everybody

I was trying to use the function GetSpellCooldown contained on spell.cs but it wasnt possible to compile.

As per sugestion of Ama on other thread i included

PHP:
using Buddy.Swtor.Objects;

on the beginning of the file and the function started to work as intended.
Then i realized the the function returns the total cooldown of a spell and not the current cooldown.
Im trying to create a new function so that it could be used as conditional to deal with some CGD issues on my rotation.

So far none of my trys worked since i have almost no programming experience.

Could someone help me with the logic of the code below?


PHP:
public static float GetCCD(string spell)
		{
			float time = 0;
			var v = AbilityManager.KnownAbilities.FirstOrDefault(a => a.Name.Contains(spell)).CooldownTime;
			time += v;
			float ccd;
			
			if ( AbilityManager.CanCast(spell, onUnit(ret)))
			{
				ccd = 0;
			}
			
			if ( !AbilityManager.CanCast(spell, onUnit(ret)))
			{
				ccd = time;
			}
			
			ccd -= Time.Time;
			Logger.Write(">> CD <<   " + ccd);
			return ccd;
		}

Thanks a lot for any help ;)
 
I hope you find the help for this, to fix some routine issues!
BUT isnt it better to name it GetGCD?
and use this code
Code:
Logger.Write(">> GCD <<   " + ccd);

Also GCD is 1,5 sec but is lowered by alacrity if im correct.
 
The ideia was to get the CD value and put inside a timer where it would decrement it and return the current value on each timer tick until zero. This way we could calculate the alacrity modifier and put on the CD value before putting it on the timer.

The logger.write i used was just to check if the timer was working properly.

The game itself have a countdown. Cant we get it directly from memory? From where and how Abilitymanager.cancast get the ready check?
 
Cass, sorry for the delay. I sent you a PM on the topic. I would recommend not using the CanCast function in this situation. It will be a relatively expensive call and is one of the last things we do before casting a spell. An ideal solution would involve remembering the last time you cast that spell and doing a little bit of math. :)
 
Wich other function i could use to check or register after a cast that a spell its on cooldown?
I cant see why the stun would be a problem.
 
not sure if this will be helpful, but what about the old timer function at the end of the line

Code:
 Spell.DoT("Creeping Terror", "", 15000),

it is what kept dots from ruining rotations back in the day.
 
not sure if this will be helpful, but what about the old timer function at the end of the line

Code:
 Spell.DoT("Creeping Terror", "", 15000),

it is what kept dots from ruining rotations back in the day.

It uses the Expireitem function on spell.cs. This function creates a timer to renew the dot only after the end of the time specified.

I could use a timer to decrement and return the value at each 10miliseconds on the timer eventhandler until the cooldown reachs zero, but im not sure if its the best approach

EDIT: it seem timer is not reliable because it varies according with pc setup, i guess using datetime its a better option

something like

PHP:
public float CCD(float cooldown)
	{
		public DateTime LastCast;
        public float CooldownTime;
		float CurrentCD;
		
		CooldownTime = cooldown;
		LastCast = DateTime.Now();
		CurrentCD = LastCast + CooldownTime;
		
		CurrentCD -= DateTime.Now();
		
                return CurrentCD;
	}
 
Last edited:
Use the skeleton I sent you, you just need to fill the functions out. I wrote the comments in, you just need to write the code those comments tell you to write :)
 
Did you figure this out?
I seem to be having similar problems, where as i Deception assassin i have "Ball Lightning" in my rotation. I am fiddling around with some rotational stuff and conditions to see if the dps can be improved over the defaultcombat one (and so far it has)..
Code:
Spell.Cast("Ball Lightning", ret => Me.BuffCount("Induction") == 2 && Me.HasBuff("Voltage")),
However, the spell "Ball Lightning" has a cooldown of 5 seconds.. What happens is that the rotation goes through, and at times the bot actually ends up waiting for over 1 second doing absolutely nothing while waiting to cast this spell! This is not really that good, as i can pop one of my other lower prio hits in there instead (Voltaic Slash).

What happens is that the condition of 2 "induction" buffs is met, AND i have voltage up.. fine.. But if the spell is still on cd, why wait for it to come off? Is it a game bug that makes the bot not understand that the spell is on cd?

C
 
Unfortunately, i couldnt get this yet, its outside my near zero programing capabilites. But i did as sugested by Aevitas and created an issue at Github. Lets hope we can have it soon :)
 
Back
Top