Manual › Custom keywords & Python
Custom keywords & Python
Your own variables from text, file, command, web address or Python code
Custom keywords are variables you create yourself – in the app under “Keywords”. In the editor they're listed under “Variables → Ventoview” and work like all others: in texts ({streamer}), in conditions, as a value for bars or keyframe dials.
Where the value comes from
Under “Value from” you choose where a keyword gets its value. PowerShell command and Python code only appear when you turn on “Advanced” at the top – they run something on your PC.
| Value from | What it does | Safe? |
|---|---|---|
| Fixed text | A fixed value, e.g. your name or Discord. | Yes – only reads |
| Text file | The content of a text file, re-read every few seconds. Many tools (music players, bots) write info into a .txt file. | Yes – only reads |
| Web address | The response of an address, optionally one field of it (JSON path, see below). | Yes – only reads |
| PowerShell command (Advanced) | The output of a PowerShell command – gets you almost anything Windows knows. | Only your own commands! |
| Python code (Advanced) | Your own Python code that makes new variables from others. | Safe mode: yes. Full access: only your own code! |
Also built in are {zeit}, {datum}, {wochentag} and {laufzeit}. Under “Examples to use” there are ready-made entries for every type – e.g. the weather in your city via https://wttr.in/Heide?format=%t.
Creating one
- Open “Keywords” in the app, click “+ Keyword”.
- Enter a name – only a–z, 0–9 and _. It must not have the same name as a module variable; then the row turns red.
- Under “Value from” choose the type and enter the text, file, address, command or code.
- For everything except text: Every … s – how often it's re-read.
- “Save”. The current value appears on the right – or the error in red.
Renaming and deleting are protected: if a keyword is used in designs or chat bot texts, the app asks first and applies a rename everywhere.
Python
With Python you calculate new variables from existing ones – e.g. double the ping, round values, reshape texts or count something. You need Python 3 on your PC: install it from python.org and tick “Add python.exe to PATH”.
How it works
- All variables are already there – under their name, without {}.
{ping}becomesping,{songtitle}becomessongtitle. Numbers arrive as numbers ("42"→42,"3,5"→3.5), everything else as text. - You set the value with the keyword's name. If the keyword is called
test, writetest = …(case doesn't matter,TEST = …works too). - If that variable doesn't exist at the end,
ergebnis = …counts – or whatever the code outputs withprint(…). True/Falsebecome “ja”/“nein” – suitable for conditions in the editor.- A dictionary becomes separate variables:
test = {"min": 1, "max": 9}gives{test_min}and{test_max}. speicheris a dictionary that persists between runs (until the app restarts) – for counters, maximums or averages.variablencontains all variables as a dictionary – handy if a name isn't a valid Python name:variablen["mein-wert"].- The code runs again at the set interval each time, for at most 10 seconds.
Examples
Calculating – keyword doppelt:
doppelt = ping * 2
Rounding and text – keyword temptext:
temptext = f"{round(gputemp)} °C"
Yes/no for conditions – keyword zuheiss (in the editor: condition “zuheiss is ja”):
zuheiss = gputemp > 80
Several cases – keyword lage:
if ping < 30:
lage = "super"
elif ping < 80:
lage = "okay"
else:
lage = "lag!"
Counting with memory – keyword lags, every 10 s:
if ping > 80:
speicher["n"] = speicher.get("n", 0) + 1
lags = speicher.get("n", 0)
Random and time – keyword gruss:
import random
from datetime import datetime
stunde = datetime.now().hour
gruss = random.choice(["Hi", "Hey", "Yo"]) if stunde < 18 else "Good evening"
Finding errors
If the code doesn't run, the error appears in red in the preview – with the line in your code, e.g. NameError: name 'pnig' is not defined (Zeile 1) (typo in the name). Common ones:
- NameError: the variable doesn't exist (yet) – check the name and whether its module is running.
- TypeError when calculating: the value is text instead of a number, e.g. because the variable is empty right now. Fix:
float(ping or 0). - IndentationError: inconsistent indentation – in the field Tab indents by 4 spaces.
- “Python 3 not found”: install Python (tick “Add to PATH”), then restart the app.
Safe mode and full access
Python keywords run in safe mode by default. Everything for calculating and for text, lists and dictionaries is allowed, plus these modules: math, random, statistics, datetime, time, json, re, decimal, fractions, itertools, collections, functools, string, textwrap, calendar, operator, bisect, heapq, cmath.
Blocked are files (open), other modules (os, subprocess, network …), eval/exec and Python internals (everything starting with _). Instead of "…".format() use f-strings: f"{wert} ms".
If you need more – e.g. reading a file or querying a website – tick “Full access” on the keyword. Then the code may do everything you're allowed to do on this PC.
Full access and PowerShell commands run with your rights: they can delete files, start programs and send data. Only enter code you wrote yourself or understand line by line – never code from chat, Discord or strangers. Safe mode protects against mistakes and simple foreign code, but it isn't a perfect cage.
Web address and JSON path
If an address returns JSON, the path picks out a field: data.title, items[0].name – or it searches the whole tree: **[Text~Tctl].Value takes the first object whose “Text” field contains “Tctl”, and its “Value”.
Example CPU temperature: Windows doesn't provide it by itself. Start the free LibreHardwareMonitor (official on github.com/LibreHardwareMonitor) as administrator and turn on Options → Remote Web Server → Run. Then use the example “CPU temperature” – for Intel use the path **[Text~CPU Package].Value instead of Tctl.
Backups
Keywords are included in the full backup (.vview). If a backup contains PowerShell or Python keywords, the app warns you before loading – only load backups that come from you.