-
Notifications
You must be signed in to change notification settings - Fork 1
Desktop
GhostglowDev edited this page Mar 21, 2024
·
2 revisions
local pc = require "ghostutil.desktop"
Wiki made by TBar09
WARNING: Some of these functions are super dangerous and could harm your system if you don't use them with caution! Please use with care.
(GhostglowDev, T-Bar, and the GhostUtil Contributors is NOT responsible for any harm done to any computer as a result of using these functions without care)
-
codeToRun
: the Command Prompt code you want to run.
function onCreatePost()
pc.runCMDCode("start https://www.youtube.com/watch?v=dQw4w9WgXcQ")
end
-
codeToRun
: the Nircmd code you want to run (must include "nircmd.exe " at the beginning) -
includeNircmdTag
: Do you want the "nircmd.exe " part to be added automatically?
function onSongStart()
pc.runNircmdCode([[nircmd.exe infobox "Title" "message" ]], false)
pc.runNircmdCode([[infobox "Title" "message" ]], true)
end
Makes a default message box, similar to the "window.alert()" function in Application.
-
message
: The message inside the box. -
title
: The title of the message box.
function onSongStart()
pc.infobox("This is a cool message. Hi!", "This is a title!")
end
-
message
: The message inside the box. -
title
: The title of the message box. -
yesFunction
: The code to run if you press "yes". -
whatToRun
: What should be ran if you press "yes"? can be "command" or "program". -
onTop
: Is the question box created on top of all apps?
function onSongStart()
pc.qbox("Do you like GhostUtil?", "Quick question", "calc.exe", "program", false)
pc.qbox("are cats cool?", "Quick question... again", [[infobox "Yea, cats are cool" "Correct Answer" ]], "command", true)
end
-
script
: The filepath of the script, starting in the 'nircmd' folder.
function onCreate()
pc.runNircmdScript("nirscripts/myscript.ncl")
end
function onGameOver()
pc.turnMonitorOff()
end
-
shutdownType
: can be:- 'logoff' - Logs off the current user and displays the log-on dialog to allow another user to log-in.
- 'reboot' - Performs a reboot.
- 'poweroff' - Shut down the entire system, and then turns off the power. (only if your pc supports this)
- 'shutdown' - Shuts down the entire system and reboots, only it doesn't turn off the power.
-
additionalOption
: can be:- 'force' - Terminates all running applications, no question. This can cause an application to lose data, so use it with care.
- 'forceifhung' - Only terminates the application IF its not responding (only on Windows 2000 or XP).
function onNoteMiss()
pc.exitwin('reboot')
pc.exitwin('reboot', 'force')
end
-
message
: The message displayed before the the shutdown. -
timeOutInSeconds
: How many seconds it takes before the shutdown, gives you a chance to close it. -
shutdownType
: can be:- 'reboot' - Performs a reboot.
- 'force' - Terminates all running applications, no question. This can cause an application to lose data, so use it with care.
function onGameOver()
pc.initshutdown("This is a message, your pc is about to be shut off.", 10)
pc.initshutdown("This is a message, your pc is about to be rebooted.", 10, 'reboot')
end
-
action
: The action to be performed:- 'off' - Turns the monitor off.
- 'async_off' - Turn off the monitor. Use this value if Nircmd remains in memory when using monitor off.
- 'on' - Turns on the monitor.
- 'low' - Set the monitor to low power mode/state.
function onCreatePost()
if lowQuality then
pc.performMonitorAction('low')
end
end
Reading this wiki is recommended before using GhostUtil