Skip to content

Instantly share code, notes, and snippets.

View SalatielSauer's full-sized avatar
🇧🇷
Salatiel#5274

Salatiel SalatielSauer

🇧🇷
Salatiel#5274
View GitHub Profile
@SalatielSauer
SalatielSauer / Sauer Vertex.md
Last active May 5, 2024 03:50
Blender python script to export object vertices to Sauerbraten

Blender + OGZ-Editor = beauty

This is a simple Blender script that exports the positions of an object's vertices to the format used by OGZ-Editor to generate .ogz (map) files.

@SalatielSauer
SalatielSauer / base64.cfg
Created April 21, 2024 20:36
CubeScript base64 encoder/decoder
// base64 encoder/decoder, ported to cubescript by @SalatielSauer
// usage: /echo (base64 1 "Hello") // encode
// /echo (base64 0 "SGVsbG8") // decode
base64 = [
local base64Chars base64CharAt encode decode isNaN
base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
base64CharAt = [substr $base64Chars $arg1 1]
isNaN = [! (codestr $arg1)]
@SalatielSauer
SalatielSauer / sauerbraten_src_comments_dump.txt
Created November 10, 2023 23:50
Cube 2 Sauerbraten Source Code Comments
// FIXME hudgunorigin(), and shorten to maxrange
// projectile, cast on target
// only one in the air at once
//mpdir = vec(yaw*RAD, pitch*RAD);
// cast on self
// FIXME: make fast "give me all rpgobs in range R that are not X" function
// quick reject, for now
// cast on target
// alternative version of update() if this ent is the main player
//lastaction = lastmillis;
@SalatielSauer
SalatielSauer / obrstructure.md
Created June 4, 2023 04:01
Incomplete data structure of Cube 2 Sauerbraten OBR (prefabs) files.

OBR File Format Incomplete Structure

OBR is a file format that holds presets of Sauerbraten map geometries.

This is an incomplete overview and may contain misinterpretations, feel free to correct or add more information. :)

Example of an uncompressed .obr file:

4f45 4252 0000 0000 f001 0000 1002 0000 0002 0000 // header
0100 0000 0100 0000 0100 0000 1000 0000 0000 0000 // selection setup
0000 8083 8043 5050 8080 8080 8080 0100 0100 0200 0300 0400 0500 // first "cube"
@SalatielSauer
SalatielSauer / calcario.alg
Last active March 23, 2023 23:43
Converte binário para decimal em Portugol
Algoritmo "Binario-Para-Decimal"
//Feito por Salatiel S.
//a lógica é simples: leia cada digito do binário individualmente da direita
//para a esquerda, se o digito for 1, o valor "imáginario" do digito atual será
//somado para o resultado final.
Var binarioInput: caractere //valor em binário
i: inteiro //digito indivudal do binário
valorImaginario: inteiro //valores de soma 1 2 4 8 16 32 64..
binarioInvertido: caractere //binário invertido para a soma ficar coerente
valorDecimal: inteiro //resultado final
@SalatielSauer
SalatielSauer / maptomodel.cfg
Last active March 20, 2023 23:24
A UI for Sauerbraten that generates the files needed to load a map as a mapmodel.
_fs_debug = 0
_fs_appendline = [
if (!=s $arg1 "") [
if $_fs_debug [echo (concat "^f0append ^f2" @arg1)]
append _fs_linesbuff (concatword "[" $arg1 "]")
]
]
_fs_open = [
_fs_linesbuff = []
@SalatielSauer
SalatielSauer / readme.md
Last active March 12, 2023 20:29
Concatenated JSON data for all Sauerbraten map variables.

Data extracted with a slightly altered version of genserverogz to output the result in a json format.

sauer-mapvars-values.json contains the values in the indexes that correspond to the items in sauer-mapvars-identifiers.json. The index value is null if the map does not use a particular mapvar.

@SalatielSauer
SalatielSauer / dreambooth-sd-cube-2-sauerbraten.ipynb
Last active November 27, 2022 01:43
Dreambooth - SD: Cube 2 Sauerbraten (fork)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@SalatielSauer
SalatielSauer / bestdelay.js
Last active May 29, 2022 15:27
A JavaScript function to calculate the best delay between a certain amount of tasks to evenly distribute them within a time range.
// organize tasks at equal intervals within a time range.
// receives two objects (start and end hours) and an integer (tasks)
function spreadTasks(start = {h: 0, m: 0}, end = {h: 23, m: 59}, tasks) {
let totalHour = end.h - start.h;
let totalMinute = end.m - start.m;
let totalTime = (totalHour*60)+totalMinute;
let taskTable = [];
for (let i = 0; i <= totalTime; i+=(totalTime/tasks)) {
let taskTime = ((start.h*60)+start.m)+i;
let taskHour = Math.floor(taskTime/60);
@SalatielSauer
SalatielSauer / DGKminer.md
Last active March 24, 2022 17:28
NodeJS for mining Discord Gift keys.

Some Important Informations

  • This kind of mining is not illegal.
  • This is far from a "hacking script".
  • Keys are valid for a few minutes after a user action, so the chances of getting a valid one are minimal.
  • A key is generated every 2.5 seconds, it can not be less than this to avoid a "block" coming from discord api.
    • Even with this delay, sometimes the block will happen ("You are being rate limited."), but it will only last a few seconds.
  • Although not illegal, if you are lucky enough to get a valid key, be aware that someone else will have this key stolen if you claim it (and this is not cool xD).
  • Everything was done for study proposals, use at your own risk!!1

How it works