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

Cast if keydown?

teamfe

Member
Joined
Mar 26, 2011
Messages
68
Reaction score
2
Hello there! I'm trying to figure out how to cast a spell if a key is pressed for example cast polymorph on focus if i press the shift key.
I've tried this code:
public void polymorph(object sender, KeyEventArgs e)
{
if (e.KeyData == Keys.Shift)
{
SpellManager.Cast(118, Me.FocusedUnit);
}
}

Or is it impossible to use a function like this with HB :/?

Thanks in advance //teamfe
 
that was my first thought but prefer the CC to handle it but i guess it's only way :/
thanks anyways :)
 
As the macro works by simply pressing the shift key, there is no difference.
 
yeah noticed :) thanks alot!

Might want to add a check also, that if you dont have a focus target - pressing shift will grant you one :)
Assuming that your original code works, as i'm currently unable to test it
 
Wasnt there a case where you could hardly execute a spell, because the CC is spamming spells like crazy?

So you had to spam your button and need a bit of luck for it to execute quickly.

I wouldnt say it makes no difference if its inside the game or hb, but yeah depends on your CC.
 
I'm not a good CC coder but yeah learning atm so don't expect anything epic ^^ but so far it does loads of damage :)
 
I'm not a good CC coder but yeah learning atm so don't expect anything epic ^^ but so far it does loads of damage :)

We all started some place, doesn't have to be big and fancy to become epic :)
 
We all started some place, doesn't have to be big and fancy to become epic :)

This. Also, I wouldn't mind getting a hold of the CC when you're done with it to check it out.. I play a 392 arcane/fire mage as my main..
 
@Teamfe,

What your trying to do has many threads with answers... Please check out my answer "Here". Look for my full answer as it will help you with the use of "Event on Keypress", also the use of scripts is a little better.
 
Back
Top