DevPad

_DevPad is an in-game text editor and addon authoring tool, inspired by Mud'sHack.

Keep notes with it, write Lua scripts, or prototype addon concepts in its trimmed down development environment. Organize your scripts into folders and share them with other _DevPad users. Scripts can run automatically on login like mini addons, and can call each other like libraries or dependencies.

Details

When you first install _DevPad, it includes an Instruction Manual script with a quick reference to using the mod. Here's an even quicker reference to the simple UI:

List Window

Reorganize scripts and folders by dragging and dropping. Rename any folder or script by double clicking.

Set scripts to auto-run by clicking the arrow buttons next to their names in the list. They will then run right after _DevPad's ADDON_LOADED event in the listed order.

Search script contents using Lua patterns in the search bar below the list.

Editor Window

Adjust font and font size, toggle Lua mode per-script, and access other editing tools with buttons at the editor's top-right.

Without Lua mode, chat links in scripts become clickable, and text coloring tools appear at the editor's top-right.

Use line numbers to navigate code. Click a line number to select that line.

There is no save button; Script text is saved as you type.

Undo and redo changes with standard keyboard shortcuts, or with the left and right arrow buttons at the top-right of the editor.

Use familiar keyboard shortcuts to manipulate text:

<Ctrl+Z>/<Ctrl+Shift+Z>: Undo and redo.

<Ctrl+G>: Go to line number dialog.

<Ctrl+F>: Focus the list's search edit box.

<F3>/<Shift+F3>: Jump to next/previous search result.

Usage

There are two ways to open the list window: by keybind, or with the /devpad or /pad slash commands.

There are also two ways to run scripts as Lua code. With a script open, click the play button at the top-left of the editor window. Alternatively, you can run them by name if you include a Lua pattern with the slash command, like so: /devpad Example Script. You can use the slash command in a macro to bind keys to _DevPad scripts.

Sending and Receiving

You can send scripts, even entire folders, to others with the trumpet icon at the top of the list window. When you receive something, you'll hear a sound and see a chat message prompting you to open your _DevPad. Once opened, you can choose to keep or discard the new item. Remember to always inspect what you receive from others before you run it though!

Notes

For help writing scripts, see the default Instruction Manual and Example Script pages.

Some components of _DevPad can safely be deleted to trim the editor even further:

By default, _DevPad comes with an Importers folder containing scripts to import pages from other notepad mods. WowLua, Hack, and TinyPad are currently supported. See the comments at the tops of these scripts for specific usage instructions.

Added a new default library script named Libs/RegisterForSave to allow other scripts to save variables between sessions. See <_DevPad/_DevPad.DefaultScripts.lua> if you want to copy it into your existing pad.

While dragging an object in the list window, folders will only expand if you hold your mouse over them briefly.

Folders can now be opened and closed by simply clicking their names. Also, they now temporarily close while being dragged.

Is there simple functionality to let me access savevariable-type stuff? (not for other addons - I know that's not possible) For example, if devpad maintained a save variable table for itself, then I could read/write arbitrary data which could survive a reload ui / restart.

I added a library called "RegisterForSave" to one of the more recent releases, but if you used _DevPad before then, you have to copy it in manually. Search <_DevPad/_DevPad.DefaultScripts.lua> for "RegisterForSave" and copy that script's contents into a new page in your list somewhere (it doesn't need to be under "Libs"). The library stores saved variables in a folder of script pages, to avoid tampering with _DevPad's raw saved variables. It behaves similarly to the old RegisterForSave API, with additional support for default values.

Although I took a break from WoW, I came back and I'm still using _DevPad. Since i found it all those years ago it's been an invaluable tool.

--

I'm even more rusty than my previous break, but I'm slowly getting back into things. Right now I hit a wall with having a script run on startup.

My previous solution was:

Lua Code:

local frame = CreateFrame("FRAME", "SprialofhopeZoomFrame")

frame:RegisterEvent("PLAYER_ENTERING_WORLD")

localfunction eventHandler(self, event, ...)

-- do stuff

end

frame:SetScript("OnEvent", eventHandler)

My current work in progress is:

Lua Code:

-- Create an anonymous blank frame

local frame = CreateFrame('Frame')

frame.RegisterEvents = RegisterEvents

-- PLAYER_ENTERING_WORLD is fired when the player enters the world, enters/leaves an instance, or respawns at a graveyard. Also fires any other time the player sees a loading screen.

frame:RegisterEvent("PLAYER_ENTERING_WORLD")

frame:SetScript("OnEvent", function(self, event, ...)

-- do stuff

end)

At this point I'm stealing code which is reported to work, but just doesn't work for me.

The code I'm running is interacting with the frames being created by another addon. It should still work, because the addon will have already loaded before PLAYER_ENTERING_WORLD is triggered. I can run it manually without any of the above autorun code, and it works. However, I cannot make it work on /console reloadui.

Is this an interaction with _DevPad?

If this is a misunderstanding with how to use event registration, I can check with the developer forums and have my hand held.

I did end up solving my problem by hacking the addon directly, but I'm still curious about solving this in a better way.

I've gotten in touch with Torhal, which is one of the authors of _Devpad. He will be properly updating this addon. I also attempted to bring his attention to other bugs, including background devpad frames stealing clicks away from foreground devpad frames, sending of pages or folders to other users (trumpet icon) and pages not saving on reloadui / logout / exits, along with the existing texture issues, which is what spiralofhope patched in his 7.0.3 copy.

I've gotten in touch with Torhal, which is one of the authors of _Devpad. He will be properly updating this addon. I also attempted to bring his attention to other bugs, including background devpad frames stealing clicks away from foreground devpad frames, sending of pages or folders to other users (trumpet icon) and pages not saving on reloadui / logout / exits, along with the existing texture issues, which is what spiralofhope patched in his 7.0.3 copy.

I don't know exactly when I'll get to it, however; I'm currently in the middle of a from-scratch rewrite of NPCScan (yes, I dropped the leading underscore), Archy needs digsite data and other things, Ackis Recipe List and Collectinator both need some love, and _Cursor is completely broken at the moment due to changes in 7.x with how 3D models are handled.

Support AddOn Development!

You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.