htw

GearSet.mac

htw
Feb 17th, 2019
226
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #warning
  2.  
  3. Sub Main(string Param0, string Param1)
  4.     /declare SlotNames[23] string outer
  5.     /varset SlotNames[1] charm
  6.     /varset SlotNames[2] leftear
  7.     /varset SlotNames[3] head
  8.     /varset SlotNames[4] face
  9.     /varset SlotNames[5] rightear
  10.     /varset SlotNames[6] neck
  11.     /varset SlotNames[7] shoulder
  12.     /varset SlotNames[8] arms
  13.     /varset SlotNames[9] back
  14.     /varset SlotNames[10] leftwrist
  15.     /varset SlotNames[11] rightwrist
  16.     /varset SlotNames[12] ranged
  17.     /varset SlotNames[13] hands
  18.     /varset SlotNames[14] mainhand
  19.     /varset SlotNames[15] offhand
  20.     /varset SlotNames[16] leftfinger
  21.     /varset SlotNames[17] rightfinger
  22.     /varset SlotNames[18] chest
  23.     /varset SlotNames[19] legs
  24.     /varset SlotNames[20] feet
  25.     /varset SlotNames[21] waist
  26.     /varset SlotNames[22] powersource
  27.     /varset SlotNames[23] ammo
  28.     /if (!${Plugin[MQ2Cecho].Name.Length}) {
  29.         /squelch /plugin MQ2Cecho noauto
  30.     }
  31.     /if (!${Plugin[MQ2Cecho].Name.Length}) {
  32.         /echo Need the MQ2CEcho plugin!
  33.         /return
  34.     }
  35.     /if (!${Plugin[MQ2Exchange].Name.Length}) {
  36.         /squelch /plugin MQ2Exchange noauto
  37.     }
  38.     /if (!${Plugin[MQ2Exchange].Name.Length}) {
  39.         /cecho \arNeed the MQ2Exchange plugin!
  40.         /return
  41.     }
  42.     /if (!${Defined[Param0]} || !${Defined[Param1]}) {
  43.         /cecho \arUsage:  \ag/mac ${Macro.Name.Arg[1,.]} [load|save] SetName
  44.         /return
  45.     }
  46.     /if (${Param0.Equal[save]} && ${Param1.Length}) {
  47.         /call SaveGearSet ${Param1}
  48.         /return
  49.     }
  50.     /if (${Param0.Equal[load]} && ${Param1.Length}) {
  51.         /call LoadGearSet ${Param1}
  52.         /return
  53.     }
  54.     /cecho \arUsage:  \ag/mac ${Macro.Name.Arg[1,.]} [load|save] SetName
  55.     /return
  56.    
  57. Sub SaveGearSet(string GearSetName)
  58.     /if (!${Defined[GearSetName]}) {
  59.         /cecho \arNeed to provide a name for SaveGearSet!
  60.         /return
  61.     }
  62.     /declare i int local
  63.     /declare j int local
  64.     /for i 1 to 23
  65.         /varcalc j ${i}-1
  66.         /mmoini "${Macro.Name.Arg[1,.]}_${EverQuest.Server}_${Me.CleanName}" "${GearSetName}" ${SlotNames[${i}]} "${Me.Inventory[${j}].Name}"
  67.     /next i
  68.     /cecho \atGear set \ag${GearSetName} \atsaved.
  69.     /return
  70.    
  71. Sub LoadGearSet(string GearSetName)
  72.     /if (!${Defined[GearSetName]}) {
  73.         /cecho \arNeed to provide a name for LoadGearSet!
  74.         /return
  75.     }
  76.     /declare s string local
  77.     /declare i int local
  78.     /declare j int local
  79.     /varset s ${Ini[${Macro.Name.Arg[1,.]}_${EverQuest.Server}_${Me.CleanName},${GearSetName}]}
  80.     /if (${s.Equal[NULL]}) {
  81.         /cecho \ayNo gear set named \ar${GearSetName} \ayfound in \ag ${Macro.Name.Arg[1,.]}_${EverQuest.Server}_${Me.CleanName}.ini
  82.         /return
  83.     }
  84.     /for i 1 to 23
  85.         /varcalc j ${i}-1
  86.         /varset s ${Ini[${Macro.Name.Arg[1,.]}_${EverQuest.Server}_${Me.CleanName},${GearSetName},${SlotNames[${i}]}]}
  87.         /if (${s.NotEqual[NULL]} && (!${Me.Inventory[${j}].Name.Length} || ${Me.Inventory[${j}].Name.NotEqual[${s}]})) {
  88.             /cecho \amSwapping in \au${s} \amto slot \ag${SlotNames[${i}]}
  89.             /exchange "${s}" ${SlotNames[${i}]}
  90.             /delay 10
  91.         }
  92.     /next i
  93.     /cecho \atGear set \ag${GearSetName} \atactivated.
  94.     /return
RAW Paste Data