Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Plugin Actions from Lua

  1. #1
    Join Date
    Mar 2006
    Location
    Sydney, Australia
    Posts
    787

    Default Plugin Actions from Lua

    hi,
    i frequently want to use NetRemote plug actions from Lua, but i never know the syntax of the commands, is there a reference guide or some rules for how to do this?
    For example right now i want to use the WebBrowser plugin action 'Go to URL' can i assume the syntax is 'NetRemote.GotoURL("browsername", "url")' ?
    tanks
    Dan

  2. #2
    Join Date
    Mar 2006
    Location
    Sydney, Australia
    Posts
    787

    Default

    I tried 'NetRemote.GotoURL("browsername", "url")' and it didnt work.
    can i use this action from Lua?

  3. #3
    Join Date
    Mar 2005
    Location
    Hutchinson, Kansas, USA
    Posts
    203

    Default

    I'm certainly not the expert on this, but I use:

    Code:
    NetRemote.ExecuteAction(-2,1,32,"browsername,URL");
    assumes, of course, that you're using the default instance of the WebBrowser plugin...

    HTH,
    Terry

  4. #4
    Join Date
    Mar 2006
    Location
    Sydney, Australia
    Posts
    787

    Default

    Hey honnt,
    Thanks for your reply, its starting to make sense now... the '-2, 1, 32' matches up with the action ID that can be found on the top of the tab i see in NRD when i click on the action in the action designer. I think i'm ready to move foward!

    It looks like the syntax you have posted is listed in the help files as being 'older', and im guessing;
    Code:
    [success] = [Instance]:ExecuteAction([actionid1], [actionid2], [params], [callno])
    is the prefered method doing it.

    Can anyone supply a code example of this new method? im not to sure where [Instance]: fits into the picture or what [callno] is for.

    Cheers

    Dan

  5. #5
    Join Date
    May 2002
    Location
    CT
    Posts
    6,559

    Default

    I can. Terry's method will still work 100%, but you can also do ...

    Code:
    plugin = NetRemote.GetPlugin('Girder');
    instance = plugin:GetCurrentInstance();
    instance:ExecuteAction(-1,0,'Test');

  6. #6
    Join Date
    Mar 2006
    Location
    Sydney, Australia
    Posts
    787

    Default

    I am trying using Terrys method bu i cant get it to go to the URL i want, im pretty sure it finds the browser but i think its sending a bogus address.
    the code im using is;
    Code:
    NetRemote.ExecuteAction(-2,1,32,"surf"..tostring(i), Dan.Menu.Web.URL)
    where i and Dan.Menu.Web.URL are both Lua vars.
    i have also tried;
    Code:
    NetRemote.ExecuteAction(-2,1,32,"surf"..tostring(i), "http://www.yahoo.com")
    with the same result and;
    Code:
    NetRemote.ExecuteAction(-2,1,32,"surf2 , http://www.yahoo.com")
    but that doesnt find the browser name

    any help would be great.

    Dan

  7. #7
    Join Date
    Mar 2005
    Location
    Hutchinson, Kansas, USA
    Posts
    203

    Default

    You might try something like this:
    Code:
    local i = 2
    local url='http://www.promixis.com'
    NetRemote.ExecuteAction(-2,1,32,'surf'..tonumber(i)..','..url)
    Also an attached ccf to demonstrate.
    Attached Files Attached Files
    Terry

  8. #8
    Join Date
    Mar 2006
    Location
    Sydney, Australia
    Posts
    787

    Default

    Thanks Terry, i soon as i saw the solution i was like "Of course!".
    Its all working -exactly- as i want it to now.

    Dan

  9. #9
    Join Date
    May 2002
    Location
    CT
    Posts
    6,559

    Default

    Great! Can't wait to see the final CCF, Dan.

  10. #10
    Join Date
    Mar 2006
    Location
    Sydney, Australia
    Posts
    787

    Default

    Quote Originally Posted by Ben S View Post
    Code:
    plugin = NetRemote.GetPlugin('Girder');
    instance = plugin:GetCurrentInstance();
    instance:ExecuteAction(-1,0,'Test');
    Hi Ben,
    I've been playing around with doing things this way but im a little stuck.
    this code raises a communication event in girder with the event string "1.0" and pld3 has the value 'Test'.
    What i want is to define an event string and also if possible send a second variable as pld4.
    Can i do this?
    thanks
    Dan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •