AutoHotkey Community

It is currently May 27th, 2012, 5:25 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 27 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Help with Magicka combos
PostPosted: January 28th, 2011, 12:01 am 
Hi, im trying to make a macro so that if i press Z, X, or C, a combination of other letters are played. However, in Magicka, you need to delay between presses in order to cast he spells.

My goal for example is for Z to result in the macro pressing and F,Q,S,A with a short delay inbetween.

Ive been experimenting for hours, but cant seem to get it to work. I think it needs to be SendPlay because Magicka uses direct input. Right now i have

SetKeyDelay, 100, 100, Play
z::send fqsa

could anyone help me?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 28th, 2011, 12:10 am 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Code:
SetKeyDelay, 100
z::send fqsa

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 28th, 2011, 12:20 am 
HotKeyIt wrote:
Code:
SetKeyDelay, 100
z::send fqsa


thanks, but did not work. fqsa goes all at once n o matter the delay


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 28th, 2011, 1:02 am 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
works fine for me :?
Code:
SetKeyDelay, 1000
z::send fqsa

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
PostPosted: January 28th, 2011, 11:47 am 
Offline

Joined: July 10th, 2008, 8:49 am
Posts: 1865
Location: Brussels, Belgium
Magicka wrote:
Hi, im trying to make a macro so that if i press Z, X, or C, a combination of other letters are played. However, in Magicka, you need to delay between presses in order to cast he spells.

My goal for example is for Z to result in the macro pressing and F,Q,S,A with a short delay inbetween.

Ive been experimenting for hours, but cant seem to get it to work. I think it needs to be SendPlay because Magicka uses direct input. Right now i have

SetKeyDelay, 100, 100, Play
z::send fqsa

could anyone help me?


LOL !!!!!
ROFL !!!!!
ILMAO !!!!!

Hum...

You want tu use SendPlay and you use Send ???

WTF !

Sorry it's too funny...

Code:
SetKeyDelay 100, 100, Play
z::SendPlay fqsa


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Try this script
PostPosted: February 1st, 2011, 6:23 pm 
Offline

Joined: June 12th, 2008, 10:29 am
Posts: 52
I have created my own combo list, try it below:
I mostly use keys 1,2 and zxc with the staff of regeneration that you get in the beginning and it seems to work well for almost all situations.
Code:
#NoEnv
Process,Priority,quickmagicka,High
;This works!!! for using send
SetKeyDelay , 5, 65
;this is necessary because magicka expects keys to be pressed for a specific time, this is the smallest interval that works reliably, you can experment more if you want. It seems like you can do it slightly faster when doing it manually
;SetKeyDelay , 0, 65, Play

;Fix for Win7 with UAC
if not A_IsAdmin ;if code does not have admin rerun it with them
{
DllCall("shell32\ShellExecuteA", uint, 0, str, "RunAs", str, A_AhkPath
, str, """" . A_ScriptFullPath . """", str, A_WorkingDir, int, 1)
ExitApp
}

;settings
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
aoe = RButton ;for use with shift for aoe effect use on own for standard cast
selfcastkey = MButton
shift= LShift ;for use with aoe expression for aoe effect
water = q
heal = w
shield = e
ice = r
lightning = a
arcane = s
earth = d
fire = f

quickaoeheal = pgup
selfheal = pgdn
deathbeam = xbutton1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;other init
WinWait, Magicka,
IfWinNotActive, Magicka, , WinActivate, Magicka,
WinWaitActive, Magicka,
quickheal()
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;Shortcuts
#IfWinActive Magicka
;for testing to refactor code
;F1::forcebeam("fqsaaa")
;F2::aoenova("fqsaaa")
;F3::selfcast("fqsaaa")
;F4::imbueweapon("fqsaaa")
;F5::spellcast("asf")

F12::run Z:\Games\Magicka\Magicka.exe

;Spells/Magicks
1::spell_haste()
2::spell_timewarp()
3::togglewaterres()
4::spell_rain()
5::spell_thunderbolt()
6::spell_teleport()

;attack/defence combos
z::supersteamlightningbeam()
x::supersteamlightningnova()
c::toggleshield()
v::quickheal()
b::resetkeys()
n::blizzardball()
m::forcebeam("sar")
,::superwetsteamlightningbeam()

g::barrierrock()
h::barrierice()
j::surge()
k::coldquake()

xbutton2::Send fqsaaa{RButton Down}
#IfWinActive
;;;;;;;;;;;;;; spells/magicks
;http://www.magickapedia.net/index.php?title=Magicks
;you must have the corresponding magick for it to work

spell_rain(){
   send qqf{space}
}

spell_thunderbolt(){
   send qfas
   sleep 150
   send a
   sleep 150
   send {space}
}

spell_conflagration(){
   send qfffqffq{space}
}

spell_timewarp(){
   send re{space}
}

spell_nullify(){
   send se{space}
}

spell_teleport(){
   send asa{space}
}

spell_haste(){
   send asf{space}
}
;;;;;;;;;;;;;;;;;;;; END SPELLS

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;attack/defence combos
;http://www.magickapedia.net/index.php?title=Spell_Combinations

toggleshield(){
   send e{Mbutton}
}

togglewaterres(){
   send qe{Mbutton}
}

quickheal(){
   send w{Mbutton}
}

superwetsteamlightningbeam(){
   send sfqfqfqar{Rbutton down}
}

supersteamlightningbeam(){
   send sfqfqaa{Rbutton down}
}

supersteamlightningnova(){
   send sfqfqaa{LShift down}{Rbutton down}
   sleep 65
   send {Rbutton up}{Lshift up}
}

blizzardball(){
   send dqrqrqrqr{Rbutton down}
}

barrierrock(){
   send edddd{Mbutton}
}

barrierice(){
   send eqwd{Mbutton}
}

surge(){
   send qqqqq{LShift down}{Rbutton down}
   sleep 65
   send {Rbutton up}{Lshift up}
}

coldquake(){
   send drddd{LShift down}{Rbutton down}
   sleep 65
   send {Rbutton up}{Lshift up}
}

resetkeys(){
   send {Rbutton up}{Mbutton  up}
}

;;;typesofattack

forcebeam(str){
   send %str%{Rbutton down}
}

aoenova(str){
   send %str%{LShift down}{Rbutton down}
   sleep 65
   send {Rbutton up}{Lshift up}
}

selfcast(str){
   send %str%{Mbutton down}
   sleep 65
   send {Mbutton up}
}

imbueweapon(str){
   send %str%{LShift down}{Lbutton down}
   sleep 65
   send {Lbutton up}{Lshift up}
}

spellcast(str){
   send %str%{Space down}
   sleep 65
   send {Space up}
}

;;;;;;
;;; End script


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: Try this script
PostPosted: February 2nd, 2011, 8:10 pm 
Offline

Joined: September 6th, 2009, 6:56 pm
Posts: 32
vixay wrote:
I have created my own combo list, try it below:
I mostly use keys 1,2 and zxc with the staff of regeneration that you get in the beginning and it seems to work well for almost all situations.
Code:
#NoEnv
Process,Priority,quickmagicka,High
;This works!!! for using send
SetKeyDelay , 5, 65
;this is necessary because magicka expects keys to be pressed for a specific time, this is the smallest interval that works reliably, you can experment more if you want. It seems like you can do it slightly faster when doing it manually
;SetKeyDelay , 0, 65, Play

;Fix for Win7 with UAC
if not A_IsAdmin ;if code does not have admin rerun it with them
{
DllCall("shell32\ShellExecuteA", uint, 0, str, "RunAs", str, A_AhkPath
, str, """" . A_ScriptFullPath . """", str, A_WorkingDir, int, 1)
ExitApp
}

;settings
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
aoe = RButton ;for use with shift for aoe effect use on own for standard cast
selfcastkey = MButton
shift= LShift ;for use with aoe expression for aoe effect
water = q
heal = w
shield = e
ice = r
lightning = a
arcane = s
earth = d
fire = f

quickaoeheal = pgup
selfheal = pgdn
deathbeam = xbutton1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;other init
WinWait, Magicka,
IfWinNotActive, Magicka, , WinActivate, Magicka,
WinWaitActive, Magicka,
quickheal()
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;Shortcuts
#IfWinActive Magicka
;for testing to refactor code
;F1::forcebeam("fqsaaa")
;F2::aoenova("fqsaaa")
;F3::selfcast("fqsaaa")
;F4::imbueweapon("fqsaaa")
;F5::spellcast("asf")

F12::run Z:\Games\Magicka\Magicka.exe

;Spells/Magicks
1::spell_haste()
2::spell_timewarp()
3::togglewaterres()
4::spell_rain()
5::spell_thunderbolt()
6::spell_teleport()

;attack/defence combos
z::supersteamlightningbeam()
x::supersteamlightningnova()
c::toggleshield()
v::quickheal()
b::resetkeys()
n::blizzardball()
m::forcebeam("sar")
,::superwetsteamlightningbeam()

g::barrierrock()
h::barrierice()
j::surge()
k::coldquake()

xbutton2::Send fqsaaa{RButton Down}
#IfWinActive
;;;;;;;;;;;;;; spells/magicks
;http://www.magickapedia.net/index.php?title=Magicks
;you must have the corresponding magick for it to work

spell_rain(){
   send qqf{space}
}

spell_thunderbolt(){
   send qfas
   sleep 150
   send a
   sleep 150
   send {space}
}

spell_conflagration(){
   send qfffqffq{space}
}

spell_timewarp(){
   send re{space}
}

spell_nullify(){
   send se{space}
}

spell_teleport(){
   send asa{space}
}

spell_haste(){
   send asf{space}
}
;;;;;;;;;;;;;;;;;;;; END SPELLS

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;attack/defence combos
;http://www.magickapedia.net/index.php?title=Spell_Combinations

toggleshield(){
   send e{Mbutton}
}

togglewaterres(){
   send qe{Mbutton}
}

quickheal(){
   send w{Mbutton}
}

superwetsteamlightningbeam(){
   send sfqfqfqar{Rbutton down}
}

supersteamlightningbeam(){
   send sfqfqaa{Rbutton down}
}

supersteamlightningnova(){
   send sfqfqaa{LShift down}{Rbutton down}
   sleep 65
   send {Rbutton up}{Lshift up}
}

blizzardball(){
   send dqrqrqrqr{Rbutton down}
}

barrierrock(){
   send edddd{Mbutton}
}

barrierice(){
   send eqwd{Mbutton}
}

surge(){
   send qqqqq{LShift down}{Rbutton down}
   sleep 65
   send {Rbutton up}{Lshift up}
}

coldquake(){
   send drddd{LShift down}{Rbutton down}
   sleep 65
   send {Rbutton up}{Lshift up}
}

resetkeys(){
   send {Rbutton up}{Mbutton  up}
}

;;;typesofattack

forcebeam(str){
   send %str%{Rbutton down}
}

aoenova(str){
   send %str%{LShift down}{Rbutton down}
   sleep 65
   send {Rbutton up}{Lshift up}
}

selfcast(str){
   send %str%{Mbutton down}
   sleep 65
   send {Mbutton up}
}

imbueweapon(str){
   send %str%{LShift down}{Lbutton down}
   sleep 65
   send {Lbutton up}{Lshift up}
}

spellcast(str){
   send %str%{Space down}
   sleep 65
   send {Space up}
}

;;;;;;
;;; End script


OMG it works so GOOODDD
You're my hero


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Ok But...
PostPosted: February 5th, 2011, 3:30 am 
Hey Vixay, nice script but a bit... excessive it seems almost?
I'm brand new to AHK but I've played a number of muds and done some programming and was wondering if there was any way to be a big simpler...

And i realize this is not correct but attempting to demonstrate the desire...

Code:
; Water: q Life: w Shield: e Cold: r
; Lightning: a Arcane: s Earth: d Fire: f
; Steam: qf Ice: qr

1::Send w::Send a::Send{Space} ;res
2::Send asf{Space} ;haste
3::Send qfasa{Space}
4::Send qqf{Space}
5::Send dqfqqf{Space}
6::Send qffqffqf{Space}
7::Send re{Space}
8::Send se{Space}
9::Send fdqfdf{Space}
0::Send z
;{F1}::Send z
;{F2}::Send z
;{F3}::Send z


To repeat myself, I realize this is incorrect... i've done a few different things to see if I could get something to work in a hurry this afternoon... but I think you get the idea... a nice neat list of binds and resultant... anyway this could be done?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 10th, 2011, 11:04 am 
Offline

Joined: June 12th, 2008, 10:29 am
Posts: 52
Hello RandomVisitor203209, nice name btw! :P
You are right, the code is a bit over long. Actually it includes amalgamations of several scripts and after several iterations. Haven't deleted a lot of stuff that's useless now (like the water = q vars), but left it in for reference. I tried to make the code more readable by using names so that it's easier for readers & editors to understand and make changes.
The example you gave, I have to mentally trace back to see what it means. ANyway your code will work if you add the following two lines to the top
Code:
SetKeyDelay , 10, 75
SetMouseDelay, 50


Hope that explains it.

tldr; It will help newcomers and make it easier to understand at the expense of verbosity + some old code left in for reference


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Updated Script
PostPosted: February 10th, 2011, 5:56 pm 
Offline

Joined: June 12th, 2008, 10:29 am
Posts: 52
Thank you for the glorious praise Wazowski!!!
And thank you for your constructive criticismRandomVisitor293209
And it is because of both you and your carrot & stick approach that I have spent an hour refining the script today.

It now features Multiple Spell & Magick COMBOS!!!
Check out buttons F1 through F4 :), sure to rock your world, and give you opportunities to create your own awesome combos! Be sure to post them here, once you have em figured out :)

I have also refactored out the unnecessary functions and such. So please feel free to comment on this new and improved script.

Yours truly,

Vixay

Code:
#NoEnv
Process,Priority,qmagicka,High
;This works!!! for using send
SetKeyDelay , 25, 75
SetMouseDelay, 50
;this is necessary because magicka expects keys to be pressed for a specific time, this is the smallest interval that works reliably, you can experment more if you want. It seems like you can do it slightly faster when doing it manually
;SetKeyDelay , 0, 65, Play
;http://www.autohotkey.com/forum/viewtopic.php?p=418841#418841

;Fix for Win7 with UAC
if not A_IsAdmin ;if code does not have admin rerun it with them
{
DllCall("shell32\ShellExecuteA", uint, 0, str, "RunAs", str, A_AhkPath
, str, """" . A_ScriptFullPath . """", str, A_WorkingDir, int, 1)
ExitApp
}

;settings
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Default keybindings - you can modify these if you have changed your settings
aoekey      = RButton ;for use with shift for aoe effect use on own for standard cast
selfcastkey = MButton
shiftkey    = LShift ;for use with aoe expression for aoe effect
water       = q
heal        = w
shield      = e
cold        = r
lightning   = a
arcane      = s
earth       = d
fire        = f
; the {@ 2} adds a delay that allows the combo to succeed as it needs a slightly longer delay
; not tested yet
ice         = qr{@ 2}
steam       = qf{@ 2}

;;spells
;From http://www.magickapedia.net/index.php?title=Magicks               
;Using default keyboard shortcuts
;you must have the corresponding magick for it to work, they are gained as described below
; also I've modified some combinations in here to make them work in game, because the delay timings weren't working out exactly. So if you change the delay timings or you computer behaves slightly differently you might have to rever to original combo for those spells.

;another good way I found to add a delay is to append a useless key sequence like so: {p 20}

Grease          =    qdw            ;Chapter 1: Found across the lake, shortly after hearing someone scream. Freeze the lake to get across.     Covers the floor with slippery grease. Burns longer than normal fire when lit.
Revive          =    wa             ;Chapter 1: Obtained at the end of the tutorial.     Revives human players.
Haste           =    asf            ;Chapter 1: Required to complete the tutorial. Found on a bookshelf.     Increases the wizards's movement speed.
MeteorShower    =    fdqfdf         ;Chapter 1: Obtained at the start of the ;Chapter. This magick is a DLC bonus for all purchases made before January 31st, 2011.    Conjures several meteors that impact random locations on the screen.
Nullify         =    se             ;Chapter 2: Found beside the altar where a goblin shaman is fought.     Removes status effects from the caster. In addition, this spell cancels some (but not all) spells and magicks cast by other players and creatures. Most notably, the "mirror image" cast by Grimnír after the mind duel.
Rain            =    qqqf           ;Chapter 2: Found in the first cave you come across that is guarded by goblins.     Causes it to rain, wetting all units on the screen except those with an active shield.
ThunderBolt     =    fqasaa         ;Chapter 3: Found in a henge.     Conjures a bolt that damages the most elevated unit heavily.
Tornado         =    dqfqqqf        ;Chapter 4: Before entering the city on the left of the main path in the trees by a shipwrecked boat.     Summons a large tornado that flings everyone nearby up into the air, causing damage
Conflagration   =    qffffffqfffq   ;Chapter 4: Inside a burning building you are forced to detour through.     Heat wave that deals 600 damage and sets on fire.
TimeWarp        =    re             ;Chapter 5: Head west immediately after leaving the camp.     Slows time down for everyone - including the caster, although possibly by a slightly smaller degree - allowing you to react faster. Doesn't affect M60.
Blizzard        =    rrrqr          ;Chapter 6: At the beginning of the ;Chapter, go east to the small lake. Use  to get across the water.     Summons a mighty blizzard, chilling everyone - including the caster! - for as long as it lasts (roughly 10 seconds?).
Teleport        =    asa            ;Chapter 7: On the broken walkway, after being transported by Vlad. There's also a way to get this Magick, as early as ;Chapter 1. To do this, you must first place Arcane/Fire mines (  ) near the base of the walkway. Make sure you place them whilst facing away from it. Then, walk over them to get blown up into the air. Some trial and error is to be expected in order for this to work. For further instructions, please see this video of the exploit.     Instantly teleports the caster a short distance forward.
SummonPhoenix   =    waf            ;Chapter 8: After fighting the waves of Goblins and Trolls on a large bridge, keep heading right.     Summons a Phoenix at the casters location, dealing fire damage to everyone nearby and reviving all fallen wizards.
Thunderstorm    =    fqfqasaa       ;Chapter 8: Just before the mines, after the first stone bridge (where you talk to Vlad) in a cave (hidden from view).     Thunderbolt, now with 900% more glorious carnage! Effectively a mix of Rain and Thunderbolt, it will begin to rain both water and thunder from the skies, striking at random positions on the battlefield. Use with caution.
RaiseDead       =    qrdsr          ;Chapter 9: After defeating the necromancers in the run-down church.     Summons a few undead ghouls to fight for the caster.
Fear            =    rse            ;Chapter 9: Found in the first room of the Count's castle on the left sitting on a bookshelf.     Every enemie nearby is scared witless, running in random directions away from the caster for approximately 3 seconds.
Charm           =    wed            ;Chapter 9: Found in the first room of the Count's castle on the right leaning on the wooden furniture next to the couches.     The targeted creature temporarily becomes your ally, attacking your enemies.
SummonDeath     =    srrqrs         ;Chapter 10: Given to the player after defeating Death.     Summons Death, who will proceed to instantly kill the nearest player or creature with the lowest amount of health remaining.
SummonElemental =    sedqfs         ;Chapter 11: After defeating the small detachment of dwarves in the second room of the cathedral, go northwest over the narrow bridge. Open the door, and the book will be on a pedestal.     Summons an inactive elemental. To activate the elemental, simply attack it with any element. The elemental will take the form of whichever element touches it first, and will subsequently be healed by that same element.
Corporealize    =    sqfaes         ;Chapter 11: Given to the player after defeating Fafnir.     Used when fighting Assatur. Also causes any ethereal daemons to materialize and become corporeal.
Invisibility    =    seqfs          ;Chapter 11: In the first area, head south along the cliff you find to the east instead of entering the fortress.     Makes the caster invisible. Enemies will no longer actively attack the caster, although arrows, charging enemies and other AoE attacks will still hit the caster. Invisibility ends after casting, attacking, taking damage or colliding with a foe.
Vortex          =    qrsqreqr       ;Chapter 12: Given to you after defeating the final boss.     Summons a large vortex that sucks in and crushes anyone careless enough to wander close.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;attack/defence combos
;http://www.magickapedia.net/index.php?title=Spell_Combinations
; you can define them using keys or names;
; eg. surge_c = qqqqq or surge_c := water water water water water
; note the ':' before the equal in the second definition using names, thats to force it to evalue it as an expression
superwetsteamlightning_c = sfqfqfqar
supersteamlightning_c = sfqfqaa
surge_c = qqqqq
blizzardball_c = dqrqrqrqr
coldquake_c = drddd
barrierrock_c = edddd
barrierice_c = eqwd

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;other init
WinWait, Magicka,
IfWinNotActive, Magicka, , WinActivate, Magicka,
WinWaitActive, Magicka,
selfcast(heal heal)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;Shortcuts
#IfWinActive Magicka

;;;combinations of various actions
; delays are necessary in combos, otherwise they don't work correctly, i've tested these and tweaked the delays a bit

fastmode_combo(){
    spellcast(TimeWarp)
    spellcast(Haste)
}
;any other ideas for good combos?
F1:: ;defense_combo() {
    selfcast(heal heal,100)
    ;selfcast(shield,100)
    selfcast(water shield,100)
    spellcast(Haste,500)
    spellcast(TimeWarp,500)
    selfcast(barrierrock_c,200)
    ;loadcombo(superwetsteamlightning_c)
    forcebeam(blizzardball_c)
return
F2:: ;freeze_combo() {
    aoe(steam steam steam steam steam,100) ;wet
    aoe(cold cold cold cold cold,100) ;freeze
    aoe(superwetsteamlightning_c) ;destroy
return
F3:: ;freezeall_combo() ; have a shield on!
    selfcast(water shield,100)
    spellcast(Rain,2500)
    selfcast(water shield,100)
    spellcast(Blizzard,500)
return
F4:: ;thunder_combo() ;your own awesome thunderstorm!! hold down to continue using it! must have shield on before using it
    selfcast(water shield,100)
    spellcast(Rain,2000)
    spellcast(ThunderBolt,500)
    ;continue casting spell as long as key is held down,
    ; your own thunderstorm!! without the self gibbing!
    While GetKeyState(A_ThisHotkey, "P")
    {
        spellcast(ThunderBolt,500)
    }   
return

F5::spellcast(Conflagration)
F6::spellcast(Blizzard)
F7::spellcast(Tornado)
F8::spellcast(Invisibility)
F9::spellcast(Fear)
F10::spellcast(Charm)
F12::run Z:\Games\Magicka\Magicka.exe
!^r::Reload
;Spells/Magicks
1::spellcast(Haste)
2::spellcast(TimeWarp)
3::selfcast(water shield)
4::spellcast(Rain)
5::spellcast(ThunderBolt)
6::spellcast(Teleport)
7::spellcast(SummonElemental)
8::spellcast(Corporealize)
9::spellcast(RaiseDead)
0::spellcast(Vortex)

;attack/defence combos
z::forcebeam(supersteamlightning_c)
x::aoe(supersteamlightning_c)
c::selfcast(shield)
v::selfcast(heal heal)
b::forcebeam(blizzardball_c)
n::loadcombo(superwetsteamlightning_c)
m::forcebeam("sar")
,::resetkeys()

g::selfcast(barrierrock_c)
h::selfcast(barrierice_c)
j::aoe(surge_c)
k::aoe(coldquake_c)

; from  j-Factor @ http://www.reddit.com/r/magicka/comments/fcvi5/macroing_with_autohotkey_dont_do_this_unless_you/
; use with loadcombo
; Melee - mouse button 4
XButton1::
    If GetKeyState("LButton", "P")
        SendEvent {Click up}

    While GetKeyState("XButton1", "P")
    {
        SendEvent +{Click}
    }

    If GetKeyState("LButton", "P")
        SendEvent {Click down}
Return

; AOE - mouse button 5
XButton2::
    SendEvent {Shift down}{Click down right}
    While GetKeyState("XButton2", "P")
    {
    }
    SendEvent {Shift up}{Click up right}
Return


#IfWinActive

;;;typesofattack - utility functions
resetkeys(){
    send {LShift up}{Rbutton up}{Lbutton up}{Mbutton  up}
}

;no clicks - use with xbutton1(melee) or xbutton2(aoe) or right click
loadcombo(str){
    send %str%
}
;right click
forcebeam(str, delay = 0){
    send %str%{Rbutton down}
    sleep delay
}
;shift right click
aoe(str, delay = 25){
    send %str%{LShift down}{Rbutton down}
    sleep 65 ;the sleeps should no longer be necessary if setmousedelay works correctly
    send {Rbutton up}{Lshift up}
    sleep delay
}
;middle click
selfcast(str, delay = 25){
    send %str%{Mbutton down}
    sleep 65
    send {Mbutton up}
    sleep delay
}
;shift left click
imbueweapon(str, delay = 25){
    send %str%{LShift down}{Lbutton down}
    sleep 65
    send {Lbutton up}{Lshift up}
    sleep delay
}
;space
spellcast(str, delay = 25){
    send %str%{Space down}
    sleep 65
    send {Space up}
    sleep delay
}
;;;;;;
;;; End script


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 11th, 2011, 4:19 am 
Offline

Joined: September 6th, 2009, 6:56 pm
Posts: 32
For vixay:

A beautiful work, more responsive note, now a question as a combo I can incorporate into your own code for example EDFFFF + RIGHT CLICK is a great coat that I drew from various troubles here I leave what I've done exploring what you've done the same

I show the shield

Image

Code:
l::
SetKeyDelay 50, 50, Play
SendPlay edfff
send {Rbutton down}
return


I would like to add that line to your code line cosets

excuse my English only speaking Spanish and I am using the google translator greetings from Venezuela and once again great job.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: hmm...
PostPosted: February 15th, 2011, 1:43 pm 
Hmm.. it is difficult to understand what you are saying, but if I understand you correctly, you can just copy paste your code into my script and it will work :), just be sure to comment out my code for that hotkey.

but if you meant how it would work in my framework. thats easy.
Code:
great_coat = edffff

;or whatever hotkey you prefer
1:: forcebeam(great_coat)


Thats it!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 22nd, 2011, 11:04 am 
Hi i try this combos, but not work in the game. If i use in simple notepad or other games then work, but not in Magicka. I use Windows7 64bit.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 22nd, 2011, 1:36 pm 
Offline

Joined: September 6th, 2010, 5:42 am
Posts: 37
vixay, you're amazing, i wanna have ur babies!

Everything works awesome, this makes the game so much more fun to play with friends coz now i can spam combos like crazy and they'll be like WTF!


One problem though, if players haven't unlocked any of the hidden spells or have only just started playing, then obviously they wouldn't be able to use some of the spells like Timewarp or teleport etc. Which also means, the combinations you use for those spells won't work. If you check your list of spells for pressing "F1", and you try to do that at the start of chapter 1, then most of the spells work except in the end you'll hit yourself with an ice meteor. I had to comment out the Timewarp to prevent that....



Also, I couldn't find out what part of your code will automatically switch to the game after I reload the script. I wanna edit the spells to my liking but after I reload the script everytime, it switches to the game automatically and adds the word "ww" to whatever line that I was last editing at........how do I fix this?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 28th, 2011, 9:30 pm 
Vixay,
Great script!!!

I'm new to this stuff, so I'm quite happy to have found yours. I changed a few things, like a more specific window name for ifwinactive. (not sure how well this will translate to other comps)

I also added a bunch of stuff that prevents Magicks that the user hasn't found from being cast by hotkeys. If the user hasn't manually cast Conflagration at least once, then any combo or hotkey that uses it will skip it. My way is probably a bit messy. Spacebar has to be pressed twice instead of once for any Magicks. Maybe there is a better way?

Code:
#SingleInstance force

#NoEnv

Process,Priority,qmagicka,High
;This works!!! for using send
SetKeyDelay , 25, 75
SetMouseDelay, 50
;this is necessary because magicka expects keys to be pressed for a specific time, this is the smallest interval that works reliably, you can experment more if you want. It seems like you can do it slightly faster when doing it manually
;SetKeyDelay , 0, 65, Play
;http://www.autohotkey.com/forum/viewtopic.php?p=418841#418841

;Fix for Win7 with UAC
if not A_IsAdmin ;if code does not have admin rerun it with them
{
DllCall("shell32\ShellExecuteA", uint, 0, str, "RunAs", str, A_AhkPath
, str, """" . A_ScriptFullPath . """", str, A_WorkingDir, int, 1)
ExitApp
}

;settings
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Default keybindings - you can modify these if you have changed your settings
aoekey      = RButton ;for use with shift for aoe effect use on own for standard cast
selfcastkey = MButton
shiftkey    = LShift ;for use with aoe expression for aoe effect
water       = q
heal        = w
shield      = e
cold        = r
lightning   = a
arcane      = s
earth       = d
fire        = f
; the {@ 2} adds a delay that allows the combo to succeed as it needs a slightly longer delay
; not tested yet
ice         = qr{@ 2}
steam       = qf{@ 2}

;;spells
;From http://www.magickapedia.net/index.php?title=Magicks               
;Using default keyboard shortcuts
;you must have the corresponding magick for it to work, they are gained as described below
; also I've modified some combinations in here to make them work in game, because the delay timings weren't working out exactly. So if you change the delay timings or you computer behaves slightly differently you might have to rever to original combo for those spells.

;another good way I found to add a delay is to append a useless key sequence like so: {p 20}

GreaseInt   :=   false ;Variable for whether the spell is active in the hotleys
Grease          =    qdw            ;Chapter 1: Found across the lake, shortly after hearing someone scream. Freeze the lake to get across.     Covers the floor with slippery grease. Burns longer than normal fire when lit.

ReviveInt   :=   false
Revive          =    wa             ;Chapter 1: Obtained at the end of the tutorial.     Revives human players.

HasteInt   :=   false
Haste           =    asf            ;Chapter 1: Required to complete the tutorial. Found on a bookshelf.     Increases the wizards's movement speed.

MeteorShowerInt    :=   false
MeteorShower    =    fdqfdf         ;Chapter 1: Obtained at the start of the ;Chapter. This magick is a DLC bonus for all purchases made before January 31st, 2011.    Conjures several meteors that impact random locations on the screen.

NullifyInt   :=   false
Nullify         =    se             ;Chapter 2: Found beside the altar where a goblin shaman is fought.     Removes status effects from the caster. In addition, this spell cancels some (but not all) spells and magicks cast by other players and creatures. Most notably, the "mirror image" cast by Grimnír after the mind duel.

RainInt      :=   false
Rain            =    qqqf           ;Chapter 2: Found in the first cave you come across that is guarded by goblins.     Causes it to rain, wetting all units on the screen except those with an active shield.

ThunderBoltInt   :=   false
ThunderBolt     =    fqasaa         ;Chapter 3: Found in a henge.     Conjures a bolt that damages the most elevated unit heavily.

TornadoInt   :=   false
Tornado         =    dqfqqqf        ;Chapter 4: Before entering the city on the left of the main path in the trees by a shipwrecked boat.     Summons a large tornado that flings everyone nearby up into the air, causing damage

ConflagrationInt :=   false
Conflagration   =    qffffffqfffq   ;Chapter 4: Inside a burning building you are forced to detour through.     Heat wave that deals 600 damage and sets on fire.

TimeWarpInt   :=   false
TimeWarp        =    re             ;Chapter 5: Head west immediately after leaving the camp.     Slows time down for everyone - including the caster, although possibly by a slightly smaller degree - allowing you to react faster. Doesn't affect M60.

BlizzardInt   :=   false
Blizzard        =    rrrqr          ;Chapter 6: At the beginning of the ;Chapter, go east to the small lake. Use  to get across the water.     Summons a mighty blizzard, chilling everyone - including the caster! - for as long as it lasts (roughly 10 seconds?).

TeleportInt   :=   false
Teleport        =    asa            ;Chapter 7: On the broken walkway, after being transported by Vlad. There's also a way to get this Magick, as early as ;Chapter 1. To do this, you must first place Arcane/Fire mines (  ) near the base of the walkway. Make sure you place them whilst facing away from it. Then, walk over them to get blown up into the air. Some trial and error is to be expected in order for this to work. For further instructions, please see this video of the exploit.     Instantly teleports the caster a short distance forward.

SummonPhoenixInt :=   false
SummonPhoenix   =    waf            ;Chapter 8: After fighting the waves of Goblins and Trolls on a large bridge, keep heading right.     Summons a Phoenix at the casters location, dealing fire damage to everyone nearby and reviving all fallen wizards.

ThunderstormInt   :=   false
Thunderstorm    =    fqfqasaa       ;Chapter 8: Just before the mines, after the first stone bridge (where you talk to Vlad) in a cave (hidden from view).     Thunderbolt, now with 900% more glorious carnage! Effectively a mix of Rain and Thunderbolt, it will begin to rain both water and thunder from the skies, striking at random positions on the battlefield. Use with caution.

RaiseDeadInt   :=   false
RaiseDead       =    qrdsr          ;Chapter 9: After defeating the necromancers in the run-down church.     Summons a few undead ghouls to fight for the caster.

FearInt      :=   false
Fear            =    rse            ;Chapter 9: Found in the first room of the Count's castle on the left sitting on a bookshelf.     Every enemie nearby is scared witless, running in random directions away from the caster for approximately 3 seconds.

CharmInt   :=   false
Charm           =    wed            ;Chapter 9: Found in the first room of the Count's castle on the right leaning on the wooden furniture next to the couches.     The targeted creature temporarily becomes your ally, attacking your enemies.

SummonDeathInt   :=   false
SummonDeath     =    srrqrs         ;Chapter 10: Given to the player after defeating Death.     Summons Death, who will proceed to instantly kill the nearest player or creature with the lowest amount of health remaining.

SummonElementalInt :=   false
SummonElemental =    sedqfs         ;Chapter 11: After defeating the small detachment of dwarves in the second room of the cathedral, go northwest over the narrow bridge. Open the door, and the book will be on a pedestal.     Summons an inactive elemental. To activate the elemental, simply attack it with any element. The elemental will take the form of whichever element touches it first, and will subsequently be healed by that same element.

CorporealizeInt :=   false
Corporealize    =    sqfaes         ;Chapter 11: Given to the player after defeating Fafnir.     Used when fighting Assatur. Also causes any ethereal daemons to materialize and become corporeal.

InvisibilityInt   :=   false
Invisibility    =    seqfs          ;Chapter 11: In the first area, head south along the cliff you find to the east instead of entering the fortress.     Makes the caster invisible. Enemies will no longer actively attack the caster, although arrows, charging enemies and other AoE attacks will still hit the caster. Invisibility ends after casting, attacking, taking damage or colliding with a foe.

VortexInt   :=   false
Vortex          =    qrsqreqr       ;Chapter 12: Given to you after defeating the final boss.     Summons a large vortex that sucks in and crushes anyone careless enough to wander close.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;attack/defence combos
;http://www.magickapedia.net/index.php?title=Spell_Combinations
; you can define them using keys or names;
; eg. surge_c = qqqqq or surge_c := water water water water water
; note the ':' before the equal in the second definition using names, thats to force it to evalue it as an expression
superwetsteamlightning_c = sfqfqfqar
supersteamlightning_c = sfqfqaa
surge_c = qqqqq
blizzardball_c = dqrqrqrqr
coldquake_c = drddd
barrierrock_c = edddd
barrierice_c = eqwd

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;other init
WinWait, Magicka,
IfWinNotActive, Magicka, , WinActivate, Magicka,
WinWaitActive, Magicka,
;selfcast(heal heal)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



;;KeyStrings to activate Magicks:
;;These are the elemental combos that activate the Magicks. Users will have to press Space twice to use these, but after used once, the shortcuts will work for them.
::qdw::
    GreaseInt    :=   true
return
::wa::
    ReviveInt   :=   true
return
::asf::
    HasteInt   :=   true
return
::fdqfdf::
    MeteorShowerInt :=   true
return
::se::
    NullifyInt   :=   true
return
::qqf::
    RainInt   :=   true
return
::qfasa::
    ThunderBoltInt :=   true
return
::fqasa::
    ThunderBoltInt :=   true
return
::dqfqqf::
    TornadoInt   :=   true
return
::dfqqqf::
    TornadoInt   :=   true
return
::fqffqffq::
    ConflagrationInt := true
return
::qfffqffq::
    ConflagrationInt := true
return
::re::
    TimeWarpInt   :=   true
return
::rrrqr::
    BlizzardInt   :=   true
return
::asa::
    TeleportInt   :=    true
return
::waf::
    SummonPhoenixInt :=   true
return
::fqfqasa::
    ThunderstormInt :=   true
return
::qfqfasa::
    ThunderstormInt :=   true
return
::fqqfasa::
    ThunderstormInt :=   true
return
::qffqasa::
    ThunderstormInt :=   true
return
::qrdsr::
    RaiseDeadInt :=   true
return
::rqdsr::
    RaiseDeadInt :=   true
return
::rse::
    FearInt   :=   true
return
::wed::
    CharmInt   :=   true
return
::srrqrs::
    SummonDeathInt :=   true
return
::sedqfs::
    SummonElementalInt := true
return
::sedfqs::
    SummonElementalInt := true
return
::sqfaes::
    CorporealizeInt :=   true
return
::sfqaes::
    CorporealizeInt :=   true
return
::seqfs::
    InvisibilityInt :=   true
return
::rqsrqerq::
    VortexInt   :=   true
return
::qrsqreqr::
    VortexInt   :=   true
return
::qrsrqeqr::
    VortexInt   :=   true
return
::qrsrqerq::
    VortexInt   :=   true
return
::rqsqreqr::
    VortexInt   :=   true
return
::rqsrqeqr::
    VortexInt   :=   true
return
::qrsqreqr::
    VortexInt   :=   true
return
::qrsqrerq::
    VortexInt   :=   true
return


;;Shortcuts
#IfWinActive, ahk_class WindowsForms10.Window.8.app.0.33c0d9d

;;;combinations of various actions
; delays are necessary in combos, otherwise they don't work correctly, i've tested these and tweaked the delays a bit

fastmode_combo(){
    spellcast(TimeWarp,TimewarpInt)
    spellcast(Haste,HasteInt)
}
;any other ideas for good combos?
F1:: ;defense_combo() {
    selfcast(heal heal,100)
    ;selfcast(shield,100)
    selfcast(water shield,100)
    spellcast(Haste,HasteInt,500)
    ;spellcast(TimeWarp,TimeWarpInt,500)
    selfcast(barrierrock_c,200)
    ;loadcombo(superwetsteamlightning_c)
    forcebeam(blizzardball_c)
return
F2:: ;freeze_combo() {
    aoe(steam steam steam steam steam,100) ;wet
    aoe(cold cold cold cold cold,100) ;freeze
    aoe(superwetsteamlightning_c) ;destroy
return
F3:: ;freezeall_combo() ; have a shield on!
    selfcast(water shield,100)
    spellcast(Rain,RainInt,2500)
    selfcast(water shield, 100)
    spellcast(Blizzard,BlizzardInt,500)
return
F4:: ;thunder_combo() ;your own awesome thunderstorm!! hold down to continue using it! must have shield on before using it
    selfcast(water shield,100)
    spellcast(Rain,RainInt,2000)
    spellcast(ThunderBolt,ThunderBoltInt,500)
    ;continue casting spell as long as key is held down,
    ; your own thunderstorm!! without the self gibbing!
    While GetKeyState(A_ThisHotkey, "P")
    {
        spellcast(ThunderBolt,ThunderBoltInt,500)
    }   
return

F5::spellcast(Conflagration,ConflagrationInt)
F6::spellcast(Blizzard,BlizzardInt)
F7::spellcast(Tornado,TornadoInt)
F8::spellcast(Invisibility,InvisibilityInt)
F9::spellcast(Fear,FearInt)
F10::spellcast(Charm,CharmInt)
F12::run Z:\Games\Magicka\Magicka.exe
!^r::Reload
;Spells/Magicks
1::spellcast(Haste,HasteInt)
2::spellcast(TimeWarp,TimeWarpInt)
3::selfcast(water shieldInt)
4::spellcast(Rain,RainInt)
5::spellcast(ThunderBolt,ThunderBoltInt)
6::spellcast(Teleport,TeleportInt)
7::spellcast(SummonElemental,SummonElementalInt)
8::spellcast(Corporealize,CorporealizeInt)
9::spellcast(RaiseDead,RaiseDeadInt)
0::spellcast(Vortex,VortexInt)

;attack/defence combos
z::forcebeam(supersteamlightning_c)
x::aoe(supersteamlightning_c)
c::selfcast(shield)
v::selfcast(heal heal)
b::forcebeam(blizzardball_c)
n::loadcombo(superwetsteamlightning_c)
m::forcebeam("sar")
,::resetkeys()

g::selfcast(barrierrock_c)
h::selfcast(barrierice_c)
j::aoe(surge_c)
k::aoe(coldquake_c)

; from  j-Factor @ http://www.reddit.com/r/magicka/comments/fcvi5/macroing_with_autohotkey_dont_do_this_unless_you/
; use with loadcombo
; Melee - mouse button 4
XButton1::
    If GetKeyState("LButton", "P")
        SendEvent {Click up}

    While GetKeyState("XButton1", "P")
    {
        SendEvent +{Click}
    }

    If GetKeyState("LButton", "P")
        SendEvent {Click down}
Return

; AOE - mouse button 5
XButton2::
    SendEvent {Shift down}{Click down right}
    While GetKeyState("XButton2", "P")
    {
    }
    SendEvent {Shift up}{Click up right}
Return


#IfWinActive

;;;typesofattack - utility functions
resetkeys(){
    send {LShift up}{Rbutton up}{Lbutton up}{Mbutton  up}
}

;no clicks - use with xbutton1(melee) or xbutton2(aoe) or right click
loadcombo(str){
    send %str%
}
;right click
forcebeam(str, delay = 0){
    send %str%{Rbutton down}
    sleep delay
}
;shift right click
aoe(str, delay = 25){
    send %str%{LShift down}{Rbutton down}
    sleep 65 ;the sleeps should no longer be necessary if setmousedelay works correctly
    send {Rbutton up}{Lshift up}
    sleep delay
}
;middle click
selfcast(str, delay = 25){
    send %str%{Mbutton down}
    sleep 65
    send {Mbutton up}
    sleep delay
}
;shift left click
imbueweapon(str, delay = 25){
    send %str%{LShift down}{Lbutton down}
    sleep 65
    send {Lbutton up}{Lshift up}
    sleep delay
}
;space
spellcast(str, active, delay = 25){
    if active
    {
        send %str%{Space down}
        sleep 65
        send {Space up}
        sleep delay
    }
}
;;;;;;
;;; End script


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 27 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Exabot [Bot], HotkeyStick, rbrtryn, XstatyK and 80 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group