Comments are greatly appreciated.
Code: Select all
||||||||||||||||||||||||||||||||||||||||||
| |
| Food and Drink Macro |
| |
| Set FoodSpell and Waterspell |
| To the respective spells you want |
| to cast |
| The stuff between the "-" lines |
| |
| Execute: /macro fnd <total> |
| <total> is the amount of each |
| to create |
| Default is 20 if not specified |
| |
||||||||||||||||||||||||||||||||||||||||||
#turbo | cause everyone else does it
#Event Fizzle "Your spell fizzles!"
#Event Recovered "You haven't recovered yet..."
#Event Interrupt "Your spell is interrupted."
#Event NoMana "Insufficient Mana to cast this spell"
#Event Distracted "You are too distracted to cast a spell now!"
#Event Stunned "You can't cast spells while stunned!"
sub main
/declare recast global |try recast if fizzle, not recovered
/declare killmac global |exit macro if interrupted, no mana, distracted, stunned
/declare Total local |total pieces of each to create
/declare Spell global |var for current spell, disregard
/declare i local |iteration count in loop
/declare CT local |spell cast time
/declare RT local |spell recovery time
/declare FoodSpell local |name of food spell
/declare WaterSpell local |name of water spell
/declare Slot local |slot number of memed spell
|--------------------------------
/varset FoodSpell "Summon Food" | Set to food spell
/varset WaterSpell "Summon Drink" | Set to water spell
|--------------------------------
/varset Total 20 | Default total
/if $defined(Param0)!=FALSE {
/varset Total @Param0
}
/echo Creating @Total Food and Drink
| Mem Spells
|Food
/varset Slot $char(gem,"@FoodSpell")
/if n @Slot==0 {
/windowstate spellbook open
/memspell 7 "@FoodSpell"
/delay 50
/cleanup
}
/varset Slot $char(gem,"@WaterSpell")
/if n @Slot==0 {
/memspell 8 "@WaterSpell"
/delay 50
/cleanup
}
| Stand up
/if $char(state)==SIT {
/stand
}
| Open Inventory to drop new food and water after creation
/windowstate inventory open
|
| Food Creation
|
/echo Beginning Food Summoning
/varset Spell "@FoodSpell"
/varset CT $spell("@Spell",casttime)s
/varset RT $spell("@Spell",recoverytime)s
/varset i 1
:foodloop
/varset recast 0
/if n @i<=@Total {
/cast "@Spell"
/delay 5
/delay @RT
/doevents
/if n @recast==1 /goto :foodloop
/if n @killmac==1 /return
/delay @CT
/delay 15 | more delay, takes too long
/click left auto
/varadd i 1
/goto :foodloop
}
|
| Drink Creation
|
/echo Beginning Water Summoning
/varset Spell "@WaterSpell"
/varset CT $spell("@Spell",casttime)s
/varset RT $spell("@Spell",recoverytime)s
/varset i 1
:waterloop
/varset recast 0
/if n @i<=@Total {
/cast "@Spell"
/delay 5
/delay @RT
/doevents
/if n @recast==1 /goto :waterloop
/if n @killmac==1 /return
/delay @CT
/delay 15 | more delay, takes too long
/click left auto
/varadd i 1
/goto :waterloop
}
/cleanup
/return
sub Event_Fizzle
/delay 10
/echo @Spell Fizzled, recasting
/varset recast 1
/return
sub Event_Recovered
/delay 10
/echo Didn't wait long enough, retrying...
/varset recast 1
/return
sub Event_Interrupt
/delay 4
/echo @Spell Interrupted, stop moving or getting hit, killing macro
/varset killmac 1
/return
sub Event_NoMana
/delay 4
/echo No mana to cast, killing macro
/varset killmac 1
/return
sub Event_Distracted
/delay 4
/echo You are distracted, killing macro
/varset killmac 1
/return
sub Event_Stunned
/delay 4
/echo You are stunned and probably shouldn't be running this now, killing macro
/varset killmac 1
/return
