Thread Tools Display Modes
09/11/14, 12:38 PM   #1
Gedalya
Join Date: May 2014
Posts: 7
Is the Lua OS Library Supported?

Is the Lua OS library suported? Is it possible to run the following snippit in my plugin to trigger another script?
os.execute('C:\\tmp\\MyFile.bat')
I keep getting the following error: "attempt to index a nil value".

Last edited by Gedalya : 09/11/14 at 12:52 PM.
  Reply With Quote
09/11/14, 01:57 PM   #2
w33zl
 
w33zl's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 13
Originally Posted by Gedalya View Post
Is the Lua OS library suported? Is it possible to run the following snippit in my plugin to trigger another script?
os.execute('C:\\tmp\\MyFile.bat')
I keep getting the following error: "attempt to index a nil value".
No, it is currently not possible to perform any i/o operations. This is intentional by Zenimax.
  Reply With Quote
09/11/14, 02:02 PM   #3
Gedalya
Join Date: May 2014
Posts: 7
Thanks! Saved me a lot of headache!
  Reply With Quote
09/11/14, 02:27 PM   #4
Fyrakin
 
Fyrakin's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 129
Well, if you could make a clipboard listener application you could trigger another script by placing something to clipboard.
  Reply With Quote
09/11/14, 02:30 PM   #5
w33zl
 
w33zl's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 13
Originally Posted by Fyrakin View Post
Well, if you could make a clipboard listener application you could trigger another script by placing something to clipboard.
You mean for the user to copy any text into the clipboard manually? Or do ESO support any LUA command to save data to clipboard?
  Reply With Quote
09/11/14, 02:40 PM   #6
Fyrakin
 
Fyrakin's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 129
Originally Posted by w33zl View Post
You mean for the user to copy any text into the clipboard manually? Or do ESO support any LUA command to save data to clipboard?
Add-on can do copy something formatted/patterned (well anything up to 1k characters) to clipboard. All you have to do is to make a desktop application which listens for clipboard, if anything is copied there your app checks its contents and if there is something that interests it it can do anything externally - shell, http post, smtp, create file, etc. You get the idea.
  Reply With Quote
09/11/14, 02:44 PM   #7
w33zl
 
w33zl's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 13
Originally Posted by Fyrakin View Post
Add-on can do copy something formatted/patterned (well anything up to 1k characters) to clipboard. All you have to do is to make a desktop application which listens for clipboard, if anything is copied there your app checks its contents and if there is something that interests it it can do anything externally - shell, http post, smtp, create file, etc. You get the idea.
Interesting, how do you save to clipboard? I have looked in the ESOUI Wiki but couldn't find anything useful.
  Reply With Quote
09/11/14, 02:57 PM   #8
Fyrakin
 
Fyrakin's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 129
Code:
--Buffer preparation
if (not _G["YOUR_BUFFER_WINDOW_NAME"]) then
	WINDOW_MANAGER:CreateTopLevelWindow("YOUR_BUFFER_WINDOW_NAME")
end
if (not _G["YOUR_BUFFER"]) then
	WINDOW_MANAGER:CreateControlFromVirtual("YOUR_BUFFER", _G["YOUR_BUFFER_WINDOW_NAME"], "ZO_DefaultEditMultiLineForBackdrop")
end
_G["YOUR_BUFFER"]:SetAlpha(0) -- make it transparent
_G["YOUR_BUFFER"]:SetCopyEnabled(true)
_G["YOUR_BUFFER"]:SetMaxInputChars(1000)
_G["YOUR_BUFFER"]:SetMouseEnabled(false)


-- Specific commands to place somethig to clipboard
_G["YOUR_BUFFER"]:SetText("Here is something for the clipboard listener")
_G["YOUR_BUFFER"]:CopyAllTextToClipboard() -- This is it.
  Reply With Quote
09/11/14, 03:00 PM   #9
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,579
EditBox control elements offer a copy to clipboard method.
You can either use an existing editbox like the chat input box or create your own, set the text and then call the copy function.
Code:
-- do this once
local clipBoardControl = WINDOW_MANAGER:CreateControl("Chat2ClipboardControl", GuiRoot, CT_EDITBOX)
clipBoardControl:SetHidden(true)
clipBoardControl:SetMaxInputChars(1000)

-- call this whenever you want to copy something
clipBoardControl:SetText("Hello World")
clipBoardControl:CopyAllTextToClipboard()
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Is the Lua OS Library Supported?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off