Added a MobDebug enabler script.
This file is to be copied to a plugin's folder in order to debug that plugin with MobDebug.
This commit is contained in:
parent
0aac17874c
commit
e4c3d3eb6d
29
MCServer/Plugins/@EnableMobDebug.lua
Normal file
29
MCServer/Plugins/@EnableMobDebug.lua
Normal file
@ -0,0 +1,29 @@
|
||||
|
||||
-- @EnableMobDebug.lua
|
||||
|
||||
-- Enables the MobDebug debugger, used by ZeroBrane Studio, for a plugin
|
||||
-- Needs to be named with a @ at the start so that it's loaded as the first file of the plugin
|
||||
|
||||
--[[
|
||||
Usage:
|
||||
Copy this file to your plugin's folder when you want to debug that plugin
|
||||
You should neither check this file into the plugin's version control system,
|
||||
nor distribute it in the final release.
|
||||
--]]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- Try to load the debugger, be silent about failures:
|
||||
local IsSuccess, MobDebug = pcall(require, "mobdebug")
|
||||
if (IsSuccess) then
|
||||
MobDebug.start()
|
||||
|
||||
-- The debugger will automatically put a breakpoint on this line, use this opportunity to set more breakpoints in your code
|
||||
LOG(cPluginManager:GetCurrentPlugin():GetName() .. ": MobDebug enabled")
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user