Ich habs gerade gebraucht - falls noch jemand Bedarf hat:
Lua
--[[
----------------------------------------------------------------------------------------------------
Creating a UUID using values from the SciTE registry table
Parts that change their value:
W - after Windows has been (re)started
O - after SciTE was (re)opened
T - after the number of opened tabs has changed
--------------------------------------------------------------------------------------------------]]
function GenerateSciTEUserUUID()
local extract = function(s, count)
return tostring(s):match('([A-F0-9]+)'):reverse():sub(1, count)
end
local tSciTEREG = debug.getregistry()
local uuid =
tostring(extract(tSciTEREG['_IO_output'], 8)) .. '-' .. -- [W]
tostring(extract(tSciTEREG['SciTE_MT_Props'], 4)) .. '-' .. -- [W, O]
tostring(extract(tSciTEREG['SciTE_InitialPackageState'], 4)) .. '-' .. -- [W, O, T]
tostring(extract(tSciTEREG['LUABOX'], 4)) .. '-' .. -- [W, O]
tostring(extract(tSciTEREG['SciTE_MT_Pane'], 8)) .. -- [W, O, T]
tostring(extract(tSciTEREG['SciTE_BufferData_Array'], 4))
return uuid
end -- GenerateSciTEUserUUID()
Alles anzeigen
Beachten: Der Wert ändert sich nicht zwingend bei jedem Aufruf, sondern bei den angegebenen Ereignissen.