Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Dirty Bag 'o Tokens Maker
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
--lua 5.3 -- a super quick and dirty way to generate a bag of image tokens in tts -- writen by stom -- -- edit the urls array below to include all the images you want in the bag -- click the "run it (f8)" button below -- copy and paste the output text into notepad or suitable text editor -- save the file in your tabletop sim save location/saved games/saved objects -- typically this is located at ~\Documents\My Games\Tabletop Simulator\Saves\Saved Objects -- save it with the filename "mybag.json" -- pull it onto your table in game local urls = { "https://i.imgur.com/l7VSueX.png", "https://i.imgur.com/GeVDO3n.png", "https://i.imgur.com/l7VSueX.png", "https://i.imgur.com/GeVDO3n.png", "https://i.imgur.com/l7VSueX.png", "https://i.imgur.com/GeVDO3n.png", "https://i.imgur.com/l7VSueX.png", "https://i.imgur.com/GeVDO3n.png", } -- -- no need to edit below this line -- local json_pre = [[ { "SaveName": "", "GameMode": "", "Gravity": 0.5, "PlayArea": 0.5, "Date": "", "Table": "", "Sky": "", "Note": "", "Rules": "", "XmlUI": "", "LuaScript": "", "LuaScriptState": "", "ObjectStates": [{ "Name": "Bag", "Transform": { "posX": 0.0, "posY": 0.0, "posZ": 0.0, "rotX": 0.0, "rotY": 0.0, "rotZ": 0.0, "scaleX": 1.0, "scaleY": 1.0, "scaleZ": 1.0 }, "Nickname": "", "Description": "", "ColorDiffuse": { "r": 0.7058823, "g": 0.366520882, "b": 0.0 }, "Locked": false, "Grid": true, "Snap": true, "IgnoreFoW": false, "Autoraise": true, "Sticky": true, "Tooltip": true, "GridProjection": false, "HideWhenFaceDown": false, "Hands": false, "MaterialIndex": -1, "MeshIndex": -1, "XmlUI": "", "LuaScript": "", "LuaScriptState": "", "ContainedObjects": [ ]] local json_post = [[ ], "GUID": "bag001" } ], "TabStates": {}, "VersionNumber": "" } ]] function obj(i, url) local str = [[ { "Name": "Custom_Token", "Transform": { "posX": 0.0, "posY": 0.0, "posZ": 0.0, "rotX": 0.0, "rotY": 0.0, "rotZ": 0.0, "scaleX": 1.0, "scaleY": 1.0, "scaleZ": 1.0 }, "Nickname": "", "Description": "", "ColorDiffuse": { "r": 1.0, "g": 1.0, "b": 1.0 }, "Locked": false, "Grid": true, "Snap": true, "IgnoreFoW": false, "Autoraise": true, "Sticky": true, "Tooltip": true, "GridProjection": false, "HideWhenFaceDown": false, "Hands": false, "CustomImage": { "ImageURL": "]]..url..[[", "ImageSecondaryURL": "", "WidthScale": 0.0, "CustomToken": { "Thickness": 0.2, "MergeDistancePixels": 15.0, "Stackable": false } }, "XmlUI": "", "LuaScript": "", "LuaScriptState": "", "GUID": "tok]]..string.format("%03d",i)..[[" }]] if i < #urls then str = str.."," end return str end print(json_pre) for k,v in ipairs(urls) do print(obj(k,v)) end print(json_post)
[
+
]
Show input
Absolute running time: 0.07 sec, cpu time: 0.01 sec, memory peak: 3 Mb, absolute service time: 0,08 sec
edit mode
|
history
|
discussion