Welcome, Guest. Please login or register.
Did you miss your activation email?
November 26, 2024, 12:19:39 pm *

Login with username, password and session length
Pages: [1]
Print
Author Topic: Xtarget usage (macro to target the one with the least % hps)  (Read 5008 times)
Bogreaper
Jr. Member
**
Posts: 62



View Profile WWW
« on: June 30, 2017, 12:44:19 pm »

Someone asked me to post this so here it is.

Basics of it.

It checks the first 40 targets on xtargets list looking for the one with the least % of hps (is that the lowest # amount? no, but hey its quick and dirty).
This allows the warrior to snag the one whom is the lowest and knock him off so that he can heal via a (hopefully) non-trival kill.

If you improve on it, please post back here and share.

If this violates any rules about Automation here on ez server please let me know and I will delete this post and stop all usage of it.

Thanks and Peace be with you.
BogTank.


| =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
   Targets the mob in the XTargets with the lowest hps
   By BogReaper ( Bogreaper@gmail.com ) June 18th 2017
   
   Hope you enjoy, and may the Bog be with you.
  =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= |


Sub Main
/echo -------------------
/echo Killing from the Least % hps first
/echo -------------------
   /declare xtlookingat int outer
   /declare xtleasthp int outer
   /declare killingit int outer
   /declare whatchakilling int outer
   
:letsbeginshallwe
   /call getatarget
   /if (${xtleasthp}<41) {
      /target ID ${Me.XTarget[${xtleasthp}].ID}
   } else {
      /if (${SpawnCount[npc radius 50]}>1) /target id ${NearestSpawn[npc radius 30].ID}
   }
   /if (${SpawnCount[npc radius 50]}>0 && ${SpawnCount[pc radius 99 raid]}>0) /call getsomehelp
   /delay 1
   /call keepswinging
   /if (${Me.XTarget[1].ID}>0) /goto :letsbeginshallwe
   /echo All Done
   /bcaa //endmac
/return
Sub getsomehelp
         /if (${Me.CleanName.NotEqual[bogtank]} && ${SpawnCount[pc radius 100 zradius 100 bogtank]} && ${Target.ID}>0) /bct bogtank //macro bogtankatk ${Me.CleanName} ${Target.ID}
         /if (${Me.CleanName.NotEqual[bogblessing]} && ${SpawnCount[pc radius 100 zradius 100 bogblessing]} && ${Target.ID}>0) /bct bogblessing //macro bogblessingatk ${Me.CleanName} ${Target.ID}
         /if (${Me.CleanName.NotEqual[fally]} && ${SpawnCount[pc radius 100 zradius 100 fally]} && ${Target.ID}>0) /bct fally //macro fallyatk ${Me.CleanName} ${Target.ID}
         /if (${Me.CleanName.NotEqual[bogreaper]} && ${SpawnCount[pc radius 100 zradius 100 bogreaper]} && ${Target.ID}>0) /bct bogreaper //macro bogreaperatk ${Me.CleanName} ${Target.ID}
         /if (${Me.CleanName.NotEqual[savagespirit]} && ${SpawnCount[pc radius 100 zradius 100 savagespirit]} && ${Target.ID}>0) /bct savagespirit //macro savagespiritatk ${Me.CleanName} ${Target.ID}
         /if (${Me.CleanName.NotEqual[bogzerker]} && ${SpawnCount[pc radius 100 zradius 100 bogzerker]} && ${Target.ID}>0) /bct bogzerker //macro bogzerkeratk ${Me.CleanName} ${Target.ID}
         /if (${Me.CleanName.NotEqual[bogfists]} && ${SpawnCount[pc radius 100 zradius 100 bogfists]} && ${Target.ID}>0) /bct bogfists //macro bogfistsatk ${Me.CleanName} ${Target.ID}
         /if (${Me.CleanName.NotEqual[bogfingers]} && ${SpawnCount[pc radius 100 zradius 100 bogfingers]} && ${Target.ID}>0) /bct bogfingers //macro bogfingersatk ${Me.CleanName} ${Target.ID}

/return

Sub keepswinging
   /attack on
   /varset whatchakilling ${Target.ID}
   /for killingit 1 to 99999
      /if (!${Melee.Combat} && ${Target.ID}>0) /attack on
      /if (${Target.ID}==${whatchakilling}) {
      } else {
         /varset killingit 99999
      }
      /delay 5
   /next killingit
/return

Sub getatarget
   /if (${SpawnCount[npc radius 50]}<40) {
      /varset xtleasthp 1
      /for xtlookingat 1 to 40
         /if (${Me.XTarget[${xtlookingat}].ID}>0) {
            /if (${Spawn[${Me.XTarget[${xtlookingat}].ID}].PctHPs}>0 && ${Spawn[${Me.XTarget[${xtlookingat}].ID}].PctHPs}<${Spawn[${Me.XTarget[${xtleasthp}].ID}].PctHPs} && ${Spawn[${Me.XTarget[${xtlookingat}].ID}].Distance}<20) /varset xtleasthp ${xtlookingat}
         }
      /next xtlookingat
   } else {
      /varset xtleasthp 69
   }
/return
Logged

warrior5
Hero Member
*****
Posts: 513


YAY


View Profile
« Reply #1 on: June 30, 2017, 08:26:51 pm »

As long as you have to press it every time I don't see why it would be a violation. Thanks!
Logged

Pages: [1]
Print
Jump to:  

Recent

Stats

Members
  • Total Members: 6156
  • Latest: Rin1
Stats
  • Total Posts: 65127
  • Total Topics: 5066
  • Online Today: 370
  • Online Ever: 8678
  • (December 19, 2022, 02:32:09 pm)
Users Online
Users: 1
Guests: 187
Total: 188
TinyPortal v1.0 beta 4 © Bloc