Download
(62Kb)
Download
Updated: 05-02-09 04:29 AM
Pictures
File Info
Updated:05-02-09 04:29 AM
Created:unknown
Downloads:15,238
Favorites:68
MD5:

Hack  Popular! (More than 5000 hits)

Version: 1.2.2
by: Mud [More]

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]>

1.2.2 Cosmetic changes (removed background texture, added grips to window corners, etc.)
1.2.1 Fixed bug in indent library.
1.2 Syntax highlighting can now be toggled on/off on a per page basis, or can be permanently disabled by deleting Indent.lua from the Hack folder. This required some fixes to the library, so Hack is no longer compatible with vanilla FAIAP.
1.1.2 Syntax highlighting no longer optional (until I can work out some bugs in the library which prevent it from being enabled/disabled on the fly).
1.1 Added "Send" button, fixed bug in Quest Query example, add/removed/improved a few examples.
1.0.6 Fixed error in Snap which caused edit window to disappear; changed ESC behavior (now clears focus from edit box). Bigger changes coming... *dun dun dun*
1.0.5 Updated to WotLK compatible, including a few necessary changes to the example pages (Quest Query and 'lib: event' in particular)
1.0.4 Update event lib and LuaSlinger importer
1.0.3 Added importers for other notebook addons, made Hack.lua WotLK compatible (Hack.xml will have to wait for release), various minor polish tweaks.
1.0.2 Added support for All Indents and Purposes
1.0.1 Update SavedVariables in TOC
Optional Files (0)


Post A Reply Comment Options
Unread 10-08-08, 12:16 PM  
IceShadow
A Deviate Faerie Dragon
 
IceShadow's Avatar

Forum posts: 15
File comments: 93
Uploads: 0
Would you be offended if I used this as just a normal notepad, rather then a tool to run scripts n' such?

Actually I'll probably end up running some scripts in it eventually but I like the way you set this up so I'll probably do both. Nice work!
Report comment to moderator  
Reply With Quote
Unread 10-08-08, 04:35 PM  
Mud
A Murloc Raider
AddOn Author - Click to view AddOns

Forum posts: 8
File comments: 23
Uploads: 4
Originally posted by IceShadow
Would you be offended if I used this as just a normal notepad, rather then a tool to run scripts n' such?
Not at all. So made the scripting support unintrusive so Hack could be used just as a notepad, too. Glad you like it.
Report comment to moderator  
Reply With Quote
Unread 10-11-08, 06:25 PM  
DrChaos
A Fallenroot Satyr

Forum posts: 24
File comments: 12
Uploads: 0
One question. I have several chars on the same account but only the account that im typing the info in can see it.

i create a book with char a and give it several pages. i log onto char b and can see the pages names but not the text that fills the pages made by char a.

ive located the lua file in the wtf/account/myaccountname/savedvariables/hack

is there a way so all my chars can access the data?
Report comment to moderator  
Reply With Quote
Unread 10-12-08, 12:18 AM  
Mud
A Murloc Raider
AddOn Author - Click to view AddOns

Forum posts: 8
File comments: 23
Uploads: 4
Originally posted by DrChaos
is there a way so all my chars can access the data? [/b]
Well, that data is already global. There should be absolutely no difference from character to character.

The first version I uploaded had a goofed up TOC, which I fixed within a few hours. Can you pull the latest version and see if your symptoms still occur?

It's important to me that Hack have absolutely no bugs, so please lemme know if you find anything.
Last edited by Mud : 10-12-08 at 03:38 AM.
Report comment to moderator  
Reply With Quote
Unread 10-12-08, 04:29 AM  
DrChaos
A Fallenroot Satyr

Forum posts: 24
File comments: 12
Uploads: 0
ok. ive done some testing. ill try to explain it.

char A can create a book and create a page and then can add text to the box that opens to the right for that page.

no other char on my account can see the text that was added to the page (the page window wont even open).
all chars can see the book and see the created page name, but no text in the page.

If I create a new book on any other char, they are able to create a page name but the actual page that you put text in does not show.

its like once you use the first char to make a book, it becomes their mod totally.

The only thing ive done was to remove the test books that you noted and said to remove if I wanted to. I also stopped running all mods but this one for testing and still got the same results.
Report comment to moderator  
Reply With Quote
Unread 10-12-08, 05:03 AM  
Mud
A Murloc Raider
AddOn Author - Click to view AddOns

Forum posts: 8
File comments: 23
Uploads: 4
Originally posted by DrChaos
its like once you use the first char to make a book, it becomes their mod totally.
Given the way WoW saves variables, I can't imagine how that could happen, and I cannot reproduce your issue here. Checklist:

1) In WoW, make sure Interface -> Options -> Display Lua Errors is checked.
2) Shut down WOW or log out, then delete your wtf\account\*\SavedVariables\Hack.lua.
3) Make sure you have the latest version of Hack
4) Run WoW and try your experiment. Let me know if you get any error messages.
Report comment to moderator  
Reply With Quote
Unread 10-12-08, 08:47 AM  
DrChaos
A Fallenroot Satyr

Forum posts: 24
File comments: 12
Uploads: 0
Display Lua Errors was already checked

i deleted the wtf folder (as hard as it was. It was full of info already. I just closed my eyes and deleted it. lol)

I got the latest ver of hack on the last try. I dont know if this was the isue but last time I deleted the books before i made a new one. This time it told me I cant delete the last book. So i created a few books and then deleted the default ones. seems to be working like a charm now. I also added this to my favorites here so I can keep with any updates.

THANKS for the great mod and quick support.

Doc
Report comment to moderator  
Reply With Quote
Unread 10-12-08, 02:23 PM  
Mud
A Murloc Raider
AddOn Author - Click to view AddOns

Forum posts: 8
File comments: 23
Uploads: 4
Originally posted by DrChaos
i deleted the wtf folder (as hard as it was. It was full of info already. I just closed my eyes and deleted it. lol)
*lol* Thanks for going above and beyond the call of duty to troubleshoot. No idea that happened there.
Report comment to moderator  
Reply With Quote
Unread 10-12-08, 08:00 PM  
ithilyn
A Kobold Labourer

Forum posts: 0
File comments: 2
Uploads: 0
thank you

This is the author of LuaSlinger. Hack looks awesome, and I look forward to switching to it. You just spared me the burden of nursing LuaSlinger through 3.x, many thanks!

~ Ithilyn
Report comment to moderator  
Reply With Quote
Unread 10-12-08, 09:38 PM  
Mud
A Murloc Raider
AddOn Author - Click to view AddOns

Forum posts: 8
File comments: 23
Uploads: 4
Re: thank you

Originally posted by ithilyn
[b]This is the author of LuaSlinger. Hack looks awesome, and I look forward to switching to it. You just spared me the burden of nursing LuaSlinger through 3.x, many thanks!
Thanks! Of course, you made me double-check my LuaSlinger importer (which I wrote in the wee hours last night) and sure enough it had a bug (forgot to quote the event name). I just updated Hack with the updated importer, and a needed tweak to the event library.

BTW: porting to 3.x appears to be pretty trivial, at least for our kinda app. I ported LuaSlinger for you (quick job, not thoroughly tested).

Cheers!
Report comment to moderator  
Reply With Quote
Unread 10-13-08, 07:40 AM  
Nefarion
A Defias Bandit
 
Nefarion's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2
File comments: 57
Uploads: 14
Real nice work. Been waiting for a notepad addon as good as this, and I never really wanted to bother to develop Nefpad further. Great job.

One little tick: The input page uses auto-focus, which is fine, but there's no simple way to clear the focus, since pressing escape just closes the page. It's a huge annoyance when I'm trying to multi-task between different things going on on my UI and the gameworld, and the page wants to steal all my keyboard input.

Also, I find it a little annoying for For All Indents and Purposes to be applied to normal text pages. Any plans on adding a button to quickly disable it on individual pages?
Last edited by Nefarion : 10-13-08 at 08:06 AM.
Report comment to moderator  
Reply With Quote
Unread 10-13-08, 11:43 AM  
ithilyn
A Kobold Labourer

Forum posts: 0
File comments: 2
Uploads: 0
Re: Re: thank you

Originally posted by Mud
BTW: porting to 3.x appears to be pretty trivial, at least for our kinda app. I ported LuaSlinger for you (quick job, not thoroughly tested).
Thanks Mud. I posted it over on LuaSlinger's download page, with a link here and a note strongly suggesting people switch to Hack instead. Keep up the good work.
Report comment to moderator  
Reply With Quote
Unread 10-13-08, 03:43 PM  
Mud
A Murloc Raider
AddOn Author - Click to view AddOns

Forum posts: 8
File comments: 23
Uploads: 4
Nefarion said: One little tick: The input page uses auto-focus, which is fine, but there's no simple way to clear the focus, since pressing escape just closes the page.
Thanks for the feedback. This is exactly the kinda stuff I want.

My rational for auto-focus was to require the fewest mouse clicks for the most common usage case. I assume when you click a page, you intend to edit it, so I put the cursor there, so you don't need to click twice every time you want to edit a page. That extra click is annoying if you're copying and pasting between pages.

My rational for ESC dismissing the page was similar. If ESC clears the focus first, you'd have to hit ESC three times to fully dismiss Hack from an open page. Also, 'clearing focus' is kinda subtle, and I thought it would feel glitchy to users if they hit ESC to get Hack off their screen and nothing happens (because they didn't notice the cursor disappearing from the edit box).

Of course, as you point out, this creates a problem if you just want to view information while continuing to play WoW. You can clear the focus, but it's not obvious how and requires several clicks.

I think the best compromise is to lose the auto-focus (which I'm happy to do, since it involves removing code ^_^), but keep the ESC behavior. Your thoughts?

Nefarion said: I find it a little annoying for For All Indents and Purposes to be applied to normal text pages. Any plans on adding a button to quickly disable it on individual pages?
Yeah, that annoys me, too. I think I'll go ahead and add that button (code/plain toggle).

There are plenty of features I'd like to add, of course, but I've been really reluctant to add anything that didn't seem nonessential. I originally wasn't even going to have more than one book, but then I figured out a way to do it with very little additional code. Still, I'm already up to nearly 50K bare naked, whereas Nefpad is a mere 28K. I'm start to feel self-conscious about it... what are your thoughts on the matter? If I were to give myself another, say, 30K to work with, would people reject Hack as bloatware?

A few things in the back of my head, if I was willing to give myself a bit more RAM (in no particular order)
  • Cloning pages/books.
  • Line numbers and/or ability to jump to specific lines (annoying when you get a script error for something on line 34 when there are no line numbers *lol*).
  • Send pages to other Hack users.
  • Highlighting of search text within pages
  • More sophisticated profile management. so that a book could contain both public and private page (i.e. global and character specific)
  • Ability to run pages in other books, or flag an entire book for execution.
  • sdf
Last edited by Mud : 10-13-08 at 03:55 PM.
Report comment to moderator  
Reply With Quote
Unread 10-15-08, 12:50 AM  
seebs
Premium Member
Premium Member
AddOn Author - Click to view AddOns

Forum posts: 155
File comments: 157
Uploads: 5
I'm usually fine with hitting escape twice to close a window.

UI design, rule 1: The principle of least astonishment. What behavior will least surprise a user? Mess around with other interfaces in the game, such as the mail window. Open the mail window, start typing a name, then see what happens when you hit escape. It takes two clicks to make the window go away; the first just drops focus.

And this looks like a really neat addon.
Report comment to moderator  
Reply With Quote
Unread 10-16-08, 01:03 AM  
thegabbert
A Kobold Labourer
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 93
Uploads: 2
I'm with seebs. The standard I've always seen/used is that for frames with keyboard focus, ESC clears focus; for frames without focus, ESC closes the frame. I'd rather lose auto focus (because when I open a page I don't always want to make edits) and have to hit ESC multiple times. I think even the non-technical will "get" the double/triple ESC thing because the rest of WoW works that way.

If I may make an additional suggestion: If you're going to add a code/text toggle to prevent FAIAP from running on text pages, the run button should also be disabled for text pages.

And if I may pick one item off your list: I'd like line numbers, but with an option to disable them for code and/or text pages.

BTW, fantastic mod, I just finished importing all my TinyPad and LuaSlinger data.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: