Last active
September 25, 2017 06:22
-
-
Save caroparo/4478f6190da0475e7254733852c19ac5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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