Skip to content

Instantly share code, notes, and snippets.

@caroparo
Last active September 25, 2017 06:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caroparo/4478f6190da0475e7254733852c19ac5 to your computer and use it in GitHub Desktop.
Save caroparo/4478f6190da0475e7254733852c19ac5 to your computer and use it in GitHub Desktop.
var generate_uuid = true;
var fname_uuid = "uuid.ini";
ini_open(fname_uuid);
global.uuid = ini_read_string("generated", "uuid", "unknown");
ini_close();
if (global.uuid == noone or global.uuid == "unknown")
{
show_debug_message("no good: " + global.uuid);
generate_uuid = true;
}
else
generate_uuid = false;
if (generate_uuid)
{
randomize();
global.uuid = uuid_generate();
ini_open(fname_uuid);
ini_write_string("generated", "uuid", global.uuid);
ini_close();
}
return global.uuid;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment