Since Aleph One doesn't (and shouldn't) have an integrated Lua debugger, we must often resort to the age-old technique known as "printf debugging". In regular scripts, this is easily achieved either through printing (to screen or to log) or through overlays. HUD scripts don't have access to any such machinery. One could add plumbing to the HUD script to display some stuff on screen, but sometimes that's not as useful as getting a big text file you can scroll and grep through.
While it is obviously a good idea to prevent HUD scripts from randomly writing to the filesystem, and (less obviously, but no less truly) a good idea to prevent HUD scripts from being able to send information to regular scripts, allowing print seems harmless enough. A malicious HUD script could create an explosively huge log file by spamming explosively huge print, but it can already do that by spamming explosively huge error calls… and since HUD scripts can only come from plugins, the risk of running a malicious HUD script is considerably less than that of running a malicious netscript.
Since Aleph One doesn't (and shouldn't) have an integrated Lua debugger, we must often resort to the age-old technique known as "printf debugging". In regular scripts, this is easily achieved either through printing (to screen or to log) or through overlays. HUD scripts don't have access to any such machinery. One could add plumbing to the HUD script to display some stuff on screen, but sometimes that's not as useful as getting a big text file you can scroll and grep through.
While it is obviously a good idea to prevent HUD scripts from randomly writing to the filesystem, and (less obviously, but no less truly) a good idea to prevent HUD scripts from being able to send information to regular scripts, allowing
print
seems harmless enough. A malicious HUD script could create an explosively huge log file by spamming explosively hugeprint
, but it can already do that by spamming explosively hugeerror
calls… and since HUD scripts can only come from plugins, the risk of running a malicious HUD script is considerably less than that of running a malicious netscript.