getfriend

General discussion pertaining to the Demise shard. Off-topic posts will be moderated.
Post Reply
pegasus321
Posts: 151

getfriend

Post by pegasus321 »

How do i set the closest yellow NPC as my "friend" so that i can move to them with a macro? I have a macro I found somewhere that has the line
getfriend 'closest' 'innocent;'
then a section to check positions and move accordingly.
But this only seems to work if i add them to my friends list in steam, and then only once. Once i recall to the next spot it does not recognize the nearest yellow NPC as a friend (even if they are on my friends list)

Anyone have any experience with this?
User avatar
The Silvertiger
Posts: 4469

Re: getfriend

Post by The Silvertiger »

Does your script give them an alias? for example 'found'? I have a couple of scripts that look for npc's by bodytype and check for property "Blacksmith" "Mage" etc... one could easily addin a setalias line to this: setalias 'npc' 'found' then follow it up with inrange checks and rails.
Never forget June 4th 1989!
Selling List & Vendor

"Screenshots will never be used as evidence but more of a reference tool for us to help in our investigations."
User avatar
Calvin
Posts: 5687
Location: UK

Re: getfriend

Post by Calvin »

im not sure, but i would guess that your script has a custom function called "getfriend", which sets a variable from an array or list.

you would have to populate the array/list yourself.

Getfriend will be a function
'closest' and 'innocent' will be variables that are required to run the function.

what you are actually saying is "run the chunk of code called 'getfriend' using the variables 'closest', and 'innocent'. oh i guess maybe it's not a populated array then.. just an 'and' requirement?

so you'd be saying "check closest person, make sure innocent is true, or find the next".
> in effect: find the closest innocent.

the list it uses is probably just the in game list of players then. on screen maybe? if UO:S is wrote by pvpers, then it's probably a built in function, so this is a legit question to be fair.

you should be able to see your UO:S libraries somewhere, and the function will be in there. find it, read it, you'll see what it does.

generally when it's Get_Something, it'll run as part of a larger block of code, where a variable needs to be set and then used. good example is the random number generator, there will no doubt be a function called "getrandom". i might be wrong, and barking up the wrong tree, but probably not. i am assuming a fair bit that i dont know.

you do really need someone that has experience with it to tell you for sure what it is and how it works. have you tried just running a search on the documentation? or getting a script that uses it and seeing how it does?

you'll be far better off learning how it works than just learning the answer to a single problem.



;P
only joking ;)

there should be something in the documentation tho for all the preset functions.
i really dont know the specific thing though, dont take my word for what it does, might do something totally different; but you get the idea of how you should be approaching it. identify what is what and what it's doing. dont just trial and error it until it sort of works.
Post Reply