Go to Page... |
Updated: | 05-02-09 04:29 AM |
Created: | unknown |
Downloads: | 15,322 |
Favorites: | 68 |
MD5: |
Hack is a lightweight notebook and/or code development addon.
Hack makes it easy to manage a large collection of notes/scripts and share them with other Hack users. Pages containing Lua code can be run and/or flagged to auto-run on startup; they can call other pages, passing arguments and receiving return values. This lets Hack serve as an in-game file system for Lua scripts.
OPTIONAL:
Hack includes several example pages. They are easily deleted from within Hack, or you can prevent them from ever being loaded by deleting HackExamples.lua from the Hack folder.
Hack itself is lightweight (<60KB), but it includes a library for highlighting/indenting Lua code (FAIAP) which will add some additional memory usage and garbage generation. It's not a big deal, but if you just use Hack as a notebook and never edit Lua code, feel free to delete Indent.lua from the Hack directory.
IMPORT:
Hack's example pages include scripts to import pages from Tinypad, Nefpad, WowLua, and LuaSlinger. LuaSlinger supports triggering pages by events, and the importer shows how easily you can wire up the same functionality in Hack.
If you have another notepad addon you want to pull pages from, lemme know.
USAGE:
/hack -- toggle Hack UI
/hack <hack name> -- run a Hack page by name
The UI is mostly self-explanatory (mouse over buttons to see what they do), but a few things deserve special mention:
1. To run the current page as Lua code, click the 'play' button at the top of edit window (this one) or hit SHIFT+TAB from the editor.
2. To make a page run automatically when Hack loads, click the 'play' button next to it's name in the list window. This makes Hack useful for little tweaks that don't warrant a full-blown addon. For instance, I hate the mail font. It's easy to fix, but I don't want to write a whole addon for two lines of code, so I type the lines into a Hack page and flag it to execute. Done.
NOTES:
* Pages are saved as you type and there is no undo, so be careful. If you really screw up a page, you can hit the Revert button, which will give you back the page as it was when you first opened it.
* The list frame and edit frame are resizable. Just grab the little handle in the bottom right corner.
* You can double-click a page name to rename it (in addition to using the rename button).
* Page search is case insensitive. You use a subset of regex search patterns (^$.*-+?).
* Autorun pages run in the order they appear, so you can control their execution order by moving them up and down the list.
EXAMPLES:
I included example pages to show how I use Hack. You can delete these quickly via the books tab. To speed Hack's loading, remove HackExamples.lua from the addon folder.
The "lib:" pages contain library code I find useful in many scripts. To facilitate the use of libraries, Hack contains one built-in function Hack.Require, which can be used to make sure a page you are dependent on is loaded, while preventing it from being loaded more than once.
The arg processing examples show how you can execute a page by name, optionally passing arguments and/or receiving return values.
The "timer lib" examples show how to use "lib: timer".
The "cmd:" examples add new slash commands to the game.
The "ui:" examples are various minor tweaks to the UI.
The "hack:" examples are bits of code I used to write Hack. Saves you a lot of reloading to develop with a tool like this.
FEEDBACK:
I'd love to get feedback about Hack. What you like, what you don't like, what you'd like to see in future versions (keeping in mind that my intention is to keep it as small as possible).
Cheers,
Eric Tetz
<[email protected]>
Comment Options |
Mud |
View Public Profile |
Send a private message to Mud |
Find More Posts by Mud |
Add Mud to Your Buddy List |
04-04-09, 07:10 PM | |
A Kobold Labourer
Forum posts: 0
File comments: 5
Uploads: 0
|
Just ran into this mod now looking for a new notebook addons and have to say AWESOME job on it, many thanks!!
|
|
Zanyth0x42 |
View Public Profile |
Send a private message to Zanyth0x42 |
Find More Posts by Zanyth0x42 |
Add Zanyth0x42 to Your Buddy List |
03-28-09, 07:26 PM | |
|
Great addon
Just have to say I love the addon. I took all my one off "addons" and macros and consolidated them all to Hack.
I did have some problems with the timer and event libs that came with it, but I just threw in the following for a quick fix:
With a few scripts running on load, I now have embedded AceTimer and AceEvent into Hack (I didn't modify the Hack code directly); example: Code:
if not Hack.RegisterEvent then LibStub("AceEvent-3.0"):Embed(Hack) end Code:
Hack:RegisterEvent("PLAYER_LOGIN", function() ... end) With the LibDataBroker library, I can create data brokers on the fly, which is nice rather than have to package 10 lines of code up as an "addon". I think the problem I had with the timer code that came with it is I was trying to remove a timer when it was trying to run it. I kept getting a nil index error, which is why I simply added AceTimer-3.0 inside a 'lib' directory in Hack and just embedded it in a new 'lib: timer' script rather than modify Hack directly. That's one reason I like Hack... quite flexible. Thanks! |
|
kellewic |
View Public Profile |
Send a private message to kellewic |
Find More Posts by kellewic |
Add kellewic to Your Buddy List |
11-02-08, 05:54 PM | ||
A Defias Bandit
Forum posts: 3
File comments: 8
Uploads: 0
|
|
|
|
doomveteran |
View Public Profile |
Send a private message to doomveteran |
Find More Posts by doomveteran |
Add doomveteran to Your Buddy List |
10-30-08, 07:15 PM | ||
|
I do think that the escape to clear focus will be useful, theres been a number of times while editing that I wished I could be editing, clear the focus and answer something someone asked on guild without having to close the hack window. And for me personally, I like the books, like someone else posted, I can have a book for notes, one for code and so on, its just useful to me. I do think that having the book page have an autorun toggle would be a nice solution to the problem of being on one book but having the other books not load their autoruns. Came here looking to see if there was a new version for that exact reason, because I have was testing timers in my book, would reload for my mod, but then my books code would error because timer (which is on autorun on mine) wasn't loaded. Would be nice to be able to set individual books (if you are staying with books) to run their autoruns. |
|
|
EVmaker |
View Public Profile |
Send a private message to EVmaker |
Visit EVmaker's homepage! |
Find More Posts by EVmaker |
Add EVmaker to Your Buddy List |
10-21-08, 11:52 PM | |||
|
|
||
|
Mud |
View Public Profile |
Send a private message to Mud |
Visit Mud's homepage! |
Find More Posts by Mud |
Add Mud to Your Buddy List |
10-20-08, 05:56 PM | |
|
The /qq page seems to have a bug; if it is set to run when loaded, right-clicking names in chat starts a tell to them instead of popping up the usual menu.
Specifically, it looks like the problem is SetItemRef() -- it is defined as taking an argument called mousebutton, but then calls the original function with the argument button. Since that's a nil, no mouse button is defined, so the original thinks it's a left click, not a right click. |
|
seebs |
View Public Profile |
Send a private message to seebs |
Visit seebs's homepage! |
Find More Posts by seebs |
Add seebs to Your Buddy List |
10-20-08, 05:27 PM | ||
|
Mostly, though, I think it's just consistency with everything else. |
|
|
seebs |
View Public Profile |
Send a private message to seebs |
Visit seebs's homepage! |
Find More Posts by seebs |
Add seebs to Your Buddy List |
10-17-08, 02:34 PM | ||||
|
|
|||
|
thegabbert |
View Public Profile |
Send a private message to thegabbert |
Visit thegabbert's homepage! |
Find More Posts by thegabbert |
Add thegabbert to Your Buddy List |
10-17-08, 01:16 PM | ||
|
|
|
|
Mud |
View Public Profile |
Send a private message to Mud |
Visit Mud's homepage! |
Find More Posts by Mud |
Add Mud to Your Buddy List |
10-17-08, 11:18 AM | ||
|
And regarding the book think, it would be annoying for people that already have books. But it sure would make things a lot cleaner. |
|
|
Nefarion |
View Public Profile |
Send a private message to Nefarion |
Visit Nefarion's homepage! |
Find More Posts by Nefarion |
Add Nefarion to Your Buddy List |
10-17-08, 09:10 AM | ||||
|
What if you the 'autorun' button was available in the book window, such that you could enable/disable entire books. Would that make it a useful as an organizational feature?
Unfortunately, it's a breaking change for people who already have multiple books. I can just merge them when loading the new version, but I wonder how many people that would piss off?
Last edited by Mud : 10-17-08 at 09:27 AM.
|
|||
|
Mud |
View Public Profile |
Send a private message to Mud |
Visit Mud's homepage! |
Find More Posts by Mud |
Add Mud to Your Buddy List |
10-17-08, 07:08 AM | |||
|
Go ahead and add code. Stop worrying about its size. Functionality, ease of coding, and true performance impact are what matter. Edit: Hack broke. I un-stuck the edit frame, and when I reloaded, it refused to open up. I can't seem to find anything in the code to fix it. Edit: Yeah, it appears the HackEditFrame is somehow going off-screen when I reload, if it isn't attached to the list frame. I had to manually reposition it with HackEditFrame:ClearAllPoints(), ... .
Last edited by Nefarion : 10-17-08 at 07:37 AM.
|
||
|
Nefarion |
View Public Profile |
Send a private message to Nefarion |
Visit Nefarion's homepage! |
Find More Posts by Nefarion |
Add Nefarion to Your Buddy List |
10-16-08, 11:21 PM | ||
|
I'll think out loud for a second here, so I can get some feedback before making any changes. Initially 'books' were going to be 'profiles', in which case it makes sense for only the selected one to run (with the index of the selected book stored per-character; currently it's not). I can easily make autorun iterate through all books, but then they couldn't be used as profiles (as John Carmack said, "The cost of adding a feature isn't just the time it takes to code it. The cost also includes the addition of an obstacle to future expansion.") I need to figure out some way of letting you enable some scripts only for certain toons. I don't think the traditional profile approach -- where each profile has a totally separate data -- suits Hack, because you really want to share pages (probably the majority) between profiles. Ideally, you'd be able to toggle individual pages as "private" or "public" (or local/global, me/everyone, etc.) so that private pages are seen only by your character and public pages are shared between all characters. I put a lot of thought into that, but it's a nightmare to implement if you want to maintain the pages as an ordered list. Any clever ideas in that regard would be helpful. I suppose I could just totally ditch the idea of supporting profiles directly, and you just maintain a Hack page which runs player-specific pages on startup. Something like: Code:
local profile = { Mud = { 'sheep watching hack', }, Rhodes = { 'shapeshifting hack', 'tanking hack', 'some other hack' }, } for page in pairs(profile[UnitName'player'] or {}) do Hack.Run(page) end Thoughts? Anyway, don't want to make any decisions right now (massive sleep deprivation). I'll take a fresh look in the morning. Cheers, Mud
Last edited by Mud : 10-17-08 at 09:25 AM.
|
|
|
Mud |
View Public Profile |
Send a private message to Mud |
Visit Mud's homepage! |
Find More Posts by Mud |
Add Mud to Your Buddy List |
10-16-08, 10:07 PM | |
|
I have either a bug report or a gripe, depending on whether or not the following behavior was intentional.
I have set up three books, one for notes, one for scripts I write, and one the example book that comes with the mod. The example book is unmodified. The behavior I take issue with is that only the "current" book is checked for autorun scripts on startup. So if I am looking at the examples book and I reload ui, autorun scripts in my scripts book do not fire. If I switch to my scripts book and try to execute one of them, it works fine. But if I reload ui at that point, my scripts do fire but they complain about functions defined in the examples book, which never fired. Worse still, if I happen to be looking at my notes book when I reload, nothing fires! For the short term, I have moved all my notes and scripts into one book, and everything seems to be working fine. But it would help me out immensely if all books would autorun scripts on startup. |
|
thegabbert |
View Public Profile |
Send a private message to thegabbert |
Visit thegabbert's homepage! |
Find More Posts by thegabbert |
Add thegabbert to Your Buddy List |