EZ Server

General Category => General Discussion => Topic started by: Bogreaper on July 21, 2017, 10:16:02 pm



Title: Who Needs this spell? {Macro}
Post by: Bogreaper on July 21, 2017, 10:16:02 pm
For those that might find this useful, here we go.

Ergg asked me if I could write this, so I threw this together real fast. (if you can get it to work in 1 macro please reply with the method so that I can do it also).

just open a /loot window ( corpse window ) and run whoneedsspell with /macro whoneedsspell
That macro will check all spells on the corpse for the classes, then ask the correct characters in your raid, that are in the zone if they need that spell or not.

The other characters will then automaticly run /macro gotdaspell and respond in /rsay if they dont have the spell in their spell book.

Hope this helps you.

Peace.
BogTank.

|-------- Begin: whoneedsspell.mac --------|


| =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|
   Whoneedsspell  Sends a command to all characters connected to the current eqbc and has them run the macro
      gotdaspell to see if they need a spell that is on this corpse.
   By BogReaper ( Bogreaper@gmail.com ) July 21st 2017
   
   Hope you enjoy, and may the Bog be with you.
  =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|


Sub Main

   /declare loottotal int outer
   /declare lootslot int outer
   /declare dateam int local
   /declare classcount int local
   /declare classy string local
   | -----------------
   | -- Count items --
   | -----------------
   
   /varset loottotal ${Math.Calc[${Corpse.Items}]}
   
   | ---------------------
   | -- Loot the corpse --
   | ---------------------
   /for lootslot 1 to 40
      /if (${Corpse.Item[${lootslot}].Spell.Name.NotEqual[NULL]} && ${Corpse.Item[${lootslot}].Type.Equal[Scroll]}) {
         /for dateam 1 to ${Raid.Members}
            /varset classy ${Spawn[pc ${Raid.Member[${dateam}]}].Class}
            /if (${classy.NotEqual[NULL]}) {
               /for classcount 1 to 16
                  /if (${classy.Equal[${Corpse.Item[${lootslot}].Class[${classcount}]}]}) {
                     /bct ${Raid.Member[${dateam}]} //macro gotdaspell ${Spell[${Corpse.Item[${lootslot}].Spell.Name}].ID}
                  }
               /next classcount
            }
         /next dateam
      }
   /next lootslot

/return


| --------------- End: whoneedsspell.mac ------------------|



| ------------- Begin: gotdaspell.mac ------------|


| =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
   Whoneedsspell  Sends a command to all characters connected to the current eqbc and has them run the macro
      gotdaspell to see if they need a spell that is on this corpse.
   By BogReaper ( Bogreaper@gmail.com ) July 21st 2017
   
   Hope you enjoy, and may the Bog be with you.
  =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


Sub Main

/if (${Me.Book[${Spell[${Param0}].Name}]}<1) /rsay I dont have ${Spell[${Param0}].Name}

/return

| ------------ End: gotdaspell.mac ----------------------|


Title: Re: Who Needs this spell? {Macro}
Post by: Ergg on July 21, 2017, 10:20:21 pm
Thanks bog, this macro is very convenient.


Title: Re: Who Needs this spell? {Macro}
Post by: s0rcier on August 11, 2017, 02:05:40 pm
bog instead of calling another macro to make your test try this!

Code:
replace:
/bct ${Raid.Member[${dateam}]} //macro gotdaspell ${Spell[${Corpse.Item[${lootslot}].Spell.Name}].ID}

with:
/bct ${Raid.Member[${dateam}]} //if ($\{Me.Book[${Corpse.Item[${lootslot}].Spell.Name}]}<1) /rsay I dont have ${Corpse.Item[${lootslot}].Spell.Name}

nice coding bro! and thanks


Title: Re: Who Needs this spell? {Macro}
Post by: Catheisst on August 14, 2017, 11:42:30 am
 $\ instead of $ in front of {} makes that character run the eval instead of coming from the looters data.  That piece of code is super useful thanks Sorc


Title: Re: Who Needs this spell? {Macro}
Post by: s0rcier on August 15, 2017, 03:41:31 pm
only works with /bct :)