//Grab Nearest Target //Created by Duck Face //Enjoy @createlist '1' @clearlist '1' @createlist '2' @clearlist '2' @createlist '3' @clearlist '3' @createlist '4' @clearlist '4' @createlist '5' @clearlist '5' @createlist '6' @clearlist '6' @createlist '7' @clearlist '7' @createlist '8' @clearlist '8' @createlist '9' @clearlist '9' @createlist '10' @clearlist '10' @createlist '11' @clearlist '11' @createlist '12' @clearlist '12' @createlist '13' @clearlist '13' @createlist '14' @clearlist '14' @createlist '15' @clearlist '15' @createlist '16' @clearlist '16' @createlist 'inputStack' @clearlist 'inputStack' @unsetalias 'target' @unsetalias 'temp' //populate a list of potential targets for 0 to 20 @getenemy grey criminal red next if @inrange 'enemy' 16 @pushlist! 'inputStack' 'enemy' endif endfor for 0 to 'inputStack' @setalias 'temp' inputStack[] //save to list based on distance if @distance 'temp' > 15 pushlist '16' 'temp' elseif @distance 'temp' > 14 pushlist '15' 'temp' elseif @distance 'temp' > 13 pushlist '14' 'temp' elseif @distance 'temp' > 12 pushlist '13' 'temp' elseif @distance 'temp' > 11 pushlist '12' 'temp' elseif @distance 'temp' > 10 pushlist '11' 'temp' elseif @distance 'temp' > 9 pushlist '10' 'temp' elseif @distance 'temp' > 8 pushlist '9' 'temp' elseif @distance 'temp' > 7 pushlist '8' 'temp' elseif @distance 'temp' > 6 pushlist '7' 'temp' elseif @distance 'temp' > 5 pushlist '6' 'temp' elseif @distance 'temp' > 4 pushlist '5' 'temp' elseif @distance 'temp' > 3 pushlist '4' 'temp' elseif @distance 'temp' > 2 pushlist '3' 'temp' elseif @distance 'temp' > 1 pushlist '2' 'temp' else pushlist '1' 'temp' endif endfor //check lists for closest if list '1' > 0 @setalias 'target' 1[0] elseif list '2' > 0 @setalias 'target' 2[0] elseif list '3' > 0 @setalias 'target' 3[0] elseif list '4' > 0 @setalias 'target' 4[0] elseif list '5' > 0 @setalias 'target' 5[0] elseif list '6' > 0 @setalias 'target' 6[0] elseif list '7' > 0 @setalias 'target' 7[0] elseif list '8' > 0 @setalias 'target' 8[0] elseif list '9' > 0 @setalias 'target' 9[0] elseif list '10' > 0 @setalias 'target' 10[0] elseif list '11' > 0 @setalias 'target' 11[0] elseif list '12' > 0 @setalias 'target' 12[0] elseif list '13' > 0 @setalias 'target' 13[0] elseif list '14' > 0 @setalias 'target' 14[0] elseif list '15' > 0 @setalias 'target' 15[0] elseif list '16' > 0 @setalias 'target' 16[0] else stop endif //uncomment the following lines to grab health bar //useobject 'target' //pause 300 //clickscreen! 1875 260 'single' 'left' //pause 300 //clickscreen! 1700 200 'single' 'right'