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

[Latest: Type'n'Paste v0.1.3.5] Smiley43210's Programs

Started by Smiley43210, 15 April 2013 - 10:57 PM
Smiley43210 #1
Posted 16 April 2013 - 12:57 AM
This post will contain all of my programs.
All of the download sections for each program is at the bottom of the program's spoiler.

External Utilities
1 listed; 1 released
SpoilerType'n'Paste v0.1.3.5 (Windows only)
Has screenshots: Yes, 2
SpoilerInfo:
SpoilerA utility that can be used to 'paste' programs and other things into ComputerCraft, and virtually anything else. Written in AutoIt.

I originally wrote it for personal use, because I needed to debug somebody's program. Going into your appdata folder, creating a new file, and then editing it became a real hassle. Having had experience with AutoIt, I decided to write a little snippet that would type code in for me. And thus, Type'n'Paste was born.

If you enabled de-indent mode, it will automatically correct indentations in programs like CC's "edit" program.
And if any of you were wondering why the settings window looks like a preference window, that's because I used a preference library I created some time ago :P/>. Some inspiration came from Microsoft Word for Mac's preference window (the description portion).

Some few virus programs may detect it as a trojan or virus, primarily because it performs simulated keystrokes to type the text you paste. If enough of you guys want, I can instead post the source so that you may compile it on your own and guarantee the absence of malicious content.

Virus scan (1/55 antivirus programs detected it): https://www.virustot...sis/1415767582/

Fun Facts:
SpoilerTotal lines: 791

Screenshots:
Spoiler

Changelog:
SpoilerKey: + Addition, - Removal, = Change/Bug fix
v0.1.3.5
= Updated auto update URL to the correct URL
= Fixed de-indent mode
+ Added de-indent amount setting (number of times backspace needs to be pressed to remove an "indent")
= Fixed new line detection and output (now presses the Enter key instead of sending CR + LF)

v0.1.3.4
= Updated auto update URL

v0.1.3.3
= Fix rare crash when using settings window
= Many minor bug fixes

v0.1.3.1
- Shourtcut: Ctrl + Alt + V, need to work on it more, causes problems with programs that use alt to focus on a menu
= Removed a lot of debug code that doesn't have any effect outside of the development environment. This sped up the code to be at least 1.5x faster

v0.1.3.0 (Minor version up)
+ Added new "Fast paste" mode that pastes up to 4x as fast
+ Minimum delay safeguard
+ Shortcut: Ctrl + Alt + V to begin pasting without an initial delay

v0.1.2.11
= Fixed tray menu starting with incorrect status on paste start

v0.1.2.10
+ Added reset handling ("Reset to Default") to settings I forgot about when I added more settings

v0.1.2.9
= Changed description of some settings

v0.1.2.8
+ Added setting to change the initial paste delay

v0.1.2.5
= Fixed de-indentation
+ Started work on setting 'De-indent amount'

v0.1.0.0 (Minor version up)
+ Started adding de-indentation
+ Added settings window
+ Added partial instructions

v0.0.1.7
= Fixed elements not re-sizing correctly when window is re-sized
+ Defined minimum window size so as to not let controls re-size wrongly

- Press Esc key to exit
+ Press Esc key to reset fields
+ Press Alt + Esc keys to exit
= Press Ctrl + A to select all text

v0.0.1.6
= Fixed status in tray menu not changing
+ Press Ctrl + A to select all text
+ Resize window support

v0.0.1.5
= Fixed repeatedly typing the same character until manually stopped

v0.0.1.4
+ Initial release
+ Auto updater
+ Esc key to exit
+ Tray menu

Todo:
Spoiler- Fix resizing issues
- Support for Ctrl + A (select all)
- Allow user to set amount of auto indent to correct

Download:
SpoilerHOW TO USE: Paste your code into the text box. Have the window you are going to 'paste' into ready. As soon as you click "Paste!", focus (click on) the window you want to paste into.

SHORTCUTS:
Esc: Stops pasting
Alt + Esc: Stops pasting, quits

This program does add a tray icon with menu.

For Windows only.

Download link: http://smiley43210.e...oad.php?appID=0

ComputerCraft Programs
3 listed; 0 released
SpoilerReleased as an example: SmartOS Currently SmartGraphicalShell :P/>
Has screenshots: No
SpoilerI could just release an early version but I don't think it can be counted as an 'OS' so much as an extended fancy graphical shell.

Please, don't download the code and expect an OS. I have provided whatever code I had just to satisfy curiosity. Oh, and I guess you could say I'm providing an example of what an OS is NOT.

Info:
SpoilerAn 'OS' extended graphical graphical shell. I used a script I made in CommandHelper for Bukkit and ported it over to Lua. It originally listed custom commands in pages. Has a customize area where you can change the text color, background color, and help text color. I will rewrite it to optimize it and remove lengthy code to replace it with simpler code that achieves the same effect..

Fun Facts:
SpoilerTotal lines: 1311 (actually more cause of installer)

Screenshots:
SpoilerBuilding…

Pre-Alpha Code:
SpoilerDon't expect anything more than an a colorful, personalized shell…
The files provided will not function, as there are files required by the installer that don't have downloads!

External file (disk): /disk/portlua
External file (disk): /disk/config/default
External file (disk): /disk/bootLoader
External file (disk): /disk/SmartOS (http://puu.sh/2AwuB)
Installer —> External file (disk): /disk/startup (http://puu.sh/2Awvj)

Coming soon: SmartMail
Has screenshots: Yes, 2
SpoilerInfo:
SpoilerBuilding…

Screenshots:
Spoiler
[Outdated]

Coming soon: Elevator Button Panel Generator
Has screenshots: Yes
SpoilerInfo:
SpoilerThis program allows you to create a button panel display on monitors. It features a display of the current floor, the direction (up or down), and buttons for each floor. You add floors by modifying the floorTable in the program. You can name floors or simply use their floor number. It calls a function when a button is clicked. The function's arguments are the floor name (the name, not the index of the floorTable) and current floor. "Pressed" buttons turn yellow. You still have to provide the handling of the button clicks and the moving of the elevator, though.

Screenshots:
Spoilerhttp://imgur.com/QOppk9N
http://imgur.com/AtdzdEt

APIs
1 listed; 0 released
SpoilerComing soon: GUIAPI
SpoilerInfo:
SpoilerThis is API is based on Java's syntax. Some ideas from AutoIt.

This API allows you to create and manage nearly every aspect of a GUI, and quite easily. From creating elements to re-styling them, you have full control over each one. This API can style elements with predefined constants, or it can be set to not style it at all.

Depending on your coding style, you can either use shell.run() or os.loadAPI() on the API. If you run it, it will only insert the style constant variables and objects into the global table. All of the API specifics will be put into ONE global table named guiApiBtn. If you load it with loadAPI(), everything will go into a table with the same name as the API file name, except for the background stuff, which will still go into the global table named btnApi. If you use loadAPI(), you will be unable to use the set___Prefix() functions. Using it will not throw an error, but just won't set a prefix. This is only so that the background mechanics can still work.

API Documentation:
SpoilerThis is just to give you an idea of what it will look like. Not long after the API is released, the documentation will move to my website.
NEW: CUSTOM PREFIXES (These do not need to be called from another object (with a colon), but just by itself)
Functions:
setLabelPrefix(prefix)
This sets the prefix of the Label object.
setButtonPrefix(prefix)
This sets the prefix of the Button object.

For example, if you use setButtonPrefix("OS"), you no longer can call Button:new(). You call OSButton:new(). If you pass it nil, an empty string, or don't pass a variable at all, it will remove the prefix. Warning: Changing the prefix of a type will change all of the existing objects of that type. This could maybe possibly perhaps ( :P/>) change in the future.

Object Functions
Every object can be referenced as a table. In every object table, the table key "type" will be populated with the type of that object. This may change according to the type's prefix. For example:
label1 = Label:new("Bar")
print(label1.type) -- This will print "Label"

The following functions require you to call the function with a colon!
Example: myButton = Button:new("Click me!")

Most optional arguments allow you to use -1 to represent the default value (ex. to skip an optional argument)

DrawableArea
:new(width, height [, x [, y ]])
Returns: (Table) DrawableArea object

:addObject(object)
Returns: (Boolean) success
The object must be a table returned from a (type):new() function

Window (Implements DrawableArea)
:new(width, height [, x [, y ]], style)
Returns: (Table) Window object
:addObject(object)
Returns: (Boolean) success
The object must be a table returned from a (type):new() function

Label (Instance of DrawableArea is required for drawing)
:new([text [, x [, y [, width [, height [, style ]]]]]])
Returns: (Table) Label object

Button (Instance of DrawableArea is required for drawing)
:new([buttonText [, x [, y [, width [, height [, style ]]]]]])
Returns: (Table) Button object
:draw()
Returns: nil
:setText(text)
Returns: nil
:setTextColor(color)
Returns: nil
:setBackgroundColor(color)
Returns: nil
:setEnabled()
Returns: nil
:setVisible()
Returns: nil
:getEnabled()
Returns: (Boolean) If button is enabled
:getVisible()
Returns: (Boolean) If button is visible
:remove()
Returns: nil

Styles (constant global variables)
These are only for drawing, they do not actually change the text stored in the object.

Button style list:
BS_SIMPLE - Adds a space on each side of the text ("Test" -> " Test ")
BS_PLAIN - Adds nothing - WYSIWYG
BS_BRACKET - Adds a bracket on each side ("Test" -> "[Test]")
BS_BRACE - Adds a brace on each side ("Test" -> "{Test}")
BS_NORMAL - Alias for BS_SIMPLE
BS_DEFAULT - Alias for BS_NORMAL

Example:
SpoilerCreating and managing a button:
local drawArea = DrawableArea:new(10, 5) -- Creates a DrawableArea object at the current cursor position that is 10 wide and 5 tall. This is needed for 'de-rendering', or rendering BEHIND the button, making object z-ordering possible
local myButton = Button:new("Save", 1, 1, -1, -1, BS_BRACE) -- Creates a button at (1, 1) and style BS_BRACE. The "-1"s are to signify that the default should be used (in this case, the width and height are auto calculated)
drawArea:addObject(myButton) -- Now we can draw the button
myButton:setText("Load") -- Changes the text displayed on the button
myButton:setEnabled(false) -- Disables the button
myButton:remove() -- Removes the button and 'de-renders' it
drawArea:remove() -- We're done, so lets get rid of it
Creates a button that looks like this: {Save}

Using custom prefixes:
setButtonPrefix("NS") -- Modeling OS X
NSButton:new("Test")

I, in no way, take any responsibility for any harm done to your or your computer caused by these programs. By downloading/using any one of them, you take full responsibility for any events caused by any of the programs listed here.
Edited on 19 June 2018 - 07:08 PM
Shuudoushi #2
Posted 16 April 2013 - 01:04 AM
Don't post till you have something please.
danny_delmax1 #3
Posted 16 April 2013 - 01:06 AM
You do realize he posted in general and not programs, right? Besides, he has a couple of screenshots.

Edit: Below, my point exactly
Edited on 16 April 2013 - 08:14 AM
theoriginalbit #4
Posted 16 April 2013 - 01:17 AM
Don't post till you have something please.
That is only the case in the 'Programs' section
TheOddByte #5
Posted 18 April 2013 - 12:35 PM
When looking at the screenshots I gotta say that It looks awesome! :)/>
Smiley43210 #6
Posted 19 April 2013 - 01:41 PM
When looking at the screenshots I gotta say that It looks awesome! :)/>
Thanks! And a utility release is coming in line 5-6 hours (after I get home and turn on my Windows computer).
remiX #7
Posted 19 April 2013 - 07:14 PM
The Type'nPaste using AutoIT? :P/>
Smiley43210 #8
Posted 19 April 2013 - 07:22 PM
Yup! It's pretty simple, too.
remiX #9
Posted 19 April 2013 - 08:13 PM
Nice :)/>
Never knew you could make GUI with it!
Smiley43210 #10
Posted 19 April 2013 - 09:34 PM
It's time for a release! Type'n'Paste! It's a solution to pasting programs into ComputerCraft! Of course, you could use it for practically anything you'd like to. There's one thing though: it's only for Windows. Nonetheless, I'm sure many people will find it useful. Details in the OP.

I've already reported the topic to be moved.
superaxander #11
Posted 20 April 2013 - 12:20 AM
Your image doesn't work…
Smiley43210 #12
Posted 20 April 2013 - 12:24 AM
Your image doesn't work…
Thanks for letting me know! Fixed. It was because the text updated but the link hadn't.
Cruor #13
Posted 20 April 2013 - 02:37 AM
Moved as requested.
jesusthekiller #14
Posted 20 April 2013 - 07:05 AM
I love it (Type 'n' paste) :D/>
Smiley43210 #15
Posted 23 April 2013 - 06:52 PM
I love it (Type 'n' paste) :D/>
Glad to hear you like it! :)/>
Engineer #16
Posted 03 May 2013 - 08:27 PM
Okay, I love typ'n'paste! Im on a server and the admin is being a little *****. Thank you very much for the creation! :D/>
As it sounds very great, your site is down D:
Smiley43210 #17
Posted 04 May 2013 - 05:31 AM
Oops, sorry. Thanks for letting me know! I'ts been fixed. I had named the file dowload.php instead of download.php :P/>
Smiley43210 #18
Posted 05 May 2013 - 01:15 AM
Type'n'Paste has been updated to v0.1.2.5!

Whats new:
  • Moved settings to own window
  • De-indentation mode! Enable it by clicking 'settings' and checking the checkbox.
Edit: Another update!

Type'n'Paste has been updated to v0.1.2.8!

Whats new:
  • Added setting to change the initial paste delay (the delay when it says "Starting in x")
  • Bug fixes
Smiley43210 #19
Posted 28 October 2014 - 08:45 AM
I'm back from the dead (slightly)!

Type'n'Paste has been updated to v0.1.3.4!

Whats new:
  • Bug fixes
  • Updated internal auto-update URL
Edited on 28 October 2014 - 07:56 AM