1 | package de.tinybrain.nt.nt01; |
2 | |
3 | import net.luaos.tb.remote.ServerConnection; |
4 | import net.luaos.tb.tb12.Sandbox; |
5 | import org.luaj.vm2.LuaValue; |
6 | |
7 | import java.io.IOException; |
8 | |
9 | public class ExecuteReplacement {
|
10 | public static void main(String[] args) throws IOException {
|
11 | String replacementID = "#2000029"; |
12 | String contentID = "#2000028"; |
13 | String replacerID = "#2000031"; |
14 | |
15 | ServerConnection serverConnection = ServerConnection.aServerConnection(); |
16 | Sandbox sandbox = new Sandbox(serverConnection); |
17 | sandbox.setOuter("replacement", serverConnection.loadSnippet(replacementID));
|
18 | sandbox.setOuter("content", serverConnection.loadSnippet(contentID));
|
19 | LuaValue result = sandbox.runSnippet(replacerID); |
20 | String textResult = result.tojstring(); |
21 | System.out.println("Result: " + textResult);
|
22 | String title = "A result for replacement " + replacementID + " on " + contentID + " using replacer " + replacerID; |
23 | System.out.println("Snippet created: " +serverConnection.ntUpload(textResult, ExecuteReplacement.class.getName(), title));
|
24 | } |
25 | } |
Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #525 |
| Snippet name: | de.tinybrain.nt.nt01.ExecuteReplacement |
| Eternal ID of this version: | #525/1 |
| Text MD5: | c6396e37da10bee9a4b49211e0411709 |
| Author: | stefan |
| Category: | |
| Type: | Java source code |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2015-03-12 21:19:42 |
| Source code size: | 1088 bytes / 25 lines |
| Pitched / IR pitched: | No / Yes |
| Views / Downloads: | 842 / 212 |
| Referenced in: | [show references] |