Simple test demonstrating the failure
Code:
getfriend 'friend'
pause 1000
if findalias 'friend'
sysmsg "A Friend was found"
else
sysmsg "A Friend was not found"
endif
if name friend == "arb"
sysmsg "arb was found"
endif
Results:
A Friend was not found
arb was found
////////////////////////////////////
the getfriend 'friend' will not set the 'friend' alias as empty or not found or in any way I can find give one the information that it didnt find a friend. Keep in mind that getfriend does not look at the ignorelist.
ergo
Code:
// This will always be false regardless of there being a friend
if findalias 'friend'
sysmsg "A Friend was found"
else
sysmsg "A Friend was not found"
endif
// Hence one can not get away with the following and no Friends
// Also without the DoWork timeout the while loop will just run forever, with a friend or without a friend
@settimer 'DoWork' 0
while timer 'DoWork' < 5000
@setalias Friend self
@getfriend 'Friend'
pause 100
@settimer 'DoWork' 5000
// if name friend != "Enigma Maitreya"
if not @inlist 'AABPIgnore' Friend
@pushlist 'AABPIgnore' Friend
pause 100
if not @inlist 'Pets' Friend
pause 100
if @infriendlist Friend
sysmsg 'Found a Friend'
pause 100
@pushlist 'Pets' Friend
pause 100
@unsetalias 'PetTypeFound'
if @list 'VegTypes' > 0
for 0 to 'VegTypes'
if 'graphic' Friend == VegTypes[]
if not @inlist 'Veg' 'Friend'
sysmsg 'Found a Vegan'
@pushlist 'Veg' Friend
@setalias 'PetTypeFound' self
endif
endif
endfor
endif
if not @findalias 'PetTypeFound'
if not @inlist 'RawMeat' Friend
sysmsg 'Found a Meat Eater'
@pushlist 'RawMeat' Friend
endif
endif
@settimer 'DoWork' 0
endif
endif
pause 100
endif
// endif
endwhile
removetimer 'DoWork'
The failure, well as far as I can tell, is there is no way to determine if the getfriend really did find a friend. Said differently I can not find anything that suggest it can tell me getfriend failed.
What I am doing is building a list of Pets that are in my Friend List so that I ca do this, don't fall for this being a simple heal a pet, it is more complicated than that, also the food type code is just so I can keep different food requirement pets fed and is not central to this issue.
Code:
if list 'Pets' > 0
for 0 to 'Pets'
if 'Hits' Pets[] <= 80
cast "Invisibility"
waitfortarget 15000
target! Pets[]
settimer 'CastDelay' 0
pause 1000
waitforcontext Pets[] 1 15000
waitfortarget 15000
target! 'self'
endif
endfor
endif
So there are cases where I want the macro to work without pets and work with pets. The failure has been with no pets out and in the friend list, the buildpets simply will loop forever, if I force a stop then the pet list is filed with what I believe is equivelent to null as the second code fragment spams messages that hits pets[] can not be found. Why I say pets[] is populated is because of the if list 'pets' > 0