magicskillup.mac

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

newb-n-training
a lesser mummy
a lesser mummy
Posts: 39
Joined: Mon Apr 19, 2004 8:51 pm

Post by newb-n-training » Wed Apr 28, 2004 12:57 am

I was trying to get ya to test a few things out and see what you could fix. I made quite a few mistakes in the first macro but here's one that works.

It needs to be tested more and could use some conditionals (right now it's always trying to cast, even if you're already casting which results in a crapload of spam.

I haven't tested this longer than 5 min but it cast and destroyed items for me so **shrug**

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 (${Me.X}) 
  /varset loc_y (${Me.Y}) 

  /call RaiseSkill "Abjuration" 200 "Okeil's Radiation" 
  /call RaiseSkill "Alteration" 200 "Root" 
  /call RaiseSkill "Conjuration" 200 "Halo of Light" 
  /call RaiseSkill "Divination" 200 "True North" 
  /call RaiseSkill "Evocation" 200 "Shock of Fire" 
  /call RaiseSkill "Channeling" 200 "True North" 
  /call RaiseSkill "Meditate" 200 "Familiar" 
  /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 { 
  /if (${Me.Book[@spell]}==0) { 
    /echo Spell '@spell' not in spellbook. 
    /return 
  } 

:loop 
|========================= 
| insert short semi-random delay 
|========================= 
| /delay $calc(5+$rand(5)) 
  /delay (${Math.Rand[10]})s 

|========================= 
| exit if character movement detected 
|========================= 
| /if (@loc_x!=$char(x) || @loc_y!=$char(y)) { 
  /if (${Me.X}!=@loc_x || ${Me.Y}!=@loc_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    
  /if (${String[@spell].Find[Summon]} && ${Cursor.Name.Find[Summoned:]}) /destroy        

|   Or should this be: 
| /if (!${String[@spell].Find[Summon]}==NULL && !${Cursor.Name.Find[Summoned:]==NULL) /destroy 


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

|========================= 
| ensure spell memorized 
|========================= 
| /if n $char(gem,"@spell")==0 { 
  /if (!${Me.Gem[@spell]}) { 
    /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 (${Me.PctMana}<MANA_SIT && ${Me.State.Equal[STAND]} && !${Me.Casting.ID}) /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 
  /if (${Me.State.Equal[SIT]} && ${Me.PctMana}<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 
  /if (${Me.Gem[@spell]}>0) {    
    /if (${Me.State.Equal[SIT]}) /stand 
    /if (${Target.CleanName.NotEqual[${Me.CleanName}]}) /target myself 
    /cast "@spell" 
  } 

|========================= 
| loop 
|========================= 
  /goto :loop 
/return 
Good luck.

s16z
a ghoul
a ghoul
Posts: 97
Joined: Thu Apr 01, 2004 12:03 pm

Post by s16z » Wed Apr 28, 2004 1:00 am

Code: Select all

/if (!${Me.Book[@spell]} {
Is missing something. It should read:

Code: Select all

/if (!${Me.Book[@spell]}[color=red])[/color] {

Mongol311
a lesser mummy
a lesser mummy
Posts: 45
Joined: Sat Apr 24, 2004 12:06 pm
Location: Connecticut, USA

Post by Mongol311 » Wed Apr 28, 2004 2:28 am

Newb, after I posted, I tried a ton of things out. Sorry to disappoint ya, but I definitely learned a lot from comparing yours to mine. In my struggle I actually reduced it down to like 30 lines, eliminating all optional pieces, to no avail. Thanks for all the input, and you to s16z.
I live in an asbestos igloo, do your worst!
(Devs, please don't hate me, I donated!)

Mongol311
a lesser mummy
a lesser mummy
Posts: 45
Joined: Sat Apr 24, 2004 12:06 pm
Location: Connecticut, USA

Post by Mongol311 » Wed Apr 28, 2004 10:46 am

Just wanted to say that I set this .mac up last night, was running fine. Thanks again. No I wont fizzle casting my familiars so often :lol:
I live in an asbestos igloo, do your worst!
(Devs, please don't hate me, I donated!)