I recently started playing Dungeon Master for the first time. Although I had an Amiga back in the day, for some reason I never came across a copy of this game.
After a brief go at the DOS version, then RTC (until I started having major issues with Wizard Eyes on the western part of level 5), I finally settled on CSBWin.
My party currently consists of Nabi, Syra, Wu Tse and Elija.
Anyway, the repetitive task of making and drinking buffing potions (got addicted to those when playing RTC) made me motivated to find a way to make that process quicker and easier.
What I've come up with so far is the following AHK script.
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetKeyDelay, 250
SetMouseDelay, 25
#IfWinActive CSB for Windows
F6::
BuffHeroes()
return
^F6::
BuffHeroes(true)
return
F7::
Send {F1}614 {F2}614 {F3}614 {F4}614{Space}
return
F8::
Send {F1}6454 {F2}6454 {F3}6454 {F4}6454{Space}
return
r::
SwapWeapons(1)
SwapWeapons(2)
return
t::
SwapWeapons(3)
SwapWeapons(4)
return
^z::
FullHeal(1)
return
^x::
FullHeal(2)
return
^c::
FullHeal(3)
return
^v::
FullHeal(4)
return
+z::
EmergencyHeal(1)
return
+x::
EmergencyHeal(2)
return
+c::
EmergencyHeal(3)
return
; This one doesn't work for some reason? Is SHIFT+V reserved for CSBWin?
+v::
EmergencyHeal(4)
return
^1::
Volley(1)
return
^2::
Volley(2)
return
^3::
Volley(3)
return
^4::
Volley(4)
return
^5::
Volley(5)
return
^6::
Volley(6)
return
SetSpeed(speed)
{
WinMenuSelectItem, CSB for Windows,, Speed, %speed%
}
Magic(hero)
{
key := "F" . hero
Send {%key%}
}
Inventory(hero)
{
key := {1: "z", 2: "x", 3: "c", 4: "v"}[hero]
Send {%key%}
}
MagicInventory(hero)
{
Magic(hero)
Inventory(hero)
}
BuffHeroes(DoubleKu := false)
{
SetKeyDelay, 100
SetSpeed("Quick as a Bunny")
BuffHero(1, DoubleKu)
BuffHero(2, DoubleKu)
BuffHero(3, DoubleKu)
BuffHero(4, DoubleKu)
SetSpeed("Normal")
SetKeyDelay, 250
}
BuffHero(hero, DoubleKu := false)
{
MagicInventory(hero)
MakeBuffs(DoubleKu)
Inventory(hero)
}
SwapWeapons(hero)
{
Inventory(hero)
Send ljl
Inventory(hero)
}
FullHeal(hero)
{
MagicInventory(hero)
SwapItems()
Send 62{Space}
DrinkPotion()
SwapItems()
Inventory(hero)
}
EmergencyHeal(hero)
{
Inventory(hero)
Send iui
Inventory(hero)
return
}
Volley(i)
{
Send {F1}%i%44 {F2}%i%44 {F3}%i%44 {F4}%i%44{Space}
}
MakeBuffs(DoubleKu := false)
{
SwapItems()
Send 1451{Space}
DrinkPotion()
Send 1352{Space}
DrinkPotion()
Send 1153{Space}
DrinkPotion()
Send 1154{Space}
DrinkPotion()
if (DoubleKu)
{
Send 1451{Space}
DrinkPotion()
}
SwapItems()
}
SwapItems()
{
;MouseClick, left, 374, 418
;MouseClick, left, 356, 509
;MouseClick, left, 374, 418
Send kjk
}
DrinkPotion()
{
;MouseClick, left, 356, 509
;MouseClick, left, 325, 310
;MouseClick, left, 356, 509
Send juj
}
+Esc::ExitApp ; Exit script with SHIFT+Esc
Code: Select all
mscan 1 005a 37 17 R ; 'Z' = first character inventory
mscan 1 0058 7c 17 R ; 'X' = second character inventory
mscan 1 0043 C1 17 R ; 'C' = third character inventory
mscan 1 0056 107 17 R ; 'V' = fourth character inventory
mscan 1 0055 41 37 L ; 'U' = mouth
mscan 1 0049 5b 37 L ; 'I' = inventory slot to the right of mouth
mscan 1 004a 47 5e L ; 'J' = main hand
mscan 1 004b 4c 4c L ; 'K' = inventory slot closest to main hand
mscan 1 004c 5b 4c L ; 'L' = inventory slot second closest to main hand
Initially I only wanted the script to automatically buff the party, but once I had done that I decided to add some other stuff to it as well and improve/clean up the code.
Hopefully someone might find this useful.