Any chance of getting this one to work with the new parms?

Got a cool macro idea? Wanna request a macro? Here is the place for you!

Moderator: MacroQuest Developers

Wink-
a ghoul
a ghoul
Posts: 122
Joined: Tue Apr 27, 2004 2:41 pm

Any chance of getting this one to work with the new parms?

Post by Wink- » Tue Apr 27, 2004 3:00 pm

This great enchant/imbue macro worked wonders and I am trying to converrt it myself unsuccessfully. Any chance of getting working again?

Code: Select all

#turbo 
#event NOCOMPONENT "You are missing some required spell components." 
#event NOSPELL "You do not seem to have that spell memorized." 
#event NOMANA "Insufficient Mana to cast this spell!" 
#event INTERRUPTED "Your spell is interrupted." 
#event FIZZLED "Your spell fizzles!" 

Sub Main 
|+ Declaring all variables. 
|-------------------------------------------------- 
   /declare mount global 
   /declare recast global 
   /declare mass global 
   /declare spellname global 
   /declare itemname global 
   /declare tmpspellname global 
|---------- 

|+ (Re-)Setting default values 
|-------------------------------------------------- 
   /varset mount 0 
   /varset recast 0 
   /varset mass 0 
   /varset spellname 0 
   /varset tmpspellname 0 
   /varset itemname 0 
|---------- 

|+ Do some simple checking before starting. 
|-------------------------------------------------- 
   /if "$defined(Param1)"=="FALSE" /call Syntax 
   /if "$defined(Param1)"=="TRUE" /varset itemname "@Param1" 
   /if n $char(gem,"@Param0")>0 /varset spellname "@Param0" 
   /if n $char(gem,"Mass @spellname")>0 /varset mass 1 
   /if n $char(buff,"Summon Horse")>0 /varset mount 1 
   /if n @mount==0 /if n $char(buff,"Summon Drogmor")>0 /varset mount 1 
|---------- 
|+ Run the imbue/enchant loop. 
|-------------------------------------------------- 
   :Loop 
      /if "$char(state)"!="STAND" /stand 
      /if n @mass==1 /if n $count("@itemname")>=5 { 
         /varset tmpspellname "Mass @spellname" 
      } else { 
         /varset tmpspellname "@spellname" 
      } 
      /cast "@tmpspellname" 
      /doevents 
      /if n @recast==1 { 
         /varset recast 0 
         /goto :Loop 
      } 
      /delay $calc($spell("@tmpspellname",casttime)+1)s    
      /doevents 
      /if n @recast==1 { 
         /varset recast 1 
         /goto :Loop 
      } 
      /if n @mount==0 /if $char(state)!="SIT" /sit 
      /click left auto 
      /delay $calc($spell("@tmpspellName",recoverytime)+5)s 
   /goto :Loop 
|---------- 
/return 

Sub Syntax 
   /echo Syntax: /macro imbue "Single Imbue/Enchant Component Spellname" "Component Name" 
   /echo Example: /macro imbue "Enchant Clay" "Large Block of Clay" 
   /echo You are recommended to memorize both the "Mass Imbue/Enchant" and the "Single Imbue/Enchant" spell, if you have it. 
   /echo The macro will automatically use the right one, according to the number of components left to imbue/enchant. 
   /endmacro 
/return 

Sub Event_NOMANA 
   /varset recast 1 
   /if "$char(state)"!="SIT" /if n @mount==0 /sit 
   :Loop 
      /delay 6s 
   /if n $char(mana,cur)<$char(mana,max) /goto :Loop 
/return 

Sub Event_FIZZLED 
   /varset recast 1 
/return 

Sub Event_INTERRUPTED 
   /varset recast 1 
/return 

Sub Event_NOSPELL 
   /endmacro 
/return 

Sub Event_NOCOMPONENT 
   /endmacro 
/return
Thanks

Wink-

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Tue Apr 27, 2004 3:14 pm

Code: Select all

|+ Do some simple checking before starting. 
|-------------------------------------------------- 
   /if "$defined(Param1)"=="FALSE" /call Syntax 
   [color=red]/if "$defined(Param1)"=="TRUE" /varset itemname "@Param1" 
   /if n $char(gem,"@Param0")>0 /varset spellname "@Param0" [/color]
   /if n $char(gem,"Mass @spellname")>0 /varset mass 1 
   /if n $char(buff,"Summon Horse")>0 /varset mount 1 
   /if n @mount==0 /if n $char(buff,"Summon Drogmor")>0 /varset mount 1 

Code: Select all

  /if (${Defined[Param1]}) /varset itemname "@Param1"
  /if (${Me.Gem["@Param0"]}) /varset spellname "@Param0"
Small example of how to get started. The rest should be easy to convert using the following link as a guide.

http://macroquest2.com/phpBB2/viewtopic.php?t=6022

If not, give it a go anyway and post what ya can't get to work.

Wink-
a ghoul
a ghoul
Posts: 122
Joined: Tue Apr 27, 2004 2:41 pm

Post by Wink- » Tue Apr 27, 2004 5:16 pm

This is what I have so far. It works but there is something I need some help figuring out. I jimmy wrigged it to work until I get this piece of code converted.

Code: Select all

/delay $calc($spell("@tmpspellName",recoverytime)+5)s 

Code: Select all

#turbo 
#event NOCOMPONENT "You are missing some required components." 
#event NOSPELL "You do not seem to have that spell memorized." 
#event NOMANA "Insufficient Mana to cast this spell!" 
#event INTERRUPTED "Your spell is interrupted." 
#event FIZZLED "Your spell fizzles!" 

|Open up your inventory window first

Sub Main 
|+ Declaring all variables. 
|-------------------------------------------------- 
   /declare mount global 
   /declare recast global 
   /declare mass global 
   /declare spellname global 
   /declare itemname global 
   /declare tmpspellname global 
|---------- 

|+ (Re-)Setting default values 
|-------------------------------------------------- 
   /varset mount 0 
   /varset recast 0 
   /varset mass 0 
   /varset spellname 0 
   /varset tmpspellname 0 
   /varset itemname 0 
|---------- 

|+ Do some simple checking before starting. 
|-------------------------------------------------- 
|   /if "$defined(Param1)"=="FALSE" /call Syntax 
    /if (${Defined[Param1]}==FALSE) /call Syntax

|   /if "$defined(Param1)"=="TRUE" /varset itemname "@Param1" 
    /if (${Defined[Param1]}) /varset itemname "@Param1" 

|   /if n $char(gem,"@Param0")>0 /varset spellname "@Param0" 
    /if (${Me.Gem["@Param0"]}) /varset spellname "@Param0" 

|   /if n $char(gem,"Mass @spellname")>0 /varset mass 1 
    /if (${Me.Gem["Mass @spellname"]}) /varset mass 1

|   /if n $char(buff,"Summon Horse")>0 /varset mount 1 
    /if (${Me.buff["Summon Horse"]}) /varset mount 1

|   /if n @mount==0 /if n $char(buff,"Summon Drogmor")>0 /varset mount 1 
    /if (${Me.buff["Summon Drogmor"]}) /varset mount 1

|---------- 
|+ Run the imbue/enchant loop. 
|-------------------------------------------------- 
   :Loop 
|      /if "$char(state)"!="STAND" /stand 
       /if (${Me.state[STAND]}==FALSE) /stand

|  
|/if n @mass==1 /if n $count("@itemname")>=5 { 
|         /varset tmpspellname "Mass @spellname" 
|      } else { 
|         /varset tmpspellname "@spellname" 
|      } 
|

        /if (@mass==1) /if (${FindItemCount["@itemname"]}>=5 )  {
	  /varset tmpspellname "Mass @spellname" 
	} else {
	  /varset tmpspellname "@spellname"
	}


      /cast "@tmpspellname" 
      /doevents 

      /if  (@recast==1) { 
         /varset recast 0 
         /goto :Loop 
      } 
|      /delay $calc($spell("@tmpspellname",casttime)+1)s    
       /delay 11s

      /doevents 
      /if  (@recast==1) { 
         /varset recast 1 
         /goto :Loop 
      } 
| /if  (@mount==0) (/if $char(state)!="SIT") /sit 
  /if  (@mount==0) /if (${Me.state[SIT]}==FALSE) /sit  

       /click left auto 
|      /delay $calc($spell("@tmpspellName",recoverytime)+5)s 
       /delay 7s

   /goto :Loop 
|---------- 
/return 

Sub Syntax 
   /echo Syntax: /macro imbue "Single Imbue/Enchant Component Spellname" "Component Name" 
   /echo Example: /macro imbue "Enchant Clay" "Large Block of Clay" 
   /echo You are recommended to memorize both the "Mass Imbue/Enchant" and the "Single Imbue/Enchant" spell, if you have it. 
   /echo The macro will automatically use the right one, according to the number of components left to imbue/enchant. 
   /endmacro 
/return 

Sub Event_NOMANA 
   /varset recast 1 

|   /if "$char(state)"!="SIT" /if n @mount==0 /sit 
    /if  (@mount==0) /if (${Me.state[SIT]}==FALSE) /sit
   
   :Loop 
      /delay 6s 

|   /if n $char(mana,cur)<$char(mana,max) /goto :Loop 
    /if ((${Me.CurrentMana})<(${Me.MaxMana})) /goto :Loop

/return 

Sub Event_FIZZLED 
   /varset recast 1 
/return 

Sub Event_INTERRUPTED 
   /varset recast 1 
/return 

Sub Event_NOSPELL 
   /endmacro 
/return 

Sub Event_NOCOMPONENT 
   /endmacro 
/return
[/code]

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Tue Apr 27, 2004 5:30 pm

This question was cross posted? I think I saw Lax answer it in Help.