├── Telemeter Landing Visualizer
├── readme.md
├── diagram.png
├── PB-telemeter.txt
├── renderscript.txt
└── PB-main.txt
├── DUImageToLuaConverter
├── DUImageToLuaConverter
│ ├── obj
│ │ └── Debug
│ │ │ ├── _IsIncrementalBuild
│ │ │ ├── DUImageToLuaConverter.vbproj.SuggestedBindingRedirects.cache
│ │ │ ├── DUImageToLuaConverter.vbproj.CoreCompileInputs.cache
│ │ │ ├── DUImageToLuaConverter.exe
│ │ │ ├── DUImageToLuaConverter.pdb
│ │ │ ├── DUImageToLuaConverter.Form1.resources
│ │ │ ├── DUImageToLuaConverter.Resources.resources
│ │ │ ├── DesignTimeResolveAssemblyReferences.cache
│ │ │ ├── TempPE
│ │ │ └── My Project.Resources.Designer.vb.dll
│ │ │ ├── DesignTimeResolveAssemblyReferencesInput.cache
│ │ │ ├── DUImageToLuaConverter.vbproj.AssemblyReference.cache
│ │ │ ├── DUImageToLuaConverter.vbproj.GenerateResource.Cache
│ │ │ ├── DUImageToLuaConverter.vbproj.GenerateResource.cache
│ │ │ ├── DUImageToLuaConverter.vbprojResolveAssemblyReference.cache
│ │ │ ├── DUImageToLuaConverter.xml
│ │ │ └── DUImageToLuaConverter.vbproj.FileListAbsolute.txt
│ ├── bin
│ │ └── Debug
│ │ │ ├── DUImageToLuaConverter.exe
│ │ │ ├── DUImageToLuaConverter.pdb
│ │ │ ├── DUImageToLuaConverter.vshost.exe
│ │ │ ├── DUImageToLuaConverter.exe.config
│ │ │ ├── DUImageToLuaConverter.vshost.exe.config
│ │ │ ├── DUImageToLuaConverter.vshost.exe.manifest
│ │ │ └── DUImageToLuaConverter.xml
│ ├── App.config
│ ├── My Project
│ │ ├── Settings.settings
│ │ ├── Application.myapp
│ │ ├── AssemblyInfo.vb
│ │ ├── Application.Designer.vb
│ │ ├── Resources.Designer.vb
│ │ ├── Settings.Designer.vb
│ │ └── Resources.resx
│ ├── DUImageToLuaConverter.sln
│ ├── Form1.vb
│ ├── DUImageToLuaConverter.vbproj
│ ├── Form1.resx
│ └── Form1.Designer.vb
├── renderscript.txt
└── README.md
├── Nuclear Universe
├── diagram.png
├── Main Controller.txt
├── Nuke Module - Timer Recursion.txt
├── Nuke Modules - Load Recursion.txt
└── readme.md
├── Remote Networking
├── diagram.png
├── readme.md
└── screen.txt
├── Custom Font From Image
├── customfont1.png
└── Custom Font.txt
├── Door Control
├── readme.md
├── Door Control - PB.txt
└── Door Control - renderscript.txt
├── Construct ID License Plate
├── Dynamic License Plate - PB.txt
├── readme.md
└── Dynamic License Plate - renderscript.txt
├── TYR Ship Kiosk
└── Readme.md
├── Voxelmancy Space Gyro Tool
└── Voxelmancy Space Gyro Tool - PB.txt
├── Item ID Scraper
└── Item ID Scraper - PB.txt
├── TYR MU Control Uplink
└── Readme.md
├── Databank Key Viewer
├── DB Key Viewer - PB.txt
└── DB Key Viewer - renderscript.txt
├── Proximity Detection
└── Proximity Detection - PB.txt
├── Terminal Emulator
└── Terminal Emulator - Renderscript.txt
├── Image Slideshow
└── Infinite Image Slideshow - Renderscript.txt
├── Conway's Game of Life
└── Conways Game Of Life - Renderscript.txt
├── Lighting RGB Control
├── Light RGB Control - PB.txt
└── Light RGB Control - renderscript.txt
├── Cellular Automata Art
└── CellAutomataArt1 - Renderscript.txt
├── README.md
├── Particle System
└── Particle System - Renderscript.txt
├── ImageToMovie
└── ImageMovieScript - Renderscript.txt
├── DUOpenMarket Ad
└── DUOpenMarket Ad - Renderscript.txt
├── Drawing Board 1.1
└── Drawing Board 1 - Renderscript.txt
├── Simple Game Skeleton
└── remote controller.txt
├── Matrix Code Rain
└── MatrixCodeRain - Renderscript.txt
└── Developer Utility Screen
└── DevScreen - Renderscript.txt
/Telemeter Landing Visualizer/readme.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/obj/Debug/_IsIncrementalBuild:
--------------------------------------------------------------------------------
1 | obj\Debug\\_IsIncrementalBuild
2 |
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/obj/Debug/DUImageToLuaConverter.vbproj.SuggestedBindingRedirects.cache:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Nuclear Universe/diagram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jason-Bloomer/DU-Lua-Scripts/HEAD/Nuclear Universe/diagram.png
--------------------------------------------------------------------------------
/Remote Networking/diagram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jason-Bloomer/DU-Lua-Scripts/HEAD/Remote Networking/diagram.png
--------------------------------------------------------------------------------
/Custom Font From Image/customfont1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jason-Bloomer/DU-Lua-Scripts/HEAD/Custom Font From Image/customfont1.png
--------------------------------------------------------------------------------
/Telemeter Landing Visualizer/diagram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jason-Bloomer/DU-Lua-Scripts/HEAD/Telemeter Landing Visualizer/diagram.png
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/obj/Debug/DUImageToLuaConverter.vbproj.CoreCompileInputs.cache:
--------------------------------------------------------------------------------
1 | 5c57553cbe005345e640834792d01b3c04d0b0d3
2 |
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/bin/Debug/DUImageToLuaConverter.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jason-Bloomer/DU-Lua-Scripts/HEAD/DUImageToLuaConverter/DUImageToLuaConverter/bin/Debug/DUImageToLuaConverter.exe
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/bin/Debug/DUImageToLuaConverter.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jason-Bloomer/DU-Lua-Scripts/HEAD/DUImageToLuaConverter/DUImageToLuaConverter/bin/Debug/DUImageToLuaConverter.pdb
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/obj/Debug/DUImageToLuaConverter.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jason-Bloomer/DU-Lua-Scripts/HEAD/DUImageToLuaConverter/DUImageToLuaConverter/obj/Debug/DUImageToLuaConverter.exe
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/obj/Debug/DUImageToLuaConverter.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jason-Bloomer/DU-Lua-Scripts/HEAD/DUImageToLuaConverter/DUImageToLuaConverter/obj/Debug/DUImageToLuaConverter.pdb
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/bin/Debug/DUImageToLuaConverter.vshost.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jason-Bloomer/DU-Lua-Scripts/HEAD/DUImageToLuaConverter/DUImageToLuaConverter/bin/Debug/DUImageToLuaConverter.vshost.exe
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/obj/Debug/DUImageToLuaConverter.Form1.resources:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jason-Bloomer/DU-Lua-Scripts/HEAD/DUImageToLuaConverter/DUImageToLuaConverter/obj/Debug/DUImageToLuaConverter.Form1.resources
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/obj/Debug/DUImageToLuaConverter.Resources.resources:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jason-Bloomer/DU-Lua-Scripts/HEAD/DUImageToLuaConverter/DUImageToLuaConverter/obj/Debug/DUImageToLuaConverter.Resources.resources
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/obj/Debug/DesignTimeResolveAssemblyReferences.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jason-Bloomer/DU-Lua-Scripts/HEAD/DUImageToLuaConverter/DUImageToLuaConverter/obj/Debug/DesignTimeResolveAssemblyReferences.cache
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/obj/Debug/TempPE/My Project.Resources.Designer.vb.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jason-Bloomer/DU-Lua-Scripts/HEAD/DUImageToLuaConverter/DUImageToLuaConverter/obj/Debug/TempPE/My Project.Resources.Designer.vb.dll
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jason-Bloomer/DU-Lua-Scripts/HEAD/DUImageToLuaConverter/DUImageToLuaConverter/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/obj/Debug/DUImageToLuaConverter.vbproj.AssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jason-Bloomer/DU-Lua-Scripts/HEAD/DUImageToLuaConverter/DUImageToLuaConverter/obj/Debug/DUImageToLuaConverter.vbproj.AssemblyReference.cache
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/obj/Debug/DUImageToLuaConverter.vbproj.GenerateResource.Cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jason-Bloomer/DU-Lua-Scripts/HEAD/DUImageToLuaConverter/DUImageToLuaConverter/obj/Debug/DUImageToLuaConverter.vbproj.GenerateResource.Cache
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/obj/Debug/DUImageToLuaConverter.vbproj.GenerateResource.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jason-Bloomer/DU-Lua-Scripts/HEAD/DUImageToLuaConverter/DUImageToLuaConverter/obj/Debug/DUImageToLuaConverter.vbproj.GenerateResource.cache
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/obj/Debug/DUImageToLuaConverter.vbprojResolveAssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jason-Bloomer/DU-Lua-Scripts/HEAD/DUImageToLuaConverter/DUImageToLuaConverter/obj/Debug/DUImageToLuaConverter.vbprojResolveAssemblyReference.cache
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/bin/Debug/DUImageToLuaConverter.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/bin/Debug/DUImageToLuaConverter.vshost.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/My Project/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Door Control/readme.md:
--------------------------------------------------------------------------------
1 | # Lua Door Access Code Control Script
2 |
3 | ### MAKE SURE you change the default access code when installing the script
4 |
5 | Recommended to have the programming board be triggered by a Detection Zone linked to a switch, so it will start automatically when someone is in proximity of the door/screen.
6 |
7 | All colors on the screen are easy to change variables. Users can be assigned specific codes that only work for them, or general all-access codes can be created.
8 | Supports automatic recognition of the system owner by player ID.
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/My Project/Application.myapp:
--------------------------------------------------------------------------------
1 |
2 |
3 | true
4 | Form1
5 | false
6 | 0
7 | true
8 | 0
9 | 0
10 | true
11 |
12 |
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/bin/Debug/DUImageToLuaConverter.vshost.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/bin/Debug/DUImageToLuaConverter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | DUImageToLuaConverter
6 |
7 |
8 |
9 |
10 |
11 | A strongly-typed resource class, for looking up localized strings, etc.
12 |
13 |
14 |
15 |
16 | Returns the cached ResourceManager instance used by this class.
17 |
18 |
19 |
20 |
21 | Overrides the current thread's CurrentUICulture property for all
22 | resource lookups using this strongly typed resource class.
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/obj/Debug/DUImageToLuaConverter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | DUImageToLuaConverter
6 |
7 |
8 |
9 |
10 |
11 | A strongly-typed resource class, for looking up localized strings, etc.
12 |
13 |
14 |
15 |
16 | Returns the cached ResourceManager instance used by this class.
17 |
18 |
19 |
20 |
21 | Overrides the current thread's CurrentUICulture property for all
22 | resource lookups using this strongly typed resource class.
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Construct ID License Plate/Dynamic License Plate - PB.txt:
--------------------------------------------------------------------------------
1 | {"slots":{"0":{"name":"slot1","type":{"events":[],"methods":[]}},"1":{"name":"slot2","type":{"events":[],"methods":[]}},"2":{"name":"slot3","type":{"events":[],"methods":[]}},"3":{"name":"slot4","type":{"events":[],"methods":[]}},"4":{"name":"slot5","type":{"events":[],"methods":[]}},"5":{"name":"slot6","type":{"events":[],"methods":[]}},"6":{"name":"slot7","type":{"events":[],"methods":[]}},"7":{"name":"slot8","type":{"events":[],"methods":[]}},"8":{"name":"slot9","type":{"events":[],"methods":[]}},"9":{"name":"slot10","type":{"events":[],"methods":[]}},"-1":{"name":"unit","type":{"events":[],"methods":[]}},"-3":{"name":"player","type":{"events":[],"methods":[]}},"-2":{"name":"construct","type":{"events":[],"methods":[]}},"-4":{"name":"system","type":{"events":[],"methods":[]}},"-5":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"slot1.setScriptInput(construct.getId())","filter":{"args":[],"signature":"onStart()","slotKey":"-1"},"key":1}],"methods":[],"events":[]}
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/DUImageToLuaConverter.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.24720.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DUImageToLuaConverter", "DUImageToLuaConverter.vbproj", "{596C6B7D-055E-4C26-B43E-6CD89F44DE06}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {596C6B7D-055E-4C26-B43E-6CD89F44DE06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {596C6B7D-055E-4C26-B43E-6CD89F44DE06}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {596C6B7D-055E-4C26-B43E-6CD89F44DE06}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {596C6B7D-055E-4C26-B43E-6CD89F44DE06}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/Custom Font From Image/Custom Font.txt:
--------------------------------------------------------------------------------
1 | local customfontimage = loadImage("assets.prod.novaquark.com/66839/e294a1f0-11ae-4fa1-a5f8-aeb02288eb24.png")
2 | local layer1 = createLayer()
3 | local layer2 = createLayer()
4 | local font1 = loadFont("Play",20)
5 | local rx,ry = getResolution()
6 |
7 | setBackgroundColor(0.5,0.5,0.5)
8 |
9 | function addCustomText(drawlayer, imagehandle, textstring, xpos, ypos, size, colorr, colorg, colorb, colora)
10 | destructstring = textstring
11 | for ix=1,#textstring do
12 | nextletter = string.sub(destructstring,1,1)
13 | destructstring = string.sub(destructstring,2,string.len(destructstring))
14 | nextascii = string.byte(nextletter) - 33
15 |
16 | local subxpos = math.fmod(nextascii,32)
17 | local subypos = math.floor(nextascii / 32)
18 | setNextFillColor(drawlayer, colorr, colorg, colorb, colora)
19 | addImageSub(drawlayer, imagehandle, xpos+(ix * (size/2)), ypos, size, size, 0 + (68*subxpos), 0 + (68 * subypos), 68, 68)
20 | end
21 | end
22 |
23 | addCustomText(layer1, customfontimage, "This is a custom font, rendered from an image file.", 50, 150, 28, 0,0,0,1)
--------------------------------------------------------------------------------
/Construct ID License Plate/readme.md:
--------------------------------------------------------------------------------
1 | # Dynamic Ship License Plate
2 |
3 | ### Installation
4 |
5 | Copy the content of renderscript.txt into the screen you wish to use to display the license plate.
6 | You may either use a standalone programming board, or a control seat to set the input to the script.
7 |
8 | To use a Programming Board: Paste PB.txt into a Programming Board as a config, and link it to the screen.
9 | Any time the construct is compactified, the ID is regenerated, and the script input will need to be reset.
10 | For this reason it may be preferable to use your control seat.
11 |
12 | To use your Control Seat: Link the seat to the screen, edit the seat's Lua with CTRL+L, click Unit on the left, and then click the onStart filter.
13 | Paste this line into the very bottom of the onStart filter's code;
14 |
15 | [screenslot].setScriptInput(construct.getId())
16 |
17 | where [screenslot] is replaced with the slot corresponding to the screen you linked earlier.
18 |
19 | ### Configuration
20 |
21 | The colors and images are all customizable. Check the first couple lines of code.
22 | To change the planet name and image displayed, simply change the "bgplanet" variable.
23 | The values of this variable correspond to the entries in atlas.json.
24 | For example, a value of 1 displays Madis, 2 displays Alioth, and 3 for Thades.
--------------------------------------------------------------------------------
/Nuclear Universe/Main Controller.txt:
--------------------------------------------------------------------------------
1 | {"slots":{"0":{"name":"slot1","type":{"events":[],"methods":[]}},"1":{"name":"slot2","type":{"events":[],"methods":[]}},"2":{"name":"slot3","type":{"events":[],"methods":[]}},"3":{"name":"slot4","type":{"events":[],"methods":[]}},"4":{"name":"slot5","type":{"events":[],"methods":[]}},"5":{"name":"slot6","type":{"events":[],"methods":[]}},"6":{"name":"slot7","type":{"events":[],"methods":[]}},"7":{"name":"slot8","type":{"events":[],"methods":[]}},"8":{"name":"slot9","type":{"events":[],"methods":[]}},"9":{"name":"slot10","type":{"events":[],"methods":[]}},"-1":{"name":"unit","type":{"events":[],"methods":[]}},"-2":{"name":"system","type":{"events":[],"methods":[]}},"-3":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"unit.setTimer(\"main\",1/240)\nslot1.deactivate()\nslot2.deactivate()\nslot3.deactivate()\nslot4.deactivate()\nslot5.deactivate()\nslot6.deactivate()\nslot7.deactivate()\nslot8.deactivate()\nslot9.deactivate()\nslot10.deactivate()","filter":{"args":[],"signature":"start()","slotKey":"-1"},"key":"0"},{"code":"slot1.activate()\nslot2.activate()\nslot3.activate()\nslot4.activate()\nslot5.activate()\nslot6.activate()\nslot7.activate()\nslot8.activate()\nslot9.activate()\nslot10.activate()","filter":{"args":[{"variable":"*"}],"signature":"tick(timerId)","slotKey":"-1"},"key":"1"}],"methods":[],"events":[]}
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/My Project/AssemblyInfo.vb:
--------------------------------------------------------------------------------
1 | Imports System
2 | Imports System.Reflection
3 | Imports System.Runtime.InteropServices
4 |
5 | ' General Information about an assembly is controlled through the following
6 | ' set of attributes. Change these attribute values to modify the information
7 | ' associated with an assembly.
8 |
9 | ' Review the values of the assembly attributes
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | 'The following GUID is for the ID of the typelib if this project is exposed to COM
21 |
22 |
23 | ' Version information for an assembly consists of the following four values:
24 | '
25 | ' Major Version
26 | ' Minor Version
27 | ' Build Number
28 | ' Revision
29 | '
30 | ' You can specify all the values or you can default the Build and Revision Numbers
31 | ' by using the '*' as shown below:
32 | '
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/Nuclear Universe/Nuke Module - Timer Recursion.txt:
--------------------------------------------------------------------------------
1 | {"slots":{"0":{"name":"switch1","type":{"events":[],"methods":[]}},"1":{"name":"switch2","type":{"events":[],"methods":[]}},"2":{"name":"slot3","type":{"events":[],"methods":[]}},"3":{"name":"slot4","type":{"events":[],"methods":[]}},"4":{"name":"slot5","type":{"events":[],"methods":[]}},"5":{"name":"slot6","type":{"events":[],"methods":[]}},"6":{"name":"slot7","type":{"events":[],"methods":[]}},"7":{"name":"slot8","type":{"events":[],"methods":[]}},"8":{"name":"slot9","type":{"events":[],"methods":[]}},"9":{"name":"slot10","type":{"events":[],"methods":[]}},"-1":{"name":"unit","type":{"events":[],"methods":[]}},"-2":{"name":"system","type":{"events":[],"methods":[]}},"-3":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"if switch1.getState() == 1 then\n switch1.deactivate()\nelse\n switch1.activate()\nend\ngloballag = 1\nunit.setTimer(\"timer\"..globallag,1/60)","filter":{"args":[],"signature":"start()","slotKey":"-1"},"key":"0"},{"code":"if switch1.getState() == 1 then\n switch1.deactivate()\nelse\n switch1.activate()\nend\ngloballag = globallag + 1\nunit.setTimer(\"timer\"..globallag,1/60)","filter":{"args":[{"variable":"*"}],"signature":"tick(timerId)","slotKey":"-1"},"key":"1"},{"code":"switch1.deactivate()\nswitch2.deactivate()","filter":{"args":[],"signature":"stop()","slotKey":"-1"},"key":"2"}],"methods":[],"events":[]}
--------------------------------------------------------------------------------
/Nuclear Universe/Nuke Modules - Load Recursion.txt:
--------------------------------------------------------------------------------
1 | {"slots":{"0":{"name":"switch1","type":{"events":[],"methods":[]}},"1":{"name":"switch2","type":{"events":[],"methods":[]}},"2":{"name":"slot3","type":{"events":[],"methods":[]}},"3":{"name":"slot4","type":{"events":[],"methods":[]}},"4":{"name":"slot5","type":{"events":[],"methods":[]}},"5":{"name":"slot6","type":{"events":[],"methods":[]}},"6":{"name":"slot7","type":{"events":[],"methods":[]}},"7":{"name":"slot8","type":{"events":[],"methods":[]}},"8":{"name":"slot9","type":{"events":[],"methods":[]}},"9":{"name":"slot10","type":{"events":[],"methods":[]}},"-1":{"name":"unit","type":{"events":[],"methods":[]}},"-3":{"name":"player","type":{"events":[],"methods":[]}},"-2":{"name":"construct","type":{"events":[],"methods":[]}},"-4":{"name":"system","type":{"events":[],"methods":[]}},"-5":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"if switch1.getState() == 1 then\n switch1.deactivate()\nelse\n switch1.activate()\nend\nbigstring = \"load(bigstring)\"\nunit.setTimer(\"a\", 1)","filter":{"args":[],"signature":"start()","slotKey":"-1"},"key":"0"},{"code":"if switch1.getState() == 1 then\n switch1.deactivate()\nelse\n switch1.activate()\nend\nfor xa=1,12500 do\n bigstring = \"load(\" .. bigstring .. \")\"\nend\nload(bigstring)","filter":{"args":[{"value":"a"}],"signature":"tick(timerId)","slotKey":"-1"},"key":"1"},{"code":"switch1.deactivate()\nswitch2.deactivate()","filter":{"args":[],"signature":"stop()","slotKey":"-1"},"key":"2"}],"methods":[],"events":[]}
--------------------------------------------------------------------------------
/Door Control/Door Control - PB.txt:
--------------------------------------------------------------------------------
1 | {"slots":{"0":{"name":"slot1","type":{"events":[],"methods":[]}},"1":{"name":"screen","type":{"events":[],"methods":[]}},"2":{"name":"slot3","type":{"events":[],"methods":[]}},"3":{"name":"slot4","type":{"events":[],"methods":[]}},"4":{"name":"slot5","type":{"events":[],"methods":[]}},"5":{"name":"slot6","type":{"events":[],"methods":[]}},"6":{"name":"slot7","type":{"events":[],"methods":[]}},"7":{"name":"slot8","type":{"events":[],"methods":[]}},"8":{"name":"slot9","type":{"events":[],"methods":[]}},"9":{"name":"slot10","type":{"events":[],"methods":[]}},"-1":{"name":"unit","type":{"events":[],"methods":[]}},"-3":{"name":"player","type":{"events":[],"methods":[]}},"-2":{"name":"construct","type":{"events":[],"methods":[]}},"-4":{"name":"system","type":{"events":[],"methods":[]}},"-5":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"screen.activate()\nscreen.setScriptInput(\"?\")\nscreen.clearScriptOutput()","filter":{"args":[],"signature":"start()","slotKey":"-1"},"key":"0"},{"code":"slot1.deactivate()\nscreen.deactivate()","filter":{"args":[],"signature":"stop()","slotKey":"-1"},"key":"1"},{"code":"local screenoutput = screen.getScriptOutput()\nif unit.getMasterPlayerId() == 00000 then\n slot1.activate()\nelse\n if screenoutput == \"\" then\n screen.setScriptInput(\"?\")\n else\n if screenoutput == \"0000\" then\n screen.setScriptInput(\"1\")\n slot1.activate()\n else\n screen.setScriptInput(\"0\")\n slot1.deactivate()\n end\n end\nend\n\nscreen.clearScriptOutput()","filter":{"args":[],"signature":"update()","slotKey":"-4"},"key":"2"}],"methods":[],"events":[]}
--------------------------------------------------------------------------------
/TYR Ship Kiosk/Readme.md:
--------------------------------------------------------------------------------
1 | # TYR Ship Sales Kiosk
2 |
3 | This script displays all relevent flight-statistics and characteristics for a given construct in a tab-like widget, alongside an image roll of said construct. Use it to display ship models or building blueprints and tokens for sale.
4 | Does NOT have the ability to record orders. This script is Screen-Unit ONLY.
5 |
6 | Originally written for TYR Expedition Group, I have been given permission to open source the code and provide it free to anyone who wishes to use it or improve upon it.
7 |
8 | You may remove the TYR branding at your discretion, however we ask that if you're going to use our script without significant modification, that you please at least keep the mostly-transparent footer at the bottom intact for our recognition.
9 |
10 | ## Usage
11 |
12 | You will need:
13 |
14 | - 1x Screen Element of any size
15 |
16 |
17 | Installation steps:
18 |
19 | - Copy the contents of the renderscript file and paste it into your Screen element, making sure you have LUA selected at the top. Ensure the screen is on.
20 | - Alter the variables at the top of the script to your needs. Every variable is commented with what info it should contain, or what it affects.
21 | - Provide an image-roll for the construct. Acceptable images are 900 pixels wide, and 600\*n pixels tall, where n = how many images you'd like to display.
22 | Maximum height is limited by NQ's acceptable filesize, but generally you can have about 6 or 7 images per construct.
23 | - Restart the screen and press the BROWSE button to ensure everything is working smoothly.
24 |
25 |
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/My Project/Application.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' This code was generated by a tool.
4 | ' Runtime Version:4.0.30319.42000
5 | '
6 | ' Changes to this file may cause incorrect behavior and will be lost if
7 | ' the code is regenerated.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 |
15 | Namespace My
16 |
17 | 'NOTE: This file is auto-generated; do not modify it directly. To make changes,
18 | ' or if you encounter build errors in this file, go to the Project Designer
19 | ' (go to Project Properties or double-click the My Project node in
20 | ' Solution Explorer), and make changes on the Application tab.
21 | '
22 | Partial Friend Class MyApplication
23 |
24 | _
25 | Public Sub New()
26 | MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
27 | Me.IsSingleInstance = false
28 | Me.EnableVisualStyles = true
29 | Me.SaveMySettingsOnExit = true
30 | Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
31 | End Sub
32 |
33 | _
34 | Protected Overrides Sub OnCreateMainForm()
35 | Me.MainForm = Global.DUImageToLuaConverter.Form1
36 | End Sub
37 | End Class
38 | End Namespace
39 |
--------------------------------------------------------------------------------
/Voxelmancy Space Gyro Tool/Voxelmancy Space Gyro Tool - PB.txt:
--------------------------------------------------------------------------------
1 | {"slots":{"0":{"name":"slot1","type":{"events":[],"methods":[]}},"1":{"name":"slot2","type":{"events":[],"methods":[]}},"2":{"name":"slot3","type":{"events":[],"methods":[]}},"3":{"name":"slot4","type":{"events":[],"methods":[]}},"4":{"name":"slot5","type":{"events":[],"methods":[]}},"5":{"name":"slot6","type":{"events":[],"methods":[]}},"6":{"name":"slot7","type":{"events":[],"methods":[]}},"7":{"name":"slot8","type":{"events":[],"methods":[]}},"8":{"name":"slot9","type":{"events":[],"methods":[]}},"9":{"name":"slot10","type":{"events":[],"methods":[]}},"-1":{"name":"unit","type":{"events":[],"methods":[]}},"-2":{"name":"system","type":{"events":[],"methods":[]}},"-3":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"pressed1 = 1\nsystem.print(\"Gyro 1 Active\")","filter":{"args":[{"value":"option1"}],"signature":"actionStart(action)","slotKey":"-2"},"key":"0"},{"code":"local pressed1 = 0\nlocal pressed2 = 0\nlocal pressed3 = 0","filter":{"args":[],"signature":"start()","slotKey":"-2"},"key":"1"},{"code":"pressed2 = 1\nsystem.print(\"Gyro 2 Active\")","filter":{"args":[{"value":"option2"}],"signature":"actionStart(action)","slotKey":"-2"},"key":"2"},{"code":"pressed3 = 1\nsystem.print(\"Gyro 3 Active\")","filter":{"args":[{"value":"option3"}],"signature":"actionStart(action)","slotKey":"-2"},"key":"3"},{"code":"if pressed1 then\n slot1.activate() \n pressed1 = 0\nend","filter":{"args":[{"value":"option1"}],"signature":"actionStop(action)","slotKey":"-2"},"key":"4"},{"code":"if pressed2 then\n slot2.activate()\n pressed2 = 0\nend","filter":{"args":[{"value":"option2"}],"signature":"actionStop(action)","slotKey":"-2"},"key":"5"},{"code":"if pressed3 then\n slot3.activate() \n pressed3 = 0\nend","filter":{"args":[{"value":"option3"}],"signature":"actionStop(action)","slotKey":"-2"},"key":"6"}],"methods":[],"events":[]}
--------------------------------------------------------------------------------
/Item ID Scraper/Item ID Scraper - PB.txt:
--------------------------------------------------------------------------------
1 | {"slots":{"0":{"name":"slot1","type":{"events":[],"methods":[]}},"1":{"name":"slot2","type":{"events":[],"methods":[]}},"2":{"name":"slot3","type":{"events":[],"methods":[]}},"3":{"name":"slot4","type":{"events":[],"methods":[]}},"4":{"name":"slot5","type":{"events":[],"methods":[]}},"5":{"name":"slot6","type":{"events":[],"methods":[]}},"6":{"name":"slot7","type":{"events":[],"methods":[]}},"7":{"name":"slot8","type":{"events":[],"methods":[]}},"8":{"name":"slot9","type":{"events":[],"methods":[]}},"9":{"name":"slot10","type":{"events":[],"methods":[]}},"-1":{"name":"unit","type":{"events":[],"methods":[]}},"-2":{"name":"system","type":{"events":[],"methods":[]}},"-3":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"list = \"\"\ntick = 175947631\nexecute = 1\n\nunit.setTimer(\"main\",1/60)","filter":{"args":[],"signature":"start()","slotKey":"-1"},"key":"0"},{"code":"if execute == 1 then\n if string.len(list) < 40000 then\n for ab=tick,tick + 5000 do\n if system.getItem(ab)[\"displayName\"] == \"\" then\n --invalid item, do nothing\n else\n list = list .. \"\\n\" .. ab .. \", \" .. system.getItem(ab)[\"displayName\"]\n end\n end\n tick = tick + 5000\n system.print(tick)\n else\n system.print(\"FLUSHED AT: \" .. tick)\n system.print(\"Type \\\"C\\\" in Lua Chat to continue execution.\")\n slot1.setRenderScript(list)\n list = \"\"\n execute = 0\n end\nelse\n --Do nothing\nend","filter":{"args":[{"value":"main"}],"signature":"tick(timerId)","slotKey":"-1"},"key":"1"},{"code":"system.print(\"STOPPED AT: \" .. tick)\nslot1.setRenderScript(list)","filter":{"args":[],"signature":"stop()","slotKey":"-1"},"key":"2"},{"code":"if text == \"c\" then\n execute = 1\nend","filter":{"args":[{"variable":"*"}],"signature":"inputText(text)","slotKey":"-2"},"key":"3"}],"methods":[],"events":[]}
--------------------------------------------------------------------------------
/Telemeter Landing Visualizer/PB-telemeter.txt:
--------------------------------------------------------------------------------
1 | {"slots":{"0":{"name":"Emitter","type":{"events":[],"methods":[]}},"1":{"name":"tel1","type":{"events":[],"methods":[]}},"2":{"name":"tel2","type":{"events":[],"methods":[]}},"3":{"name":"tel3","type":{"events":[],"methods":[]}},"4":{"name":"tel4","type":{"events":[],"methods":[]}},"5":{"name":"tel5","type":{"events":[],"methods":[]}},"6":{"name":"tel6","type":{"events":[],"methods":[]}},"7":{"name":"tel7","type":{"events":[],"methods":[]}},"8":{"name":"tel8","type":{"events":[],"methods":[]}},"9":{"name":"tel9","type":{"events":[],"methods":[]}},"-1":{"name":"unit","type":{"events":[],"methods":[]}},"-3":{"name":"player","type":{"events":[],"methods":[]}},"-2":{"name":"construct","type":{"events":[],"methods":[]}},"-4":{"name":"system","type":{"events":[],"methods":[]}},"-5":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"tel1dist = tel1.raycast().distance\ntel2dist = tel2.raycast().distance\ntel3dist = tel3.raycast().distance\ntel4dist = tel4.raycast().distance\ntel5dist = tel5.raycast().distance\ntel6dist = tel6.raycast().distance\ntel7dist = tel7.raycast().distance\ntel8dist = tel8.raycast().distance\ntel9dist = tel9.raycast().distance\nunit.setTimer(\"startup\",0.2)","filter":{"args":[],"signature":"start()","slotKey":"-1"},"key":"0"},{"code":"tel1dist = tel1.raycast().distance\ntel2dist = tel2.raycast().distance\ntel3dist = tel3.raycast().distance\ntel4dist = tel4.raycast().distance\ntel5dist = tel5.raycast().distance\ntel6dist = tel6.raycast().distance\ntel7dist = tel7.raycast().distance\ntel8dist = tel8.raycast().distance\ntel9dist = tel9.raycast().distance\nEmitter.send(\"telemeter1\", tel1dist .. \", \" .. tel2dist .. \", \" .. tel3dist .. \", \" .. tel4dist .. \", \" .. tel5dist .. \", \" .. tel6dist .. \", \" .. tel7dist .. \", \" .. tel8dist .. \", \" .. tel9dist)","filter":{"args":[{"value":"main"}],"signature":"onTimer(tag)","slotKey":"-1"},"key":"1"},{"code":"unit.setTimer(\"main\",1/30)","filter":{"args":[{"value":"startup"}],"signature":"onTimer(tag)","slotKey":"-1"},"key":3}],"methods":[],"events":[]}
--------------------------------------------------------------------------------
/DUImageToLuaConverter/renderscript.txt:
--------------------------------------------------------------------------------
1 | if not init then
2 | l1 = 0
3 | l2 = 0
4 | rr = 6
5 | rx, ry = getResolution()
6 | cx1, cy1 = rx/rr, ry/rr
7 | sx, sy = rr, (rr + 1)
8 | lp = 0
9 | m1 = {}
10 | m2 = {}
11 | m3 = {}
12 | is = ""
13 | for ix=1,cx1 do
14 | m1[ix] = {}
15 | for iy=1,cy1 do
16 | m1[ix][iy] = 0
17 | end
18 | end
19 | for ix2=1,cx1 do
20 | m2[ix2] = {}
21 | for iy2=1,cy1 do
22 | m2[ix2][iy2] = 0
23 | end
24 | end
25 | for ix3=1,cx1 do
26 | m3[ix3] = {}
27 | for iy3=1,cy1 do
28 | m3[ix3][iy3] = 0
29 | end
30 | end
31 | init = true
32 | end
33 |
34 | dl1 = createLayer()
35 |
36 | function DrawAllPixelsL1()
37 | if l2 == 1 then
38 | for by=1,cy1 do
39 | for bx=1,cx1 do
40 | setNextFillColor(dl1, (m1[bx][by]/255), (m2[bx][by]/255), (m3[bx][by]/255), 1)
41 | addBox(dl1, (bx - 1)*rr, (by - 1)*sy, rr, sy)
42 | end
43 | end
44 | end
45 | end
46 |
47 | function LoadLines()
48 | if l1 < cy1 then
49 | if l2 == 0 then
50 | for ix4=1,cx1 do
51 | cl = l1 + 1
52 | for ch=1,3 do
53 | lp = lp + 1
54 | if string.byte(is, lp) ~= nil then
55 | if ch == 1 then
56 | m1[ix4][cl] = (string.byte(is, lp) - 33)*2.8
57 | elseif ch == 2 then
58 | m2[ix4][cl] = (string.byte(is, lp) - 33)*2.8
59 | elseif ch == 3 then
60 | m3[ix4][cl] = (string.byte(is, lp) - 33)*2.8
61 | end
62 | end
63 | end
64 | end
65 | l1 = l1 + 1
66 | requestAnimationFrame(1)
67 | end
68 | end
69 | if l1 > (cy1 - 10) then
70 | l2 = 1
71 | end
72 | end
73 |
74 | LoadLines()
75 | DrawAllPixelsL1()
--------------------------------------------------------------------------------
/TYR MU Control Uplink/Readme.md:
--------------------------------------------------------------------------------
1 | # TYR Mining Unit Control Uplink
2 |
3 | This script will provide a simple but elegant report for Mining Units in Dual Universe, using a single Programming Board and Screen. It updates in real-time, provided nothing breaks.
4 |
5 | Originally written for TYR Expedition Group, I have been given permission to open source the code and provide it free to anyone who wishes to use it or improve upon it.
6 |
7 | ## Usage
8 |
9 | You will need:
10 |
11 | - 1x Screen Element of any size
12 | - 1x Programming Board
13 | - 1x Databank
14 | - 1x Detection Zone (Optional, but at least a size-M is recommended)
15 | - At least one Mining Unit. Supports up to seven. (1-7)
16 |
17 |
18 | Installation steps:
19 |
20 | - Place your elements. They can be moved later.
21 | - Copy the contents of the screen file and paste it into your Screen element. Make sure the screen is on.
22 | - Copy the contents of the PB file, and in-game, right click your Programming Board, and select "Advanced > Paste Lua Configuration from Clipboard".
23 | - Link order is important here. Link the PB to the screen first. Second, link the PB to the databank. Then, link PB to all mining units you want the script to monitor.
24 | - Link your detection zone to the PB if you want the script to run when someone is nearby.
25 |
26 |
27 | ### If at any point the script stops updating, simply restart the programming board.
28 | Sometimes, it gets stuck. This can happen when the system hits a lagspike, or something. Oof :(
29 |
30 | ## TODO
31 |
32 | I had big ambitions for this project. Hopefully it will be revived at some point after NQ decides on a wipe.
33 |
34 | Features I would like to add:
35 |
36 | - The "Uplink" portion (Allow the data to be transmitted and recieved via transmitter, ships could collect the data)
37 | - An interface for viewing calibrations, who did them, and the results.
38 | - Better visuals, enhanced animations.
39 | - Something that helps you find and search for harvest rocks from calibrations. Possibly AR?
40 | - And... you know, stuff.
41 |
--------------------------------------------------------------------------------
/Remote Networking/readme.md:
--------------------------------------------------------------------------------
1 | # Remote Networking Script
2 |
3 | This script allows remote, two-way communication between two programming boards running the same script, which are not physically linked. They do not need to be on the same construct, but the recievers/emitters do need to be loaded and within rendering range when attempting to connect.
4 | This script is entirely unfinished and unpolished. It does occasionally have some hiccups, and is by no means perfect. If anything bugs out, I recommend resetting the Programming Board and Screen, then try again.
5 |
6 | ## Usage
7 |
8 | When setting up the system, you will likely want to edit some of the default values of the variables in the onStart() filter.
9 | DeviceTag contains the name of the current machine you are setting up - this name will be seen and displayed by other machines that attempt to connect to it. Having multiple machines with the same DeviceTag in close proximity causes issues, make sure this is unique to each machine.
10 | SeekTag can be given the name of another machine, to which this machine should attempt to connect with automatically upon startup. Used in combination with the WhitelistOnly variable.
11 |
12 | To connect to a remote machine, simply activate the Programming Board, and press the "SCAN LOCAL" button to retrieve a list of the DeviceTag of all nearby machines which are also running this script.
13 | Click the name of the machine you wish to connect to. A message should show, stating the connection was successful.
14 |
15 | Click "TERMINATE" to disconnect from the remote machine.
16 | "DATA READ" will use the contents of Buffer-1 to attempt to read a databank key with that name from the remote machine. Result is returned to Buffer-2.
17 | "DATA WRITE" will attempt to write a databank key to the remote machine, using Buffer-1 as the key name, and Buffer-2 as the value. (Currently broken, works with some slight tweaks)
18 |
19 | Read Key, Save Key, and Clear Keys are local (non-remote) operations which modify the databank contents on the current machine.
20 |
21 | Verify Keys is an example function which showcases one method of making a function call to the remote machine, and returning the result.
22 |
23 | ## Setup
24 |
25 | Requires at least 1x Screen (any size), 1x Programming Board, 2x Recievers, 2x Emitters, 1x Manual Switch, and 1x Databank.
26 | For detailed link order and direction, see the included diagram in this directory.
--------------------------------------------------------------------------------
/Databank Key Viewer/DB Key Viewer - PB.txt:
--------------------------------------------------------------------------------
1 | {"slots":{"0":{"name":"screen","type":{"events":[],"methods":[]}},"1":{"name":"databank","type":{"events":[],"methods":[]}},"2":{"name":"slot3","type":{"events":[],"methods":[]}},"3":{"name":"slot4","type":{"events":[],"methods":[]}},"4":{"name":"slot5","type":{"events":[],"methods":[]}},"5":{"name":"slot6","type":{"events":[],"methods":[]}},"6":{"name":"slot7","type":{"events":[],"methods":[]}},"7":{"name":"slot8","type":{"events":[],"methods":[]}},"8":{"name":"slot9","type":{"events":[],"methods":[]}},"9":{"name":"slot10","type":{"events":[],"methods":[]}},"-1":{"name":"unit","type":{"events":[],"methods":[]}},"-3":{"name":"player","type":{"events":[],"methods":[]}},"-2":{"name":"construct","type":{"events":[],"methods":[]}},"-4":{"name":"system","type":{"events":[],"methods":[]}},"-5":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"local screenoutput = screen.getScriptOutput()\nlocal screeninput = \"\"\nif screenoutput == \"\" then\n screeninput = \"?\"\nelse\n if screenoutput == \"<\" then\n --previous key\n if page > 0 then\n page = page - 1\n screeninput = \"KEY: \" .. DBKeys[page]\n else\n screeninput = \"\"\n end\n else\n if screenoutput == \">\" then\n --next key\n if page < NBKeys then\n page = page + 1\n screeninput = \"KEY: \" .. DBKeys[page]\n else\n screeninput = \"\"\n end\n else\n if screenoutput == \"KEYOK\" then\n --accepted key, send val\n screeninput = \"VAL: \" .. databank.getStringValue(DBKeys[page])\n else\n --command not understood\n end\n end\n end\nend\nscreen.setScriptInput(screeninput)\nscreen.clearScriptOutput()\nsystem.print(\"Screen OUT: \" .. screenoutput)\nsystem.print(\"Screen IN: \" .. screeninput)","filter":{"args":[{"variable":"*"}],"signature":"onOutputChanged(output)","slotKey":"0"},"key":"0"},{"code":"DBKeys = json.decode(databank.getKeys())\nNBKeys = databank.getNbKeys()\nscreen.activate()\nlocal screenoutput = screen.getScriptOutput()\nlocal screeninput = \"\"\nscreen.setScriptInput(\"?\")\nscreen.clearScriptOutput()\npage = 1\n\n\nsystem.print(\"Screen OUT: \" .. screenoutput)\nsystem.print(\"Screen IN: \" .. screeninput)","filter":{"args":[],"signature":"start()","slotKey":"-1"},"key":"1"}],"methods":[],"events":[]}
--------------------------------------------------------------------------------
/Nuclear Universe/readme.md:
--------------------------------------------------------------------------------
1 | # Nuclear Winter
2 | Dual Universe Unavoidable Lag Trap
3 | Using this script to lag other players is against Novaquark's Terms of Service, and is likely to get you banned. Use of this script for anything other than testing purposes is heavily discouraged. I bear no responsibility for the results of using it.
4 | I decided to document this script because, as of the time of posting, Dual Universe has been released for over a year - and this script still, unfortunately, works quite well. I have made every attempt to notify NQ of the possibility of such scripts to impact players, however based on the fact they still work over a year later, it seems they are not concerned enough to fix it. By making this publicly available, I hope to showcase just how trivial lagging players with Lua in DU truly is, in the hopes that NQ will eventually deem it necessary to fix.
5 |
6 | ## Unavoidability
7 | Players are able to remotely shut down any programming boards or scripts they are running, by pressing CTRL + Backspace. This would effectively render our lagscript useless in most scenarios, in the event that this worked properly. However, it does not.
8 | As of the time of posting, CTRL+BKSPC will only shut down ONE script at a time. Thus if we create multiple lag scripts which all reactivate each other every tick, we can prevent players from ever escaping our lag field, effectively trapping them until the system is disabled.
9 | Logging out and back into the game world, will immediately reactivate the trap.
10 |
11 | *** To properly combat this, all NQ would need to do is make it so CTRL+BKSPC terminates ALL running scripts, simultaneously. Simple, right?... ***
12 |
13 | ## Setup
14 | There are two main components at play here:
15 |
16 | - The Main Module, whose job is to constantly reactivate the Nuke Modules
17 | - The Nuke Modules, whose job is to generate crippling lag
18 |
19 |
20 | There are two Nuke Modules provided which cause lag by utilizing different methods. Load Recursion causes lag by recursively loading a string, which when loaded, causes itself to be loaded (into infinity). Timer Recursion causes lag by recursively creating timers and consuming exponential amounts of memory. As of the time of posting, it doesn't matter which one you use - Your FPS will drop to single digits instantly upon activation, and the effects worsen exponentially the longer the script stays active.
21 |
22 | For more detailed information about the link structure and order, see the included diagram in this directory.
23 | You can link up to ten (10) Nuke Modules to a single Main Module, though two is more than sufficient.
24 |
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/obj/Debug/DUImageToLuaConverter.vbproj.FileListAbsolute.txt:
--------------------------------------------------------------------------------
1 | E:\Files\Projects\DUImageToLuaConverter\DUImageToLuaConverter\bin\Debug\DUImageToLuaConverter.exe.config
2 | E:\Files\Projects\DUImageToLuaConverter\DUImageToLuaConverter\bin\Debug\DUImageToLuaConverter.exe
3 | E:\Files\Projects\DUImageToLuaConverter\DUImageToLuaConverter\bin\Debug\DUImageToLuaConverter.pdb
4 | E:\Files\Projects\DUImageToLuaConverter\DUImageToLuaConverter\bin\Debug\DUImageToLuaConverter.xml
5 | E:\Files\Projects\DUImageToLuaConverter\DUImageToLuaConverter\obj\Debug\DUImageToLuaConverter.vbprojResolveAssemblyReference.cache
6 | E:\Files\Projects\DUImageToLuaConverter\DUImageToLuaConverter\obj\Debug\DUImageToLuaConverter.Form1.resources
7 | E:\Files\Projects\DUImageToLuaConverter\DUImageToLuaConverter\obj\Debug\DUImageToLuaConverter.Resources.resources
8 | E:\Files\Projects\DUImageToLuaConverter\DUImageToLuaConverter\obj\Debug\DUImageToLuaConverter.vbproj.GenerateResource.Cache
9 | E:\Files\Projects\DUImageToLuaConverter\DUImageToLuaConverter\obj\Debug\DUImageToLuaConverter.exe
10 | E:\Files\Projects\DUImageToLuaConverter\DUImageToLuaConverter\obj\Debug\DUImageToLuaConverter.xml
11 | E:\Files\Projects\DUImageToLuaConverter\DUImageToLuaConverter\obj\Debug\DUImageToLuaConverter.pdb
12 | G:\Files\Projects\DUImageToLuaConverter\DUImageToLuaConverter\bin\Debug\DUImageToLuaConverter.exe.config
13 | G:\Files\Projects\DUImageToLuaConverter\DUImageToLuaConverter\bin\Debug\DUImageToLuaConverter.exe
14 | G:\Files\Projects\DUImageToLuaConverter\DUImageToLuaConverter\bin\Debug\DUImageToLuaConverter.pdb
15 | G:\Files\Projects\DUImageToLuaConverter\DUImageToLuaConverter\bin\Debug\DUImageToLuaConverter.xml
16 | G:\Files\Projects\DUImageToLuaConverter\DUImageToLuaConverter\obj\Debug\DUImageToLuaConverter.vbproj.AssemblyReference.cache
17 | G:\Files\Projects\DUImageToLuaConverter\DUImageToLuaConverter\obj\Debug\DUImageToLuaConverter.vbproj.SuggestedBindingRedirects.cache
18 | G:\Files\Projects\DUImageToLuaConverter\DUImageToLuaConverter\obj\Debug\DUImageToLuaConverter.Form1.resources
19 | G:\Files\Projects\DUImageToLuaConverter\DUImageToLuaConverter\obj\Debug\DUImageToLuaConverter.Resources.resources
20 | G:\Files\Projects\DUImageToLuaConverter\DUImageToLuaConverter\obj\Debug\DUImageToLuaConverter.vbproj.GenerateResource.cache
21 | G:\Files\Projects\DUImageToLuaConverter\DUImageToLuaConverter\obj\Debug\DUImageToLuaConverter.vbproj.CoreCompileInputs.cache
22 | G:\Files\Projects\DUImageToLuaConverter\DUImageToLuaConverter\obj\Debug\DUImageToLuaConverter.exe
23 | G:\Files\Projects\DUImageToLuaConverter\DUImageToLuaConverter\obj\Debug\DUImageToLuaConverter.xml
24 | G:\Files\Projects\DUImageToLuaConverter\DUImageToLuaConverter\obj\Debug\DUImageToLuaConverter.pdb
25 |
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/My Project/Resources.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' This code was generated by a tool.
4 | ' Runtime Version:4.0.30319.42000
5 | '
6 | ' Changes to this file may cause incorrect behavior and will be lost if
7 | ' the code is regenerated.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 | Imports System
15 |
16 | Namespace My.Resources
17 |
18 | 'This class was auto-generated by the StronglyTypedResourceBuilder
19 | 'class via a tool like ResGen or Visual Studio.
20 | 'To add or remove a member, edit your .ResX file then rerun ResGen
21 | 'with the /str option, or rebuild your VS project.
22 | '''
23 | ''' A strongly-typed resource class, for looking up localized strings, etc.
24 | '''
25 | _
29 | Friend Module Resources
30 |
31 | Private resourceMan As Global.System.Resources.ResourceManager
32 |
33 | Private resourceCulture As Global.System.Globalization.CultureInfo
34 |
35 | '''
36 | ''' Returns the cached ResourceManager instance used by this class.
37 | '''
38 | _
39 | Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
40 | Get
41 | If Object.ReferenceEquals(resourceMan, Nothing) Then
42 | Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("DUImageToLuaConverter.Resources", GetType(Resources).Assembly)
43 | resourceMan = temp
44 | End If
45 | Return resourceMan
46 | End Get
47 | End Property
48 |
49 | '''
50 | ''' Overrides the current thread's CurrentUICulture property for all
51 | ''' resource lookups using this strongly typed resource class.
52 | '''
53 | _
54 | Friend Property Culture() As Global.System.Globalization.CultureInfo
55 | Get
56 | Return resourceCulture
57 | End Get
58 | Set
59 | resourceCulture = value
60 | End Set
61 | End Property
62 | End Module
63 | End Namespace
64 |
--------------------------------------------------------------------------------
/Proximity Detection/Proximity Detection - PB.txt:
--------------------------------------------------------------------------------
1 | {"slots":{"0":{"name":"SysData","type":{"events":[],"methods":[]}},"1":{"name":"OrgData","type":{"events":[],"methods":[]}},"2":{"name":"slot3","type":{"events":[],"methods":[]}},"3":{"name":"slot4","type":{"events":[],"methods":[]}},"4":{"name":"slot5","type":{"events":[],"methods":[]}},"5":{"name":"slot6","type":{"events":[],"methods":[]}},"6":{"name":"slot7","type":{"events":[],"methods":[]}},"7":{"name":"slot8","type":{"events":[],"methods":[]}},"8":{"name":"slot9","type":{"events":[],"methods":[]}},"9":{"name":"slot10","type":{"events":[],"methods":[]}},"-1":{"name":"unit","type":{"events":[],"methods":[]}},"-3":{"name":"player","type":{"events":[],"methods":[]}},"-2":{"name":"construct","type":{"events":[],"methods":[]}},"-4":{"name":"system","type":{"events":[],"methods":[]}},"-5":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"DBKeys = json.decode(SysData.getKeys())\nlocal NameRecorded = 0\nlocal MplayerID = player.getId()\nlocal MplayerName = player.getName()\nlocal MplayerMass = player.getNanopackMass()\nlocal MplayerVolume = player.getNanopackVolume()\nlocal MplayerMaxVolume = player.getNanopackMaxVolume()\nlocal MplayerWrldPos = player.getWorldPosition()\nlocal MplayerWrldVelo = player.getWorldVelocity()\nlocal MplayerOrgIDs = player.getOrgIds()\nlocal MplayerTime = system.getUtcTime()\nlocal MplayerTimeOffset = system.getUtcOffset()\n\nlocal MplayerParentID = player.getParent()\nlocal MplayerIsSeated = player.isSeated()\nlocal MplayerSeatID = player.getSeatId()\nlocal MplayerSprinting = player.isSprinting()\nlocal MplayerIsJetpackOn = player.isJetpackOn()\nlocal MplayerIsHeadlightOn = player.isHeadlightOn()\n\nfunction DumpTable(o)\n if type(o) == 'table' then\n local s = '{ '\n for k,v in pairs(o) do\n if type(k) ~= 'number' then k = '\"'..k..'\"' end\n s = s .. '['..k..'] = ' .. DumpTable(v) .. ','\n end\n return s .. '} '\n else\n return tostring(o)\n end\nend\n\nfunction TableConstructor(plname,plmass,plvol,plvolmax,plorgs,logtime,logtimeoff,plwpos,plwvelo,plparent,plisseated,plseatid,plsprint,pljetpack,plheadlight)\n local NewTable = {name = plname, mass = plmass, volume = plvol, volumemax = plvolmax, orgs = plorgs, time = logtime, timeoffset = logtimeoff, pos = plwpos, velo = plwvelo, parent = plparent, seated = plisseated, seatid = plseatid, sprint = plsprint, jetpack = pljetpack, headlight = plheadlight}\n return NewTable\nend\n\nfor k, v in pairs(MplayerOrgIDs) do\n local orginfo = database.getOrganization(v)\n OrgData.setStringValue(v,DumpTable(orginfo))\nend\n\nfor key, value in pairs(DBKeys) do\n if MplayerID == value then\n NameRecorded = 1\n end\nend\n--if NameRecorded == 0 then\nSysData.setStringValue(MplayerID,DumpTable(TableConstructor(MplayerName,MplayerMass,MplayerVolume,MplayerMaxVolume,MplayerOrgIDs,MplayerTime,MplayerTimeOffset,MplayerWrldPos,MplayerWrldVelo,MplayerParentID,MplayerIsSeated,MplayerSeatID,MplayerSprinting,MplayerIsJetpackOn,MplayerIsHeadlightOn)))\n--end\nunit.exit()","filter":{"args":[],"signature":"start()","slotKey":"-1"},"key":"0"},{"code":"","filter":{"args":[],"signature":"stop()","slotKey":"-1"},"key":"1"}],"methods":[],"events":[]}
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/My Project/Settings.Designer.vb:
--------------------------------------------------------------------------------
1 | '------------------------------------------------------------------------------
2 | '
3 | ' This code was generated by a tool.
4 | ' Runtime Version:4.0.30319.42000
5 | '
6 | ' Changes to this file may cause incorrect behavior and will be lost if
7 | ' the code is regenerated.
8 | '
9 | '------------------------------------------------------------------------------
10 |
11 | Option Strict On
12 | Option Explicit On
13 |
14 |
15 | Namespace My
16 |
17 | _
20 | Partial Friend NotInheritable Class MySettings
21 | Inherits Global.System.Configuration.ApplicationSettingsBase
22 |
23 | Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
24 |
25 | #Region "My.Settings Auto-Save Functionality"
26 | #If _MyType = "WindowsForms" Then
27 | Private Shared addedHandler As Boolean
28 |
29 | Private Shared addedHandlerLockObject As New Object
30 |
31 | _
32 | Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs)
33 | If My.Application.SaveMySettingsOnExit Then
34 | My.Settings.Save()
35 | End If
36 | End Sub
37 | #End If
38 | #End Region
39 |
40 | Public Shared ReadOnly Property [Default]() As MySettings
41 | Get
42 |
43 | #If _MyType = "WindowsForms" Then
44 | If Not addedHandler Then
45 | SyncLock addedHandlerLockObject
46 | If Not addedHandler Then
47 | AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
48 | addedHandler = True
49 | End If
50 | End SyncLock
51 | End If
52 | #End If
53 | Return defaultInstance
54 | End Get
55 | End Property
56 | End Class
57 | End Namespace
58 |
59 | Namespace My
60 |
61 | _
64 | Friend Module MySettingsProperty
65 |
66 | _
67 | Friend ReadOnly Property Settings() As Global.DUImageToLuaConverter.My.MySettings
68 | Get
69 | Return Global.DUImageToLuaConverter.My.MySettings.Default
70 | End Get
71 | End Property
72 | End Module
73 | End Namespace
74 |
--------------------------------------------------------------------------------
/Terminal Emulator/Terminal Emulator - Renderscript.txt:
--------------------------------------------------------------------------------
1 | if not init then
2 | local textr, textg, textb = 1, 0.5, 0
3 | strings1 = {}
4 | strings1[0] = "[ OK ][HID] Starting USB 7.0 Interface"
5 | strings1[1] = "[ OK ] USB 7-0: New Device Found, VendorID=Novark, ProductID=AeroSuitGeneralPnP"
6 | strings1[2] = "[ OK ] USB 7-0: New USB Device Strings: MFR=Novark, Product=AS10994, Serial=8971205532"
7 | strings1[3] = "[ OK ][SYS] Freeing initrd Memory: 187429GB freed"
8 | strings1[4] = "[ OK ][RTC_CMOS] Setting System Clock, synchronizing with Novark Arkship"
9 | strings1[5] = "[ OK ] BIOS EDD Facility V6.26 2782-Jan-14, 1 Device Found"
10 | strings1[6] = "[ OK ] Write-Protecting Kernel Binaries: 31648GB"
11 | strings1[7] = "[ OK ][ACPI] Video Device [GFX0] (Multi-head:yes, ROM:no, POST:no)"
12 | strings1[8] = "[ OK ][INPUT] Video Bus as /devices/LNXSYSTM:00/LNXSYSBUS:00/PNP0C35:00/LNXVIDEO:00/input/"
13 | strings1[9] = "[ OK ][USBCORE] Registered New Interface Driver USBHID on Port 2142"
14 | strings1[10] = "[ OK ][HID] Generic Input, hidRaw0: USB HID v7.1 Neuralink [Novark]"
15 | strings1[11] = "[ ERROR ][SYS] Sys_core time error of .002 picoseconds. Correcting system clock... "
16 | strings1[12] = "[ OK ][SYS] Integrity Check: All system elements reporting nominal."
17 | strings1[13] = "[ ERROR ][SYS] System Warning: PointerException.Null thrown at 0xFFAE0095"
18 | strings1[14] = "[ OK ][HID] Parsing filesystem for updates; No new volumes found."
19 | strings1[15] = "[ OK ][SYS] Remounting root filesystem in read-write mode: OK"
20 | strings1[16] = "[ OK ][HID] Creating qdisk volume: (Dynamic Size: 4096GB) on shared memory... Done."
21 | strings1[17] = "[ OK ][HID] Rechecking unionfs and symlinks on qdisk... Done."
22 | strings1[18] = "[ OK ][HID] Total qdisk volume entropy exceeded calculated parity entropy."
23 | strings1[19] = "[ ERROR ][HID] Qbit error in system qdisk volume AD36C2B92E was corrected automatically."
24 | strings1[20] = "[ OK ][TEMP] Cryostate readings updated. Qprocessor temperatures nominal."
25 | strings1[21] = "[ ERROR ][TEMP] Qprocessor temperatures exceeding 65% maximum. System venting..."
26 | end
27 |
28 | function randomString(length)
29 | if not length or length <= 0 then return '' end
30 | local rand1 = math.random(21)
31 | return strings1[rand1]
32 | end
33 |
34 | function randomInt(max)
35 | if not max or max <= 0 then return '' end
36 | local rand1 = math.random(max)
37 | return rand1
38 | end
39 |
40 | if not init then
41 | l1fontsize = 20
42 | l1xoffset = -20
43 | l1yoffset = 0
44 | rx, ry = getResolution()
45 | cx1, cy1 = rx, ry/l1fontsize
46 | mem1 = {}
47 | for iy=1,cy1 do
48 | mem1[iy] = randomString(1)
49 | end
50 | init = true
51 | end
52 |
53 | fontL = loadFont("Play", l1fontsize)
54 | layer1 = createLayer()
55 |
56 | function DrawAllTextL1()
57 | for by=1,cy1 do
58 | setNextFillColor(layer1, textr, textg, textb, 1)
59 | addText(layer1, fontL, mem1[by], l1fontsize+l1xoffset, (l1fontsize*by)+l1yoffset)
60 | end
61 | end
62 |
63 | function ShiftLines()
64 | for sy=1,cy1 - 1 do
65 | mem1[sy] = mem1[sy+1]
66 | end
67 | mem1[math.floor(cy1)] = strings1[math.random(21)]
68 | end
69 |
70 | DrawAllTextL1()
71 | ShiftLines()
72 | requestAnimationFrame(randomInt(20))
--------------------------------------------------------------------------------
/Image Slideshow/Infinite Image Slideshow - Renderscript.txt:
--------------------------------------------------------------------------------
1 | if not init then
2 | anim = 0
3 | animtick = 0
4 | animtickmax = 100
5 | display = 1
6 | nextdisplay = 1
7 | displaymax = 20
8 | displaytick = 0
9 | displaytickmax = 175
10 | images = {}
11 | for xa=1,displaymax do
12 | images[xa] = ""
13 | end
14 |
15 | images[1] = "assets.prod.novaquark.com/66839/b249f117-4120-472e-8c12-d84c04c28775.png"
16 | images[2] = "assets.prod.novaquark.com/66839/8452f802-cb36-40ec-9d26-f5530a82ac1c.png"
17 | images[3] = "assets.prod.novaquark.com/10847/74614e8a-3e83-4054-ae34-5bd13e80b3fe.jpg"
18 | images[4] = "assets.prod.novaquark.com/10847/2652fe31-3c4b-4daa-b1d2-4d25ec230cae.jpg"
19 | images[5] = "assets.prod.novaquark.com/51710/a31ce61b-b290-49fd-b8cc-60ed50837e86.jpg"
20 | images[6] = "assets.prod.novaquark.com/60816/b543e8eb-deb8-4319-926e-0bea0da6aa91.jpg"
21 | images[7] = "assets.prod.novaquark.com/60816/d457cdb8-67bc-43b5-97e8-afcad2c42dde.jpg"
22 | images[8] = "assets.prod.novaquark.com/15526/661fe770-9e52-4026-be44-7834c37da61c.jpg"
23 | images[9] = "assets.prod.novaquark.com/15526/b7826b57-3ca0-4721-8bb3-13b47986dc9b.jpg"
24 | images[10] = "assets.prod.novaquark.com/15526/e9d43aac-6706-486f-b91d-78024fac4679.jpg"
25 | images[11] = "assets.prod.novaquark.com/15526/f79d0256-34c1-4945-b786-91027681b6df.png"
26 | images[12] = "assets.prod.novaquark.com/3014/10bcb0e9-1ac9-44bf-9174-afb1854cce13.jpg"
27 | images[12] = "assets.prod.novaquark.com/35519/b997a7b6-6217-4394-b34c-fa1ef6fee1d0.png"
28 | images[13] = "assets.prod.novaquark.com/40256/19e9ef08-6674-4ab5-a9cf-708c2ed3c9be.jpg"
29 | images[14] = "assets.prod.novaquark.com/40256/ae88a73f-acb0-45d1-a164-047084905db9.jpg"
30 | images[15] = "assets.prod.novaquark.com/40256/fefa0f2d-31ee-4023-9ff7-abde8f43a00b.jpg"
31 | images[16] = "assets.prod.novaquark.com/4745/566b4304-6cc5-4d3d-92ea-44b7f03f453d.jpg"
32 | images[17] = "assets.prod.novaquark.com/60491/0ea71244-19fe-417f-bca2-6927bcafd9cd.jpg"
33 | images[18] = "assets.prod.novaquark.com/60816/2c93cca6-f883-4be2-a279-396af1498efb.jpg"
34 | images[19] = "assets.prod.novaquark.com/60816/6a2a2a2d-e9bd-403d-b87f-bec526314869.jpg"
35 | images[20] = "assets.prod.novaquark.com/60816/814bd0e5-a651-410d-a2b7-0cc885c8ed7f.png"
36 |
37 | imagehandle = 0
38 | init = true
39 | end
40 | local layer = createLayer()
41 | local rx, ry = getResolution()
42 |
43 | imagehandle = loadImage(images[display])
44 | imagehandle2 = loadImage(images[nextdisplay])
45 | if anim == 1 then
46 | if animtick < animtickmax then
47 | if display == displaymax then
48 | nextdisplay = 1
49 | else
50 | nextdisplay = display + 1
51 | end
52 | local animprcnt = animtick/animtickmax
53 | addImage(layer, imagehandle, 0 - rx*animprcnt, 0, rx, ry)
54 | addImage(layer, imagehandle2, 0 - (rx*animprcnt) + rx, 0, rx, ry)
55 | animtick = animtick + 1
56 | else
57 | if display == displaymax then
58 | display = 1
59 | else
60 | display = display + 1
61 | end
62 | displaytick = 0
63 | anim = 0
64 | addImage(layer, imagehandle2, 0, 0, rx, ry)
65 | animtick = 0
66 | end
67 | else
68 | addImage(layer, imagehandle, 0, 0, rx, ry)
69 | end
70 |
71 | if displaytick < displaytickmax then
72 | displaytick = displaytick + 1
73 | else
74 | anim = 1
75 | end
76 |
77 | requestAnimationFrame(1)
--------------------------------------------------------------------------------
/DUImageToLuaConverter/README.md:
--------------------------------------------------------------------------------
1 | # DU Image To Lua-string Converter
2 |
3 | ## Renderscript
4 |
5 | NOTE: A small portion of the lower part of the image (5 to 8%) will be obstructed or may not be able to fit into the character requirements. Please take this into account when selecting your images.
6 |
7 | Use of the included VB.NET program is not required, so long as you are able to convert an image to the proper string format which you can supply the renderscript.
8 | Simply paste the contents of renderscript.txt into an ingame Screen element of any size, and paste the string for the image you have converted, into the empty double-quotes on line 12. You should be assigning the 'is' variable to the string.
9 |
10 | Optimization help from EasternGamer.
11 |
12 | ## Image Converter
13 |
14 | If you do not trust my precompiled VB.net program, you can look at the source code and compile your own if you so desire.
15 | Following the simple rules above however should be easy enough, if you'd like to create your own conversion script.
16 |
17 | To use the Image Converter;
18 |
19 | - Launch the program, and click Browse.
20 | - Select the image you would like to convert, in the popup window.
21 | - Select any changes to the images orientation, if any.
22 | - Click Convert button, and wait for the progress bar to show green.
23 | - Copy all text from the textbox on the right with ctrl+a and ctrl+c, and paste the string into the 'is' variable on line 12.
24 |
25 | That's it!
26 |
27 | Depending on the size of the image, and the string that was pasted in, you may have to delete a few characters from the end of the string, so that it all fits into the 50,000 character limit.
28 |
29 | Other than that, simply click "apply", and give the screen about 30 seconds to render the image.
30 |
31 | ## Technical
32 |
33 | The strings themselves must follow two simple rules;
34 | - All ASCII character values must be greater than 33 and less than 126
35 | - Do not use ASCII values 34 and 92
36 |
37 | In effect we have 91 possible values with which we can represent the intensity of a color.
38 | Typical images represent colors with values in range of 0 to 255, so we can divide 91 by 255, which gives us roughly 0.356.
39 | We use this number as a multiplier to the color values in the image, to get them to fall within acceptable character ranges.
40 | On the renderscript end we then multiply them back (by 2.8) to "restore" the color. This results in more color degradation when color values are closer to a median value (128) rather than outlying values, which helps to preserve contrast.
41 | Obviously this process is not lossless, but it does work fairly well.
42 |
43 | After some discussion in Lua chat, it appears this concept could be pushed even further with heavily optimized code and compressed image data. We initially looked at implementing LZW for compression, however due to the available character space this is not a valid option. It maybe be possile to use Base64 t transmit the data, decode into ASCII, and then decompress. However the issue I ran into was that LZW as an algorithm doesnt usually work in blocks since it always needs a reference to the next byte in the sequence. Getting this to work any better than it already does seems like quite the difficult task, and not something I'm willing to take further for the moment.
44 |
45 | ## Disclaimer
46 |
47 | I take no responsibility for the content you put into screens with this tool. Use it appropriately. Note that NovaQuark has a standard submittal process for using actual image files in-game, and that all images are subject to NovaQuark's EULA and Terms of Service. Any content which violates these terms is subject to punishment at NovaQuark's discretion. My advance appologies to NQ if/when this concept is used in any nefarious manner, but if I didn't do it, someone else would!
48 |
--------------------------------------------------------------------------------
/Conway's Game of Life/Conways Game Of Life - Renderscript.txt:
--------------------------------------------------------------------------------
1 | if not init then
2 | l1fontsize = 8
3 | l1xoffset = -20
4 | l1yoffset = 0
5 | rx, ry = getResolution()
6 | cx1, cy1 = math.floor(rx/l1fontsize-1), math.floor(ry/l1fontsize)
7 | mem1 = {}
8 | mem2 = {}
9 | refresh = 1
10 | for ix=1,cx1 do
11 | mem1[ix] = {}
12 | for iy=1,cy1 do
13 | mem1[ix][iy] = math.random(math.floor(2))-1
14 | if mem1[ix][iy] == 1 then
15 | mem1[ix][iy] = math.random(math.floor(2))-1
16 | if mem1[ix][iy] == 1 then
17 | mem1[ix][iy] = math.random(math.floor(2))-1
18 | if mem1[ix][iy] == 1 then
19 | mem1[ix][iy] = math.random(math.floor(2))-1
20 | end
21 | end
22 | end
23 | end
24 | end
25 | for ix1=1,cx1 do
26 | mem2[ix1] = {}
27 | for iy1=1,cy1 do
28 | mem2[ix1][iy1] = 0
29 | end
30 | end
31 | init = true
32 | end
33 |
34 | fontL = loadFont("Play", 15)
35 | layer1 = createLayer()
36 | layer2 = createLayer()
37 | cursorx, cursory = getCursor()
38 | curx2 = math.floor(cursorx/8)+2
39 | cury2 = math.floor(cursory/8)+1
40 |
41 | setNextFillColor(layer2, 0.4, 0.4, 0.4, 0.3)
42 | addBox(layer2, 100, 100, 100, 25)
43 | if refresh == 1 then
44 | setNextFillColor(layer2, 0, 1, 0, 0.3)
45 | else
46 | setNextFillColor(layer2, 1, 0, 0, 1)
47 | end
48 | addText(layer2,fontL,"Pause",125,115)
49 |
50 | function updateStates()
51 | for dx=1,cx1 do
52 | for dy=1,cy1 do
53 | --rules, in order
54 | --mem2[dx][dy] = 0
55 | --neighbors = 0
56 | if dx > 1 and dx < cx1 then
57 | if dy > 1 and dy < cy1 then
58 | dx0 = dx - 1
59 | dx2 = dx + 1
60 | dy0 = dy - 1
61 | dy2 = dy + 1
62 | neighbors = mem1[dx0][dy0] + mem1[dx][dy0] + mem1[dx2][dy0] + mem1[dx0][dy] + mem1[dx2][dy] + mem1[dx0][dy2] + mem1[dx][dy2] + mem1[dx2][dy2]
63 | if mem1[dx][dy] == 1 then
64 | if neighbors == 2 or neighbors == 3 then
65 | mem2[dx][dy] = 1
66 | else
67 | mem2[dx][dy] = 0
68 | end
69 | else
70 | if neighbors == 3 then
71 | mem2[dx][dy] = 1
72 | else
73 | mem2[dx][dy] = 0
74 | end
75 | end
76 | end
77 | end
78 | end
79 | end
80 | mem1 = mem2
81 | end
82 |
83 | function DrawAllBoxes()
84 | for bx=2,cx1 - 1 do
85 | for by=2,cy1 - 1 do
86 | if mem1[bx][by] == 1 then
87 | setNextFillColor(layer1, 1, 1, 1, 1)
88 | addBox(layer1, (bx*l1fontsize)+l1xoffset, (by*l1fontsize)+l1yoffset, l1fontsize, l1fontsize)
89 | --addText(layer1,fontL,mem1[bx - 1][by - 1] + mem1[bx][by - 1] + mem1[bx + 1][by - 1] + mem1[bx - 1][by] + mem1[bx + 1][by] + mem1[bx - 1][by + 1] + mem1[bx][by + 1] + mem1[bx + 1][by + 1],(l1fontsize*bx)+l1xoffset, (l1fontsize*by)+l1yoffset)
90 |
91 | --addText(layer1,fontL,mem2[bx][by],(l1fontsize*bx)+l1xoffset, (l1fontsize*by)+l1yoffset)
92 | end
93 | end
94 | end
95 | end
96 |
97 | if refresh == 1 then
98 | updateStates()
99 | end
100 |
101 |
102 | if getCursorReleased() then
103 | if cursorx > 100 and cursorx < 200 then
104 | if cursory > 100 and cursory < 125 then
105 | if refresh == 1 then
106 | refresh = 0
107 | else
108 | refresh = 1
109 | end
110 | end
111 | end
112 | if curx2 > 0 and cury2 > 0 then
113 | if mem1[curx2][cury2] == 1 then
114 | mem1[curx2][cury2] = 0
115 | else
116 | mem1[curx2][cury2] = 1
117 | end
118 | end
119 | end
120 |
121 | DrawAllBoxes()
122 | requestAnimationFrame(1)
--------------------------------------------------------------------------------
/Lighting RGB Control/Light RGB Control - PB.txt:
--------------------------------------------------------------------------------
1 | {"slots":{"0":{"name":"slot1","type":{"events":[],"methods":[]}},"1":{"name":"slot2","type":{"events":[],"methods":[]}},"2":{"name":"slot3","type":{"events":[],"methods":[]}},"3":{"name":"slot4","type":{"events":[],"methods":[]}},"4":{"name":"slot5","type":{"events":[],"methods":[]}},"5":{"name":"slot6","type":{"events":[],"methods":[]}},"6":{"name":"slot7","type":{"events":[],"methods":[]}},"7":{"name":"slot8","type":{"events":[],"methods":[]}},"8":{"name":"slot9","type":{"events":[],"methods":[]}},"9":{"name":"slot10","type":{"events":[],"methods":[]}},"-1":{"name":"unit","type":{"events":[],"methods":[]}},"-2":{"name":"system","type":{"events":[],"methods":[]}},"-3":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"ColorRed = 255 --export: Ship Accent Lighting color Red component\nColorGreen = 0 --export: Ship Accent Lighting color Green component\nColorBlue = 0 --export: Ship Accent Lighting color Blue component\n\nRainbow = 1 --export: Ship Accent Lighting RGB component will shift through all possible colors. Overrides other RGB settings. \n\nDimWhenOff = 0\n\nCtrR = 1\nCtrG = 0\nCtrB = 0\n\nslot1.deactivate()\nslot2.deactivate()\nslot3.deactivate()\nslot4.deactivate()\nslot5.deactivate()\nslot6.deactivate()\nslot7.deactivate()\nslot8.deactivate()\nslot9.deactivate()\nslot10.deactivate()\n\nslot1.setRGBColor(ColorRed,ColorGreen,ColorBlue)\nslot2.setRGBColor(ColorRed,ColorGreen,ColorBlue)\nslot3.setRGBColor(ColorRed,ColorGreen,ColorBlue)\nslot4.setRGBColor(ColorRed,ColorGreen,ColorBlue)\nslot5.setRGBColor(ColorRed,ColorGreen,ColorBlue)\nslot6.setRGBColor(ColorRed,ColorGreen,ColorBlue)\nslot7.setRGBColor(ColorRed,ColorGreen,ColorBlue)\nslot8.setRGBColor(ColorRed,ColorGreen,ColorBlue)\nslot9.setRGBColor(ColorRed,ColorGreen,ColorBlue)\nslot10.setRGBColor(ColorRed,ColorGreen,ColorBlue)\n\nslot1.activate()\nslot2.activate()\nslot3.activate()\nslot4.activate()\nslot5.activate()\nslot6.activate()\nslot7.activate()\nslot8.activate()\nslot9.activate()\nslot10.activate()","filter":{"args":[],"signature":"start()","slotKey":"-2"},"key":"0"},{"code":"if Rainbow == 1 then\n if CtrR == 1 then\n ColorGreen = ColorGreen + 1\n ColorRed = ColorRed - 1\n if ColorBlue > 0 then\n ColorBlue = ColorBlue - 1\n ColorRed = ColorRed + 1\n end\n if ColorRed == 0 then\n CtrR = 0\n CtrG = 1\n end\n end\n\n if CtrG == 1 then\n ColorBlue = ColorBlue + 1\n ColorGreen = ColorGreen - 1\n if ColorRed > 0 then\n ColorRed = ColorRed - 1\n ColorGreen = ColorGreen + 1\n end\n if ColorGreen == 0 then\n CtrG = 0\n CtrB = 1\n end\n end\n\n if CtrB == 1 then\n ColorRed = ColorRed + 1\n ColorBlue = ColorBlue - 1\n if ColorGreen > 0 then\n ColorGreen = ColorGreen - 1\n ColorBlue = ColorBlue + 1\n end\n if ColorBlue == 0 then\n CtrB = 0\n CtrR = 1\n end\n end\n slot1.deactivate()\n slot2.deactivate()\n slot3.deactivate()\n slot4.deactivate()\n slot5.deactivate()\n slot6.deactivate()\n slot7.deactivate()\n slot8.deactivate()\n slot9.deactivate()\n slot10.deactivate()\n\n slot1.setRGBColor(ColorRed,ColorGreen,ColorBlue)\n slot2.setRGBColor(ColorRed,ColorGreen,ColorBlue)\n slot3.setRGBColor(ColorRed,ColorGreen,ColorBlue)\n slot4.setRGBColor(ColorRed,ColorGreen,ColorBlue)\n slot5.setRGBColor(ColorRed,ColorGreen,ColorBlue)\n slot6.setRGBColor(ColorRed,ColorGreen,ColorBlue)\n slot7.setRGBColor(ColorRed,ColorGreen,ColorBlue)\n slot8.setRGBColor(ColorRed,ColorGreen,ColorBlue)\n slot9.setRGBColor(ColorRed,ColorGreen,ColorBlue)\n slot10.setRGBColor(ColorRed,ColorGreen,ColorBlue)\n\n slot1.activate()\n slot2.activate()\n slot3.activate()\n slot4.activate()\n slot5.activate()\n slot6.activate()\n slot7.activate()\n slot8.activate()\n slot9.activate()\n slot10.activate()\nend","filter":{"args":[],"signature":"update()","slotKey":"-2"},"key":"1"},{"code":"if DimWhenOff == 1 then\n slot1.deactivate()\n slot2.deactivate()\n slot3.deactivate()\n slot4.deactivate()\n slot5.deactivate()\n slot6.deactivate()\n slot7.deactivate()\n slot8.deactivate()\n slot9.deactivate()\n slot10.deactivate()\nend","filter":{"args":[],"signature":"stop()","slotKey":"-2"},"key":"2"}],"methods":[],"events":[]}
--------------------------------------------------------------------------------
/Cellular Automata Art/CellAutomataArt1 - Renderscript.txt:
--------------------------------------------------------------------------------
1 | if not init then
2 | l1fontsize = 8
3 | l1xoffset = -20
4 | l1yoffset = 0
5 | rx, ry = getResolution()
6 | cx1, cy1 = math.floor(rx/l1fontsize-1), math.floor(ry/l1fontsize)
7 | mem1 = {}
8 | mem2 = {}
9 | refresh = 1
10 | for ix=1,cx1 do
11 | mem1[ix] = {}
12 | for iy=1,cy1 do
13 | mem1[ix][iy] = math.random(math.floor(2))-1
14 | if mem1[ix][iy] == 1 then
15 | mem1[ix][iy] = math.random(math.floor(2))-1
16 | if mem1[ix][iy] == 1 then
17 | mem1[ix][iy] = math.random(math.floor(2))-1
18 | if mem1[ix][iy] == 1 then
19 | mem1[ix][iy] = math.random(math.floor(2))-1
20 | end
21 | end
22 | end
23 | end
24 | end
25 | for ix1=1,cx1 do
26 | mem2[ix1] = {}
27 | for iy1=1,cy1 do
28 | mem2[ix1][iy1] = 0
29 | end
30 | end
31 | init = true
32 | end
33 |
34 | fontL = loadFont("Play", 15)
35 | layer1 = createLayer()
36 | layer2 = createLayer()
37 | cursorx, cursory = getCursor()
38 | curx2 = math.floor(cursorx/8)+2
39 | cury2 = math.floor(cursory/8)+1
40 |
41 | setNextFillColor(layer2, 0.4, 0.4, 0.4, 0.3)
42 | addBox(layer2, 100, 100, 100, 25)
43 | if refresh == 1 then
44 | setNextFillColor(layer2, 0, 1, 0, 0.3)
45 | else
46 | setNextFillColor(layer2, 1, 0, 0, 1)
47 | end
48 | addText(layer2,fontL,"Pause",125,115)
49 |
50 | function updateStates()
51 | mem2 = mem1
52 | for dx=1,cx1 do
53 | for dy=1,cy1 do
54 | --rules, in order
55 | --mem2[dx][dy] = 0
56 | --neighbors = 0
57 | if dx > 1 and dx < cx1 then
58 | if dy > 1 and dy < cy1 then
59 | dx0 = dx - 1
60 | dx2 = dx + 1
61 | dy0 = dy - 1
62 | dy2 = dy + 1
63 | neighbors = mem2[dx0][dy0] + mem2[dx][dy0] + mem2[dx2][dy0] + mem2[dx0][dy] + mem2[dx2][dy] + mem2[dx0][dy2] + mem2[dx][dy2] + mem2[dx2][dy2]
64 | if mem2[dx][dy] == 1 then
65 | if neighbors == 1 or neighbors == 2 then
66 | mem2[dx][dy] = 1
67 | else
68 | mem2[dx][dy] = 0
69 | end
70 | else
71 | if neighbors == 3 then
72 | mem2[dx][dy] = 1
73 | else
74 | mem2[dx][dy] = 0
75 | end
76 | end
77 | end
78 | end
79 | end
80 | end
81 | mem1 = mem2
82 | end
83 |
84 | function DrawAllBoxes()
85 | for bx=2,cx1 - 1 do
86 | for by=2,cy1 - 1 do
87 | if mem1[bx][by] == 1 then
88 | setNextFillColor(layer1, mem1[bx][by - 1], mem1[bx][by + 1], mem1[bx - 1][by], 1)
89 | addBox(layer1, (bx*l1fontsize)+l1xoffset, (by*l1fontsize)+l1yoffset, l1fontsize, l1fontsize)
90 | --addText(layer1,fontL,mem1[bx - 1][by - 1] + mem1[bx][by - 1] + mem1[bx + 1][by - 1] + mem1[bx - 1][by] + mem1[bx + 1][by] + mem1[bx - 1][by + 1] + mem1[bx][by + 1] + mem1[bx + 1][by + 1],(l1fontsize*bx)+l1xoffset, (l1fontsize*by)+l1yoffset)
91 |
92 | --addText(layer1,fontL,mem2[bx][by],(l1fontsize*bx)+l1xoffset, (l1fontsize*by)+l1yoffset)
93 | end
94 | end
95 | end
96 | end
97 |
98 | if refresh == 1 then
99 | updateStates()
100 | end
101 |
102 |
103 | if getCursorReleased() then
104 | if cursorx > 100 and cursorx < 200 then
105 | if cursory > 100 and cursory < 125 then
106 | if refresh == 1 then
107 | refresh = 0
108 | else
109 | refresh = 1
110 | end
111 | end
112 | end
113 | if curx2 > 0 and cury2 > 0 then
114 | if mem1[curx2][cury2] == 1 then
115 | mem1[curx2][cury2] = 0
116 | else
117 | mem1[curx2][cury2] = 1
118 | end
119 | end
120 | end
121 |
122 | DrawAllBoxes()
123 | requestAnimationFrame(1)
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # DU-Lua-Scripts
2 | A collection of potentially useful scripts and tools for Lua programming in Dual Universe.
3 | Nothing super complicated here, but perhaps you find some of these scripts useful to learn from.
4 |
5 | ## List of available open-source scripts:
6 |
7 |
8 | - Cellular Automata Art
- A modified version of the GOL script that uses multiple conditional color sets. Looks cool, doesn't do anything.
9 | - Construct ID License Plate
- Uses a construct's ID to generate a unique license plate with configurable display settings.
10 | - Conway's Game Of Life
- GOL done in lua. Runs on an in-game screen. (currently not working)
11 | - Custom Font From Image
- Uses sub-regions of an image to render text as if it were using a custom font. Supports custom colors, and per-character coloring.
12 | - Databank Key Viewer
- Used to manually inspect the contents of a databank, when it contains many values or large tables. Output retains heirachical JSON structure.
13 | - Developer Utility Screen
- General screen debug, built with basic re-usable example functions to serve most UI purposes.
14 | - Door Control
- Touch-control screen with 4-digit passcode, for "securely" regulating access to doors or other elements.
15 | - Drawing Board 1.1
- Draw images by hand on a screen using custom colors and a minimalistic UI.
16 | - DU Image To Lua-string Converter
- Convert images to string which can be loaded and displayed by a single Screen element.
17 | - DU OpenMarket Advertisement
- An advertisement billboard for DU OpenMarket, my Market API for DU. Cycles between 4 states.
18 | - Infinite Image Slideshow
- Displays a slideshow of images, with support for an infinite number of them. Smooth scrolling transitions and configurable parameters.
19 | - Image To Movie
- Uses sub-regions of multiple large images to display a quick frame sequence, which looks like an animation or movie clip. Adjustable parameters, supports a theoretically infinite number of images.
20 | - Item ID Scraper
- Runs a loop which repeatedly checks the game server for a given item ID, and if the item exists, pulls its data and appends it to a screen's renderscript for copying.
21 | - Lighting RGB Control
- Simple screen UI with 3 sliders which can interact with a PB to change the color of light elements.
22 | - Matrix Code Rain
- Creates a "Matrix"-like scrolling backdrop, using a non-Cyrillic character set.
23 | - Nuclear Universe
- Simple script that creates an unavoidable, impassable lag-field which can "permanently" trap players. Using this on other players is against TOS.
24 | - Particle System
- 2d Particle simulation with adjustable parameters. Can be used to emulate snow or rain, or as an art-piece.
25 | - Proximity Detection Logger
- Logs all available data about a player, whenever they cross a detection zone.
26 | - Remote Networking
- A basic Remote Networking system for use with Emitters and Recievers. Allows you to send/retrieve data, and even run commands from a remote programming board.
27 | - Simple Game Skeleton
- A barebones game using a remote controller, kind of like asteroids. WASD movement, Click to shoot at the cursor's position. Basic high-score record.
28 | - Telemeter Landing Visualizer
- Uses telemeters (x36) to map the surface beneath your ship, and renders a wireframe projection of the data to a screen.
29 | - Terminal Emulator
- Emulates an active terminal, scrolling text with editable technical jargon and color.
30 | - TYR Mining Unit Control Uplink
- Displays calibrations and stats for up to 7 Mining Units. Updates in real-time.
31 | - TYR Ship Info Kiosk
- Displays flight-stats and images of constructs, fully configurable. Screen ONLY, no order placement.
32 | - Voxelmancy Space Gyro Tool
- Very simple script that maps 3 Gyroscope elements to 3 toggle keys, for building in space.
33 |
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/Form1.vb:
--------------------------------------------------------------------------------
1 | Public Class Form1
2 | Dim ImageArray(100, 100, 2) As Byte
3 | Dim nativeWidth As Integer = 1024
4 | Dim nativeHeight As Integer = 576
5 | Dim resolutionScale As Integer = 8
6 | Dim orientationMod As Integer = 0
7 | Dim Rchan As Boolean = True
8 | Dim Gchan As Boolean = True
9 | Dim Bchan As Boolean = True
10 |
11 | Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
12 | ConvertImage(PictureBox1.Image)
13 | End Sub
14 |
15 | Private Sub ConvertImage(ByRef bm_combined As Bitmap)
16 | ReDim ImageArray((nativeWidth / resolutionScale) - 1, (nativeHeight / resolutionScale) - 1, 2)
17 | Dim bounds As Rectangle = New Rectangle(0, 0, bm_combined.Width, bm_combined.Height)
18 | If bounds.Width > (nativeWidth / resolutionScale) - 1 Or bounds.Height > (nativeHeight / resolutionScale) - 1 Then
19 | bm_combined = ResizeImage(bm_combined)
20 | End If
21 | Dim output As String = ""
22 | For Y = 0 To bm_combined.Height - 1
23 | For X = 0 To bm_combined.Width - 1
24 | ImageArray(X, Y, 0) = bm_combined.GetPixel(X, Y).R / 2
25 | ImageArray(X, Y, 1) = bm_combined.GetPixel(X, Y).G / 2
26 | ImageArray(X, Y, 2) = bm_combined.GetPixel(X, Y).B / 2
27 | Next X
28 | Dim progress As Integer = ((Y / (bm_combined.Height - 1)) * 100)
29 | ProgressBar1.Value = Progress
30 | Next Y
31 | For Ya = 0 To (nativeHeight / resolutionScale) - 1
32 | For Xa = 0 To (nativeWidth / resolutionScale) - 1
33 | For Za = 0 To 2
34 | ImageArray(Xa, Ya, Za) = (ImageArray(Xa, Ya, Za) * 0.356) + 33
35 | If ImageArray(Xa, Ya, Za) = 34 Then
36 | ImageArray(Xa, Ya, Za) = 33
37 | End If
38 | If ImageArray(Xa, Ya, Za) = 92 Then
39 | ImageArray(Xa, Ya, Za) = 91
40 | End If
41 | If ImageArray(Xa, Ya, Za) > 126 Then
42 | ImageArray(Xa, Ya, Za) = 126
43 | End If
44 | 'If ImageArray(Xa, Ya, Za) > 193 Then
45 | 'ImageArray(Xa, Ya, Za) = ImageArray(Xa, Ya, Za) + 3
46 | 'End If
47 | 'If ImageArray(Xa, Ya, Za) > 197 Then
48 | 'ImageArray(Xa, Ya, Za) = 197
49 | 'End If
50 | Next Za
51 | output = output & System.Text.Encoding.ASCII.GetString({ImageArray(Xa, Ya, 0), ImageArray(Xa, Ya, 1), ImageArray(Xa, Ya, 2)})
52 | Next Xa
53 | Next Ya
54 | TextBox2.Text = output
55 | End Sub
56 |
57 | Public Sub NewTextMsg(ByVal input As String)
58 | TextBox2.Text = TextBox2.Text & input
59 | TextBox2.ScrollToCaret()
60 | Application.DoEvents()
61 | End Sub
62 |
63 | Public Function ResizeImage(ByVal InputImage As Image) As Image
64 | Dim tempimg = InputImage
65 | If orientationMod = 1 Then
66 | tempimg.RotateFlip(RotateFlipType.Rotate90FlipNone)
67 | End If
68 | If orientationMod = 2 Then
69 | tempimg.RotateFlip(RotateFlipType.Rotate180FlipNone)
70 | End If
71 | If orientationMod = 3 Then
72 | tempimg.RotateFlip(RotateFlipType.Rotate270FlipNone)
73 | End If
74 | Dim tempbmp As Bitmap = New Bitmap(tempimg, New Size((nativeWidth / resolutionScale), (nativeHeight / resolutionScale)))
75 | Return tempbmp
76 | End Function
77 |
78 |
79 | Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
80 | If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
81 | Try
82 | Using fs As New System.IO.FileStream(OpenFileDialog1.FileName, IO.FileMode.Open)
83 | PictureBox1.Image = New Bitmap(Image.FromStream(fs))
84 | End Using
85 | Catch ex As Exception
86 | MessageBox.Show("An error occurred while loading the file:" & Environment.NewLine & OpenFileDialog1.FileName & Environment.NewLine & Environment.NewLine & "Exception: " & ex.ToString & Environment.NewLine & ex.Message, "Error")
87 | End Try
88 | End If
89 | End Sub
90 |
91 | Private Sub NumericUpDown1_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown1.ValueChanged
92 | resolutionScale = NumericUpDown1.Value
93 | End Sub
94 |
95 | Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
96 | orientationMod = ComboBox1.SelectedIndex
97 | End Sub
98 | End Class
99 |
--------------------------------------------------------------------------------
/Lighting RGB Control/Light RGB Control - renderscript.txt:
--------------------------------------------------------------------------------
1 | -- Initialize
2 | if not Slider then
3 |
4 |
5 | -- Returns a new slider class
6 | Slider = {}
7 | Slider.__index = Slider
8 | function Slider:new(x, y, width, length, min, max, value, label)
9 | self = {
10 | x = x or 0,
11 | y = y or 0,
12 | l = length or 100,
13 | w = width or 20,
14 | min = min or 0,
15 | max = max or 1,
16 | ratio = 0,
17 | label = label or "",
18 | drag = false,
19 | color = {1,1,1}
20 | }
21 | self.ratio = math.max(0, math.min(1, (value or self.min)/(self.max-self.min)))
22 |
23 | -- Set the value of the slider
24 | function self:setValue(val)
25 | if type(val) == 'number' then
26 | self.value = math.max(self.min, math.min(self.max, val))
27 | end
28 | end
29 |
30 | -- Get the value of the slider
31 | function self:getValue(val)
32 | return self.ratio*(self.max - self.min) + self.min
33 | end
34 |
35 | -- Draws the slider on the screen using the given layer
36 | function self:draw(layer)
37 | -- Localize object data
38 | local x, y, w, l = self.x, self.y, self.w, self.l
39 | local min, max, ratio = self.min, self.max
40 |
41 | local font = loadFont('Play', 14)
42 |
43 | -- Get cursor data
44 | local mx, my = getCursor()
45 | local pressed = getCursorPressed()
46 | local released = getCursorReleased()
47 |
48 | -- Determine if the cursor is on the bar and detect if the mouse is down
49 | if (mx >= x and mx <= x+w) and (my >= y and my <= y+l) then
50 |
51 | if pressed then self.drag = true end
52 | end
53 |
54 | -- Set the ratio based on the cursor position
55 | if self.drag then
56 | self.ratio = math.max(0, math.min(1, 1 - (my-y)/l))
57 | if released then
58 | self.drag = false
59 | end
60 | end
61 |
62 | local ratio = self.ratio
63 | local h = ratio*(max-min)
64 | local color = self.color
65 |
66 | -- Draw the slider
67 | setDefaultStrokeColor(layer, Shape_BoxRounded, 1, 1, 1, 1)
68 | setDefaultStrokeWidth(layer, Shape_BoxRounded, 0.1)
69 |
70 | setNextFillColor(layer, 0.1, 0.1, 0.1, 1)
71 | addBoxRounded(layer, x, y, w, l, 0)
72 |
73 | setNextFillColor(layer, color[1], color[2], color[3], 1)
74 | addBoxRounded(layer, x, y+(1-ratio)*l, w, l*ratio, 0)
75 |
76 | setNextFillColor(layer, 0.5, 0.5, 0.5, 1)
77 | addBoxRounded(layer, x-3, y+(1-ratio)*l -3, w+6, 6, 0)
78 |
79 | -- Draw label and value display
80 | local label = self.label
81 | setNextTextAlign( layer, AlignH_Center, AlignV_Middle)
82 | addText( layer, font, label, x+0.5*w, y-14)
83 |
84 | local display = string.format('%.0f', math.floor(((ratio*(max - min) + min)*255)+0.5))
85 | setNextTextAlign( layer, AlignH_Center, AlignV_Middle)
86 | addText( layer, font, display, x+0.5*w, y+l+14)
87 | end
88 |
89 |
90 | return setmetatable(self, Slider)
91 | end
92 |
93 | end
94 |
95 |
96 | -- Get screen resolution
97 | local rx, ry = getResolution()
98 | local click = getCursorDown()
99 |
100 | -- Draw the 3 sliders
101 | if not _init then
102 | local r, g, b = 0.5, 0.5, 0.5
103 |
104 | sliderRed = Slider:new(rx*0.8, ry*0.2, 16, ry*0.6, 0, 1, r, "Red")
105 | sliderRed.color = { 1, 0, 0}
106 | sliderGreen = Slider:new(rx*0.85, ry*0.2, 16, ry*0.6, 0, 1, g, "Green")
107 | sliderGreen.color = { 0, 1, 0}
108 | sliderBlue = Slider:new(rx*0.9, ry*0.2, 16, ry*0.6, 0, 1, b, "Blue")
109 | sliderBlue.color = { 0, 0, 1}
110 |
111 | _init = true
112 | end
113 | -- Set the background color based on sliders value
114 | setBackgroundColor( sliderRed.ratio, sliderGreen.ratio, sliderBlue.ratio, 1)
115 | local layer = createLayer()
116 |
117 | setNextFillColor( layer, 0.05, 0.05, 0.05, 1)
118 | addBoxRounded( layer, rx*0.75 +8, ry*0.1, rx*0.2, ry*0.8, 16)
119 |
120 | local font = loadFont('Play', 14)
121 | setNextFillColor( layer, 0.05, 0.05, 0.05, 1)
122 | addText(layer, font, math.floor((sliderRed.ratio*255)+0.5)..","..math.floor((sliderGreen.ratio*255)+0.5)..","..math.floor((sliderBlue.ratio*255)+0.5), 15, 15)
123 | if click then setOutput(math.floor((sliderRed.ratio*255)+0.5)..","..math.floor((sliderGreen.ratio*255)+0.5)..","..math.floor((sliderBlue.ratio*255)+0.5)) end
124 |
125 | sliderRed:draw( layer)
126 | sliderGreen:draw( layer)
127 | sliderBlue:draw( layer)
128 |
129 | requestAnimationFrame(1)
--------------------------------------------------------------------------------
/Particle System/Particle System - Renderscript.txt:
--------------------------------------------------------------------------------
1 | if not init then
2 | maxparticles = 120
3 | particlespeed = 0.25
4 | velocitylimit = 5
5 | particles = {}
6 | for aa=1,maxparticles do
7 | particles[aa] = {}
8 | particles[aa][1] = math.random(1,1000)
9 | particles[aa][2] = math.random(1,600)
10 | local neg = math.random(1,2) - 1
11 | if neg == 0 then
12 | neg = -1
13 | end
14 | particles[aa][3] = math.random(1,100)/100 * neg
15 | neg = math.random(1,2) - 1
16 | if neg == 0 then
17 | neg = -1
18 | end
19 | particles[aa][4] = math.random(1,100)/100 * neg
20 | particles[aa][5] = 0
21 | particles[aa][6] = 0
22 | end
23 | -- xpos, ypos, xvec, yvec,
24 |
25 | --particle behaviour
26 | edgebehaviour = 1
27 | gravity = 0
28 | attraction = 1
29 | attractdistance = 100
30 | connect = 1
31 | velolimiting = 1
32 |
33 |
34 | function DrawParticles()
35 | for ac=1,maxparticles do
36 | setNextFillColor(layer1,0.3,0,0.3,0.6)
37 | addCircle(layer1, particles[ac][1], particles[ac][2], 5)
38 | end
39 | end
40 |
41 | function UpdateParticles()
42 | for ac=1,maxparticles do
43 | if edgebehaviour == 1 then
44 | if particles[ac][1] > (rx - 10) then --right
45 | particles[ac][3] = particles[ac][3] * -1
46 | end
47 | if particles[ac][1] < 10 then --left
48 | particles[ac][3] = math.abs(particles[ac][3])
49 | end
50 |
51 | if particles[ac][2] < 10 then --top
52 | particles[ac][4] = math.abs(particles[ac][4])
53 | end
54 | if particles[ac][2] > (ry - 10) then --bottom
55 | particles[ac][4] = particles[ac][4] * -1
56 | end
57 | end
58 | if edgebehaviour == 2 then
59 | if particles[ac][1] > (rx - 10) then --right
60 | particles[ac][1] = particles[ac][1] - rx
61 | end
62 | if particles[ac][1] < 10 then --left
63 | particles[ac][1] = particles[ac][1] + rx
64 | end
65 |
66 | if particles[ac][2] < 10 then --top
67 | particles[ac][2] = particles[ac][2] + ry
68 | end
69 | if particles[ac][2] > (ry - 10) then --bottom
70 | particles[ac][2] = particles[ac][2] - ry
71 | end
72 | end
73 | if attraction == 1 or connect == 1 then
74 | for af=1,maxparticles do
75 | if af ~= ac then
76 | local tempx1 = particles[ac][1]
77 | local tempx2 = particles[af][1]
78 | local tempy1 = particles[ac][2]
79 | local tempy2 = particles[af][2]
80 | if math.abs(tempx2 - tempx1) < attractdistance then
81 | if math.abs(tempy2 - tempy1) < attractdistance then
82 | if connect == 1 then
83 | local dist1 = (tempx1 - tempx2)/attractdistance
84 | local dist2 = (tempy1 - tempy2)/attractdistance
85 | local distavg = (dist1 + dist2) / 2
86 | setNextStrokeColor(layer1,0.4+distavg,distavg,0.4-distavg,0.4+distavg)
87 | addLine(layer1,tempx1,tempy1,tempx2,tempy2)
88 | end
89 | if attraction == 1 then
90 | particles[ac][3] = particles[ac][3] - (((tempx2 - tempx1)/attractdistance)*0.05)
91 | particles[ac][4] = particles[ac][4] - (((tempy2 - tempy1)/attractdistance)*0.05)
92 | end
93 | end
94 | end
95 | end
96 | end
97 | end
98 | if velolimiting == 1 then
99 | if particles[ac][3] > velocitylimit then particles[ac][3] = velocitylimit end
100 | if particles[ac][3] < -velocitylimit then particles[ac][3] = -velocitylimit end
101 | if particles[ac][4] > velocitylimit then particles[ac][4] = velocitylimit end
102 | if particles[ac][4] < -velocitylimit then particles[ac][4] = -velocitylimit end
103 | end
104 | particles[ac][1] = particles[ac][1] + (particlespeed * particles[ac][3])
105 | particles[ac][2] = particles[ac][2] + (particlespeed * particles[ac][4])
106 | end
107 | end
108 | init = true
109 | end
110 | rx, ry = getResolution()
111 | layer1 = createLayer()
112 |
113 | UpdateParticles()
114 | DrawParticles()
115 |
116 | requestAnimationFrame(1)
--------------------------------------------------------------------------------
/ImageToMovie/ImageMovieScript - Renderscript.txt:
--------------------------------------------------------------------------------
1 | if not init then
2 | frame = 1
3 | movieframes = {}
4 | for ix=1,7 do
5 | movieframes[ix] = ""
6 | end
7 | movieframes[1] = "assets.prod.novaquark.com/126901/ee9c505a-b794-435a-b01c-5937716864a3.jpg"
8 | movieframes[2] = "assets.prod.novaquark.com/126901/0ab8ecc2-079e-47c6-abfd-e7cab7c78394.jpg"
9 | movieframes[3] = "assets.prod.novaquark.com/126901/63ebb2ea-864c-403b-8970-68c11f418156.jpg"
10 | movieframes[4] = "assets.prod.novaquark.com/126901/39ad11b6-09d2-47f5-ae7e-5041df127964.jpg"
11 | movieframes[5] = "assets.prod.novaquark.com/126901/f03b226f-0654-4908-be23-be28d9399d3f.jpg"
12 | movieframes[6] = "assets.prod.novaquark.com/126901/ebc95a7a-92a4-4cbf-8bb0-5c46c07ba44b.jpg"
13 | movieframes[7] = "assets.prod.novaquark.com/126901/07c25db0-9771-42a8-8664-9e8e9d2aaad8.jpg"
14 |
15 | movieimages = {}
16 | for ix=1,5 do
17 | movieimages[ix] = 0
18 | end
19 | movieindex = 1
20 | subframeresx = 200
21 | subframeresy = 112
22 | subframecountx = 5
23 | subframecounty = 44
24 | scrollvalue = 0
25 | play = 0
26 | framerate = 1
27 | init = true
28 | end
29 | local layer1 = createLayer() --image
30 | local layer2 = createLayer() --controls
31 | local font1 = loadFont("Play",20)
32 | local rx,ry = getResolution()
33 | local cx,cy = getCursor()
34 | local cd = getCursorDown()
35 | local cp = getCursorPressed()
36 | local cr = getCursorReleased()
37 |
38 | function DrawSlider(drawlayer, btnx, btny, btnw, btnh, value, maxvalue, alpha)
39 | if cx > btnx and cx < (btnx+btnw) then
40 | if cy > (btny-(btnh*0.5)) and cy < (btny+(btnh*0.5)) then
41 | if cd == true then
42 | --clicked
43 | alpha = 1
44 | scrollvalue = ((cx - btnx)/btnw)*100
45 | local tempseek1 = (scrollvalue * 0.01)*(subframecountx * subframecounty)*7
46 | scrollvalue = math.floor(tempseek1)
47 | movieindex = 1
48 | if scrollvalue > (subframecountx * subframecounty) and scrollvalue < (subframecountx * subframecounty)*7 then
49 | while scrollvalue >= (subframecountx * subframecounty) do
50 | scrollvalue = scrollvalue - (subframecountx * subframecounty)
51 | movieindex = movieindex + 1
52 | end
53 | else
54 |
55 | end
56 | frame = scrollvalue
57 | else
58 | --hovered
59 | alpha = 1
60 | end
61 | end
62 | end
63 | setNextShadow(drawlayer,25,0,0,0,1)
64 | setNextFillColor(drawlayer, 0.35, 0.35, 0.35, alpha)
65 | setNextStrokeWidth(drawlayer, 0)
66 | addBoxRounded(drawlayer, btnx, btny-(btnh*0.25), btnw, btnh-(btnh*0.5), 5)
67 |
68 | setNextFillColor(drawlayer, 0.65, 0.15, 0.15, alpha)
69 | setNextStrokeWidth(drawlayer, 0)
70 | addBoxRounded(drawlayer, btnx, btny-(btnh*0.25), ((value/maxvalue)*btnw), btnh-(btnh*0.5), 5)
71 |
72 | setNextShadow(drawlayer,10,0,0,0,1)
73 | setNextFillColor(drawlayer, 1, 1, 1, alpha)
74 | addBoxRounded(drawlayer, btnx+((value/maxvalue)*btnw)-7.5, btny-(btnh*0.5), 15, btnh, 5)
75 | end
76 |
77 | function DrawPausedIndicator()
78 | setNextShadow(layer2,50,0,0,0,1)
79 | setNextStrokeWidth(layer2, 0)
80 | setNextFillColor(layer2, 1, 1, 1, 0.75)
81 | addBox(layer2, 375, 150, 100, 300)
82 |
83 | setNextShadow(layer2,50,0,0,0,1)
84 | setNextStrokeWidth(layer2, 0)
85 | setNextFillColor(layer2, 1, 1, 1, 0.75)
86 | addBox(layer2, 525, 150, 100, 300)
87 | end
88 |
89 | if movieindex > 1 then
90 | movieimages[1] = loadImage(movieframes[movieindex - 1])
91 | end
92 | movieimages[2] = loadImage(movieframes[movieindex])
93 | if movieindex < 7 then
94 | movieimages[3] = loadImage(movieframes[movieindex + 1])
95 | end
96 |
97 | if play == 1 then
98 | if frame == (subframecountx * subframecounty) then
99 | frame = 1
100 | if movieindex < 7 then
101 | movieindex = movieindex + 1
102 | movieimages[2] = movieimages[3]
103 | else
104 | play = 0
105 | end
106 | else
107 | frame = frame + 1
108 | end
109 | DrawSlider(layer2, 50, 575, 925, 50, (subframecountx * subframecounty)*(movieindex - 1)+frame, (subframecountx * subframecounty)*7, 0.1)
110 | else
111 | --draw hud
112 | DrawSlider(layer2, 50, 575, 925, 50, (subframecountx * subframecounty)*(movieindex - 1)+frame, (subframecountx * subframecounty)*7, 1)
113 | DrawPausedIndicator()
114 | end
115 |
116 | if cr == true then
117 | if scrollvalue ~= 0 then
118 | scrollvalue = 0
119 | else
120 | if play == 1 then
121 | play = 0
122 | else
123 | play = 1
124 | end
125 | end
126 | end
127 |
128 | local subxpos = math.fmod(frame,5)
129 | local subypos = math.floor(frame / 5)
130 | addImageSub(layer1, movieimages[2], 0, 0, rx, ry, 0 + (subframeresx*subxpos), 0 + (subframeresy * subypos), subframeresx, subframeresy)
131 | requestAnimationFrame(framerate)
--------------------------------------------------------------------------------
/Telemeter Landing Visualizer/renderscript.txt:
--------------------------------------------------------------------------------
1 | if not init then
2 | mem1 = {}
3 | for ix=1,9 do
4 | mem1[ix] = 0
5 | end
6 | datapoint = {}
7 | for ix1=1,6 do
8 | datapoint[ix1] = {}
9 | for iy1=1,6 do
10 | datapoint[ix1][iy1] = 0
11 | end
12 | end
13 | tarezero = 1
14 | datapoint2 = {}
15 | for ix1=1,6 do
16 | datapoint2[ix1] = {}
17 | for iy1=1,6 do
18 | datapoint2[ix1][iy1] = 0
19 | end
20 | end
21 | viewenabled = 1
22 | cordx = {}
23 | for ix1=1,6 do
24 | cordx[ix1] = {}
25 | for iy1=1,6 do
26 | cordx[ix1][iy1] = 0
27 | end
28 | end
29 | cordy = {}
30 | for ix1=1,6 do
31 | cordy[ix1] = {}
32 | for iy1=1,6 do
33 | cordy[ix1][iy1] = 0
34 | end
35 | end
36 | cordz = {}
37 | for ix1=1,6 do
38 | cordz[ix1] = {}
39 | for iy1=1,6 do
40 | cordz[ix1][iy1] = 0
41 | end
42 | end
43 | init = true
44 | end
45 | font1 = loadFont("Montserrat-Light", 15)
46 | layer1 = createLayer()
47 | rx, ry = getResolution()
48 | cx, cy = getCursor()
49 | cd = getCursorDown()
50 | cp = getCursorPressed()
51 | cr = getCursorReleased()
52 |
53 | local inputstr = getInput()
54 | if inputstr == nil or inputstr == "" then
55 | --do nothing
56 | else
57 | --addText(layer1, font1, getInput(), 100,100)
58 | local inputstr2 = ""
59 | for iy0=1,6 do
60 | for iy1=1,6 do
61 | inputstr2 = string.sub(inputstr,1,string.find(inputstr,",") - 1)
62 | inputstr = string.sub(inputstr,string.find(inputstr,",")+1,string.len(inputstr))
63 | datapoint[iy0][iy1] = tonumber(inputstr2)
64 | end
65 | end
66 | end
67 |
68 | function DrawButton(drawlayer, btnx, btny, btnw, btnh, btntxt, callfunc)
69 | setNextFillColor(drawlayer, 0.35, 0.35, 0.35, 1)
70 | if cx > btnx and cx < (btnx+btnw) then
71 | if cy > btny and cy < (btny+btnh) then
72 | if getCursorReleased() == true then
73 | --clicked
74 | setNextFillColor(drawlayer, 1, 0, 0, 1)
75 | callfunc()
76 | else
77 | --hovered
78 | setNextFillColor(drawlayer, 1, 1, 0, 1)
79 | end
80 | end
81 | end
82 | setNextStrokeWidth(drawlayer, 0)
83 | addBoxRounded(drawlayer, btnx, btny, btnw, btnh, 5)
84 | setNextFillColor(drawlayer, 1, 1, 1, 1)
85 | local txtw, txty = getTextBounds(font1,btntxt)
86 | addText(drawlayer, font1, btntxt, btnx + ((btnw - txtw)/2), btny + (btnh/2)+(txty/2))
87 | end
88 |
89 | if tarezero == 1 then
90 | for bx1=1,6 do
91 | for by1=1,6 do
92 | datapoint2[bx1][by1] = tonumber(datapoint[bx1][by1])
93 | tarezero = 0
94 | end
95 | end
96 | end
97 |
98 | local output = function() if viewenabled == 1 then viewenabled = 0 else viewenabled = 1 end end
99 | DrawButton(layer1, 20, 20, 100, 35, "SHOW / HIDE", output)
100 |
101 | local output = function() tarezero = 1 end
102 | DrawButton(layer1, 20, 100, 100, 35, "ZERO INPUT", output)
103 |
104 | if viewenabled == 1 then
105 | --setup draw coordinates
106 | local inc = 1
107 | for dx1=1,6 do
108 | for dy1=1,6 do
109 | --cordx[dx1][dy1] = (dx1*150-(dy1*20))-350
110 | --cordy[dx1][dy1] = (dy1*60)+150+(tonumber(datapoint[dx1][dy1]) * 20)
111 | cordx[dx1][dy1] = (dx1*80-(dy1*20))+300
112 | cordy[dx1][dy1] = (dy1*30)+150+((tonumber(datapoint[dx1][dy1]) - datapoint2[dx1][dy1]) * 4)
113 | cordz[dx1][dy1] = (tonumber(datapoint[dx1][dy1]) - datapoint2[dx1][dy1])
114 | --addText(layer1,font1,cordz[dx1][dy1],(dx1*150-(dy1*20))+100, (dy1*50)+250+(tonumber(datapoint[dx1][dy1]) * 3))
115 | setNextFillColor(layer1, 1*((100 - cordz[dx1][dy1])/100), 1*((100 - cordz[dx1][dy1])/100), 1*((100 - cordz[dx1][dy1])/100), 1)
116 | addCircle(layer1, cordx[dx1][dy1], cordy[dx1][dy1], 5)
117 | inc = inc + 1
118 | end
119 | end
120 | --draw vertical lines
121 | for dx2=1,6 do
122 | for dl2=1,5 do
123 | local brightness = (dx2*0.3)
124 | local diff = math.abs(tonumber(cordz[dx2][dl2]) - tonumber(cordz[dx2][dl2+1]))
125 | local colorr = (1*brightness)-(0.5/diff)
126 | local colorg = (1*brightness)*(0.5/diff)
127 | local colorb = (1*brightness)*(0.5/diff)
128 | setNextStrokeColor(layer1,colorr,colorg,colorb,(1*brightness))
129 | setNextStrokeWidth(layer1,3)
130 | addLine(layer1,cordx[dx2][dl2],cordy[dx2][dl2],cordx[dx2][dl2+1],cordy[dx2][dl2+1])
131 | end
132 | end
133 | --draw horizontal lines
134 | for dy2=1,6 do
135 | for dl2=1,5 do
136 | local brightness = (dy2*0.3)
137 | local diff = math.abs(tonumber(cordz[dl2][dy2]) - tonumber(cordz[dl2+1][dy2]))
138 | local colorr = (1*brightness)-(0.5/diff)
139 | local colorg = (1*brightness)*(0.5/diff)
140 | local colorb = (1*brightness)*(0.5/diff)
141 | setNextStrokeColor(layer1,colorr,colorg,colorb,(1*brightness))
142 | setNextStrokeWidth(layer1,3)
143 | addLine(layer1,cordx[dl2][dy2],cordy[dl2][dy2],cordx[dl2+1][dy2],cordy[dl2+1][dy2])
144 | end
145 | end
146 | end
147 |
148 | requestAnimationFrame(1)
--------------------------------------------------------------------------------
/Construct ID License Plate/Dynamic License Plate - renderscript.txt:
--------------------------------------------------------------------------------
1 | local atlas = require("atlas")
2 | --user configurable variables
3 | local bgplanet = 2
4 | local planetsize = 400
5 | local outlinecolor1R, outlinecolor1G, outlinecolor1B = 0, 1.5, 1.75
6 | local outlinecolor2R, outlinecolor2G, outlinecolor2B = 0, 0.25, 0.5
7 | local outlinecolor3R, outlinecolor3G, outlinecolor3B = 0, 0.25, 0.5
8 | local textcolor1R, textcolor1G, textcolor1B = 1, 1, 1
9 | local textcolor2R, textcolor2G, textcolor2B = 3, 3, 3
10 | local spacebg = loadImage("assets.prod.novaquark.com/66839/ea555f35-0b6a-4c15-a4d4-d0d0b1e26927.png")
11 | local drawspacebg = 1
12 | --# Local rendering preparation
13 | -- Create layers
14 | local rear = createLayer()
15 | local back = createLayer()
16 | local front = createLayer()
17 | local fore = createLayer()
18 |
19 | local layer2 = createLayer()
20 | local platetextsize = 200
21 | local font1 = loadFont("Play",platetextsize)
22 | local font2 = loadFont("Play",platetextsize/2)
23 |
24 | local system = atlas[0]
25 | local rx,ry = getResolution()
26 |
27 | if drawspacebg == 1 then
28 | addImage(rear, spacebg, 0, 0, rx, ry)
29 | end
30 |
31 | local images = {}
32 | local function loadImages(src)
33 | for k,img in pairs(images) do
34 | if k == src then return img end
35 | end
36 | images[src] = loadImage(src)
37 | return images[src]
38 | end
39 |
40 | local function contains(t, u)
41 | for i,v in pairs(t) do
42 | if v == u then return true, i end
43 | end
44 | return false
45 | end
46 |
47 | _planets = _planets or {}
48 | local input, dist = getInput(), 0
49 |
50 | if not _init then
51 | if not system[_select] then
52 | _select = 1
53 | end
54 | for _,b in pairs(system) do
55 | if b.systemId == 0 then
56 | if b.satellites then
57 | table.sort (b.satellites, function (b1, b2) return system[b1].positionInSystem < system[b1].positionInSystem end )
58 | end
59 | _planets[#_planets+1] = b
60 | end
61 | end
62 | table.sort (_planets, function (b1, b2) return b1.positionInSystem < b2.positionInSystem end )
63 | _init = true
64 | end
65 |
66 | local planet = system[_select]
67 | local vignette = loadImages(planet.iconPath)
68 |
69 |
70 | --- Draw all planets
71 | for i,body in pairs(_planets) do
72 | -- For each planet load the icon from the atlas data
73 | if i == bgplanet then
74 | local img = loadImages(body.iconPath)
75 | local hover = false
76 | local r = planetsize
77 | local bx, by = 450,350
78 | local mbx = 224+(i*350)/6
79 |
80 | if body.hasAtmosphere then
81 | local atm = body.atmosphereRadius/900
82 |
83 | setNextStrokeWidth( rear, 0.1)
84 | setNextStrokeColor( rear, 1, 1, 1, 0.03)
85 | setNextShadow( rear, 80, 1, 1, 1, 0.035)
86 | setNextFillColor( rear, 1, 1, 1, 0.025)
87 | addCircle( rear, bx, by, r)
88 | end
89 | --Draw planet image
90 | addImage( back, img, bx-r, by-r, 2*r, 2*r)
91 | --draw border
92 | setNextShadow(fore,25,outlinecolor1R, outlinecolor1G, outlinecolor1B,1)
93 | setNextStrokeWidth(fore,5)
94 | setNextFillColor(fore,0,0,0,0)
95 | addBoxRounded(fore, 25, 25, rx - 50, ry - 50, 20)
96 |
97 | setNextShadow(fore,25,outlinecolor2R, outlinecolor2G, outlinecolor2B,1)
98 | setNextFillColor(fore,textcolor1R, textcolor1G, textcolor1B,1)
99 | local bndx,bndy = getTextBounds(font2,body.name[1])
100 | addText(fore,font2,body.name[1],rx/2-(bndx/2),ry/2-(bndy/2)-100)
101 | end
102 | end
103 |
104 | local baseCharacters = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
105 | local baseLength = #baseCharacters
106 |
107 | local floor = math.floor
108 | local abs = math.abs
109 | local sub = string.sub
110 | function baseEncode(x, base)
111 | assert(base, "Argument 2 missing or nil")
112 | assert(not (base > baseLength or base < 2), "Base not in range of 2 - " .. baseLength)
113 | local returnString = ""
114 | local negative = x < 0
115 | if negative then
116 | x = abs(x)
117 | end
118 | local i = 0
119 | local remainder
120 | while x ~= 0 do
121 | i = i + 1
122 | x, remainder = floor(x / base), x % base + 1
123 | returnString = sub(baseCharacters, remainder, remainder) .. returnString
124 | end
125 | return (negative and "-" or "") .. returnString
126 | end
127 | local find = string.find
128 | function baseDecode(s, encodedBase)
129 | if encodedBase <= 36 then
130 | s = s:upper()
131 | end
132 |
133 | local positive = true
134 | if sub(s, 1, 1) == "-" then
135 | positive = false
136 | s = sub(s, 2, -1)
137 | end
138 |
139 | local returnNumber = 0
140 | local length = #s
141 |
142 | for i = 1, length do
143 | local currentCharacter = sub(s, i, i)
144 | local characterValue = (find(baseCharacters, currentCharacter) - 1) * encodedBase ^ (length - i)
145 | returnNumber = returnNumber + characterValue
146 | end
147 | return positive and returnNumber or -returnNumber
148 | end
149 | function convertBase(s, encodedBase, newBase)
150 | return baseEncode(baseDecode(s, encodedBase), newBase)
151 | end
152 | local platetext = convertBase(getInput(), 10, 36)
153 | local bndw, bndh = getTextBounds(font1,platetext)
154 | setNextShadow(layer2,50,outlinecolor3R, outlinecolor3G, outlinecolor3B,1)
155 | setNextFillColor(layer2,textcolor2R, textcolor2G, textcolor2B,1)
156 | addText(layer2,font1,platetext,rx/2-(bndw/2),(ry/2)+100)
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/My Project/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/DUImageToLuaConverter.vbproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {596C6B7D-055E-4C26-B43E-6CD89F44DE06}
8 | WinExe
9 | DUImageToLuaConverter.My.MyApplication
10 | DUImageToLuaConverter
11 | DUImageToLuaConverter
12 | 512
13 | WindowsForms
14 | v4.8
15 | true
16 |
17 |
18 |
19 | AnyCPU
20 | true
21 | full
22 | true
23 | true
24 | bin\Debug\
25 | DUImageToLuaConverter.xml
26 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022
27 |
28 |
29 | AnyCPU
30 | pdbonly
31 | false
32 | true
33 | true
34 | bin\Release\
35 | DUImageToLuaConverter.xml
36 | 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022
37 |
38 |
39 | On
40 |
41 |
42 | Binary
43 |
44 |
45 | Off
46 |
47 |
48 | On
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 | Form
78 |
79 |
80 | Form1.vb
81 | Form
82 |
83 |
84 |
85 | True
86 | Application.myapp
87 | True
88 |
89 |
90 | True
91 | True
92 | Resources.resx
93 |
94 |
95 | True
96 | Settings.settings
97 | True
98 |
99 |
100 |
101 |
102 | Form1.vb
103 |
104 |
105 | VbMyResourcesResXFileCodeGenerator
106 | Resources.Designer.vb
107 | My.Resources
108 | Designer
109 |
110 |
111 |
112 |
113 | MyApplicationCodeGenerator
114 | Application.Designer.vb
115 |
116 |
117 | SettingsSingleFileGenerator
118 | My
119 | Settings.Designer.vb
120 |
121 |
122 |
123 |
124 |
131 |
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/Form1.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
--------------------------------------------------------------------------------
/DUImageToLuaConverter/DUImageToLuaConverter/Form1.Designer.vb:
--------------------------------------------------------------------------------
1 | _
2 | Partial Class Form1
3 | Inherits System.Windows.Forms.Form
4 |
5 | 'Form overrides dispose to clean up the component list.
6 | _
7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8 | Try
9 | If disposing AndAlso components IsNot Nothing Then
10 | components.Dispose()
11 | End If
12 | Finally
13 | MyBase.Dispose(disposing)
14 | End Try
15 | End Sub
16 |
17 | 'Required by the Windows Form Designer
18 | Private components As System.ComponentModel.IContainer
19 |
20 | 'NOTE: The following procedure is required by the Windows Form Designer
21 | 'It can be modified using the Windows Form Designer.
22 | 'Do not modify it using the code editor.
23 | _
24 | Private Sub InitializeComponent()
25 | Me.Button1 = New System.Windows.Forms.Button()
26 | Me.Button3 = New System.Windows.Forms.Button()
27 | Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog()
28 | Me.PictureBox1 = New System.Windows.Forms.PictureBox()
29 | Me.TextBox2 = New System.Windows.Forms.TextBox()
30 | Me.ProgressBar1 = New System.Windows.Forms.ProgressBar()
31 | Me.Label1 = New System.Windows.Forms.Label()
32 | Me.NumericUpDown1 = New System.Windows.Forms.NumericUpDown()
33 | Me.Label2 = New System.Windows.Forms.Label()
34 | Me.ComboBox1 = New System.Windows.Forms.ComboBox()
35 | CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
36 | CType(Me.NumericUpDown1, System.ComponentModel.ISupportInitialize).BeginInit()
37 | Me.SuspendLayout()
38 | '
39 | 'Button1
40 | '
41 | Me.Button1.Location = New System.Drawing.Point(141, 220)
42 | Me.Button1.Name = "Button1"
43 | Me.Button1.Size = New System.Drawing.Size(132, 42)
44 | Me.Button1.TabIndex = 0
45 | Me.Button1.Text = "Convert"
46 | Me.Button1.UseVisualStyleBackColor = True
47 | '
48 | 'Button3
49 | '
50 | Me.Button3.Location = New System.Drawing.Point(13, 13)
51 | Me.Button3.Name = "Button3"
52 | Me.Button3.Size = New System.Drawing.Size(260, 23)
53 | Me.Button3.TabIndex = 3
54 | Me.Button3.Text = "Browse"
55 | Me.Button3.UseVisualStyleBackColor = True
56 | '
57 | 'OpenFileDialog1
58 | '
59 | Me.OpenFileDialog1.FileName = "OpenFileDialog1"
60 | '
61 | 'PictureBox1
62 | '
63 | Me.PictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch
64 | Me.PictureBox1.Location = New System.Drawing.Point(12, 42)
65 | Me.PictureBox1.Name = "PictureBox1"
66 | Me.PictureBox1.Size = New System.Drawing.Size(260, 172)
67 | Me.PictureBox1.TabIndex = 4
68 | Me.PictureBox1.TabStop = False
69 | '
70 | 'TextBox2
71 | '
72 | Me.TextBox2.Location = New System.Drawing.Point(279, 13)
73 | Me.TextBox2.Multiline = True
74 | Me.TextBox2.Name = "TextBox2"
75 | Me.TextBox2.Size = New System.Drawing.Size(346, 278)
76 | Me.TextBox2.TabIndex = 8
77 | '
78 | 'ProgressBar1
79 | '
80 | Me.ProgressBar1.Location = New System.Drawing.Point(12, 268)
81 | Me.ProgressBar1.Name = "ProgressBar1"
82 | Me.ProgressBar1.Size = New System.Drawing.Size(261, 23)
83 | Me.ProgressBar1.TabIndex = 9
84 | '
85 | 'Label1
86 | '
87 | Me.Label1.AutoSize = True
88 | Me.Label1.Location = New System.Drawing.Point(9, 223)
89 | Me.Label1.Name = "Label1"
90 | Me.Label1.Size = New System.Drawing.Size(37, 13)
91 | Me.Label1.TabIndex = 11
92 | Me.Label1.Text = "Scale:"
93 | '
94 | 'NumericUpDown1
95 | '
96 | Me.NumericUpDown1.Location = New System.Drawing.Point(52, 221)
97 | Me.NumericUpDown1.Maximum = New Decimal(New Integer() {20, 0, 0, 0})
98 | Me.NumericUpDown1.Minimum = New Decimal(New Integer() {1, 0, 0, 0})
99 | Me.NumericUpDown1.Name = "NumericUpDown1"
100 | Me.NumericUpDown1.Size = New System.Drawing.Size(83, 20)
101 | Me.NumericUpDown1.TabIndex = 12
102 | Me.NumericUpDown1.Value = New Decimal(New Integer() {6, 0, 0, 0})
103 | '
104 | 'Label2
105 | '
106 | Me.Label2.AutoSize = True
107 | Me.Label2.Location = New System.Drawing.Point(9, 244)
108 | Me.Label2.Name = "Label2"
109 | Me.Label2.Size = New System.Drawing.Size(38, 13)
110 | Me.Label2.TabIndex = 13
111 | Me.Label2.Text = "Orient:"
112 | '
113 | 'ComboBox1
114 | '
115 | Me.ComboBox1.FormattingEnabled = True
116 | Me.ComboBox1.Items.AddRange(New Object() {"None", "Rotate 90", "Rotate 180", "Rotate 270"})
117 | Me.ComboBox1.Location = New System.Drawing.Point(52, 241)
118 | Me.ComboBox1.Name = "ComboBox1"
119 | Me.ComboBox1.Size = New System.Drawing.Size(83, 21)
120 | Me.ComboBox1.TabIndex = 14
121 | '
122 | 'Form1
123 | '
124 | Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
125 | Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
126 | Me.ClientSize = New System.Drawing.Size(634, 304)
127 | Me.Controls.Add(Me.ComboBox1)
128 | Me.Controls.Add(Me.Label2)
129 | Me.Controls.Add(Me.NumericUpDown1)
130 | Me.Controls.Add(Me.Label1)
131 | Me.Controls.Add(Me.ProgressBar1)
132 | Me.Controls.Add(Me.TextBox2)
133 | Me.Controls.Add(Me.PictureBox1)
134 | Me.Controls.Add(Me.Button3)
135 | Me.Controls.Add(Me.Button1)
136 | Me.Name = "Form1"
137 | Me.Text = "DU Image to Lua String Converter"
138 | CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit()
139 | CType(Me.NumericUpDown1, System.ComponentModel.ISupportInitialize).EndInit()
140 | Me.ResumeLayout(False)
141 | Me.PerformLayout()
142 |
143 | End Sub
144 |
145 | Friend WithEvents Button1 As Button
146 | Friend WithEvents Button3 As Button
147 | Friend WithEvents OpenFileDialog1 As OpenFileDialog
148 | Friend WithEvents PictureBox1 As PictureBox
149 | Friend WithEvents TextBox2 As TextBox
150 | Friend WithEvents ProgressBar1 As ProgressBar
151 | Friend WithEvents Label1 As Label
152 | Friend WithEvents NumericUpDown1 As NumericUpDown
153 | Friend WithEvents Label2 As Label
154 | Friend WithEvents ComboBox1 As ComboBox
155 | End Class
156 |
--------------------------------------------------------------------------------
/DUOpenMarket Ad/DUOpenMarket Ad - Renderscript.txt:
--------------------------------------------------------------------------------
1 | if not init then
2 | tick = 0
3 | tickmax = 100
4 | hexx = 515
5 | hexy = 175
6 | a = 2 * math.pi / 6
7 | r = 100
8 | display = 1
9 | displaymax = 4
10 | displaytick = 0
11 | displaytickmax = 175
12 | init = true
13 | end
14 | local layer = createLayer()
15 | local layer2 = createLayer()
16 | local layer3 = createLayer()
17 | local layer4 = createLayer()
18 | local rx, ry = getResolution()
19 | local fontL = loadFont("Play", 80)
20 | local fontB = loadFont("Play", 70)
21 | local fontB2 = loadFont("Play", 71)
22 | local fontB3 = loadFont("Play", 72)
23 | local fontM = loadFont("Play", 50)
24 | local fontS = loadFont("Play", 40)
25 | local imagehandle = loadImage("assets.prod.novaquark.com/66839/b249f117-4120-472e-8c12-d84c04c28775.png")
26 | local imagehandle2 = loadImage("assets.prod.novaquark.com/66839/8452f802-cb36-40ec-9d26-f5530a82ac1c.png")
27 |
28 | if display == 1 then
29 |
30 | addImage(layer, imagehandle, 0, 0, rx, ry)
31 |
32 | --setNextFillColor(layer, 1, 0, 0, 1)
33 | --addText(layer, fontS, "In Development", rx*0.02, ry*0.08)
34 | --setNextFillColor(layer, 1, 0, 0, 1)
35 | --addText(layer, fontS, "@EpicPhail#3860", rx*0.02, ry*0.16)
36 |
37 | setNextShadow(layer3,15,0,0,0,1)
38 | setNextFillColor(layer3, 1, 1, 1, 1)
39 | addText(layer3, fontB, "DUOpenMarket", rx*0.265, ry*0.55)
40 |
41 | setNextShadow(layer3,15,0,0,0,1)
42 | setNextFillColor(layer3, 0.65, 0.65, 0.65, 1)
43 | addText(layer3, fontM, "Open Source Third-Party Market API", rx*0.11, ry*0.675)
44 |
45 | setNextFillColor(layer3, 0.65, 0.65, 0.65, 1)
46 | setNextShadow(layer3,15,0,0,0,1)
47 | addText(layer3, fontM, "with Discord-based login", rx*0.235, ry*0.74)
48 |
49 | setNextShadow(layer3,15,0,0,0,1)
50 | setNextFillColor(layer3, 2, 2, 0, 1)
51 | addText(layer3, fontL, "https://duopenmarket.com", rx*0.025, ry*0.9)
52 |
53 |
54 | setNextShadow(layer4,15,0,0,0,1)
55 | setNextFillColor(layer4, 1, 0.85, 0, 1)
56 | addText(layer4, fontM, "Version 1.61.1", rx*0.04, ry*0.07)
57 |
58 | setNextShadow(layer4,15,0,0,0,1)
59 | setNextFillColor(layer4, 1, 0.85, 0, 1)
60 | addText(layer4, fontM, "Now Available!", rx*0.04, ry*0.17)
61 |
62 | setLayerOrigin(layer4,rx/2,ry/2)
63 | setLayerRotation(layer4,(math.pi*2)*-0.1)
64 | setLayerTranslation(layer4,50,-150)
65 |
66 | if tick > tickmax then
67 | tick = 0
68 | end
69 | if tick > (tickmax / 2) then
70 | alpha = 1-(tick/tickmax)
71 | else
72 | alpha = (tick/tickmax)
73 | end
74 | for ia=0,5 do
75 | setNextShadow(layer3,20,1,0.85,0,alpha)
76 | setNextStrokeWidth(layer3,15)
77 | setNextStrokeColor(layer3,1,0.85,0,alpha)
78 | addLine(layer3,hexx + (r + tick) * math.cos(a * ia), hexy + (r + tick) * math.sin(a * ia),hexx + (r + tick) * math.cos(a * (ia+1)), hexy + (r + tick) * math.sin(a * (ia+1)))
79 | end
80 | tick = tick + 1
81 | end
82 |
83 | if display == 2 then
84 | addImage(layer, imagehandle, 0, 0, rx, ry)
85 | addImage(layer2, imagehandle2, -50, -75, rx, ry)
86 |
87 | setNextShadow(layer3,15,0,0,0,1)
88 | setNextFillColor(layer3, 0.85, 0.85, 0.15, 1)
89 | addText(layer3, fontS, "Tired of spreadsheets?", rx*0.05, ry*0.1)
90 |
91 | setNextShadow(layer3,15,0,0,0,1)
92 | setNextFillColor(layer3, 0.85, 0.85, 0.15, 1)
93 | addText(layer3, fontS, "Try graphs instead!", rx*0.05, ry*0.175)
94 |
95 |
96 | setNextShadow(layer3,15,0,0,0,1)
97 | setNextFillColor(layer3, 0.85, 0.85, 0.15, 1)
98 | addText(layer3, fontS, "Automatically generated historical statistics", rx*0.05, ry*0.7)
99 |
100 |
101 | setNextShadow(layer3,15,0,0,0,1)
102 | setNextFillColor(layer3, 2, 2, 0, 1)
103 | addText(layer3, fontL, "https://duopenmarket.com", rx*0.025, ry*0.9)
104 | end
105 |
106 | if display == 3 then
107 |
108 | addImage(layer, imagehandle, 0, 0, rx, ry)
109 |
110 | setNextShadow(layer3,15,0,0,0,1)
111 | setNextFillColor(layer3, 0.75, 0.75, 0.75, 1)
112 | addText(layer3, fontB, "Current Features:", rx*0.025, ry*0.1)
113 |
114 | setNextShadow(layer3,15,0,0,0,1)
115 | setNextFillColor(layer3, 0.45, 0.85, 0.25, 1)
116 | addText(layer3, fontM, "Open-Source, with Secure Auth", rx*0.05, ry*0.2)
117 |
118 | setNextShadow(layer3,15,0,0,0,1)
119 | setNextFillColor(layer3, 0.45, 0.85, 0.25, 1)
120 | addText(layer3, fontM, "Advanced Searching, save search terms", rx*0.05, ry*0.3)
121 |
122 | setNextShadow(layer3,15,0,0,0,1)
123 | setNextFillColor(layer3, 0.45, 0.85, 0.25, 1)
124 | addText(layer3, fontM, "Small client, low resource use", rx*0.05, ry*0.4)
125 |
126 | setNextShadow(layer3,15,0,0,0,1)
127 | setNextFillColor(layer3, 0.45, 0.85, 0.25, 1)
128 | addText(layer3, fontM, "Sort by price, market, quantity, etc", rx*0.05, ry*0.5)
129 |
130 | setNextShadow(layer3,15,0,0,0,1)
131 | setNextFillColor(layer3, 0.45, 0.85, 0.25, 1)
132 | addText(layer3, fontM, "History trend Graphing and Economy stats", rx*0.05, ry*0.6)
133 |
134 | setNextShadow(layer3,15,0,0,0,1)
135 | setNextFillColor(layer3, 2, 2, 0, 1)
136 | addText(layer3, fontL, "https://duopenmarket.com", rx*0.025, ry*0.9)
137 |
138 | end
139 |
140 | if display == 4 then
141 |
142 | addImage(layer, imagehandle, 0, 0, rx, ry)
143 |
144 | setNextShadow(layer3,15,0,0,0,1)
145 | setNextFillColor(layer3, 0.75, 0.75, 0.75, 1)
146 | addText(layer3, fontB, "Features In Development:", rx*0.025, ry*0.1)
147 |
148 | setNextShadow(layer3,15,0,0,0,1)
149 | setNextFillColor(layer3, 0.85, 0.45, 0.25, 1)
150 | addText(layer3, fontM, "Profit and Margin calculators for industry", rx*0.05, ry*0.2)
151 |
152 | setNextShadow(layer3,15,0,0,0,1)
153 | setNextFillColor(layer3, 0.85, 0.45, 0.25, 1)
154 | addText(layer3, fontM, "Cost/value calculator for constructs", rx*0.05, ry*0.3)
155 |
156 | setNextShadow(layer3,15,0,0,0,1)
157 | setNextFillColor(layer3, 0.85, 0.45, 0.25, 1)
158 | addText(layer3, fontM, "Construct / Blueprint / Script Market", rx*0.05, ry*0.4)
159 |
160 | setNextShadow(layer3,15,0,0,0,1)
161 | setNextFillColor(layer3, 0.85, 0.45, 0.25, 1)
162 | addText(layer3, fontM, "Public anti-scam Reputation directory", rx*0.05, ry*0.5)
163 |
164 | setNextShadow(layer3,15,0,0,0,1)
165 | setNextFillColor(layer3, 0.85, 0.45, 0.25, 1)
166 | addText(layer3, fontM, "...And more!", rx*0.05, ry*0.7)
167 |
168 | setNextShadow(layer3,15,0,0,0,1)
169 | setNextFillColor(layer3, 2, 2, 0, 1)
170 | addText(layer3, fontL, "https://duopenmarket.com", rx*0.025, ry*0.9)
171 |
172 | end
173 |
174 |
175 | if displaytick < displaytickmax then
176 | displaytick = displaytick + 1
177 | else
178 | if display == displaymax then
179 | display = 1
180 | else
181 | display = display + 1
182 | end
183 | displaytick = 0
184 | end
185 |
186 | requestAnimationFrame(1)
--------------------------------------------------------------------------------
/Drawing Board 1.1/Drawing Board 1 - Renderscript.txt:
--------------------------------------------------------------------------------
1 | if not Slider then
2 |
3 |
4 | -- Returns a new slider class
5 | Slider = {}
6 | Slider.__index = Slider
7 | function Slider:new(x, y, width, length, min, max, value, label)
8 | self = {
9 | x = x or 0,
10 | y = y or 0,
11 | l = length or 100,
12 | w = width or 20,
13 | min = min or 0,
14 | max = max or 1,
15 | ratio = 0,
16 | label = label or "",
17 | drag = false,
18 | color = {1,1,1}
19 | }
20 | self.ratio = math.max(0, math.min(1, (value or self.min)/(self.max-self.min)))
21 |
22 | -- Set the value of the slider
23 | function self:setValue(val)
24 | if type(val) == 'number' then
25 | self.value = math.max(self.min, math.min(self.max, val))
26 | end
27 | end
28 |
29 | -- Get the value of the slider
30 | function self:getValue(val)
31 | return self.ratio*(self.max - self.min) + self.min
32 | end
33 |
34 | -- Draws the slider on the screen using the given layer
35 | function self:draw(layer)
36 | -- Localize object data
37 | local x, y, w, l = self.x, self.y, self.w, self.l
38 | local min, max, ratio = self.min, self.max
39 |
40 | local font = loadFont('Play', 14)
41 |
42 | -- Get cursor data
43 | local mx, my = getCursor()
44 | local pressed = getCursorPressed()
45 | local released = getCursorReleased()
46 |
47 | -- Determine if the cursor is on the bar and detect if the mouse is down
48 | if (mx >= x and mx <= x+w) and (my >= y and my <= y+l) then
49 |
50 | if pressed then self.drag = true end
51 | end
52 |
53 | -- Set the ratio based on the cursor position
54 | if self.drag then
55 | self.ratio = math.max(0, math.min(1, 1 - (my-y)/l))
56 | if released then
57 | self.drag = false
58 | end
59 | end
60 |
61 | local ratio = self.ratio
62 | local h = ratio*(max-min)
63 | local color = self.color
64 |
65 | -- Draw the slider
66 | setDefaultStrokeColor(layer, Shape_BoxRounded, 1, 1, 1, 1)
67 | setDefaultStrokeWidth(layer, Shape_BoxRounded, 0.1)
68 |
69 | setNextFillColor(layer, 0.1, 0.1, 0.1, 1)
70 | addBoxRounded(layer, x, y, w, l, 0)
71 |
72 | setNextFillColor(layer, color[1], color[2], color[3], 1)
73 | addBoxRounded(layer, x, y+(1-ratio)*l, w, l*ratio, 0)
74 |
75 | setNextFillColor(layer, 0.5, 0.5, 0.5, 1)
76 | addBoxRounded(layer, x-3, y+(1-ratio)*l -3, w+6, 6, 0)
77 |
78 | -- Draw label and value display
79 | local label = self.label
80 | setNextTextAlign( layer, AlignH_Center, AlignV_Middle)
81 | addText( layer, font, label, x+0.5*w, y-14)
82 |
83 | local display = string.format('%.0f', math.floor(((ratio*(max - min) + min)*255)+0.5))
84 | setNextTextAlign( layer, AlignH_Center, AlignV_Middle)
85 | addText( layer, font, display, x+0.5*w, y+l+14)
86 | end
87 |
88 |
89 | return setmetatable(self, Slider)
90 | end
91 |
92 | end
93 |
94 | if not init then
95 | l3fontsize = 20
96 | l2fontsize = 30
97 | l1fontsize = 40
98 | l3xoffset = -20
99 | l3yoffset = 0
100 | l2xoffset = -20
101 | l2yoffset = 0
102 | l1xoffset = -20
103 | l1yoffset = 0
104 | brushr = 0.5
105 | brushg = 0.2
106 | brushb = 0.7
107 | showmenu = 0
108 | fontL = loadFont("Play", l1fontsize)
109 | rr = 8
110 | rx, ry = getResolution()
111 | cx1, cy1 = rx/rr, ry/rr
112 | mem1 = {}
113 | mem2 = {}
114 | mem3 = {}
115 | charset = "0123456789ABCDEF"
116 | for ix=1,cx1 do
117 | mem1[ix] = {}
118 | for iy=1,cy1 do
119 | mem1[ix][iy] = 0
120 | end
121 | end
122 | for ix2=1,cx1 do
123 | mem2[ix2] = {}
124 | for iy2=1,cy1 do
125 | mem2[ix2][iy2] = 0
126 | end
127 | end
128 | for ix3=1,cx1 do
129 | mem3[ix3] = {}
130 | for iy3=1,cy1 do
131 | mem3[ix3][iy3] = 0
132 | end
133 | end
134 | maxcost = getRenderCostMax()
135 | local r, g, b = 0.5, 0.5, 0.5
136 |
137 | sliderRed = Slider:new(rx*0.8, ry*0.2, 16, ry*0.6, 0, 1, r, "Red")
138 | sliderRed.color = { 1, 0, 0}
139 | sliderGreen = Slider:new(rx*0.85, ry*0.2, 16, ry*0.6, 0, 1, g, "Green")
140 | sliderGreen.color = { 0, 1, 0}
141 | sliderBlue = Slider:new(rx*0.9, ry*0.2, 16, ry*0.6, 0, 1, b, "Blue")
142 | sliderBlue.color = { 0, 0, 1}
143 |
144 | init = true
145 | end
146 |
147 |
148 | fontL = loadFont("Play", l1fontsize)
149 | layer1 = createLayer()
150 | layer2 = createLayer()
151 | cursorx, cursory = getCursor()
152 | curx2 = math.floor(cursorx/rr)
153 | cury2 = math.floor(cursory/rr)
154 |
155 | function DrawAllPixelsL1()
156 | local lm1, lm2, lm3, rr = mem1, mem2, mem3, rr
157 | local sNFC, aB = setNextFillColor, addBox
158 | for bx=1,cx1 do
159 | currcost = getRenderCost()
160 | if currcost < (maxcost*0.9) then
161 | for by=1,cy1 do
162 | sNFC(layer1, mem1[bx][by], mem2[bx][by], mem3[bx][by], 1)
163 | aB(layer1, bx*rr, by*rr, rr,rr)
164 | end
165 | end
166 | end
167 | end
168 |
169 | function DrawUI()
170 | if showmenu == 1 then
171 | sliderRed:draw(layer2)
172 | sliderGreen:draw(layer2)
173 | sliderBlue:draw(layer2)
174 | brushr = sliderRed.ratio
175 | brushg = sliderGreen.ratio
176 | brushb = sliderBlue.ratio
177 |
178 | setNextStrokeWidth(layer2, 5)
179 | setNextStrokeColor(layer2, 1, 0, 0, 1)
180 | setNextFillColor(layer2, 0.5,0.5,0.5, 1)
181 | addBox(layer2, rx*0.875, ry*0.08, rx*0.04, ry*0.06)
182 |
183 | if cursorx > rx*0.875 and cursorx < (rx*0.875)+(rx*0.04) then
184 | if cursory > ry*0.08 and cursory < (ry*0.08)+(ry*0.06) then
185 | setNextStrokeWidth(layer2, 5)
186 | setNextStrokeColor(layer2, 1, 0, 0, 1)
187 | setNextFillColor(layer2, 1,0.5,0.5, 1)
188 | addBox(layer2, rx*0.875, ry*0.08, rx*0.04, ry*0.06)
189 | if getCursorDown() then
190 | showmenu = 0
191 | end
192 | end
193 | end
194 | else
195 | setNextFillColor(layer2, brushr, brushg, brushb, 1)
196 | addBox(layer2, 0, ry - 20, rx, 20)
197 | if getCursorDown() then
198 | if curx2 > 0 and cury2 > 0 then
199 | if curx2 < rx and cury2 < ry then
200 | if cursory < ry and cursory > (ry - 20) then
201 | showmenu = 1
202 | else
203 | mem1[curx2][cury2] = brushr
204 | mem2[curx2][cury2] = brushg
205 | mem3[curx2][cury2] = brushb
206 | end
207 | end
208 | end
209 | end
210 | end
211 | end
212 |
213 | DrawAllPixelsL1()
214 | DrawUI()
215 |
216 | requestAnimationFrame(1)
--------------------------------------------------------------------------------
/Telemeter Landing Visualizer/PB-main.txt:
--------------------------------------------------------------------------------
1 | {"slots":{"0":{"name":"Telemeter1","type":{"events":[],"methods":[]}},"1":{"name":"Screen","type":{"events":[],"methods":[]}},"2":{"name":"Telemeter2","type":{"events":[],"methods":[]}},"3":{"name":"Telemeter3","type":{"events":[],"methods":[]}},"4":{"name":"Telemeter4","type":{"events":[],"methods":[]}},"5":{"name":"ExternalPBSwitch","type":{"events":[],"methods":[]}},"6":{"name":"slot7","type":{"events":[],"methods":[]}},"7":{"name":"slot8","type":{"events":[],"methods":[]}},"8":{"name":"slot9","type":{"events":[],"methods":[]}},"9":{"name":"slot10","type":{"events":[],"methods":[]}},"-1":{"name":"unit","type":{"events":[],"methods":[]}},"-3":{"name":"player","type":{"events":[],"methods":[]}},"-2":{"name":"construct","type":{"events":[],"methods":[]}},"-4":{"name":"system","type":{"events":[],"methods":[]}},"-5":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"local messagereceived = message\n--Screen.setScriptInput(messagerecieved)\ndatapoints[1][1] = string.sub(messagereceived,1,string.find(messagereceived, \",\") - 1)\nlocal newstr = string.sub(messagereceived,string.find(messagereceived, \",\") + 1, string.len(messagereceived))\ndatapoints[1][2] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[1][3] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[2][1] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[2][2] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[2][3] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[3][1] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[3][2] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[3][3] = newstr\n\n\n","filter":{"args":[{"value":"telemeter1"},{"variable":"*"}],"signature":"onReceived(channel,message)","slotKey":"0"},"key":"0"},{"code":"local messagereceived = message\n--Screen.setScriptInput(messagerecieved)\ndatapoints[4][1] = string.sub(messagereceived,1,string.find(messagereceived, \",\") - 1)\nlocal newstr = string.sub(messagereceived,string.find(messagereceived, \",\") + 1, string.len(messagereceived))\ndatapoints[4][2] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[4][3] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[5][1] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[5][2] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[5][3] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[6][1] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[6][2] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[6][3] = newstr","filter":{"args":[{"value":"telemeter2"},{"variable":"*"}],"signature":"onReceived(channel,message)","slotKey":"2"},"key":"1"},{"code":"local messagereceived = message\n--Screen.setScriptInput(messagerecieved)\ndatapoints[1][4] = string.sub(messagereceived,1,string.find(messagereceived, \",\") - 1)\nlocal newstr = string.sub(messagereceived,string.find(messagereceived, \",\") + 1, string.len(messagereceived))\ndatapoints[1][5] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[1][6] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[2][4] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[2][5] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[2][6] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[3][4] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[3][5] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[3][6] = newstr","filter":{"args":[{"value":"telemeter3"},{"variable":"*"}],"signature":"onReceived(channel,message)","slotKey":"3"},"key":"2"},{"code":"local messagereceived = message\n--Screen.setScriptInput(messagerecieved)\ndatapoints[4][4] = string.sub(messagereceived,1,string.find(messagereceived, \",\") - 1)\nlocal newstr = string.sub(messagereceived,string.find(messagereceived, \",\") + 1, string.len(messagereceived))\ndatapoints[4][5] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[4][6] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[5][4] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[5][5] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[5][6] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[6][4] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[6][5] = string.sub(newstr,1,string.find(newstr, \",\") - 1)\nlocal newstr = string.sub(newstr,string.find(newstr, \",\") + 1, string.len(newstr))\ndatapoints[6][6] = newstr","filter":{"args":[{"value":"telemeter4"},{"variable":"*"}],"signature":"onReceived(channel,message)","slotKey":"4"},"key":"3"},{"code":"datapoints = {}\nfor aa=1,6 do\n datapoints[aa] = {}\n for ab=1,6 do\n datapoints[aa][ab] = 0\n end\nend\n\nfunction round(num, numDecimalPlaces)\n local mult = 10^(numDecimalPlaces or 0)\n return math.floor(num * mult + 0.5) / mult\nend\n\nExternalPBSwitch.activate()\nunit.setTimer(\"screen\",1/20)","filter":{"args":[],"signature":"onStart()","slotKey":"-1"},"key":"4"},{"code":"local tempstring = \"\"\nfor sa=1,6 do\n for sb=1,6 do\n if datapoints[sa][sb] == \"-1.0\" or datapoints[sa][sb] == \" -1.0\" then\n datapoints[sa][sb] = \"100\"\n end\n tempstring = tempstring .. tostring(round(datapoints[sa][sb], 3)) .. \",\"\n end\nend\ncollectgarbage(\"collect\")\nScreen.setScriptInput(tempstring)","filter":{"args":[{"value":"screen"}],"signature":"onTimer(tag)","slotKey":"-1"},"key":"5"},{"code":"ExternalPBSwitch.deactivate()","filter":{"args":[],"signature":"onStop()","slotKey":"-1"},"key":"6"}],"methods":[],"events":[]}
--------------------------------------------------------------------------------
/Databank Key Viewer/DB Key Viewer - renderscript.txt:
--------------------------------------------------------------------------------
1 | json = require("dkjson")
2 | if not init then
3 | init = true
4 | imagebg = 1
5 | passwordstring = ""
6 | displaystringdefault = "NO KEYS FOUND"
7 | displaystringkey = ""
8 | displaystringvalue = ""
9 | lastinput = ""
10 | valuetable = ""
11 | drawposx = 50
12 | drawposy = 50
13 | scrollpos = 0
14 | color1R, color1G, color1B, color1A = 0, 0, 0, 0.85 --background
15 | color2R, color2G, color2B, color2A = 0.1, 0.1, 0.1, 0.5 --button BG
16 | color3R, color3G, color3B, color3A = 0.5, 0.3, 0.1, 0.5 --button border
17 | color4R, color4G, color4B, color4A = 0.5, 0.3, 0.1, 0.5 --button BG hover
18 | color5R, color5G, color5B, color5A = 0.9, 0.7, 0.1, 0.5 --button BG click
19 | color6R, color6G, color6B, color6A = 1, 1, 1, 0.75 --button text
20 |
21 | color7R, color7G, color7B, color7A = 0.15, 0.15, 0.15, 1 --scrollbar BG
22 | --color8R, color8G, color8B, color8A = 0.25, 0.75, 0.25, 0.15 --scrollbar grabber BG
23 | --color9R, color9G, color9B, color9A = 1, 1, 1, 0.75 --scrollbar grabber border
24 |
25 |
26 | color10R, color10G, color10B, color10A = 0.05, 0.05, 0.05, 1 --UI Panel BG
27 | color11R, color11G, color11B, color11A = 1, 1, 0, 1 --Data Value Text
28 | end
29 | local layer = createLayer() -- Main Background
30 | local layer4 = createLayer() -- key value text
31 | local layer5 = createLayer() -- UI
32 | local rx, ry = getResolution()
33 | local fontL = loadFont("Play", 110)
34 | local fontH = loadFont("Play", 100)
35 | local fontB = loadFont("Play", 60)
36 | local fontM = loadFont("Play", 40)
37 | local fontS = loadFont("Play", 20)
38 | local curx, cury = getCursor()
39 | local scriptinput = ""
40 | drawposx = 50
41 | drawposy = 50
42 |
43 | setNextFillColor(layer, color1R, color1G, color1B, 1)
44 | addBox(layer,0,0,rx,ry)
45 |
46 | if getInput() then
47 | scriptinput = getInput()
48 | --process PB input
49 | if string.sub(scriptinput,0,4) == "KEY:" then
50 | displaystringkey = string.sub(scriptinput,5,string.len(scriptinput))
51 | setOutput("KEYOK")
52 | else
53 | if string.sub(scriptinput,0,4) == "VAL:" then
54 | scriptinput = string.sub(scriptinput,5,string.len(scriptinput))
55 | valuetable = scriptinput
56 | setOutput("VALOK")
57 | end
58 | end
59 | lastinput = scriptinput
60 | end
61 |
62 | function DrawKeypadButton(btnx, btny, btnw, btnh, btntxt)
63 | setNextFillColor(layer5, color2R, color2G, color2B, color2A)
64 | if curx > btnx then
65 | if curx < btnx+btnw then
66 | if cury > btny then
67 | if cury < (btny+btnh) then
68 | if getCursorReleased() == true then
69 | setNextFillColor(layer5, color5R, color5G, color5B, color5A)
70 | setOutput(btntxt)
71 | else
72 | setNextFillColor(layer5, color4R, color4G, color4B, color4A)
73 | end
74 | end
75 | end
76 | end
77 | end
78 | setNextStrokeColor(layer5, color3R, color3G, color3B, color3A)
79 | setNextStrokeWidth(layer5, 5)
80 | addBoxRounded(layer5, btnx, btny, btnw, btnh, 5)
81 | setNextFillColor(layer5, color6R, color6G, color6B, color6A)
82 | addText(layer5, fontM, btntxt, btnx + (rx*0.015), btny + (ry*0.0625))
83 | end
84 |
85 | function DrawScrollBar(btnx, btny, btnw, btnh)
86 | setNextFillColor(layer5, color7R, color7G, color7B, color7A)
87 | addBox(layer5, btnx, btny, btnw, btnh)
88 | setNextFillColor(layer5, color2R, color2G, color2B, color2A)
89 | if curx > btnx then
90 | if curx < (btnx + btnw) then
91 | if cury > btny then
92 | if cury < (btny + btnh) then
93 | if getCursorDown() == true then
94 | --drag scrollbar
95 | setNextFillColor(layer5, color5R, color5G, color5B, color5A)
96 | scrollpos = ((cury - btny) / btnh) * 2048
97 | else
98 | setNextFillColor(layer5, color4R, color4G, color4B, color4A)
99 | end
100 | end
101 | end
102 | end
103 | end
104 | setNextStrokeColor(layer5, color3R, color3G, color3B, color3A)
105 | setNextStrokeWidth(layer5, 5)
106 | addBox(layer5, btnx, (((scrollpos/2048) * btnh) ), btnw, rx*0.025)
107 | end
108 |
109 | function DrawInterface()
110 | --Control bar, bottom
111 | setNextFillColor(layer5, color10R, color10G, color10B, color10A)
112 | addBox(layer5, 0, ry*0.8, rx, ry*0.2)
113 |
114 | DrawKeypadButton(rx*0.05,ry*0.8, rx*0.045, ry*0.08,"<")
115 | DrawKeypadButton(rx*0.75,ry*0.8, rx*0.045, ry*0.08,">")
116 |
117 | addText(layer5, fontM, displaystringkey, rx*0.1 + 15, ry*0.815 + 35)
118 | end
119 |
120 | function decodeJson(json)
121 | local tempstring = string.sub(json, 2, string.len(json) - 1)
122 | local tempchar = string.sub(json, 1, 1)
123 | local charsleft = 0
124 | local namebuffer = ""
125 | local isname = 0
126 | local valuebuffer = ""
127 | local isvalue = 0
128 | repeat
129 | tempchar = string.sub(tempstring, 1, 1)
130 | tempstring = string.sub(tempstring, 2, string.len(tempstring))
131 | charsleft = string.len(tempstring)
132 | if tempchar == "{" then
133 | --increase indentation
134 | drawposx = drawposx + 25
135 | drawposy = drawposy + 20
136 | namebuffer = ""
137 | valuebuffer = ""
138 | end
139 | if tempchar == "}" then
140 | --increase indentation
141 | drawposx = drawposx - 25
142 | end
143 | if tempchar == "]" then
144 | --stop accumulating chars in buffer and print
145 | isname = 0
146 | setNextFillColor(layer4, color11R, color11G, color11B, color11A)
147 | addText(layer4, fontS, namebuffer, drawposx, drawposy - scrollpos)
148 | --drawposy = drawposy + 20
149 | namebuffer = ""
150 | end
151 | if isname == 1 then
152 | --accumulate chars in buffer
153 | namebuffer = namebuffer .. tempchar
154 | end
155 | if tempchar == "[" then
156 | --accumulate chars in buffer until the end of the name is reached
157 | isname = 1
158 | end
159 | if tempchar == "," and isvalue == 1 then
160 | --stop accumulating chars in buffer and print
161 | isvalue = 0
162 | setNextFillColor(layer4, color11R, color11G, color11B, color11A)
163 | addText(layer4, fontS, valuebuffer, drawposx + 175, drawposy - scrollpos)
164 | drawposy = drawposy + 20
165 | valuebuffer = ""
166 | end
167 | if tempchar == "{" and isvalue == 1 then
168 | --stop accumulating chars in buffer and print
169 | isvalue = 0
170 | valuebuffer = ""
171 | end
172 | if isvalue == 1 then
173 | --accumulate chars in buffer
174 | valuebuffer = valuebuffer .. tempchar
175 | end
176 | if tempchar == "=" then
177 | --accumulate chars in buffer until the end of the value is reached
178 | isvalue = 1
179 | end
180 | until(charsleft == 0)
181 | end
182 |
183 | --draw key value
184 | decodeJson(valuetable)
185 |
186 | --draw UI
187 | DrawScrollBar(rx*0.9,0,rx*0.1,ry*0.8)
188 | DrawInterface()
189 |
190 | requestAnimationFrame(1)
--------------------------------------------------------------------------------
/Simple Game Skeleton/remote controller.txt:
--------------------------------------------------------------------------------
1 | {"slots":{"0":{"name":"Screen","type":{"events":[],"methods":[]}},"1":{"name":"Databank","type":{"events":[],"methods":[]}},"2":{"name":"slot3","type":{"events":[],"methods":[]}},"3":{"name":"slot4","type":{"events":[],"methods":[]}},"4":{"name":"slot5","type":{"events":[],"methods":[]}},"5":{"name":"Screen2","type":{"events":[],"methods":[]}},"6":{"name":"Screen","type":{"events":[],"methods":[]}},"7":{"name":"slot8","type":{"events":[],"methods":[]}},"8":{"name":"slot9","type":{"events":[],"methods":[]}},"9":{"name":"slot10","type":{"events":[],"methods":[]}},"-1":{"name":"unit","type":{"events":[],"methods":[]}},"-3":{"name":"player","type":{"events":[],"methods":[]}},"-2":{"name":"construct","type":{"events":[],"methods":[]}},"-4":{"name":"system","type":{"events":[],"methods":[]}},"-5":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"screeninput = Screen.getScriptOutput()\nscreenoutput = controlleractive .. \",\" .. forward .. \",\" .. backward .. \",\" .. left .. \",\" .. right .. \",\" .. fire .. \",\"\n--system.print(screenoutput)\nif screeninput == lastscreeninput then\n \nelse\n if string.sub(screeninput,1,9) == \"NEWSCORE:\" then\n local newscore = string.sub(screeninput,10,string.len(screeninput))\n local scorekeys = Databank.getKeyList()\n local placed = 0\n for si=1,10 do\n if placed == 0 then\n compscore = Databank.getStringValue(tostring(si))\n if compscore ~= nil and compscore ~= \"\" then\n local scorecomponent = string.sub(compscore,string.find(compscore, \":\")+1,string.len(compscore))\n if tonumber(newscore) > tonumber(scorecomponent) then\n for ri=si,10 do\n local shiftkey = Databank.getStringValue(tostring(11 - ri))\n if shiftkey ~= nil and shiftkey ~= \"\" then\n Databank.setStringValue((11 - ri)+1, shiftkey)\n end\n end\n system.print(\"SAVED New High Score\")\n Databank.setStringValue(si, playername..\":\"..tostring(newscore))\n placed = 1\n end\n else\n system.print(\"SAVED New High Score\")\n Databank.setStringValue(si, playername..\":\"..tostring(newscore))\n placed = 1\n end\n end\n end\n end\n if string.sub(screeninput,1,9) == \"GETSCORES\" then\n listscores = 1\n scoreindex = 0\n end\n if string.sub(screeninput,1,6) == \"LIGHT:\" then\n local lightstring = string.sub(screeninput,7,string.len(screeninput))\n lightr = string.sub(lightstring,1,string.find(lightstring, \":\") - 1)\n lightstring = string.sub(lightstring,string.find(lightstring, \":\")+1,string.len(lightstring))\n lightg = string.sub(lightstring,1,string.find(lightstring, \":\") - 1)\n lightstring = string.sub(lightstring,string.find(lightstring, \":\")+1,string.len(lightstring))\n lightb = lightstring\n slot3.setColor(lightr, lightg, lightb)\n slot4.setColor(lightr, lightg, lightb)\n slot5.setColor(lightr, lightg, lightb)\n end\n lastscreeninput = screeninput\nend\nif listscores == 1 then\n if scoreindex < 9 then\n scoreindex = scoreindex + 1\n local returnscore = Databank.getStringValue(scoreindex)\n screenoutput = \"HIGHSCORE\"..scoreindex..\":\"..returnscore\n else\n listscores = 0\n end\nend\nScreen.setScriptInput(screenoutput)","filter":{"args":[{"value":"screen"}],"signature":"onTimer(tag)","slotKey":"-1"},"key":"0"},{"code":"\nlocal screencontent1 = [[if not init then\n highscores = {}\n for bb1=1,10 do\n highscores[bb1] = {}\n for bv1=1,2 do\n highscores[bb1][bv1] = \"\"\n end\n end]]\nlocal screencontent2 = [[]]\nlocal screencontent3 = [[ images = {}\n for ig1=1,2 do\n images[ig1] = \"\"\n end\n images[1] = \"assets.prod.novaquark.com/66839/23968750-1ea6-47cb-a1b1-e665cf6d03fd.png\"\n images[2] = \"\"\n init = true\nend\nfont1 = loadFont(\"Montserrat-Light\", 15)\nlayer1 = createLayer()\nlayer2 = createLayer()\nrx, ry = getResolution()\ncx, cy = getCursor()\ncd = getCursorDown()\ncp = getCursorPressed()\ncr = getCursorReleased()\nscriptoutput = \"\"\nlocal titleimage = loadImage(images[1])\nfont2 = loadFont(\"Play-Bold\",75)\nfont1 = loadFont(\"Play\",25)\naddImage(layer1,titleimage,0,0,rx,ry)\nsetNextShadow(layer1,15,0,0,0,1)\nsetNextFillColor(layer1,1,0.8,0,1)\naddText(layer1,font2,\"UNIVERSE INVADERS\",150,75)\nsetNextShadow(layer1,15,0,0,0,1)\nsetNextFillColor(layer1,1,0.8,0,1)\naddText(layer1,font2,\"LEADERBOARD\",245,150)\nsetNextShadow(layer1,15,0,0,0,1)\nsetNextFillColor(layer1,0,0,0,0.7)\naddBoxRounded(layer1,50,50,rx - 100,ry - 100,15)\nfor ix1=1,9 do\n setNextShadow(layer1,5,0,0,0,1)\n setNextFillColor(layer1,1,0.6,0,1)\n addText(layer1,font1,\"#\"..ix1..\":\",350,(35*ix1)+200)\nend\nfor ix1=1,9 do\n setNextShadow(layer1,5,0,0,0,1)\n setNextFillColor(layer1,1,0.6,0,1)\n addText(layer1,font1,highscores[ix1][1]..\" - \"..highscores[ix1][2],450,(35*ix1)+200)\nend\n]]\n\nfor scores=1,9 do\n local keyscore = Databank.getStringValue(scores)\n local keyname = string.sub(keyscore,0,string.find(keyscore,\":\")-1)\n local keyvalue = string.sub(keyscore,string.find(keyscore,\":\")+1,string.len(keyscore))\n local addscore = [[\n highscores[]]..scores..[[][1] = \"]]..keyname..[[\"\n highscores[]]..scores..[[][2] = \"]]..keyvalue..[[\"]]\n screencontent2 = screencontent2 .. addscore\nend\n\nScreen2.setRenderScript(screencontent1 .. screencontent2 .. screencontent3)","filter":{"args":[{"value":"screen2"}],"signature":"onTimer(tag)","slotKey":"-1"},"key":"1"},{"code":"player.freeze(true)\nsystem.showHelper(false)\nScreen.activate()\nplayername = player.getName()\nplayerid = player.getId()\nlightr = 0.35\nlightg = 1\nlightb = 0.15\ncontrolleractive = 1\nforward = 0\nleft = 0\nright = 0\nbackward = 0\nfire = 0\nscreenoutput = \"\"\nscreeninput = \"\"\nlastscreeninput = \"\"\ncompscore = 0\nlistscores = 0\nscoreindex = 0\nunit.setTimer(\"screen\",1/30)\nunit.setTimer(\"screen2\",1/20)\nslot3.setColor(lightr, lightg, lightb)\nslot4.setColor(lightr, lightg, lightb)\nslot5.setColor(lightr, lightg, lightb)","filter":{"args":[],"signature":"onStart()","slotKey":"-4"},"key":"2"},{"code":"forward = 1","filter":{"args":[{"value":"forward"}],"signature":"actionStart(action)","slotKey":"-4"},"key":"3"},{"code":"forward = 0","filter":{"args":[{"value":"forward"}],"signature":"actionStop(action)","slotKey":"-4"},"key":"4"},{"code":"fire = 1","filter":{"args":[{"value":"up"}],"signature":"onActionStart(action)","slotKey":"-4"},"key":"5"},{"code":"fire = 0","filter":{"args":[{"value":"up"}],"signature":"onActionStop(action)","slotKey":"-4"},"key":"6"},{"code":"left = 1","filter":{"args":[{"value":"yawleft"}],"signature":"onActionStart(action)","slotKey":"-4"},"key":"7"},{"code":"left = 0","filter":{"args":[{"value":"yawleft"}],"signature":"onActionStop(action)","slotKey":"-4"},"key":"8"},{"code":"right = 1","filter":{"args":[{"value":"yawright"}],"signature":"onActionStart(action)","slotKey":"-4"},"key":"9"},{"code":"right = 0","filter":{"args":[{"value":"yawright"}],"signature":"onActionStop(action)","slotKey":"-4"},"key":"10"},{"code":"backward = 1","filter":{"args":[{"value":"backward"}],"signature":"onActionStart(action)","slotKey":"-4"},"key":"11"},{"code":"backward = 0","filter":{"args":[{"value":"backward"}],"signature":"onActionStop(action)","slotKey":"-4"},"key":"12"},{"code":"controlleractive = 0\nforward = 0\nleft = 0\nright = 0\nbackward = 0\nfire = 0\nscreenoutput = controlleractive .. \",\" .. forward .. \",\" .. backward .. \",\" .. left .. \",\" .. right .. \",\" .. fire .. \",\"\nScreen.setScriptInput(screenoutput)\nScreen.deactivate()\nScreen.activate()\nslot3.setColor(lightr, lightg, lightb)\nslot4.setColor(lightr, lightg, lightb)\nslot5.setColor(lightr, lightg, lightb)\nplayer.freeze(false)","filter":{"args":[],"signature":"onStop()","slotKey":"-4"},"key":"13"}],"methods":[],"events":[]}
--------------------------------------------------------------------------------
/Door Control/Door Control - renderscript.txt:
--------------------------------------------------------------------------------
1 | if not init then
2 | init = true
3 | passwordstring = ""
4 | displaystringdefault = "[ENTER ACCESS CODE]"
5 | displaystring = ""
6 | displayswitchtimer = 0
7 | displayswitchtimerbase = 120
8 | displaycolorR, displaycolor8G, displaycolorB, displaycolorA = 1, 1, 1, 0.75
9 | end
10 | local layer = createLayer() -- Main Background
11 | local layer4 = createLayer() -- keypad boxes
12 | local layer5 = createLayer() -- rotated text
13 | local rx, ry = getResolution()
14 | local fontL = loadFont("Play", 110)
15 | local fontH = loadFont("Play", 100)
16 | local fontB = loadFont("Play", 60)
17 | local fontM = loadFont("Play", 40)
18 | local fontS = loadFont("Play", 20)
19 | local color1R, color1G, color1B, color1A = 1, 1, 1, 0.0 --button background
20 | local color2R, color2G, color2B, color2A = 0, 0.75, 0, 0.5 --button border
21 | local color3R, color3G, color3B, color3A = 1, 1, 1, 1 --text
22 | local color4R, color4G, color4B, color4A = 1, 1, 1, 0.5 --button hover
23 | local color5R, color5G, color5B, color5A = 1, 0.15, 0.15, 1 --input deny
24 | local color6R, color6G, color6B, color6A = 0.15, 1, 0.15, 1 --input accept
25 | local color7R, color7G, color7B, color7A = 0.25, 0.75, 0.25, 0.5 --button click
26 | local color8R, color8G, color8B, color8A = 1, 1, 1, 0.75 --display text
27 | local curx, cury = getCursor()
28 | local scriptinput = ""
29 |
30 | setNextFillColor(layer, 0.0, 0, 0, 1)
31 | addBox(layer,0,0,rx,ry)
32 | logMessage(displayswitchtimer)
33 | if getInput() then
34 | scriptinput = getInput()
35 | if scriptinput == "0" then
36 | displaycolorR = 1
37 | displaycolorG = 0
38 | displaycolorB = 0
39 | displaycolorA = 0.75
40 | displaystring = "[ACCESS DENIED]"
41 | displayswitchtimer = displayswitchtimerbase
42 | end
43 | if scriptinput == "1" then
44 | displaycolorR = 0
45 | displaycolorG = 1
46 | displaycolorB = 0
47 | displaycolorA = 0.75
48 | displaystring = "[ACCESS GRANTED]"
49 | displayswitchtimer = displayswitchtimerbase
50 | end
51 | end
52 |
53 | if displayswitchtimer > 0 then
54 | displayswitchtimer = displayswitchtimer - 1
55 | end
56 | if displayswitchtimer == 0 then
57 | displaycolorR = 1
58 | displaycolorG = 1
59 | displaycolorB = 1
60 | displaycolorA = 0.75
61 | displaystring = displaystringdefault
62 | end
63 |
64 | function DrawKeypadSendButton(btnx, btny, btnw, btnh, btntxt)
65 | setNextFillColor(layer4, color1R, color1G, color1B, color1A)
66 | if curx > btnx then
67 | if curx < btnx+btnw then
68 | if cury > btny then
69 | if cury < (btny+btnh) then
70 | if getCursorReleased() == true then
71 | setNextFillColor(layer4, color7R, color7G, color7B, color7A)
72 | setOutput(passwordstring)
73 | passwordstring = ""
74 | else
75 | setNextFillColor(layer4, color4R, color4G, color4B, color4A)
76 | end
77 | end
78 | end
79 | end
80 | end
81 | setNextStrokeColor(layer4, color2R, color2G, color2B, color2A)
82 | setNextStrokeWidth(layer4, 5)
83 | addBoxRounded(layer4, btnx, btny, btnw, btnh, 5)
84 | --setNextFillColor(layer5, 0.35, 0, 0, 1)
85 | --addText(layer5, fontM, btntxt, btnx + (rx*0.015), btny + (ry*0.15))
86 | end
87 |
88 | function DrawKeypadButton(btnx, btny, btnw, btnh, btntxt)
89 | setNextFillColor(layer4, color1R, color1G, color1B, color1A)
90 | if curx > btnx then
91 | if curx < btnx+btnw then
92 | if cury > btny then
93 | if cury < (btny+btnh) then
94 | if getCursorReleased() == true then
95 | if string.len(passwordstring) < 4 then
96 | setNextFillColor(layer4, color7R, color7G, color7B, color7A)
97 | passwordstring = passwordstring .. btntxt
98 | else
99 | setNextFillColor(layer4, color7R, color7G, color7B, color7A)
100 | end
101 | else
102 | setNextFillColor(layer4, color4R, color4G, color4B, color4A)
103 | end
104 | end
105 | end
106 | end
107 | end
108 | setNextStrokeColor(layer4, color2R, color2G, color2B, color2A)
109 | setNextStrokeWidth(layer4, 5)
110 | addBoxRounded(layer4, btnx, btny, btnw, btnh, 5)
111 | --setNextFillColor(layer5, 0.35, 0, 0, 1)
112 | --addText(layer5, fontL, btntxt, btnx + (rx*0.015), btny + (ry*0.15))
113 | end
114 |
115 | function DrawKeypadText(btnx, btny, btnw, btnh, btntxt)
116 | setNextFillColor(layer5, color3R, color3G, color3B, color3A)
117 | addText(layer5, fontL, btntxt, btnx + (rx*0.015), btny + (ry*0.15))
118 | end
119 |
120 | function DrawKeypadSendText(btnx, btny, btnw, btnh, btntxt)
121 | setNextFillColor(layer5, color3R, color3G, color3B, color3A)
122 | addText(layer5, fontB, btntxt, btnx + (rx*0.015), btny + (ry*0.15))
123 | end
124 |
125 | function DrawInputText(rx, ry)
126 | if string.len(passwordstring) < 4 then
127 | setNextFillColor(layer5, color5R, color5G, color5B, color5A)
128 | addText(layer5, fontL, passwordstring, rx*0.15, ry*0.35)
129 | end
130 | if string.len(passwordstring) == 4 then
131 | setNextFillColor(layer5, color6R, color6G, color6B, color6A)
132 | addText(layer5, fontL, passwordstring, rx*0.15, ry*0.35)
133 | end
134 | end
135 |
136 | function DrawDisplayText(rx, ry)
137 | setNextFillColor(layer5, displaycolorR, displaycolorG, displaycolorB, displaycolorA)
138 | addText(layer5, fontM, displaystring, rx*0.095, ry*0.15)
139 | end
140 |
141 | function DrawDisplayLines(rx, ry)
142 | setNextFillColor(layer5, color8R, color8G, color8B, color8A)
143 | addLine(layer5, 0, ry*0.175, rx*1, ry*0.175)
144 | setNextFillColor(layer5, color8R, color8G, color8B, color8A)
145 | addLine(layer5, 0, ry*0.215, rx*0.42, ry*0.215)
146 | setNextFillColor(layer5, color8R, color8G, color8B, color8A)
147 | addLine(layer5, rx*0.13, ry*0.36, rx*1, ry*0.36)
148 | end
149 |
150 | --draw keypad buttons
151 | DrawKeypadButton(rx*0.3,ry*0.6, rx*0.1, ry*0.17,"1")
152 | DrawKeypadButton(rx*0.3,ry*0.4, rx*0.1, ry*0.17,"2")
153 | DrawKeypadButton(rx*0.3,ry*0.2, rx*0.1, ry*0.17,"3")
154 |
155 | DrawKeypadButton(rx*0.425,ry*0.6, rx*0.1, ry*0.17,"4")
156 | DrawKeypadButton(rx*0.425,ry*0.4, rx*0.1, ry*0.17,"5")
157 | DrawKeypadButton(rx*0.425,ry*0.2, rx*0.1, ry*0.17,"6")
158 |
159 | DrawKeypadButton(rx*0.55,ry*0.6, rx*0.1, ry*0.17,"7")
160 | DrawKeypadButton(rx*0.55,ry*0.4, rx*0.1, ry*0.17,"8")
161 | DrawKeypadButton(rx*0.55,ry*0.2, rx*0.1, ry*0.17,"9")
162 |
163 | DrawKeypadButton(rx*0.675,ry*0.6, rx*0.1, ry*0.17,"0")
164 | DrawKeypadSendButton(rx*0.675,ry*0.2, rx*0.1, ry*0.37,"send")
165 |
166 |
167 | --placeholder input text
168 |
169 | DrawDisplayText(rx, ry)
170 | DrawDisplayLines(rx, ry)
171 | DrawInputText(rx, ry)
172 |
173 | --draw keypad text
174 | DrawKeypadText(rx*0.13,ry*0.52, rx*0.1, ry*0.17,"1")
175 | DrawKeypadText(rx*0.245, ry*0.52, rx*0.1, ry*0.17,"2")
176 | DrawKeypadText(rx*0.365, ry*0.52, rx*0.1, ry*0.17,"3")
177 | DrawKeypadText(rx*0.13, ry*0.73, rx*0.1, ry*0.17,"4")
178 | DrawKeypadText(rx*0.245, ry*0.73, rx*0.1, ry*0.17,"5")
179 | DrawKeypadText(rx*0.365, ry*0.73, rx*0.1, ry*0.17,"6")
180 | DrawKeypadText(rx*0.13, ry*0.93, rx*0.1, ry*0.17,"7")
181 | DrawKeypadText(rx*0.245, ry*0.93, rx*0.1, ry*0.17,"8")
182 | DrawKeypadText(rx*0.365, ry*0.93, rx*0.1, ry*0.17,"9")
183 | DrawKeypadText(rx*0.13, ry*1.13, rx*0.1, ry*0.17,"0")
184 | DrawKeypadSendText(rx*0.245, ry*1.13, rx*0.23, ry*0.17,"send")
185 |
186 |
187 | --rotate text layer
188 | setLayerRotation(layer5,(3.14*0.75)*2)
189 | setLayerTranslation(layer5,-10,600)
190 |
191 | requestAnimationFrame(1)
--------------------------------------------------------------------------------
/Matrix Code Rain/MatrixCodeRain - Renderscript.txt:
--------------------------------------------------------------------------------
1 | function randomString(length)
2 | if not length or length <= 0 then return '' end
3 | local rand1 = math.random(#charset)
4 | return string.sub(charset, rand1, rand1)
5 | end
6 |
7 | if not init then
8 | l3fontsize = 40
9 | l2fontsize = 30
10 | l1fontsize = 20
11 | l3xoffset = -20
12 | l3yoffset = 0
13 | l2xoffset = -20
14 | l2yoffset = 0
15 | l1xoffset = -20
16 | l1yoffset = 0
17 | fontL = loadFont("Play", l1fontsize)
18 | fontM = loadFont("Play", l2fontsize)
19 | fontS = loadFont("Play", l3fontsize)
20 | rx, ry = getResolution()
21 | cx1, cy1 = rx/l1fontsize, ry/l1fontsize
22 | cx2, cy2 = rx/l2fontsize, ry/l2fontsize
23 | cx3, cy3 = rx/l3fontsize, ry/l3fontsize
24 | mem1 = {}
25 | mem2 = {}
26 | mem3 = {}
27 | charset = "0123456789ABCDEF"
28 | for ix=1,cx1 do
29 | mem1[ix] = {}
30 | for iy=1,cy1 do
31 | mem1[ix][iy] = {}
32 | for iz=1,2 do
33 | if iz == 1 then
34 | mem1[ix][iy][iz] = randomString(1)
35 | else
36 | mem1[ix][iy][iz] = 1
37 | end
38 | end
39 | end
40 | end
41 | for jx=1,cx2 do
42 | mem2[jx] = {}
43 | for jy=1,cy2 do
44 | mem2[jx][jy] = {}
45 | for jz=1,2 do
46 | if jz == 1 then
47 | mem2[jx][jy][jz] = randomString(1)
48 | else
49 | mem2[jx][jy][jz] = 1
50 | end
51 | end
52 | end
53 | end
54 | for kx=1,cx3 do
55 | mem3[kx] = {}
56 | for ky=1,cy3 do
57 | mem3[kx][ky] = {}
58 | for kz=1,2 do
59 | if kz == 1 then
60 | mem3[kx][ky][kz] = randomString(1)
61 | else
62 | mem3[kx][ky][kz] = 1
63 | end
64 | end
65 | end
66 | end
67 | init = true
68 | end
69 |
70 | fontL = loadFont("Play", l1fontsize)
71 | fontM = loadFont("Play", l2fontsize)
72 | fontS = loadFont("Play", l3fontsize)
73 | layer1 = createLayer()
74 | layer2 = createLayer()
75 | layer3 = createLayer()
76 |
77 | function randomValueL1()
78 | if posx ~= nil then
79 | mem1[posx][posy][1] = randomString(1)
80 | else
81 | local randx1 = math.random(math.floor(cx1))
82 | local randy1 = math.random(math.floor(cy1))
83 | mem1[randx1][randy1][1] = randomString(1)
84 | end
85 | end
86 |
87 | function randomValueL2(posx,posy)
88 | if posx ~= nil then
89 | mem2[posx][posy][1] = randomString(1)
90 | else
91 | local randx2 = math.random(math.floor(cx2))
92 | local randy2 = math.random(math.floor(cy2))
93 | mem2[randx2][randy2][1] = randomString(1)
94 | end
95 | end
96 |
97 | function randomValueL3(posx,posy)
98 | if posx ~= nil then
99 | mem3[posx][posy][1] = randomString(1)
100 | else
101 | local randx3 = math.random(math.floor(cx3))
102 | local randy3 = math.random(math.floor(cy3))
103 | mem3[randx3][randy3][1] = randomString(1)
104 | end
105 | end
106 |
107 | function updateStatesL1()
108 | for dx=1,cx1 do
109 | local changecount = 0
110 | for dy=1,cy1 do
111 | dy0 = (dy - 1)
112 | dy2 = dy+1
113 | if dy0 > 0 then
114 | if mem1[dx][dy][2] == 1 then
115 | if mem1[dx][dy0][2] == 0 then
116 | if changecount == 0 then
117 | mem1[dx][dy][2] = 0
118 | changecount = 1
119 | end
120 | end
121 | end
122 | end
123 | if dy2 < cy1 then
124 | if mem1[dx][dy][2] == 1 then
125 | if mem1[dx][dy2][2] == 0 then
126 | if changecount == 0 then
127 | mem1[dx][dy2][2] = 1
128 | randomValueL1(dx,dy2)
129 | changecount = 1
130 | end
131 | end
132 | end
133 | end
134 | end
135 | rand4 = math.random(5)
136 | if rand4 == 1 then
137 | if changecount == 0 then
138 | mem1[dx][1][2] = 0
139 | changecount = 1
140 | end
141 | end
142 | if rand4 == 4 then
143 | if changecount == 0 then
144 | mem1[dx][1][2] = 1
145 | randomValueL1(dx,1)
146 | changecount = 1
147 | end
148 | end
149 | end
150 | end
151 |
152 | function updateStatesL2()
153 | for fx=1,cx2 do
154 | local changecount = 0
155 | for fy=1,cy2 do
156 | fy0 = (fy - 1)
157 | fy2 = fy+1
158 | if fy0 > 0 then
159 | if mem2[fx][fy][2] == 1 then
160 | if mem2[fx][fy0][2] == 0 then
161 | if changecount == 0 then
162 | mem2[fx][fy][2] = 0
163 | changecount = 1
164 | end
165 | end
166 | end
167 | end
168 | if fy2 < cy2 then
169 | if mem2[fx][fy][2] == 1 then
170 | if mem2[fx][fy2][2] == 0 then
171 | if changecount == 0 then
172 | mem2[fx][fy2][2] = 1
173 | randomValueL2(fx,fy2)
174 | changecount = 1
175 | end
176 | end
177 | end
178 | end
179 | end
180 | rand5 = math.random(5)
181 | if rand5 == 1 then
182 | if changecount == 0 then
183 | mem2[fx][1][2] = 0
184 | changecount = 1
185 | end
186 | end
187 | if rand5 == 4 then
188 | if changecount == 0 then
189 | mem2[fx][1][2] = 1
190 | randomValueL1(fx,1)
191 | changecount = 1
192 | end
193 | end
194 | end
195 | end
196 |
197 | function updateStatesL3()
198 | for gx=1,cx3 do
199 | local changecount = 0
200 | for gy=1,cy3 do
201 | gy0 = (gy - 1)
202 | gy2 = gy+1
203 | if gy0 > 0 then
204 | if mem3[gx][gy][2] == 1 then
205 | if mem3[gx][gy0][2] == 0 then
206 | if changecount == 0 then
207 | mem3[gx][gy][2] = 0
208 | changecount = 1
209 | end
210 | end
211 | end
212 | end
213 | if gy2 < cy3 then
214 | if mem3[gx][gy][2] == 1 then
215 | if mem3[gx][gy2][2] == 0 then
216 | if changecount == 0 then
217 | mem3[gx][gy2][2] = 1
218 | randomValueL3(gx,gy2)
219 | changecount = 1
220 | end
221 | end
222 | end
223 | end
224 | end
225 | rand6 = math.random(5)
226 | if rand6 == 1 then
227 | if changecount == 0 then
228 | mem3[gx][1][2] = 0
229 | changecount = 1
230 | end
231 | end
232 | if rand6 == 4 then
233 | if changecount == 0 then
234 | mem3[gx][1][2] = 1
235 | randomValueL3(gx,1)
236 | changecount = 1
237 | end
238 | end
239 | end
240 | end
241 |
242 | function DrawAllTextL1()
243 | for bx=1,cx1 do
244 | for by=1,cy1 do
245 | for bz=1,2 do
246 | if mem1[bx][by][2] == 1 then
247 | setNextFillColor(layer1, 0, 0.25, 0, 0.33)
248 | addText(layer1, fontL, mem1[bx][by][1], (l1fontsize*bx)+l1xoffset, (l1fontsize*by)+l1yoffset)
249 | end
250 | end
251 | end
252 | end
253 | end
254 |
255 | function DrawAllTextL2()
256 | for ex=1,cx2 do
257 | for ey=1,cy2 do
258 | for ez=1,2 do
259 | if mem2[ex][ey][2] == 1 then
260 | setNextFillColor(layer2, 0, 0.5, 0, 0.5)
261 | addText(layer2, fontM, mem2[ex][ey][1], (l2fontsize*ex)+l2xoffset, (l2fontsize*ey)+l2yoffset)
262 | end
263 | end
264 | end
265 | end
266 | end
267 |
268 | function DrawAllTextL3()
269 | for hx=1,cx3 do
270 | for hy=1,cy3 do
271 | for hz=1,2 do
272 | if mem3[hx][hy][2] == 1 then
273 | setNextFillColor(layer3, 0, 1, 0, 0.66)
274 | addText(layer3, fontS, mem3[hx][hy][1], (l3fontsize*hx)+l3xoffset, (l3fontsize*hy)+l3yoffset)
275 | end
276 | end
277 | end
278 | end
279 | end
280 |
281 | updateStatesL3()
282 | updateStatesL2()
283 | updateStatesL1()
284 | DrawAllTextL3()
285 | DrawAllTextL2()
286 | DrawAllTextL1()
287 | requestAnimationFrame(3)
--------------------------------------------------------------------------------
/Remote Networking/screen.txt:
--------------------------------------------------------------------------------
1 | if not init then
2 | nearbysystems = {}
3 | for ix=1,32 do
4 | nearbysystems[ix] = 0
5 | end
6 | consoletext = {}
7 | for ix=1,8 do
8 | consoletext[ix] = ""
9 | end
10 | textbuffer = {}
11 | for ix=1,2 do
12 | textbuffer[ix] = ""
13 | end
14 | bufferselect = 1
15 | pbactive = 0
16 | lastinput = ""
17 | isconnected = 0
18 | systemmessage = ""
19 | init = true
20 | end
21 |
22 | local layer1 = createLayer()
23 | local layer2 = createLayer()
24 | local font1 = loadFont("Play",15)
25 | local font2 = loadFont("Play",50)
26 |
27 | local rx, ry = getResolution()
28 | local cx,cy = getCursor()
29 | local cd = getCursorDown()
30 | local cp = getCursorPressed()
31 | local cr = getCursorReleased()
32 |
33 | setNextFillColor(layer1,0.1,0.1,0.1,1)
34 | addBox(layer1,0,0,rx,ry)
35 |
36 | function DrawButton(drawlayer, btnx, btny, btnw, btnh, btntxt, callfunc)
37 | setNextFillColor(drawlayer, 0.35, 0.35, 0.35, 1)
38 | if cx > btnx and cx < (btnx+btnw) then
39 | if cy > btny and cy < (btny+btnh) then
40 | if getCursorReleased() == true then
41 | --clicked
42 | setNextFillColor(drawlayer, 1, 0, 0, 1)
43 | callfunc()
44 | else
45 | --hovered
46 | setNextFillColor(drawlayer, 1, 1, 0, 1)
47 | end
48 | end
49 | end
50 | setNextStrokeColor(drawlayer, 0, 0.2, 0.6, 1)
51 | setNextStrokeWidth(drawlayer, 5)
52 | setNextShadow(drawlayer, 25, 0, 0, 0, 1)
53 | addBoxRounded(drawlayer, btnx, btny, btnw, btnh, 5)
54 | setNextFillColor(drawlayer, 0.15, 0.15, 1, 1)
55 | local txtw, txty = getTextBounds(font1,btntxt)
56 | addText(drawlayer, font1, btntxt, btnx + ((btnw - txtw)/2), btny + (btnh/2)+(txty/2))
57 | end
58 |
59 | function DrawDisabledButton(drawlayer, btnx, btny, btnw, btnh, btntxt)
60 | setNextFillColor(drawlayer, 0.15, 0.15, 0.15, 1)
61 | if cx > btnx and cx < (btnx+btnw) then
62 | if cy > btny and cy < (btny+btnh) then
63 | setNextFillColor(drawlayer, 0.35, 0.35, 0.35, 1)
64 | end
65 | end
66 | setNextStrokeColor(drawlayer, 0.4, 0.4, 0.4, 1)
67 | setNextStrokeWidth(drawlayer, 5)
68 | setNextShadow(drawlayer, 25, 0, 0, 0, 1)
69 | addBoxRounded(drawlayer, btnx, btny, btnw, btnh, 5)
70 | setNextFillColor(drawlayer, 0.65, 0.65, 0.65, 1)
71 | local txtw, txty = getTextBounds(font1,btntxt)
72 | addText(drawlayer, font1, btntxt, btnx + ((btnw - txtw)/2), btny + (btnh/2)+(txty/2))
73 | end
74 |
75 | function DrawKeyButton(drawlayer, btnx, btny, btnw, btnh, btntxt, callfunc)
76 | setNextFillColor(drawlayer, 0.35, 0.35, 0.35, 1)
77 | if cx > btnx and cx < (btnx+btnw) then
78 | if cy > btny and cy < (btny+btnh) then
79 | if getCursorReleased() == true then
80 | --clicked
81 | setNextFillColor(drawlayer, 1, 0, 0, 1)
82 | callfunc()
83 | else
84 | --hovered
85 | setNextFillColor(drawlayer, 1, 1, 0, 1)
86 | end
87 | end
88 | end
89 | setNextStrokeColor(drawlayer, 0, 0, 0, 1)
90 | setNextStrokeWidth(drawlayer, 0)
91 | addBoxRounded(drawlayer, btnx, btny, btnw, btnh, 5)
92 | setNextFillColor(drawlayer, 1, 1, 1, 1)
93 | local txtw, txty = getTextBounds(font1,btntxt)
94 | addText(drawlayer, font1, btntxt, btnx + ((btnw - txtw)/2), btny + (btnh/2)+(txty/2))
95 | end
96 |
97 | function addTextToConsole(text)
98 | consoletext[8] = consoletext[7]
99 | consoletext[7] = consoletext[6]
100 | consoletext[6] = consoletext[5]
101 | consoletext[5] = consoletext[4]
102 | consoletext[4] = consoletext[3]
103 | consoletext[3] = consoletext[2]
104 | consoletext[2] = consoletext[1]
105 | consoletext[1] = text
106 | end
107 |
108 | --get script input and substring it into the appropriate array
109 | local inputstr = getInput()
110 | if inputstr == nil or inputstr == "" then
111 | --do nothing
112 | else
113 | if inputstr == lastinput then
114 | --do nothing
115 | else
116 | --addText(layer1, font1, getInput(), 100,500) --debug
117 | if string.sub(inputstr,1,9) == "ACTIVATED" then
118 | pbactive = 1
119 | end
120 | if string.sub(inputstr,1,11) == "DEACTIVATED" then
121 | pbactive = 0
122 | end
123 | if string.sub(inputstr,1,10) == "LOCALCONN:" then
124 | inputstr = string.sub(inputstr,11,string.len(inputstr))
125 | local inputstr2 = ""
126 | local index = 1
127 | while(#inputstr > 0)
128 | do
129 | if string.find(inputstr,",") ~= nil then
130 | inputstr2 = string.sub(inputstr,1,string.find(inputstr,",") - 1)
131 | inputstr = string.sub(inputstr,string.find(inputstr,",")+1,string.len(inputstr))
132 | nearbysystems[index] = inputstr2
133 | index = index + 1
134 | else
135 | inputstr2 = string.sub(inputstr,1,string.len(inputstr))
136 | nearbysystems[index] = inputstr2
137 | inputstr = ""
138 | end
139 | end
140 | end
141 | if string.sub(inputstr,1,10) == "CONNECTED:" then
142 | isconnected = 1
143 | systemmessage = "Connected successfully to "..string.sub(inputstr,11,string.len(inputstr))
144 | addTextToConsole(systemmessage)
145 | end
146 | if string.sub(inputstr,1,8) == "MESSAGE:" then
147 | systemmessage = string.sub(inputstr,9,string.len(inputstr))
148 | addTextToConsole(systemmessage)
149 | end
150 | if string.sub(inputstr,1,8) == "DATARET:" then
151 | local datain = string.sub(inputstr,9,string.len(inputstr))
152 | local keyin = string.sub(datain,1,string.find(datain,":")-1)
153 | local valin = string.sub(datain,string.find(datain,":")+1,string.len(datain))
154 | addTextToConsole("Response: " .. datain)
155 | if textbuffer[1] == keyin then
156 | textbuffer[2] = valin
157 | end
158 | end
159 | end
160 | end
161 |
162 | if pbactive == 1 then
163 | if isconnected == 0 then
164 | output = function() setOutput("SCANLOCAL") end
165 | DrawButton(layer1, 25, 10, 120, 35, "SCAN LOCAL", output)
166 |
167 | output = function() for ab=1,32 do nearbysystems[ab] = nil end setOutput("CLEARBUFFER") end
168 | DrawButton(layer1, 185, 10, 65, 35, "CLEAR", output)
169 |
170 | for aa=1,#nearbysystems do
171 | if nearbysystems[aa] == nil or nearbysystems[aa] == "" or nearbysystems[aa] == 0 then
172 | --do nothing
173 | else
174 | output = function() setOutput("CONNECT:"..nearbysystems[aa]) end
175 | DrawButton(layer1, 50, 80*aa, 200, 35, nearbysystems[aa], output)
176 | --addText(layer1, font1, nearbysystems[aa], 100,30*aa)
177 | end
178 | end
179 | else
180 | DrawDisabledButton(layer1, 25, 10, 120, 35, "SCAN LOCAL")
181 |
182 | DrawDisabledButton(layer1, 185, 10, 65, 35, "CLEAR")
183 |
184 | for aa=1,#nearbysystems do
185 | if nearbysystems[aa] == nil or nearbysystems[aa] == "" or nearbysystems[aa] == 0 then
186 | --do nothing
187 | else
188 | DrawDisabledButton(layer1, 50, 80*aa, 200, 35, nearbysystems[aa])
189 | --addText(layer1, font1, nearbysystems[aa], 100,30*aa)
190 | end
191 | end
192 |
193 | output = function() setOutput("TERMINATE") isconnected = 0 end
194 | DrawButton(layer1, 285, 10, 95, 35, "TERMINATE", output)
195 |
196 | output = function() setOutput("DATAREAD:"..textbuffer[1]) end
197 | DrawButton(layer1, 485, 10, 125, 35, "DATA READ", output)
198 |
199 | output = function() setOutput("DATAWRIT:"..textbuffer[1]..":"..textbuffer[2]) end
200 | DrawButton(layer1, 485, 70, 125, 35, "DATA WRITE", output)
201 |
202 | output = function() setOutput("VERIFYKEYS") end
203 | DrawButton(layer1, 885, 10, 125, 35, "Verify Keys", output)
204 | end
205 |
206 |
207 | output = function() setOutput("READKEY:"..textbuffer[1]) end
208 | DrawButton(layer1, 685, 10, 125, 35, "Read Key", output)
209 |
210 | output = function() setOutput("SAVEKEY:"..textbuffer[1]..":"..textbuffer[2]) end
211 | DrawButton(layer1, 685, 70, 125, 35, "Save Key", output)
212 |
213 | output = function() setOutput("CLEARKEYS") end
214 | DrawButton(layer1, 685, 130, 125, 35, "Clear Keys", output)
215 |
216 | --system message console
217 | setNextFillColor(layer1,0.05,0.05,0.05,1)
218 | addBox(layer1,300,480,500,8*15)
219 | for ad=1,8 do
220 | setNextFillColor(layer1,1,1,1,1)
221 | addText(layer1, font1, consoletext[9-ad], 300,480+(ad*15))
222 | end
223 |
224 | --text buffer 1
225 | if bufferselect == 1 then
226 | setNextFillColor(layer1,0.05,0.05,0.15,1)
227 | else
228 | setNextFillColor(layer1,0.05,0.05,0.05,1)
229 | end
230 | addBox(layer1,420,180,400,20)
231 | setNextFillColor(layer1,1,1,1,1)
232 | addText(layer1,font1,textbuffer[1],420,195)
233 | output = function() bufferselect = 1 end
234 | DrawButton(layer1, 320, 180, 80, 15, "Buffer 1", output)
235 |
236 | --text buffer 2
237 | if bufferselect == 2 then
238 | setNextFillColor(layer1,0.05,0.05,0.15,1)
239 | else
240 | setNextFillColor(layer1,0.05,0.05,0.05,1)
241 | end
242 | addBox(layer1,420,210,400,20)
243 | setNextFillColor(layer1,1,1,1,1)
244 | addText(layer1,font1,textbuffer[2],420,225)
245 | output = function() bufferselect = 2 end
246 | DrawButton(layer1, 320, 210, 80, 15, "Buffer 2", output)
247 |
248 | --generate on-screen keyboard
249 | local keyinc = 0
250 | for af=33,127 do
251 | if af == 127 then
252 | --backspace
253 | liney = math.floor(keyinc / 16)
254 | linex = keyinc - (liney*16)
255 | output = function() textbuffer[bufferselect] = string.sub(textbuffer[bufferselect],1,string.len(textbuffer[bufferselect])-1) end
256 | DrawKeyButton(layer2, 320+(linex*35), 250+(liney*35), 60, 25, "BKSPC", output)
257 | keyinc = keyinc + 1
258 | else
259 | liney = math.floor(keyinc / 16)
260 | linex = keyinc - (liney*16)
261 | output = function() textbuffer[bufferselect] = textbuffer[bufferselect] .. string.char(af) end
262 | DrawKeyButton(layer2, 320+(linex*35), 250+(liney*35), 25, 25, string.char(af), output)
263 | keyinc = keyinc + 1
264 | end
265 | end
266 |
267 | else
268 | addText(layer1, font2, "Remote Networking System", 100,200)
269 | addText(layer1, font1, "Activate Programming Board to connect", 100,275)
270 | end
271 |
272 | requestAnimationFrame(1)
--------------------------------------------------------------------------------
/Developer Utility Screen/DevScreen - Renderscript.txt:
--------------------------------------------------------------------------------
1 | --simple persistence across frames, global varialbes must be created here
2 | if not init then
3 | tabindex = 1
4 | textbuffer = {}
5 | keyboardshift = 0
6 | for ix=1,2 do
7 | textbuffer[ix] = ""
8 | end
9 | bufferselect = 1
10 | a = 2 * math.pi / 6
11 | b = 2 * math.pi / 5
12 | r = 100
13 | slidervalue = 100
14 | fontselect = 1
15 | fontselectmax = 12
16 | init = true
17 | end
18 |
19 | fontS = loadFont("Play", 15)
20 | fontV = loadFont("Play", 30)
21 | fonttab = {}
22 | fontnames = {}
23 | layer1 = createLayer()
24 | layer2 = createLayer()
25 | layer3 = createLayer()
26 | layer4 = createLayer()
27 | rx, ry = getResolution()
28 | cx, cy = getCursor()
29 | cd = getCursorDown()
30 | cp = getCursorPressed()
31 | cr = getCursorReleased()
32 | fontcount = getAvailableFontCount()
33 | line = 1
34 | charset = ""
35 | for ia=1,fontcount do
36 | fontnames[ia] = getAvailableFontName(ia)
37 | end
38 | for ia=fontselect,fontselect+4 do
39 | fonttab[ia] = loadFont(fontnames[ia], 15)
40 | end
41 |
42 | function DrawCharacterSet()
43 | for ix=0,255 do
44 | line = math.floor(ix / 32)
45 | if ix > 32 and ix < 127 then
46 | setNextFillColor(layer1,0,1,0,1)
47 | if ix == 34 or ix == 92 then
48 | setNextFillColor(layer1,1,0,0,1)
49 | end
50 | end
51 | if ix > 160 and ix < 194 then
52 | setNextFillColor(layer1,1,1,0,1)
53 | end
54 | addText(layer1, fontS, string.char(ix), 30*(ix-(line*32))+30, (65*(line+1))+30)
55 | addText(layer1, fontS, ix, 30*(ix-(line*32))+25, 65*(line+1)+50)
56 | end
57 | end
58 |
59 | function DrawButton(drawlayer, btnx, btny, btnw, btnh, btntxt, callfunc)
60 | setNextFillColor(drawlayer, 0.35, 0.35, 0.35, 1)
61 | if cx > btnx and cx < (btnx+btnw) then
62 | if cy > btny and cy < (btny+btnh) then
63 | if getCursorReleased() == true then
64 | --clicked
65 | setNextFillColor(drawlayer, 1, 0, 0, 1)
66 | callfunc()
67 | else
68 | --hovered
69 | setNextFillColor(drawlayer, 1, 1, 0, 1)
70 | end
71 | end
72 | end
73 | setNextStrokeWidth(drawlayer, 0)
74 | addBoxRounded(drawlayer, btnx, btny, btnw, btnh, 5)
75 | setNextFillColor(drawlayer, 1, 1, 1, 1)
76 | local txtw, txty = getTextBounds(fontS,btntxt)
77 | addText(drawlayer, fontS, btntxt, btnx + ((btnw - txtw)/2), btny + (btnh/2)+(txty/2))
78 | end
79 |
80 | function DrawScreenInfo()
81 | setNextFillColor(layer1,1,0,0,1)
82 | addText(layer1, fontS, "Resolution: " .. math.floor(rx) .. " x " .. math.floor(ry), 80, 80)
83 |
84 | setNextFillColor(layer1,1,0.5,0,1)
85 | addText(layer1, fontS, "Cursor: " .. cx .. " , " .. cy, 80, 100)
86 | setNextFillColor(layer1,1,1,0,1)
87 | addText(layer1, fontS, "Down: " .. tostring(cd), 80, 120)
88 | setNextFillColor(layer1,1,1,0,1)
89 | addText(layer1, fontS, "Press: " .. tostring(cp), 80, 140)
90 | setNextFillColor(layer1,1,1,0,1)
91 | addText(layer1, fontS, "Release: " .. tostring(cr), 80, 160)
92 |
93 | ct = getTime()
94 | dt = getDeltaTime()
95 | setNextFillColor(layer1,0,1,0,1)
96 | addText(layer1, fontS, "Time: " .. ct, 80, 200)
97 | setNextFillColor(layer1,0,1,0,1)
98 | addText(layer1, fontS, "Delta: " .. dt, 80, 220)
99 |
100 | rc = getRenderCost()
101 | rcmax = getRenderCostMax()
102 | setNextFillColor(layer1,0,0.5,1,1)
103 | addText(layer1, fontS, "Render Cost: " .. rc .. " / " .. rcmax, 80, 300)
104 | end
105 |
106 | function DrawOSKFull()
107 | --generate on-screen keyboard
108 | --Full keyboard, all buttons visible all the time, no shift.
109 | local keyinc = 0
110 | for af=33,127 do
111 | if af == 127 then
112 | --backspace
113 | liney = math.floor(keyinc / 16)
114 | linex = keyinc - (liney*16)
115 | output = function() textbuffer[bufferselect] = string.sub(textbuffer[bufferselect],1,string.len(textbuffer[bufferselect])-1) end
116 | DrawButton(layer1, 320+(linex*35), 250+(liney*35), 60, 25, "BKSPC", output)
117 | keyinc = keyinc + 1
118 | else
119 | liney = math.floor(keyinc / 16)
120 | linex = keyinc - (liney*16)
121 | output = function() textbuffer[bufferselect] = textbuffer[bufferselect] .. string.char(af) end
122 | DrawButton(layer1, 320+(linex*35), 250+(liney*35), 25, 25, string.char(af), output)
123 | keyinc = keyinc + 1
124 | end
125 | end
126 | end
127 |
128 | function drawCircularProgressBar(layerin,xin,yin,rad,v,vmax)
129 | local prcnt = v/vmax
130 | local angle = prcnt*360
131 | local cntr = 0
132 | --progress circles
133 | for xb = 1,20 do
134 | cntr = cntr + 0.05
135 | setNextStrokeWidth(layerin,1)
136 | setNextStrokeColor(layerin,0,0,0,0)
137 | setNextFillColor(layerin,0,0.2,0.7,1)
138 | addCircle(layerin,xin+(math.cos((prcnt*cntr)*(math.pi*2))*rad),yin+(math.sin((prcnt*cntr)*(math.pi*2))*rad),rad/3)
139 | end
140 | --center circle
141 | setNextStrokeWidth(layerin,2)
142 | setNextStrokeColor(layerin,0,0,0,0)
143 | setNextFillColor(layerin,0.5,0.5,0.5,1)
144 | addCircle(layerin,xin,yin,rad/2+(rad/4))
145 | --outer circle
146 | setNextStrokeWidth(layerin,3)
147 | setNextStrokeColor(layerin,0.5,0.5,0.5,1)
148 | setNextFillColor(layerin,0,0,0,0)
149 | addCircle(layerin,xin,yin,rad+(rad/3))
150 | --position circle
151 | setNextStrokeWidth(layerin,1)
152 | setNextStrokeColor(layerin,0.75,0.75,0.75,1)
153 | setNextFillColor(layerin,0.75,0.75,0.75,1)
154 | addCircle(layerin,xin+(math.cos(prcnt*(math.pi*2))*rad),yin+(math.sin(prcnt*(math.pi*2))*rad),rad/3)
155 | end
156 |
157 | function DrawSlider(drawlayer, btnx, btny, btnw, btnh, value)
158 | setNextFillColor(drawlayer, 0.35, 0.35, 0.35, 1)
159 | if cx > btnx and cx < (btnx+btnw) then
160 | if cy > (btny-(btnh*0.5)) and cy < (btny+(btnh*0.5)) then
161 | if cd == true then
162 | --clicked
163 | setNextFillColor(drawlayer, 1, 0, 0, 1)
164 | slidervalue = ((cx - btnx)/btnw)*100
165 | else
166 | --hovered
167 | setNextFillColor(drawlayer, 1, 1, 0, 1)
168 | end
169 | end
170 | end
171 | setNextStrokeWidth(drawlayer, 0)
172 | addBoxRounded(drawlayer, btnx, btny-(btnh*0.25), btnw, btnh-(btnh*0.5), 5)
173 | setNextFillColor(drawlayer, 1, 1, 1, 1)
174 | addBoxRounded(drawlayer, btnx+((value*0.01)*btnw), btny-(btnh*0.5), 15, btnh, 5)
175 | end
176 |
177 | function addHexagon1(inlayer,hexx,hexy,rad,strkwdth,sr,sg,sb,shwdth,shr,shg,shb,alpha)
178 | for ia=0,5 do
179 | setNextShadow(inlayer,shwdth,shr,shg,shb,alpha)
180 | setNextStrokeWidth(inlayer,strkwdth)
181 | setNextStrokeColor(inlayer,sr,sg,sb,alpha)
182 | addLine(inlayer,hexx + (r + rad) * math.sin(a * ia), hexy + (r + rad) * math.cos(a * ia),hexx + (r + rad) * math.sin(a * (ia+1)), hexy + (r + rad) * math.cos(a * (ia+1)))
183 | end
184 | end
185 |
186 | function addHexagon2(inlayer,hexx,hexy,rad,strkwdth,sr,sg,sb,shwdth,shr,shg,shb,alpha)
187 | for ia=0,5 do
188 | setNextShadow(inlayer,shwdth,shr,shg,shb,alpha)
189 | setNextStrokeWidth(inlayer,strkwdth)
190 | setNextStrokeColor(inlayer,sr,sg,sb,alpha)
191 | addLine(inlayer,hexx + (r + rad) * math.cos(a * ia), hexy + (r + rad) * math.sin(a * ia),hexx + (r + rad) * math.cos(a * (ia+1)), hexy + (r + rad) * math.sin(a * (ia+1)))
192 | end
193 | end
194 |
195 | function addPentagon(inlayer,hexx,hexy,rad,strkwdth,sr,sg,sb,shwdth,shr,shg,shb,alpha)
196 | for ia=0,4 do
197 | setNextShadow(inlayer,shwdth,shr,shg,shb,alpha)
198 | setNextStrokeWidth(inlayer,strkwdth)
199 | setNextStrokeColor(inlayer,sr,sg,sb,alpha)
200 | addLine(inlayer,hexx + (r + rad) * math.sin(b * ia), hexy + (r + rad) * math.cos(b * ia),hexx + (r + rad) * math.sin(b * (ia+1)), hexy + (r + rad) * math.cos(b * (ia+1)))
201 | end
202 | end
203 |
204 | function addCustomText(drawlayer, imagehandle, textstring, xpos, ypos, size, colorr, colorg, colorb, colora)
205 | destructstring = textstring
206 | for ix=1,#textstring do
207 | nextletter = string.sub(destructstring,1,1)
208 | destructstring = string.sub(destructstring,2,string.len(destructstring))
209 | nextascii = string.byte(nextletter) - 33
210 |
211 | local subxpos = math.fmod(nextascii,32)
212 | local subypos = math.floor(nextascii / 32)
213 | setNextFillColor(drawlayer, colorr, colorg, colorb, colora)
214 | addImageSub(drawlayer, imagehandle, xpos+(ix * (size/2+2)), ypos, size, size, 0 + (68*subxpos), 0 + (68 * subypos), 68, 68)
215 | end
216 | end
217 |
218 | --Simple tab pane to keep things organized
219 | setNextFillColor(layer1,0.1,0.1,0.1,1)
220 | addBox(layer1,0,50,rx,ry - 50)
221 | local output = function() tabindex = 1 end
222 | DrawButton(layer1,10,10,100,30,"Charset",output)
223 | local output = function() tabindex = 2 end
224 | DrawButton(layer1,130,10,100,30,"Screen Data",output)
225 | local output = function() tabindex = 3 end
226 | DrawButton(layer1,250,10,100,30,"Inputs",output)
227 | local output = function() tabindex = 4 end
228 | DrawButton(layer1,370,10,100,30,"Bars / Meters",output)
229 | local output = function() tabindex = 5 end
230 | DrawButton(layer1,490,10,100,30,"Shapes",output)
231 | local output = function() tabindex = 6 end
232 | DrawButton(layer1,610,10,100,30,"Text",output)
233 |
234 | if tabindex == 1 then
235 | DrawCharacterSet()
236 | end
237 | if tabindex == 2 then
238 | DrawScreenInfo()
239 | end
240 | if tabindex == 3 then
241 | --text buffer 1
242 | if bufferselect == 1 then
243 | setNextFillColor(layer1,0.05,0.05,0.15,1)
244 | else
245 | setNextFillColor(layer1,0.05,0.05,0.05,1)
246 | end
247 | addBox(layer1,420,180,400,20)
248 | setNextFillColor(layer1,1,1,1,1)
249 | addText(layer1,fontS,textbuffer[1],420,195)
250 | output = function() bufferselect = 1 end
251 | DrawButton(layer1, 320, 180, 80, 15, "Buffer 1", output)
252 |
253 | --text buffer 2
254 | if bufferselect == 2 then
255 | setNextFillColor(layer1,0.05,0.05,0.15,1)
256 | else
257 | setNextFillColor(layer1,0.05,0.05,0.05,1)
258 | end
259 | addBox(layer1,420,210,400,20)
260 | setNextFillColor(layer1,1,1,1,1)
261 | addText(layer1,fontS,textbuffer[2],420,225)
262 | output = function() bufferselect = 2 end
263 | DrawButton(layer1, 320, 210, 80, 15, "Buffer 2", output)
264 |
265 | DrawOSKFull()
266 | end
267 | if tabindex == 4 then
268 | drawCircularProgressBar(layer1,200,200,50,slidervalue,100)
269 | DrawSlider(layer1,400,200,150,50,slidervalue)
270 | end
271 | if tabindex == 5 then
272 | addHexagon1(layer1,200,200,25,5,1,1,1,20,0,0,0,1)
273 | addHexagon2(layer1,200,200,25,5,1,1,1,20,0,0,0,1)
274 | addPentagon(layer1,200,450,25,5,1,1,1,20,0,0,0,1)
275 | end
276 | if tabindex == 6 then
277 | local customfontimage = loadImage("assets.prod.novaquark.com/66839/e294a1f0-11ae-4fa1-a5f8-aeb02288eb24.png")
278 | addCustomText(layer2, customfontimage, "This is a custom font, rendered from an image file.", 150, 100, 22, 0,0.25,0.75,1)
279 |
280 | setNextFillColor(layer1,0,1,1,1)
281 | addText(layer1, fontS, "Available Fonts: " .. fontcount, 80, 495)
282 | local prevfontselect = fontselect
283 | local output = function() if fontselect > 1 then fontselect = fontselect - 1 end end
284 | DrawButton(layer1, 40, 475, 35, 35, "<", output)
285 | local output = function() if fontselect < fontcount - 4 then fontselect = fontselect + 1 end end
286 | DrawButton(layer1, 300, 475, 35, 35, ">", output)
287 | for aa=prevfontselect,prevfontselect+4 do
288 | setNextFillColor(layer1,0,1,1,1)
289 | addText(layer1, fonttab[aa], fontnames[aa], 100, ((aa - prevfontselect)*15)+515)
290 | end
291 |
292 | addText(layer3,fontV,"Vertical Text Example 1",10,10)
293 | setLayerRotation(layer3,(6.285*0.75))
294 | setLayerTranslation(layer3,25,400)
295 |
296 | addText(layer4,fontV,"Vertical Text Example 2",10,10)
297 | setLayerRotation(layer4,(6.285*0.25))
298 | setLayerTranslation(layer4,75,100)
299 | end
300 | requestAnimationFrame(1)
--------------------------------------------------------------------------------