ComputerCraft Forums

ComputerCraft => Programs => APIs and Utilities => Topic started by: Lucasx150 on Aug 28, 2020, 07:16 PM

Title: rednetspy
Post by: Lucasx150 on Aug 28, 2020, 07:16 PM

rednetspy
(https://camo.tmpim.com/7b5bc0d6337d054cd63389236cc52f20b7ce1a8f/68747470733a2f2f692e6962622e636f2f6b4b714e3959362f556e62656e616e6e742e706e67) (https://ibb.co/SNVFdq7)
Code: https://pastebin.com/s5wXb5fD (https://pastebin.com/s5wXb5fD)
Install:
pastebin get s5wXb5fD rednetspy
Title: rednetspy
Post by: QuickMuffin8782 on Sep 03, 2020, 02:29 PM
That utility is great to do to spy on other rednet messages. However you can as well change colors by doing this code below.
There is a possibility for custom colors on some emulators, but in game is supported.
You can also change it to writeColor(txt, color) and change the print(txt) to write(txt) if you want to have a write sys as well.

function printColor(txt, color)
    local oldColor = term.getTextColor()
    if term.isColor()
        term.setTextColor(color)
        print(txt)
        term.setTextColor(oldColor)
    end
end

Here is a example color function. I will later post a color utility api, when I get the chance.

printColor("Hello, World!", 0xFF7400) --Everyone didn't know this can be possible until I found out about it. (Except some coders)
With that way of doing colors by hex code (0xRRGGBB) you can also tinker around with it using a colorutils functions I can work on. This can be useful since CCEmuX supports it, IDK if other emulators can support it. But, since Mimic can only support straight up color given variables in the color api, it is not supported for the custom color hex code.