Handbuch › Eigene Keywords & Python
Eigene Keywords & Python
Eigene Variablen aus Text, Datei, Befehl, Webadresse oder Python-Code
Eigene Keywords sind Variablen, die du selbst anlegst – in der App unter „Keywords“. Im Editor stehen sie unter „Variablen → Ventoview“ und funktionieren wie alle anderen: in Texten ({streamer}), in Bedingungen, als Wert für Balken oder Keyframe-Regler.
Woher der Wert kommt
Unter „Wert aus“ wählst du, woher ein Keyword seinen Wert bekommt. PowerShell-Befehl und Python-Code erscheinen erst, wenn du oben „Erweitert“ einschaltest – sie führen etwas auf deinem PC aus.
| Wert aus | Was es macht | Sicher? |
|---|---|---|
| Fester Text | Ein fester Wert, z. B. dein Name oder Discord. | Ja – liest nur |
| Textdatei | Der Inhalt einer Textdatei, alle paar Sekunden neu gelesen. Viele Tools (Musik-Player, Bots) schreiben Infos in eine .txt-Datei. | Ja – liest nur |
| Webadresse | Die Antwort einer Adresse, optional ein Feld daraus (JSON-Pfad, siehe unten). | Ja – liest nur |
| PowerShell-Befehl (Erweitert) | Die Ausgabe eines PowerShell-Befehls – damit kommst du an fast alles, was Windows weiß. | Nur eigene Befehle! |
| Python-Code (Erweitert) | Eigener Python-Code, der aus anderen Variablen neue macht. | Sicherer Modus: ja. Voller Zugriff: nur eigener Code! |
Fest eingebaut sind außerdem {zeit}, {datum}, {wochentag} und {laufzeit}. Unter „Beispiele zum Übernehmen“ gibt es für jede Art fertige Einträge zum Anpassen – z. B. das Wetter deiner Stadt über https://wttr.in/Heide?format=%t.
Anlegen
- In der App „Keywords“ öffnen, „+ Keyword“.
- Name eintragen – nur a–z, 0–9 und _. Er darf nicht so heißen wie eine Variable eines Moduls; dann wird die Zeile rot.
- Unter „Wert aus“ die Art wählen und Text, Datei, Adresse, Befehl oder Code eintragen.
- Bei allem außer Text: Alle … s – wie oft neu gelesen wird.
- „Speichern“. Rechts erscheint der aktuelle Wert – oder rot der Fehler.
Umbenennen und Löschen sind geschützt: Wird ein Keyword in Designs oder Chat-Bot-Texten benutzt, fragt die App vorher und zieht eine Umbenennung überall mit.
Python
Mit Python rechnest du aus vorhandenen Variablen neue – z. B. den Ping verdoppeln, Werte runden, Texte umbauen oder etwas zählen. Du brauchst Python 3 auf dem PC: von python.org installieren und dabei den Haken bei „Add python.exe to PATH“ setzen.
So funktioniert es
- Alle Variablen sind schon da – unter ihrem Namen, ohne {}. Aus
{ping}wirdping, aus{songtitle}songtitle. Zahlen kommen als Zahlen an ("42"→42,"3,5"→3.5), alles andere als Text. - Den Wert setzt du mit dem Namen des Keywords. Heißt das Keyword
test, schreibst dutest = …(Groß/klein egal,TEST = …geht auch). - Gibt es diese Variable am Ende nicht, zählt
ergebnis = …– oder was der Code mitprint(…)ausgibt. True/Falsewerden zu „ja“/„nein“ – passend für Bedingungen im Editor.- Ein Wörterbuch wird zu eigenen Variablen:
test = {"min": 1, "max": 9}ergibt{test_min}und{test_max}. speicherist ein Wörterbuch, das zwischen den Läufen erhalten bleibt (bis die App neu startet) – für Zähler, Höchstwerte oder Durchschnitte.variablenenthält alle Variablen als Wörterbuch – praktisch, wenn ein Name kein gültiger Python-Name ist:variablen["mein-wert"].- Der Code läuft im eingestellten Abstand jedes Mal neu, höchstens 10 Sekunden lang.
Beispiele
Rechnen – Keyword doppelt:
doppelt = ping * 2
Runden und Text – Keyword temptext:
temptext = f"{round(gputemp)} °C"
Ja/Nein für Bedingungen – Keyword zuheiss (im Editor: Bedingung „zuheiss ist ja“):
zuheiss = gputemp > 80
Mehrere Fälle – Keyword lage:
if ping < 30:
lage = "super"
elif ping < 80:
lage = "okay"
else:
lage = "lag!"
Zählen mit Gedächtnis – Keyword lags, alle 10 s:
if ping > 80:
speicher["n"] = speicher.get("n", 0) + 1
lags = speicher.get("n", 0)
Zufall und Zeit – Keyword gruss:
import random
from datetime import datetime
stunde = datetime.now().hour
gruss = random.choice(["Hi", "Hey", "Moin"]) if stunde < 18 else "Guten Abend"
Fehler finden
Läuft der Code nicht, steht der Fehler rot in der Vorschau – mit der Zeile in deinem Code, z. B. NameError: name 'pnig' is not defined (Zeile 1) (Tippfehler im Namen). Häufig:
- NameError: Variable gibt es (noch) nicht – Name prüfen, und ob das Modul dazu läuft.
- TypeError bei Rechnen: der Wert ist Text statt Zahl, z. B. weil die Variable gerade leer ist. Abhilfe:
float(ping or 0). - IndentationError: Einrückung uneinheitlich – im Feld rückt Tab um 4 Leerzeichen ein.
- „Python 3 nicht gefunden“: Python installieren (Haken bei „Add to PATH“), dann die App neu starten.
Sicherer Modus und voller Zugriff
Python-Keywords laufen standardmäßig im sicheren Modus. Erlaubt ist alles zum Rechnen und für Text, Listen und Wörterbücher, dazu diese Module: math, random, statistics, datetime, time, json, re, decimal, fractions, itertools, collections, functools, string, textwrap, calendar, operator, bisect, heapq, cmath.
Gesperrt sind Dateien (open), andere Module (os, subprocess, Netzwerk …), eval/exec und Python-Interna (alles mit _ am Anfang). Statt "…".format() nimmst du f-Strings: f"{wert} ms".
Brauchst du mehr – z. B. eine Datei lesen oder eine Webseite abfragen –, setzt du beim Keyword den Haken „Voller Zugriff“. Dann darf der Code alles, was du auf diesem PC darfst.
Voller Zugriff und PowerShell-Befehle laufen mit deinen Rechten: Sie können Dateien löschen, Programme starten und Daten verschicken. Trag nur Code ein, den du selbst geschrieben hast oder Zeile für Zeile verstehst – niemals Code aus Chat, Discord oder von Fremden. Der sichere Modus schützt vor Versehen und einfachem fremdem Code, ist aber kein perfekter Käfig.
Webadresse und JSON-Pfad
Liefert eine Adresse JSON, holt der Pfad ein Feld heraus: data.title, items[0].name – oder er sucht im ganzen Baum: **[Text~Tctl].Value nimmt das erste Objekt, dessen Feld „Text“ „Tctl“ enthält, und davon „Value“.
Beispiel CPU-Temperatur: Windows liefert sie nicht selbst. Das kostenlose LibreHardwareMonitor (offiziell auf github.com/LibreHardwareMonitor) als Administrator starten und unter Options → Remote Web Server → Run einschalten. Dann das Beispiel „CPU-Temperatur“ übernehmen – bei Intel statt Tctl den Pfad **[Text~CPU Package].Value.
Sicherungen
Keywords kommen in die komplette Sicherung (.vview) mit. Enthält eine Sicherung PowerShell- oder Python-Keywords, warnt die App vor dem Laden – lade nur Sicherungen, die von dir stammen.
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.
I keyword personali sono variabili che crei tu – nell'app in “Keywords”. Nell'editor si trovano in “Variabili → Ventoview” e funzionano come tutte le altre: nei testi ({streamer}), nelle condizioni, come valore per barre o regolatori keyframe.
Da dove arriva il valore
In “Valore da” scegli da dove una keyword prende il suo valore. Comando PowerShell e Codice Python appaiono solo se in alto attivi “Avanzate” – eseguono qualcosa sul tuo PC.
| Valore da | Cosa fa | Sicuro? |
|---|---|---|
| Testo fisso | Un valore fisso, es. il tuo nome o Discord. | Sì – legge soltanto |
| File di testo | Il contenuto di un file di testo, riletto ogni pochi secondi. Molti strumenti (player musicali, bot) scrivono informazioni in un file .txt. | Sì – legge soltanto |
| Indirizzo web | La risposta di un indirizzo, facoltativamente un suo campo (percorso JSON, vedi sotto). | Sì – legge soltanto |
| Comando PowerShell (Avanzate) | L'output di un comando PowerShell – arrivi a quasi tutto ciò che Windows sa. | Solo comandi tuoi! |
| Codice Python (Avanzate) | Codice Python tuo che crea nuove variabili da altre. | Modalità sicura: sì. Accesso completo: solo codice tuo! |
Integrate ci sono anche {zeit}, {datum}, {wochentag} e {laufzeit}. In “Esempi da usare” trovi voci pronte per ogni tipo – es. il meteo della tua città con https://wttr.in/Heide?format=%t.
Creare
- Nell'app apri “Keywords”, “+ Keyword”.
- Inserisci il nome – solo a–z, 0–9 e _. Non può chiamarsi come una variabile di un modulo; altrimenti la riga diventa rossa.
- In “Valore da” scegli il tipo e inserisci testo, file, indirizzo, comando o codice.
- Per tutto tranne il testo: Ogni … s – ogni quanto viene riletto.
- “Salva”. A destra appare il valore attuale – o l'errore in rosso.
Rinominare ed eliminare sono protetti: se un keyword è usato in design o testi del chat bot, l'app chiede prima e applica la ridenominazione ovunque.
Python
Con Python calcoli nuove variabili da quelle esistenti – es. raddoppiare il ping, arrotondare valori, rielaborare testi o contare qualcosa. Ti serve Python 3 sul PC: installalo da python.org spuntando “Add python.exe to PATH”.
Come funziona
- Tutte le variabili sono già presenti – con il loro nome, senza {}.
{ping}diventaping,{songtitle}songtitle. I numeri arrivano come numeri ("42"→42,"3,5"→3.5), tutto il resto come testo. - Il valore lo imposti con il nome del keyword. Se il keyword si chiama
test, scrivitest = …(maiuscole/minuscole indifferenti, va ancheTEST = …). - Se alla fine questa variabile non esiste, vale
ergebnis = …– o ciò che il codice stampa conprint(…). True/Falsediventano “ja”/“nein” – adatti alle condizioni nell'editor.- Un dizionario diventa variabili separate:
test = {"min": 1, "max": 9}dà{test_min}e{test_max}. speicherè un dizionario che resta tra un'esecuzione e l'altra (fino al riavvio dell'app) – per contatori, massimi o medie.variablencontiene tutte le variabili come dizionario – utile se un nome non è un nome Python valido:variablen["mein-wert"].- Il codice viene rieseguito ogni volta all'intervallo impostato, al massimo per 10 secondi.
Esempi
Calcolare – keyword doppelt:
doppelt = ping * 2
Arrotondare e testo – keyword temptext:
temptext = f"{round(gputemp)} °C"
Sì/no per le condizioni – keyword zuheiss (nell'editor: condizione “zuheiss è ja”):
zuheiss = gputemp > 80
Più casi – keyword lage:
if ping < 30:
lage = "super"
elif ping < 80:
lage = "okay"
else:
lage = "lag!"
Contare con memoria – keyword lags, ogni 10 s:
if ping > 80:
speicher["n"] = speicher.get("n", 0) + 1
lags = speicher.get("n", 0)
Caso e tempo – keyword gruss:
import random
from datetime import datetime
stunde = datetime.now().hour
gruss = random.choice(["Ciao", "Ehi", "Salve"]) if stunde < 18 else "Buonasera"
Trovare gli errori
Se il codice non funziona, l'errore appare in rosso nell'anteprima – con la riga del tuo codice, es. NameError: name 'pnig' is not defined (Zeile 1) (errore di battitura nel nome). Frequenti:
- NameError: la variabile non esiste (ancora) – controlla il nome e se il suo modulo è attivo.
- TypeError nei calcoli: il valore è testo invece di numero, es. perché la variabile è vuota. Soluzione:
float(ping or 0). - IndentationError: rientro non uniforme – nel campo Tab rientra di 4 spazi.
- “Python 3 non trovato”: installa Python (spunta “Add to PATH”), poi riavvia l'app.
Modalità sicura e accesso completo
I keyword Python girano di default in modalità sicura. È permesso tutto per calcoli, testo, liste e dizionari, più questi moduli: math, random, statistics, datetime, time, json, re, decimal, fractions, itertools, collections, functools, string, textwrap, calendar, operator, bisect, heapq, cmath.
Bloccati sono i file (open), altri moduli (os, subprocess, rete …), eval/exec e gli interni di Python (tutto ciò che inizia con _). Invece di "…".format() usa le f-string: f"{wert} ms".
Se ti serve di più – es. leggere un file o interrogare un sito – spunta “Accesso completo” sul keyword. Allora il codice può fare tutto ciò che puoi fare tu su questo PC.
Accesso completo e comandi PowerShell girano con i tuoi permessi: possono eliminare file, avviare programmi e inviare dati. Inserisci solo codice scritto da te o che capisci riga per riga – mai codice dalla chat, da Discord o da sconosciuti. La modalità sicura protegge da errori e da semplice codice altrui, ma non è una gabbia perfetta.
Indirizzo web e percorso JSON
Se un indirizzo restituisce JSON, il percorso estrae un campo: data.title, items[0].name – oppure cerca in tutto l'albero: **[Text~Tctl].Value prende il primo oggetto il cui campo “Text” contiene “Tctl”, e da questo “Value”.
Esempio temperatura CPU: Windows non la fornisce da solo. Avvia il gratuito LibreHardwareMonitor (ufficiale su github.com/LibreHardwareMonitor) come amministratore e attiva Options → Remote Web Server → Run. Poi usa l'esempio “Temperatura CPU” – con Intel invece di Tctl il percorso **[Text~CPU Package].Value.
Backup
I keyword finiscono nel backup completo (.vview). Se un backup contiene keyword PowerShell o Python, l'app avvisa prima di caricarlo – carica solo backup che provengono da te.
Los keywords propios son variables que creas tú – en la app en “Keywords”. En el editor están en “Variables → Ventoview” y funcionan como todas las demás: en textos ({streamer}), en condiciones, como valor para barras o reguladores de keyframes.
De dónde viene el valor
En “Valor de” eliges de dónde obtiene su valor un keyword. Comando de PowerShell y Código Python solo aparecen si activas arriba “Avanzado” – ejecutan algo en tu PC.
| Valor de | Qué hace | ¿Seguro? |
|---|---|---|
| Texto fijo | Un valor fijo, p. ej., tu nombre o Discord. | Sí – solo lee |
| Archivo de texto | El contenido de un archivo de texto, releído cada pocos segundos. Muchas herramientas (reproductores, bots) escriben información en un .txt. | Sí – solo lee |
| Dirección web | La respuesta de una dirección, opcionalmente un campo de ella (ruta JSON, ver abajo). | Sí – solo lee |
| Comando de PowerShell (Avanzado) | La salida de un comando de PowerShell – con ella llegas a casi todo lo que sabe Windows. | ¡Solo comandos propios! |
| Código Python (Avanzado) | Código Python propio que crea variables nuevas a partir de otras. | Modo seguro: sí. Acceso completo: ¡solo código propio! |
Además vienen integradas {zeit}, {datum}, {wochentag} y {laufzeit}. En “Ejemplos para usar” hay entradas listas para cada tipo – p. ej., el tiempo de tu ciudad con https://wttr.in/Heide?format=%t.
Crear
- En la app abre “Keywords”, “+ Keyword”.
- Escribe el nombre – solo a–z, 0–9 y _. No puede llamarse como una variable de un módulo; si no, la fila se pone roja.
- En “Valor de” elige el tipo y escribe el texto, archivo, dirección, comando o código.
- En todo salvo texto: Cada … s – cada cuánto se vuelve a leer.
- “Guardar”. A la derecha aparece el valor actual – o el error en rojo.
Renombrar y eliminar están protegidos: si un keyword se usa en diseños o textos del bot, la app pregunta antes y aplica el cambio de nombre en todas partes.
Python
Con Python calculas variables nuevas a partir de las existentes – p. ej., duplicar el ping, redondear valores, rehacer textos o contar algo. Necesitas Python 3 en el PC: instálalo desde python.org marcando “Add python.exe to PATH”.
Cómo funciona
- Todas las variables ya están – con su nombre, sin {}.
{ping}pasa a serping,{songtitle}songtitle. Los números llegan como números ("42"→42,"3,5"→3.5), todo lo demás como texto. - El valor lo fijas con el nombre del keyword. Si el keyword se llama
test, escribestest = …(mayúsculas/minúsculas da igual, también valeTEST = …). - Si al final esa variable no existe, cuenta
ergebnis = …– o lo que el código muestre conprint(…). True/Falsese convierten en “ja”/“nein” – adecuados para condiciones en el editor.- Un diccionario se convierte en variables propias:
test = {"min": 1, "max": 9}da{test_min}y{test_max}. speicheres un diccionario que se conserva entre ejecuciones (hasta reiniciar la app) – para contadores, máximos o medias.variablencontiene todas las variables como diccionario – útil si un nombre no es un nombre Python válido:variablen["mein-wert"].- El código se vuelve a ejecutar cada vez en el intervalo ajustado, como mucho durante 10 segundos.
Ejemplos
Calcular – keyword doppelt:
doppelt = ping * 2
Redondear y texto – keyword temptext:
temptext = f"{round(gputemp)} °C"
Sí/no para condiciones – keyword zuheiss (en el editor: condición “zuheiss es ja”):
zuheiss = gputemp > 80
Varios casos – keyword lage:
if ping < 30:
lage = "super"
elif ping < 80:
lage = "okay"
else:
lage = "lag!"
Contar con memoria – keyword lags, cada 10 s:
if ping > 80:
speicher["n"] = speicher.get("n", 0) + 1
lags = speicher.get("n", 0)
Azar y hora – keyword gruss:
import random
from datetime import datetime
stunde = datetime.now().hour
gruss = random.choice(["Hola", "Hey", "Buenas"]) if stunde < 18 else "Buenas noches"
Encontrar errores
Si el código no funciona, el error aparece en rojo en la vista previa – con la línea de tu código, p. ej., NameError: name 'pnig' is not defined (Zeile 1) (errata en el nombre). Frecuentes:
- NameError: la variable no existe (aún) – revisa el nombre y si su módulo está activo.
- TypeError al calcular: el valor es texto en vez de número, p. ej., porque la variable está vacía. Solución:
float(ping or 0). - IndentationError: sangría irregular – en el campo Tab sangra 4 espacios.
- “No se encontró Python 3”: instala Python (marca “Add to PATH”) y reinicia la app.
Modo seguro y acceso completo
Los keywords de Python funcionan por defecto en modo seguro. Se permite todo para cálculos, texto, listas y diccionarios, además de estos módulos: math, random, statistics, datetime, time, json, re, decimal, fractions, itertools, collections, functools, string, textwrap, calendar, operator, bisect, heapq, cmath.
Están bloqueados los archivos (open), otros módulos (os, subprocess, red …), eval/exec y el interior de Python (todo lo que empieza por _). En vez de "…".format() usa f-strings: f"{wert} ms".
Si necesitas más – p. ej., leer un archivo o consultar una web –, marca “Acceso completo” en el keyword. Entonces el código puede hacer todo lo que tú puedes hacer en este PC.
El acceso completo y los comandos de PowerShell funcionan con tus permisos: pueden borrar archivos, iniciar programas y enviar datos. Introduce solo código que hayas escrito tú o entiendas línea a línea – nunca código del chat, de Discord o de desconocidos. El modo seguro protege de errores y de código ajeno sencillo, pero no es una jaula perfecta.
Dirección web y ruta JSON
Si una dirección devuelve JSON, la ruta saca un campo: data.title, items[0].name – o busca en todo el árbol: **[Text~Tctl].Value toma el primer objeto cuyo campo “Text” contiene “Tctl”, y de él “Value”.
Ejemplo temperatura de CPU: Windows no la da por sí solo. Inicia el gratuito LibreHardwareMonitor (oficial en github.com/LibreHardwareMonitor) como administrador y activa Options → Remote Web Server → Run. Luego usa el ejemplo “Temperatura de CPU” – con Intel, en lugar de Tctl, la ruta **[Text~CPU Package].Value.
Copias de seguridad
Los keywords van incluidos en la copia completa (.vview). Si una copia contiene keywords de PowerShell o Python, la app avisa antes de cargarla – carga solo copias que vengan de ti.
Les keywords perso sont des variables que tu crées toi-même – dans l'app sous « Keywords ». Dans l'éditeur, elles se trouvent sous « Variables → Ventoview » et fonctionnent comme toutes les autres : dans les textes ({streamer}), dans les conditions, comme valeur pour les barres ou les curseurs d'images clés.
D’où vient la valeur
Sous « Valeur depuis », tu choisis d’où un keyword tire sa valeur. Commande PowerShell et Code Python n’apparaissent que si tu actives « Avancé » en haut – ils exécutent quelque chose sur ton PC.
| Valeur depuis | Ce que ça fait | Sûr ? |
|---|---|---|
| Texte fixe | Une valeur fixe, ex. ton nom ou ton Discord. | Oui – lecture seule |
| Fichier texte | Le contenu d'un fichier texte, relu toutes les quelques secondes. Beaucoup d'outils (lecteurs de musique, bots) écrivent des infos dans un fichier .txt. | Oui – lecture seule |
| Adresse web | La réponse d'une adresse, éventuellement un champ de celle-ci (chemin JSON, voir plus bas). | Oui – lecture seule |
| Commande PowerShell (Avancé) | La sortie d'une commande PowerShell – tu accèdes ainsi à presque tout ce que Windows sait. | Seulement tes propres commandes ! |
| Code Python (Avancé) | Ton propre code Python qui crée de nouvelles variables à partir d'autres. | Mode sécurisé : oui. Accès complet : seulement ton propre code ! |
Sont aussi intégrées {zeit}, {datum}, {wochentag} et {laufzeit}. Sous « Exemples à reprendre », il y a des entrées prêtes pour chaque type – ex. la météo de ta ville via https://wttr.in/Heide?format=%t.
Créer
- Dans l'app, ouvre « Keywords », puis « + Keyword ».
- Saisis un nom – seulement a–z, 0–9 et _. Il ne doit pas porter le nom d'une variable de module ; sinon la ligne devient rouge.
- Sous « Valeur depuis », choisis le type et saisis le texte, le fichier, l'adresse, la commande ou le code.
- Pour tout sauf le texte : Toutes les … s – à quelle fréquence c'est relu.
- « Enregistrer ». La valeur actuelle apparaît à droite – ou l'erreur en rouge.
Renommer et supprimer sont protégés : si un keyword est utilisé dans des designs ou des textes du bot, l'app demande d'abord et applique un renommage partout.
Python
Avec Python, tu calcules de nouvelles variables à partir de celles qui existent – ex. doubler le ping, arrondir des valeurs, remanier des textes ou compter quelque chose. Il te faut Python 3 sur le PC : installe-le depuis python.org en cochant « Add python.exe to PATH ».
Fonctionnement
- Toutes les variables sont déjà là – sous leur nom, sans {}.
{ping}devientping,{songtitle}songtitle. Les nombres arrivent comme nombres ("42"→42,"3,5"→3.5), tout le reste comme texte. - Tu définis la valeur avec le nom du keyword. Si le keyword s'appelle
test, écristest = …(majuscules/minuscules sans importance,TEST = …marche aussi). - Si cette variable n'existe pas à la fin, c'est
ergebnis = …qui compte – ou ce que le code affiche avecprint(…). True/Falsedeviennent « ja »/« nein » – adaptés aux conditions dans l'éditeur.- Un dictionnaire devient des variables séparées :
test = {"min": 1, "max": 9}donne{test_min}et{test_max}. speicherest un dictionnaire conservé entre les exécutions (jusqu'au redémarrage de l'app) – pour des compteurs, maximums ou moyennes.variablencontient toutes les variables sous forme de dictionnaire – pratique si un nom n'est pas un nom Python valide :variablen["mein-wert"].- Le code est relancé à chaque intervalle réglé, pendant 10 secondes au plus.
Exemples
Calculer – keyword doppelt :
doppelt = ping * 2
Arrondir et texte – keyword temptext :
temptext = f"{round(gputemp)} °C"
Oui/non pour les conditions – keyword zuheiss (dans l'éditeur : condition « zuheiss est ja ») :
zuheiss = gputemp > 80
Plusieurs cas – keyword lage :
if ping < 30:
lage = "super"
elif ping < 80:
lage = "okay"
else:
lage = "lag!"
Compter avec mémoire – keyword lags, toutes les 10 s :
if ping > 80:
speicher["n"] = speicher.get("n", 0) + 1
lags = speicher.get("n", 0)
Hasard et heure – keyword gruss :
import random
from datetime import datetime
stunde = datetime.now().hour
gruss = random.choice(["Salut", "Coucou", "Yo"]) if stunde < 18 else "Bonsoir"
Trouver les erreurs
Si le code ne tourne pas, l'erreur apparaît en rouge dans l'aperçu – avec la ligne de ton code, ex. NameError: name 'pnig' is not defined (Zeile 1) (faute de frappe dans le nom). Fréquentes :
- NameError : la variable n'existe pas (encore) – vérifie le nom et si son module tourne.
- TypeError en calculant : la valeur est du texte au lieu d'un nombre, ex. parce que la variable est vide. Solution :
float(ping or 0). - IndentationError : indentation irrégulière – dans le champ, Tab indente de 4 espaces.
- « Python 3 introuvable » : installe Python (coche « Add to PATH »), puis redémarre l'app.
Mode sécurisé et accès complet
Les keywords Python tournent par défaut en mode sécurisé. Tout ce qui sert aux calculs, au texte, aux listes et aux dictionnaires est permis, plus ces modules : math, random, statistics, datetime, time, json, re, decimal, fractions, itertools, collections, functools, string, textwrap, calendar, operator, bisect, heapq, cmath.
Sont bloqués les fichiers (open), les autres modules (os, subprocess, réseau …), eval/exec et les rouages internes de Python (tout ce qui commence par _). Au lieu de "…".format(), utilise des f-strings : f"{wert} ms".
S'il t'en faut plus – ex. lire un fichier ou interroger un site –, coche « Accès complet » sur le keyword. Le code peut alors faire tout ce que tu as le droit de faire sur ce PC.
L'accès complet et les commandes PowerShell tournent avec tes droits : ils peuvent supprimer des fichiers, lancer des programmes et envoyer des données. N'y mets que du code que tu as écrit toi-même ou que tu comprends ligne par ligne – jamais du code venant du chat, de Discord ou d'inconnus. Le mode sécurisé protège des erreurs et du code étranger simple, mais ce n'est pas une cage parfaite.
Adresse web et chemin JSON
Si une adresse renvoie du JSON, le chemin en extrait un champ : data.title, items[0].name – ou cherche dans tout l'arbre : **[Text~Tctl].Value prend le premier objet dont le champ « Text » contient « Tctl », et sa « Value ».
Exemple température CPU : Windows ne la fournit pas lui-même. Lance le gratuit LibreHardwareMonitor (officiel sur github.com/LibreHardwareMonitor) en administrateur et active Options → Remote Web Server → Run. Reprends ensuite l'exemple « Température CPU » – sur Intel, au lieu de Tctl, le chemin **[Text~CPU Package].Value.
Sauvegardes
Les keywords sont inclus dans la sauvegarde complète (.vview). Si une sauvegarde contient des keywords PowerShell ou Python, l'app te prévient avant le chargement – ne charge que des sauvegardes qui viennent de toi.