confused as hell

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

cobra
orc pawn
orc pawn
Posts: 13
Joined: Wed Feb 11, 2004 5:38 am

confused as hell

Post by cobra » Thu Apr 22, 2004 5:54 am

Hi guys
I have no background in programing at all I learnt the old system on my own enough to write my one and only macro i have ever done .and now
/cry it does not work any longer. iam afraid it will take me another 3 months to learn new data language and iam willing to try in mean time any kind soul who understands the language can help me convert this macro i would for ever be in your debt and i can use it to compare new to old to help me better understand .

Code: Select all


#chat tell
#chat group
#include spellcast2.inc
#include routines.mac
#turbo 75
 
Sub main

 
/declare tankname global
/declare nukename global
/declare mobhp global
/declare tempvar global
/declare assisthealth global

/echo "Macro Starting"
/varset assisthealth @Param1
/varset tankname @Param0
/varset nukename black steel 
/echo "@tankname is assist tank."
/varset tempvar 0

/goto :top
/return


:top

/doevents
/if $char(state)==DUCK { 
/pet back off 
/endmacro 
} 
/if $char(state)==SIT { 
/pet back off 
/endmacro 
} 
/echo starting TOP Assisitng @tankname
/assist @tankname
/delay 10
/if "$target()"=="FALSE" {
/echo Nothing on @tankname Target
/target @tankname
/goto :top
}
/if "$target(type)"!="NPC" {
/goto :top
}
/if n @tempvar!="$target(hp,pct)" /echo $target(name,clean) targeted at $target(hp,pct)% at distance $target(distance).
/varset tempvar "$target(hp,pct)"

/if n "$target(hp,pct)">="@assisthealth" {
/echo Time to start working
/goto :top
} else {
/echo Target Acquired: $target(name,clean)
/if n "$target(hp,pct)"<=95 {
/delay 5
/echo Casting Malosinia 
/call cast "malosinia"
/echo sending Pet IN to KILL $target(name,clean)
/pet attack
/echo Checking for MOD ROD
/if $count(id,3426)==0 { 
/echo Making mod rod
/keypress F1 
/call cast "Rod Of Mystical Transvergance" 
/delay 5
/autoinv
/delay 5
}
/echo going to Nuke
/goto :nuke
}

| ---Nuking---

/goto :top

:nuke

/if $char(state)==DUCK { 
/pet back off 
/endmacro 
} 
/if $char(state)==SIT { 
/pet back off 
/endmacro 
} 
/echo Starting Nuke
/if "$target(type)"=="NPC" {
/echo Nuking $target(name,clean). It is a level $target(level) $target(race).
/call Cast "Rock of Taelosia"
/delay @Param2
/if "$target()"=="FALSE" {
/target @tankname
/echo using Mod rod
/cast item "Rod of Mystical Transvergance"
}
/goto :nuke
}
/goto :top

/return

/goto :top


Sub Event_Chat(MsgType,MsgFrom,MsgData) 
/if "@MsgData"~~"rod" { 
    /delay 50
    /echo @MsgFrom needs a rod. 
    /tell @MsgFrom Mod Rod inc stay close
    /delay 50
    /target pc @MsgFrom 
    /stand 
    /cast 8 
} 
/return

now even any small snipts to help me to rerwite it would be greatly appreciated thank you in advance and i will keep trying to at least understand the new data wish me luck. :D
Ps. macroquest rocks.

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Post by wassup » Thu Apr 22, 2004 6:48 am

Here you go:


Just be aware that spellcast2.inc and routines.mac need to be converted also before you can use this, assuming there are functions in them that you need.

Code: Select all

#chat tell
#chat group
#include spellcast2.inc
#include routines.mac
#turbo 75

Sub Main
   /declare tankname global
   /declare nukename global
   /declare mobhp global
   /declare tempvar global
   /declare assisthealth global
   
   /echo "Macro Starting"
   /varset assisthealth @Param1
   /varset tankname @Param0
   /varset nukename black steel
   /echo "@tankname is assist tank."
   /varset tempvar 0
   
   :top
   /doevents
   /if (${Me.State.Equal[DUCK]}) {
      /pet back off
      /endmacro
   }
   
   /if (${Me.State.Equal[SIT]}) {
         /pet back off
         /endmacro
   }
   /echo starting TOP Assisitng @tankname
   /assist @tankname
   /delay 10
   
   /if (!${Target.ID}) {
      /echo Nothing on @tankname Target
      /target @tankname
      /goto :top
   }
   
   /if (${Target.Type.NotEqual[NPC]}) /goto :top
   
   /if (@tempvar!=${Target.PctHPs}) /echo ${Target.CleanName} targeted at ${Target.PctHPs}% at distance ${Target.Distance}.
   /varset tempvar ${Target.PctHPs}
   
   /if (${Target.PctHPs}>=@assisthealth) {
      /echo Time to start working
      /goto :top
   } else {
      /echo Target Acquired: ${Target.CleanName}
      /if (${Target.PctHPs}<=95) {
         /delay 5
         /echo Casting Malosinia
         /call cast "malosinia"
         /echo sending Pet IN to KILL ${Target.CleanName}
         /pet attack
         /echo Checking for MOD ROD
         /if (!${FindItem[Rod Of Mystical Transvergance].ID}) {
            /echo Making mod rod
            /keypress F1
            /call cast "Rod Of Mystical Transvergance"
            /delay 5
            /autoinv
            /delay 5
         }
         /echo going to Nuke
         /goto :nuke
      }
   }

   | ---Nuking---
   :nuke
   /if (${Me.State.Equal[DUCK]}) {
      /pet back off
      /endmacro
   }
   
   /if (${Me.State.Equal[SIT]}) {
      /pet back off
      /endmacro
   }
   /echo Starting Nuke
   
   /if (${Target.Type.Equal[NPC]}) {
      /echo Nuking ${Target.CleanName}. It is a level ${Target.Level} ${Target.Race}
      /call Cast "Rock of Taelosia"
      /delay @Param2
      /if (!${Target.ID}) {
         /target @tankname
         /echo using Mod rod
         /cast item "Rod of Mystical Transvergance"
      }
      /goto :nuke
   }
   /goto :top
   
/endmacro

Sub Event_Chat(MsgType,MsgFrom,MsgData)
   /if (${String[@MsgData].Compare[rod]}) {
       /delay 50
       /echo @MsgFrom needs a rod.
       /tell @MsgFrom Mod Rod inc stay close
       /delay 50
       /target pc @MsgFrom
       /stand
       /cast 8
   }
/return

cobra
orc pawn
orc pawn
Posts: 13
Joined: Wed Feb 11, 2004 5:38 am

Post by cobra » Thu Apr 22, 2004 10:17 am

omg thank you very much you rock i have

spellcast2.inc

Code: Select all


| SpellCast.inc 
| This will cast a spell reliably for you... 
| 
| Usage: 
|       /call Cast "spellname|itemname|AA#" [item|activate] 
| 
| This would essentially: /cast "Death Peace" 
| example: /call Cast "Death Peace" 
| 
| This would essentially: /cast item "White Rope Bridle" 
| example: /call Cast "White Rope Bridle" item 
| 
| This would essentially: /alt activate 169 
| example: /call Cast "169" activate 
| 
| It will return the following values: 
| CAST_SUCCESS 
| CAST_UNKNOWNSPELL 
| CAST_OUTOFMANA 
| CAST_OUTOFRANGE 
| CAST_CANNOTSEE 
| CAST_STUNNED 
| CAST_RESISTED 
| CAST_TOOK2LONG 
| CAST_ABILITYNOTREADY 
| 
| New Vars Modification 
| Plazmic's no globals needed version 
| 
| Oct 09, 2003 - Updated to work with new vars and $char(casting) -gf 
| Oct 11, 2003 - switched some logic, removed defines -gf 
| Oct 15, 2003 - Item support added by -EqMule 
| XXX xx, xxxx - Modified to add automeming of spells. -Goofmester1 
| Dec 26, 2003 - fd fail 1 added -m0nk 
| Jan 01, 2004 - timeout(5s) added to stop "dead-time" -m0nk 
| Jan 01, 2004 - switchd fdfail to a standing check. -m0nk 
| Jan 01, 2004 - added silence checking as a stun check -m0nk 
| Feb 17, 2004 - added AA activate capabilities -ml2517 
| Apr 11, 2004 - Updated for new Parm system -ml2517 
| Apr 12, 2004 - Will spit out a different message on immune to slows. -ml2517 
| Apr 16, 2004 - Removed /sendkeys and replaced with /keypress. -ml2517 
| Apr 17, 2004 - Various code enhancements. -Wassup 
| Apr 20, 2004 - Updated all of the /if's to have parenthesis. -ml2517 
| 

#event Fizzle "Your spell fizzles" 
#event Interrupt "Your casting has been interrupted" 
#event Interrupt "Your spell is interrupted." 
#event Recover "You haven't recovered yet..." 
#event Recover "Spell recovery time not yet met." 
#event Resisted "Your target resisted the " 
#event OutOfMana "Insufficient Mana to cast this spell!" 
#event OutOfRange "Your target is out of range, get closer!" 
#event NoLOS "You cannot see your target." 
#event Stunned "You cannot cast while stunned" 
#event Stunned "You *CANNOT* cast spells, you have been silenced!" 
#event Standing "You must be standing to cast a spell" 
#event Standing "has fallen to the ground." 
#event Collapse "Your gate is too unstable, and collapses." 
#event Ability "You can use the ability " 
#event ImmuneSlow "Your target is immune to changes in its attack speed." 


Sub Cast(SpellName,Item) 
   /if (!${Defined[CastGiveUpTime]}) /declare CastGiveUpTime timer 
   /if (!${Defined[Item]}) /declare Item local 
   /if (${Me.Speed}>0) { 
       /keypress forward 
       /keypress back 
       /delay 8 
   } else { 
       /delay 4 
   } 
   /if ((${String["@Item"].Equal["Item"]})||(${String["@Item"].Equal["Activate"]})) /goto :StartCast 

   /if (!${Me.Gem["@SpellName"]}) { 
      /memspell 5 "@SpellName" 
      /delay 5s 
   } 
   :StartCast 
      /varset CastGiveUpTime 5s 
   :CastNow 
      /if (${String["@Item"].Equal["Item"]}) { 
         /call ClearReturnValue 
         /cast item "@SpellName" 

      } else /if (${String["@Item"].Equal["Activate"]}) { 
         /call ClearReturnValue 
         /alt activate "@SpellName" 
      } else { 
         /if (!${Me.Gem["@SpellName"]}) /return CAST_UNKNOWNSPELL 
         /call ClearReturnValue 
         /if (!${Me.SpellReady["@SpellName"]}) { 
            /if (@CastGiveUpTime==0) /return CAST_TOOK2LONG 
            /delay 1 
            /goto :CastNow 
            } 
         /cast "@SpellName" 
         } 
   :WaitCast 
      /if (${Me.Casting.ID}) { 
      /delay 1 
      /goto :WaitCast 
      } 
   /delay 1 
   /doevents Fizzle 
   /doevents Interrupt 
   /doevents Interrupt 
   /doevents Recover 
   /doevents Standing 
   /doevents OutOfRange 
   /doevents OutOfMana 
   /doevents NoLOS 
   /doevents Resisted 
   /doevents ImmuneSlow 
   /doevents Stunned 
   /doevents Collapse 
   /doevents Ability 
   /if (${Macro.Return.Equal["CAST_RESTART"]}) /goto :StartCast 
   /if (${Macro.Return.NotEqual["NULL"]}) /return ${Macro.Return} 
/return CAST_SUCCESS 

Sub ClearReturnValue 
/return NULL 

Sub Event_Fizzle 
/return CAST_RESTART 

Sub Event_Interrupt 
/return CAST_RESTART 

Sub Event_Recover 
   /delay 5 
/return CAST_RESTART 

Sub Event_Standing 
   /stand 
/return CAST_RESTART 

Sub Event_Collapse 
/return CAST_RESTART 

Sub Event_OutOfMana 
/return CAST_OUTOFMANA 

Sub Event_OutOfRange 
/return CAST_OUTOFRANGE 

Sub Event_NoLOS 
/return CAST_CANNOTSEE 

Sub Event_Stunned 
   /delay 1s 
/return CAST_RESTART 

Sub Event_Resisted 
/return CAST_RESISTED 

Sub Event_ImmuneSlow 
/return CAST_IMMUNESLOW 

Sub Event_Ability 
/return CAST_ABILITYNOTREADY 

i found it on the forums i will try this out :D

Thank you friend you have made me very happy God Bless you :lol: