This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
houseofkraft's profile picture

How do I redefine printer functions

Started by houseofkraft, 30 September 2016 - 11:19 AM
houseofkraft #1
Posted 30 September 2016 - 01:19 PM
Hi Guys!

I would like to know how to redefine printer functions because I am making a custom printer and I want to overwrite the printer functions to support the custom printer

Thanks!
KingofGamesYami #2
Posted 30 September 2016 - 01:40 PM
The same way you would overwrite any functions. Make a variable pointing to the old function, and call that in your custom function.
Sewbacca #3
Posted 30 September 2016 - 03:21 PM
Example:

-- API has the function foo
local native_API_foo = API.foo
API.foo = function (...)
  <CODE>
  native_API_foo(...)
end