How to check if someone has clicked ok or cancel on a debug box
Posted: 29 Jan 2016, 18:22
title says it all. I want to use it for something in an episode.
Official Community of WohlSoft Team
https://wohlsoft.ru/forum/
I wouldn't answer a "How to"-Question with a yes or no.lighthouse64 wrote:How to check if someone has clicked ok or cancel on a debug box
pcall is a global lua function:lighthouse64 wrote:Also, is pcall a global function?
Code: Select all
if pcall(windowDebug("LOL")) then
-- Success! No error
else
-- Error! Probably hit "cancle"
end
Code: Select all
function onLoad()
if pcall(windowDebug("Are you a nice person?")==true) then
windowDebug("you are invited!")
else
windowDebug("Die.")
end
endCode: Select all
function onLoad()
if(pcall(windowDebug("Are you a nice person?"))==true)then
windowDebug("you are invited!")
else
windowDebug("Die.")
end
end

Code: Select all
if pcall(function() windowDebug("LOL") end) then
-- Success! No error
else
-- Error! Probably hit "cancle"
end
