Mage Initial Summon Mac

A forum for you to dump all the macros you create, allowing users to use, modify, and comment on your work.

Moderator: MacroQuest Developers

Zacaria
orc pawn
orc pawn
Posts: 19
Joined: Wed Dec 03, 2003 5:47 pm

Mage Initial Summon Mac

Post by Zacaria » Tue Jan 13, 2004 10:20 pm

Ok decided to post this dont really know why or who it would be usefull for. But hey why not share my couple hours of work.

Code: Select all

| Mage Summoning Macro
|----------------------
| Written By Zacaria
| V.1.0
| 13-Jan-2004
|----------------------
|
|
|---------------------------------------------
| REQUIRED ITEMS REQUIRED ITEMS REQUIRED ITEMS
|---------------------------------------------
| Ok You MUST be at least level 63 for this script to work perfect AND have all the spells Up to that point
| ALSO you must create some Spell Lists. (This isnt required but really helps)
| If you look at the variables below you'll see the default is "Full Conjur" and "petconj" and "default"
| Those are as follows DefaultSpellSet is for your summon spells (Gift of Xev, Focus Items)
| PetWeapsSpellSet has your Pet weapons and belt etc
| DefaultSpellSetReg is just for your regular spell set so when the macro is done it will make you ready to rock.
|---------------------------------------------
| This Macro is For Mages with Lots Of Summons to do on Log In.
| My Mage has all kinds of Bags that I summon (Gift of Xev Bags) and also I use all the focus items
| I have added 2 Variables that need to be Set.
| They are the Default Spell Set which is for your Regular Spells for Summoning (Bag and Focus Items)
| Next is For Pet Weapons. These are Both Optional (Default is to do Both)
|
|Syntax is.
| Yes For Pet Weapons-----------------------------o
| Yes For Summoning Bags and Food.--------------o |
| Macro Name ---------------------------o       | |
|                                       |       | |
|                                       |       | |
|                                    vvvvvvvvv  v v
|                               /mac mage_start 1 1
|
|	Either one of the options can be either 1 or 0 (results are as expected)
|
| I have this for my level 63 Mage and you can change the settings below with a little macro knowledge I also have it Auto equip
| all the focus items (Ring, Earring, DD Bracer) Also a Orb Of Exploration.
|
| It will summon Gift of Xev bags up to the point of having 1 slot free. Which it will put a Mana Rod in there.
|
| Also will automagically put Shield of Arcane and Xegony's on you
| let me know what you would like to see and i'll see if i can get to it.
|----------------------------------------------------------------------------

#turbo

#Event CastStart "You begin casting" 
#Event CastFizzle "Your spell fizzles!" 
#Event CastInterrupt "Your spell is interrupted." 
#Event CastNoMana "Insufficient Mana to cast this spell" 
#Event Recovered "You haven't recovered yet..." 
#Event Distracted "You are too distracted to cast a spell now!" 
#Event Sitting "You must be standing to cast a spell." 
#Event NoMem "You do not seem to have that spell memorized." 
#Event Stunned "You can't cast spells while stunned!" 

Sub Main
/call SetupSpellVars
/if $defined(@Param0)!=TRUE /varset SetupVars(1) 1
/if $defined(@Param0)==TRUE /varset SetUpVars(1) @Param0
/if $defined(@Param1)!=TRUE /varset SetupVars(2) 1
/if $defined(@Param1)==TRUE /varset SetUpVars(2) @Param1

/declare l1 local
/declare temp1 local
|
|
|
| Put your Spell Sets Here
|
|
/varset DefaultSpellSet "Full Conjur"
/varset PetWeapsSpellSet "petconj"
/varset DefaultSpellSetReg "default"

/if $char(state)==SIT {
/stand
}

/if @SetupVars(1)==1 {
	/varset temp1 0

	/for l1 0 to 7 

	/if $item(inv,@l1)!=TRUE /varadd temp1 1
	/if n $item(inv,@l1,id)==3426 /varadd temp1 1

	/next l1

	/varsub temp1 1

	/if n @temp1<0 {

		/echo .. You already have Summoned Bags.. Get Rid of them and re-run
		/endmacro
	}
	/call Memspell @DefaultSpellSet
	/call CheckEquip finger 29799

	

	/if n $return==0 {
		/call SpellSub "Summon Spiked Ring"
		/click left autoequip
	}
	/if n @temp1>0 {

	/for l1 1 to @temp1

	/call SpellSub "Gift Of Xev"
	/call PutAway
	/next l1
	}

	/call CheckEquip wrist 29798

	/if n $return==0 {
		/call SpellSub "Summon Sapphire Bracelet"
		/click left autoequip
		}

	
	/call CheckEquip ear 29800

	/if n $return==0 {
		/call SpellSub "Summon Glowing Bauble"
		/click left autoequip
	}
	
	/if "$equip(ammo)"!="TRUE" {

		/call SpellSub "Summon: Orb Of Exploration"
		/click left autoequip
	}

}

/if n @SetupVars(2)==1 {
	/varset temp1 0
	/for l1 0 to 7
		/if "$pack(@l1,name)"~~"Glowing Backpack" {
			/if n @l1>@temp1 /varset temp1 @l1
		}
	/next l1
	/if n $pack(@temp1,space)<8 {

	/echo Not Enough Space In that Bag.. Exiting Make Sure Last Glowing Backpack has 8 free spaces

	/cleanup

	/windowstate Inventory open
	/click right inv @temp1
	/goto :buffcheck
	}
	/cleanup
	/delay 1
	/windowstate Inventory open
	/call Memspell @PetWeapsSpellSet	
	/call SpellSub "Muzzle Of Mardu"
	/call SpellSub "Muzzle Of Mardu"
	/call PutInPack @temp1

	/call SpellSub "Belt Of Magi'Kot"
	/call SpellSub "Belt Of Magi'Kot"
	/call PutInPack @temp1

	/call SpellSub "Fist Of Ixiblat"
	/call SpellSub "Fist Of Ixiblat"
	/call PutInPack @temp1

	/call SpellSub "Blade Of Walnan"
	/call SpellSub "Blade Of Walnan"
	/call PutInPack @temp1
}
	:buffcheck

	/if $count(id,3426)==0 {
	/press F1
	/call SpellSub "Rod Of Mystical Transvergance"
	/autoinv
	}
	/if n $char(buff,"Xegony's Phantasmal Guard")==0 /call SpellSub "Xegony's Phantasmal Guard"
	/if n $char(buff,"Shield Of The Arcane")==0 /call SpellSub "Shield Of The Arcane"
	/call Memspell @DefaultSpellSetReg

/return

Sub SetupSpellVars 
	/declare Amount global
	/declare Remem global
	/declare Fail global
	/declare DefaultSpellSet global 
	/declare DoAgain global 
	/declare StartCast global 
	/declare SpellSlot global 
	/declare SpellName global 
	/declare CastTime global 
	/declare CTimer timer 
	/declare OOMtimer timer 
	/declare PetWeapsSpellSet global

	/declare DefaultSpellSetReg global

	/declare SetupVars array

	/cleanup
	/windowstate Inventory open

/return 

|SpellSub 
|Main spell casting sub. 
|Used to handle all spell casting.  Auto mems spells and handles fizzles. 
|Will need to set the DefaultSpellSet var to your default spell set. 
| 
|Usage /call SpellSub "spellname" 
| 

Sub SpellSub 
   /if "@Param0"=="NA" /return 
   /varset Fail 0 
   /varset SpellName "@Param0" 
   /if $char(state)==SIT { 
      /stand 
   } 
   /varset Remem 0 
   :WaitForStop 
   /doevents 
   /if $char(ismoving)!=FALSE { 
      /delay 1s 
      /goto :WaitForStop 
   } 
   :MemWait 
   /doevents 
   /if n @Fail==1 { 
      /varset Fail 0 
      /if n @Remem==1 { 
         /call Memspell @DefaultspellSet
      } 
      /return 1 
   }    
   /varset SpellSlot $char(gem,"@SpellName") 
   /if n @SpellSlot<0 { 
      /delay 1s 
      /goto :MemWait 
   } 
   /if n @SpellSlot==0 { 
      /memspell 2 "@Param0" 
      /varset SpellSlot 2 
      /varset Remem 1 
      :refreshwait 
      /doevents 
      /if n @Fail==1 { 
         /varset Fail 0 
         /if n @Remem==1 { 
             /call Memspell @DefaultSpellSet
         } 
         /return 1 
      }    
      /delay 5 
      /if n $char(gem,"@SpellName")<=0 /goto :refreshwait 
   } 
   /varset CastTime "$spell("@SpellName",casttime)" 
   /varadd CastTime 1 
   :BeginCast 
   /varset Fail 0 
   /varset DoAgain 0 
   /varset StartCast 0 
   /call WaitForStart 
   :TimerLoop 
   /doevents 
   /if n @DoAgain==1 /goto :BeginCast 
   /if n @Fail==1 { 
      /varset Fail 0 
       /if n @Remem==1 { 
          /call Memspell @DefaultSpellSet 
       } 
     
  /if n @SitAfterCast==1 { 
         /if $char(state)==STAND /sit 
      } 
      /return 1 
   } 
   /if n @CTimer>0 /goto :TimerLoop 
   /delay 2 
   /doevents 
   /if n @DoAgain==1 /goto :BeginCast 
   /if n @Remem==1 { 
      /call Memspell @DefaultSpellSet 
      }    
/return 0 

|WaitForStart 
|Used by SpellSub to determine when to start spell countdown. 
Sub WaitForStart 
   /cast @SpellSlot 
   :StartLoop 
   /doevents 
   /if n @Fail==1 /return 
   /if n @DoAgain==1 /return 
   /if n @StartCast==0 { 
      /goto :StartLoop 
   } 
   /varset CTimer "@CastTime"s 
/return 

Sub Event_CastStart 
   /varset StartCast 1 
/return 

Sub Event_CastFizzle 
   /delay 2 
   /varset DoAgain 1 
/return 

Sub Event_CastInterrupt 
   /delay 2 
   /if n @Fail==1 /return 
   /varset DoAgain 1 
/return 

Sub Event_Sitting 
   /stand 
   /delay 2 
   /varset DoAgain 1 
/return 

Sub Event_CastTooFar 
   /varset Fail 1 
   /echo "Too far away. " 
   /varset CTimer 0 
/return 

Sub Event_Distracted 
   /echo "I can't cast. I'm too distracted. " 
   /varset Fail 1 
   /varset CTimer 0 
/return 

Sub Event_NoTarget 
   /varset Fail 1 
   /echo "I don't know what target to cast on. " 
   /varset CTimer 0 
/return 

Sub Event_NoMem 
   /echo "That spell is not memed. " 
   /varset Fail 1 
   /varset CTimer 0 
/return 

Sub Event_CastNoMana 
   /if n @OOMtimer<=0 /echo "OUT OF MANA! OOM OOM OOM!! Medding for 20 seconds then trying again....."
   /varset DoAgain 1 
   /sit off 
   /sit on 
   /varset OOMtimer 13s 
   :medingwait 
   /delay 1 
   /doevents 
   /if n @OOMtimer>0 /goto :medingwait 
   /sit off 
/return 

Sub Event_Stunned 
   /echo "Stunned waiting 3 seconds to try again. " 
   /delay 3s 
   /varset DoAgain 1 
/return 

Sub Event_Recovered 
   /delay 2s 
   /varset DoAgain 1 
/return 


Sub PutAway
/declare l1 local
/varset Amount 7

/for l1 0 to 7

	/if $count(id,17306)>=1 {

		/if n $item(inv,@l1,id)!=17306 /next l1
	/varset Amount @l1
	/autoinv

	/call PutInPack @Amount
	/return
	}
	/if "$item(inv,@l1)"=="TRUE" /next l1
	/if n @l1<=@Amount {
		/varset Amount @l1
	}
/next l1

/autoinv

/call PutInPack @Amount

/return

Sub PutInPack
/declare l1 local
/if $pack(@Param0,open)==FALSE /click right inv @Param0
/for l1 0 to $int($calc($pack(@Param0,slots)-1))
	/if $cursor()=="TRUE" {
		/if n $count(id,$cursor(id))>=25 {
			/destroy
		}
		/if n $cursor(id)==13081 {
				/destroy
		}
		/if "$item(@Param0,@l1,name)"==NULL {
		/click left pack @Param0 @l1
		}
	}
/next l1

/return


Sub CheckEquip(Slot,ID)
/declare CheckEquipResult local
/declare Goodbad local

/varset Goodbad 0

/if "@Slot"~~"finger" /goto :multiple
/if "@Slot"~~"wrist" /goto :multiple
/if "@Slot"~~"ear" /goto :multiple
:single

:multiple
/varcat Slot 1
:multi2
/if n $equip(@Slot,id)!=@ID /varadd Goodbad 1
/if "$equip(@Slot)"~~"$equip" /varadd Goodbad 1
/if n $equip(@Slot,id)==@ID /varsub Goodbad 1
/if "$equip(@Slot)"~~"TRUE" /varsub Goodbad 1
/if n $instr(2,"@Slot")!=-1 /goto :done
/varset Slot $left($int($calc($strlen(@Slot)-1)),@Slot)
/varcat Slot 2
/goto :multi2

:done
/if n @Goodbad>=1  {
	/varset CheckEquipResult 0
	} else {
	/varset CheckEquipResult 1
	}
}
/return @CheckEquipResult

Sub MemSpell
/memspellset @Param0
:loop1
/if $char(state)==SIT {
	/goto :loop1
}
/return

topgun
a lesser mummy
a lesser mummy
Posts: 43
Joined: Thu Jan 09, 2003 8:27 am

Post by topgun » Wed Jan 14, 2004 2:45 am

I been looking for this in ages, going to test it tonight.... tnx