Can You Do Argumetns For Scripts?

Eorzea Time
 
 
 
Language: JP EN FR DE
users online
Forum » Windower » General » can you do Argumetns for scripts?
can you do Argumetns for scripts?
Offline
Posts: 1109
By DaneBlood 2018-10-13 17:35:37
Link | Quote | Reply
 
in batch fiels we have %1 and %2 etc to handle arguemnt provide to the batch files

E.G:
Dosomthing.bat me you
will run th batch files and have the internal variable %1 and %2 be me and you so you can use those for values for internal use

i would love to be able to do something alogn the line of
exec Dosomthing Me you
and it would have some internal variable in the same way.

Is this possible ?
 Bismarck.Xurion
Offline
Server: Bismarck
Game: FFXI
user: Xurion
Posts: 693
By Bismarck.Xurion 2018-10-14 14:01:46
Link | Quote | Reply
 
An addon has the ability to respond to being called, but only once loaded.

For example, to achieve what you said above, you'd need to:

lua load <addon>
<addon> dosomething <arg1> <arg2>

In the addon, the code you need is:
Code
windower.register_event('addon command', function(command, arg1, arg2)
  if command == 'dosomething' then
    --code goes here
  end
end)


There are more dynamic ways to code this event, so have a look at some of the other addons you probably already have installed for ideas.
[+]
Offline
Posts: 1109
By DaneBlood 2018-10-18 18:37:45
Link | Quote | Reply
 
Bismarck.Xurion said: »
An addon has the ability to respond to being called, but only once loaded.

For example, to achieve what you said above, you'd need to:

lua load <addon>
<addon> dosomething <arg1> <arg2>

In the addon, the code you need is:
Code
windower.register_event('addon command', function(command, arg1, arg2)
  if command == 'dosomething' then
    --code goes here
  end
end)


There are more dynamic ways to code this event, so have a look at some of the other addons you probably already have installed for ideas.


I was thinking scripts ( aka the exec command).
But I think I can work with this