Can You Do Argumetns For Scripts?

言語: JP EN DE FR
2010-06-21
New Items
users online
フォーラム » Windower » General » can you do Argumetns for scripts?
can you do Argumetns for scripts?
Offline
Posts: 551
By DaneBlood 2018-10-13 17:35:37  
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
サーバ: Bismarck
Game: FFXI
user: Xurion
Posts: 241
By Bismarck.Xurion 2018-10-14 14:01:46  
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: 551
By DaneBlood 2018-10-18 18:37:45  
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
Log in to post.