From 8fe683fff9e51c9796e419553d0b6102c5730663 Mon Sep 17 00:00:00 2001
From: TorchedSammy
end)
What this does is, whenever the command.exit
event is thrown,
this function will set the user prompt.
catch(name, cb) | Catches a hook with name . Runs the cb when it is thrown |
catchOnce(name, cb) | Same as catch, but only runs the cb once and then removes the hook |
hooks(name) -> table | Returns a table with hooks (callback functions) on the event with name . |
release(name, catcher) | Removes the catcher for the event with name . |
throw(name, …args) | Throws a hook with name with the provided args |
Catches a hook with name
. Runs the cb
when it is thrown
string
name
ummm
function
cb
?
catch(name, cb) | Catches a hook. This function is used to act on hooks/events. |
catchOnce(name, cb) | Same as catch, but only runs the cb once and then removes the hook |
hooks(name) -> table | Returns a table with hooks (callback functions) on the event with name . |
release(name, catcher) | Removes the catcher for the event with name . |
throw(name, …args) | Throws a hook with name with the provided args |
Catches a hook. This function is used to act on hooks/events.
string
name
The name of the hook.
function
cb
The function that will be called when the hook is thrown.
bait.catch('hilbish.exit', function()
+ print 'Goodbye Hilbish!'
+end)
+
Same as catch, but only runs the cb
once and then removes the hook
This function has no parameters.
Returns a table with hooks (callback functions) on the event with name
.
Hooks are Hilbish’s versions of events, which are used via the Bait +module. +For more detail on how to act on these hooks, you may check the Bait page.