MQData and Skillup.mac

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

Moderator: MacroQuest Developers

Mixy
a lesser mummy
a lesser mummy
Posts: 46
Joined: Tue Jul 09, 2002 5:00 pm

MQData and Skillup.mac

Post by Mixy » Fri Apr 23, 2004 2:26 pm

Anyone willing to update the following skillup macro to the current system?

I take no credit for the folowing macro, just copied and pasted from the depot.

Code: Select all

| Call this macro after defining targetted skill levels and appropriate spells
|
| Will iterate through all skills and raise them to requested levels in order
| The macro will auto end if the character moves.
|
| IMPORTANT NOTE: If you're casting a summoning spell and an item with "Summoned:"
|                 exists on your cursor it will be DESTROYED.



#define MANA_SIT 30         |% mana to sit and regain mana
#define MANA_CAST 90         |% mana to stand and resume casting

sub Main

  /declare loc_x global         |x loc
  /declare loc_y global         |y loc

  |record loc of character
  /varset loc_x $char(x)
  /varset loc_y $char(y)

  /call RaiseSkill "Abjuration" 120 "Taper Enchantment"
  /call RaiseSkill "Alteration" 120 "Shallow Breath"
  /call RaiseSkill "Conjuration" 120 "Mesmerize"
  /call RaiseSkill "Divination" 120 "True North"
  /call RaiseSkill "Evocation" 120 "Chaotic Feedback"
  /call RaiseSkill "Channeling" 120 "True North"
  /call RaiseSkill "Meditate" 120 "Alacrity"
  /call RaiseSkill "Specialize Alteration" 50 "Shallow Breath"
  /return


|===================================================================================
sub RaiseSkill(skill,level,spell)

  |general notification
  /echo - Raising @skill to @level with '@spell'
  /echo Macro will AUTO STOP if movement is detected.

  |return if spell not in book
  /if $char(book,"@spell")==NULL {
    /echo Spell '@spell' not in spellbook.
    /return
  }

  :loop
  |insert short semi-random delay
  /delay $calc(5+$rand(5))

  |exit if character movement detected
  /if (n @loc_x!=$char(x) || n @loc_y!=$char(y)) {
    /echo Movement detected!  Ending macro.
    /endmacro
  }

  |if casting a summoning spell and a summoned item on cursor, destroy it
  /if ("@spell"~~"Summon" && "$cursor(name)"~~"Summoned:") /destroy

  |return if this skill at desired level
  /if n $char(skill,"@skill")>=@level {
    /echo @skill at $char(skill,"@skill")
    /return
  }

  |insure spell memorized
  /if n $char(gem,"@spell")==0 {
    /memspell 8 "@spell"
    /delay 10s
  }

  |sit if not casting/medding and mana dropped to MANA_SIT value
  /if (n $char(mana,pct)<MANA_SIT && $char(state)=="STAND" && $char(casting)=="FALSE") /sit

  |if medding and mana not yet up to MANA_CAST, continue to med
  /if ($char(state)=="SIT" && n $char(mana,pct)<MANA_CAST) /goto :loop

  |cast if the spell has refreshed
  /if n $char(gem,"@spell")>0 {
    /if $char(state)=="SIT" /stand
    /if n $target(id)!=$char(id) /target myself
    /cast "@spell"
  }

  |loop
  /goto :loop
  /return 
Thanks.

-Mixy!