Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI-Nspire => Topic started by: LD_Chimpman on January 14, 2014, 05:38:35 pm

Title: nCoder
Post by: LD_Chimpman on January 14, 2014, 05:38:35 pm
Ever wanted to look like a secret agent hacking into top secret files?
Want to impress your friends?
Try nCoder for TI nSpire!

Boot it up and be greeted with the ability to select your desired typing speed
(http://i.imgur.com/zrO8b4p.gif)
Continue, and witness an awesome intro scene making it look like you are hacking through a security system!
(http://i.imgur.com/R3jg6xV.gif)
Then comes the main point of the program: simply mash random buttons on the keyboard, and actual code will appear onscreen, tricking bystanders into thinking you have some sort of black-magic typing skills. You can look more believable by using a 1:1 ratio of button presses to character outputs, or look like a typing whiz by cranking it up to 9 characters outputted per one button press.
(http://i.imgur.com/yllrink.gif)
This program is based on the awesome http://hackertyper.net/ and I give all credit to the developer of that webpage for the idea. The code that appears when you type is literally just an older version of the code for the program itself because I was too lazy to write a fake yet realistic-looking placeholder code, but if anyone feels like writing up a fake (or real) piece of code that looks like it would be used to hack into something, send it my way and I'll reformat it and implement it in the program (I might even make it so you get a random output code each time) to make it more authentic.
Hope you all find it interesting - the .tns file is attached to this post!
Title: Re: nCoder
Post by: The_King on January 14, 2014, 09:13:25 pm
know i get the plan of the game  ;)

nice work and keep it up  :thumbsup: :thumbsup: :thumbsup:
Title: Re: nCoder
Post by: DJ Omnimaga on January 14, 2014, 10:37:53 pm
Looks nice, but I wonder if it would be possible to make the text smaller so that more can fit in the screen?
Title: Re: nCoder
Post by: blue_bear_94 on January 14, 2014, 11:27:59 pm
You might be able to pull something up from a Github repo such as this (https://github.com/bluebear94/amethyst), if you aren't insistent on having only Lua sources.
(Also, use a monospaced font.)
Title: Re: nCoder
Post by: fb39ca4 on January 14, 2014, 11:29:10 pm
Using a monospace raster font would also help. (Yeah, I know all fonts on the Nspire are raster, but I'm talking about the kind you see when you use the terminal on a computer.)
Title: Re: nCoder
Post by: Levak on January 15, 2014, 01:26:19 pm
Monospace font doesn't exist out of the box on TI-Nspire.
You have to hack the output, either displaying char by char, or displaying tiles by tiles with a custom font made of images.

On another note : How could we lok like a  hacker without fullscreen and with Lua code displayed ?
Title: Re: nCoder
Post by: Hayleia on January 15, 2014, 01:31:35 pm
I agree that full screen is a must, but Lua code, Axe code, C++ code, console code or brainf*ck code, it doesn't matter, this is made to amaze noob and as long as text they don't understand is written in green on a black background, they assume you are a hacker.
Title: Re: nCoder
Post by: LD_Chimpman on January 15, 2014, 02:32:26 pm
Thanks everyone for the great suggestions.

Looks nice, but I wonder if it would be possible to make the text smaller so that more can fit in the screen?
This would be an easy fix and I'm sure it would make it look cooler, I'll definitely implement this.

You might be able to pull something up from a Github repo such as this (https://github.com/bluebear94/amethyst), if you aren't insistent on having only Lua sources.
Yeah I don't really care what language the code is. I actually prefer it to not be lua because it definitely looks a bit too simplistic to be real hacking software. Thanks for the link, that looks more like the kind of thing I should use; I'll try to add that in.

Using a monospace raster font would also help. (Yeah, I know all fonts on the Nspire are raster, but I'm talking about the kind you see when you use the terminal on a computer.)
Monospace font doesn't exist out of the box on TI-Nspire.
You have to hack the output, either displaying char by char, or displaying tiles by tiles with a custom font made of images.
I'm worried that having every character as an image would cause CRAZY amounts of lag when typing. What would be a good way to go about doing this? I don't have any experience with custom fonts, the extent of my knowledge for lua fonts is the vanilla "serif" and "sansserif" :P

On another note : How could we lok like a  hacker without fullscreen and with Lua code displayed ?
Fullscreen is another thing I do not have experience with. How would I implement it? It certainly would make it look better.
(and yeah I can understand that the lua code looks kind of dumb and irrelevant, but it will be replaced soon. After all, a hacker wouldn't care all that much about drawing rectangles and such)
Title: Re: nCoder
Post by: Jim Bauwens on January 15, 2014, 04:04:01 pm
I've implemented some monospace routines that you can find in LuaTerm 2.0 http://ourl.ca/19543

Fullscreen requires some little tricks, because it's not officially supported. If you draw using the gc from platform.withGC (while being in on.paint) you can go fullscreen. On 3.1 you need to to call gc:begin(), do what you want to draw in fullscreen, and then call gc:finish(). On 3.6 the withGC trick doesn't work anymore and you have to use the 1.0 apiLevel together with the 3.1 code to be able to do it.
Title: Re: nCoder
Post by: Eiyeron on January 15, 2014, 04:20:40 pm
Rad idea: make it show its own source code.
Title: Re: nCoder
Post by: LDStudios on January 15, 2014, 04:52:59 pm
Rad idea: make it show its own source code.

That's what it does currently xD
Title: nCoder
Post by: LD_Chimpman on January 15, 2014, 07:02:39 pm
Rad idea: make it show its own source code.
That's what it does currently xD
Well, an outdated version of it that probably doesn't actually work.
Title: Re: nCoder
Post by: Jim Bauwens on January 16, 2014, 07:12:46 am
Here is a function that returns the source of the current document:

Code: [Select]
function getSource()
    return (string.dump(getSource):sub(14):gsub("-- %TI.SCRIPTAPP.*$", ""):gsub("%z", ""))
end
Title: Re: nCoder
Post by: Adriweb on January 16, 2014, 07:40:21 am
Ooh, nice, jim :)

I've tried a bit going further than the "LuaQ", some time ago, but didn't succeed ^^
(whoever tried string.dumping stuff will know what I'm talking about :P)

stupid sub(14)... :P
Title: Re: nCoder
Post by: Jim Bauwens on January 16, 2014, 11:43:40 am
Yeah, well it's cutting the Lua header off. There are some interesting bytes in there you know ;P But as we only need the source code I have to extract just what I need.