What's new

UOSteam Attack Closest

#1
Not my macro, but its very helpful. Makes dungeon hunting alot funner imo.

https://github.com/gmccord333/UOOutlands/blob/master/Combat/AttackClosest.txt

/////////////////////////////////////////////// UO Steam Attack Closest Macro// for Outlands//// This macro _attacks_ your closest target,// prioritizing targets by your color (red, blue).//// If you want to 'get' but not attack, use// GetClosest.txt macro instead. Personally,// I prefer a get script and an attack script.//// Outlands server does not support 'nearest'// or 'closest' filters, making this type of// macro very difficult. However, we can work// around that (below).//// How to use:// ===========// 1) Save your current equipment as 'default'// in dress macro. // 2) Run script any time to attack your current enemy.//// Version History:// * 1.0 initial release// * 1.1 removed timer// updated for murderers// * 1.2 added dress/////////////////////////////////////////////// //// run dress macro//dress 'default'while dressingendwhile //// Run search loop for all targets and insert into list// @removetimer 'search'@createtimer 'search'@removelist 'found'@createlist 'found'for 0 to 20 @unsetalias 'enemy' if murderer 'self' getenemy 'murderer' 'innocent' 'enemy' 'criminal' 'gray' 'humanoid' 'transformation' 'random' else getenemy 'murderer' 'enemy' 'criminal' 'gray' 'humanoid' 'transformation' 'random' endif @pushlist! 'found' 'enemy'[email protected] 'search' //// Create a distances list, seeding from 1// @removelist 'distances'@createlist 'distances'pushlist 'distances' 1pushlist 'distances' 2pushlist 'distances' 3pushlist 'distances' 4pushlist 'distances' 5pushlist 'distances' 6pushlist 'distances' 7pushlist 'distances' 8pushlist 'distances' 9pushlist 'distances' 10pushlist 'distances' 11pushlist 'distances' 12pushlist 'distances' 13pushlist 'distances' 14pushlist 'distances' 15 //// Sort by distance// with closest first// @removelist 'targets'@createlist 'targets'for 0 to 'distances' for 0 to 'found' if @findobject found[] 0 0 0 distances[] @pushlist! 'targets' found[] endif endforendfor //// Attack if we see targets//if list 'targets' > 0 headmsg "*Attacking*" 22 setalias 'enemy' targets[0] if not war 'self' warmode 'on' endif attack! targets[0]else headmsg "No targets" 44endif