Questions, questions...
Moderator: Eowul
Forum rules
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
Re: Questions, questions...
In what scenario?Yanus wrote:Why args.length is undefined?
Caretaker of Arda
Re: Questions, questions...
Is there anyway to set up a macro?
I am so used to have 0 as a "h all" macro and I hit it obsessively.
I am so used to have 0 as a "h all" macro and I hit it obsessively.
Re: Questions, questions...
args is an object, objects in JS have no length property and that's what's causing it to be undefined. You can iterate through them but you can't invoke array-specific functions on them (like length).Yanus wrote:Alias.
Name: bromba
Type: javascript
Body:Input:Code: Select all
gwc.output.append(args.length); gwc.output.append(args[1]);
Output:Code: Select all
bromba alalala
Code: Select all
undefined alalala
More reading: https://www.inkling.com/read/javascript ... ke-objects
Time is precious. Waste it wisely.
Re: Questions, questions...
Your example isn't 100% clear to me, but hopefully some of this helps? If you are actually passing in an argument like args, then its possible in your example that args could be an object, not an array.Yanus wrote: @Zhar
That's the ancient problem.
Code: Select all
var obj = {};
obj[1] = 'test';
If you are actually trying to access the arguments of a function, then, the keyword is arguments and it isn't passed into the function, its just kind of there.
What happens if you change the code to:
Code: Select all
gwc.output.append(arguments.length);
Time is precious. Waste it wisely.
Re: Questions, questions...
Yes. in Zmud I have the 0 on the numpad as h all and I hit it compulsively all the time.Yanus wrote:@Arcon:
What do you mean by that? Is macro being fired up on pressing the key (without the need to press Enter afterwards)?
I don't think it's possible at the moment.
@Zhar
That's the ancient problem.
http://tworzymyatmosfere.pl/przescieradla-jedwabne-z-gumka/