Welcome, Guest. Please login or register.
Did you miss your activation email?
April 26, 2024, 05:22:35 pm *

Login with username, password and session length
Pages: [1]
Print
Author Topic: Who Needs this spell? {Macro}  (Read 3186 times)
Bogreaper
Jr. Member
**
Posts: 62



View Profile WWW
« 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 ----------------------|
« Last Edit: July 21, 2017, 10:18:48 pm by Bogreaper » Logged

Ergg
Newbie
*
Posts: 22


View Profile
« Reply #1 on: July 21, 2017, 10:20:21 pm »

Thanks bog, this macro is very convenient.
Logged
s0rcier
Newbie
*
Posts: 38


View Profile
« Reply #2 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
Logged
Catheisst
Newbie
*
Posts: 1


View Profile
« Reply #3 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
Logged
s0rcier
Newbie
*
Posts: 38


View Profile
« Reply #4 on: August 15, 2017, 03:41:31 pm »

only works with /bct Smiley
Logged
Pages: [1]
Print
Jump to:  

Recent

Stats

Members
  • Total Members: 6124
  • Latest: Havicck
Stats
  • Total Posts: 64987
  • Total Topics: 5053
  • Online Today: 91
  • Online Ever: 8678
  • (December 19, 2022, 02:32:09 pm)
Users Online
Users: 0
Guests: 70
Total: 70
TinyPortal v1.0 beta 4 © Bloc