Page 1 of 1

What is Userfunction any guides to making them?

Posted: Fri Jan 22, 2016 1:34 am
by beanybabe
I have used them and got kind of idea of what they are for but I do not see any info on making them in the wiki.
Another question is how can we avoid using function names that are used in others user-functions.

Re: What is Userfunction any guides to making them?

Posted: Fri Jan 22, 2016 8:09 am
by noobbotter
Userfunction are common functions that you would want available in multiple scripts. Kind of like the travelTo userfunction. It's nice to be able to use it in multiple different waypoint scripts instead of having to type all of that function inside each waypoint script.

One way to avoid using common function names is to use a naming scheme. For instance suppose you're making a Wailing Fjord TP Farming script. You could name all your functions starting with WFTPF_<name>(). doing something like this won't guarantee that it won't conflict with a userfunction function name, but it drastically reduces the chances of a conflict. That's even something I don't always do but probably should.

Re: What is Userfunction any guides to making them?

Posted: Fri Jan 22, 2016 3:53 pm
by beanybabe
Thanks, I asked because of one old function was causing mm pop up a message about running code to early.

I find reusing same bits of code in my daily's and vendor interactions is leading to some problems as updates are included in some, but missed in others. User-function is an easy solution it seems.