#1
Posted 03 June 2012 - 11:10 PM
Download Here
Ever get annoyed that you can't transfer your programs to a server that has HTTP disabled? Do you get annoyed when you have to type the same stuff into multiple computers? Want to code with a REAL text editor, and play SMP too? The solution is here!
Just open your minecraft and log in to a computercraft shell, then run the script with a list of files as parameters. Sit back and relax as it reads in the files, compresses them automagically, and rapidly types them into your minecraft window, saving them.
Notes: This program is buggy as hell. Make sure you call it from the same directory as the .lua files you want to transfer, because it will try to preserve relative file locations. If the text comes out with mistakes, slow down the keystrokes. If you want to be able to debug your code, disable compression. THE PROGRAM WILL RAPIDLY VOMIT KEYSTROKES INTO WHATEVER APPLICATION HAS FOCUS! IF YOU HAVE ANYTHING OTHER THEN MINECRAFT FOCUSED, IT WILL GET HAMMERED WITH LUA COMMANDS! YOU HAVE BEEN WARNED!
Enjoy, and please send me any questions you have, or patches you make to the code!
Linux requirements:
- Python 2.7
- libxdo
- lua [OPTIONAL: needed for lua file compression]
No links, this shit is trivial to install with a package manager on any distro. Once you have all the prerequesites, you should be able to just run the script.
Windows requirements:
- Python 2.7
http://www.python.org/download/
- pywin32 [OPTIONAL: needed for automatic window switching]
http://sourceforge.n.../pywin32/files/
- lua [OPTIONAL: needed for lua file compression]
http://code.google.c.../luaforwindows/
Windows is a little stupid when it comes to command line stuff like python. Go to My Computer>Properties>Advanced>Environment Variables, edit the PATH variable, and add to the end of it ";C:\Python27". Then you should be able to run the script doing something like: "> python scriptfolder/minecopy/minecopy.py luafolder/script1.lua luafolder/script2.lua"
#2
Posted 03 June 2012 - 11:31 PM
1) Configuration options outside of the script (to configure it currently, you have to edit the first couple lines of minecopy.py, bleh)
2) Support for Macs (so I can goof off at work in my lab)
3) Command line options and flags, for example, to disable lua compression on specific files, like data files.
#3
Posted 04 June 2012 - 11:59 AM
I was inspired by the concept, but I don't really like external dependencies on Windows (python, pywin32 /> ), so I quickly coded the same in c++ using only the windows api. It's Windows only (porting to Linux would practically mean rewriting the program ^^) and it doesn't support Lua compression. The code's much shorter though. : )
I don't think I'm posting it though, no need to interfere with your magnificent work. />
I also want to encourage you to expand it further, I don't plan on adding any more features to mine.
It would be especially handy to have some sort of 'config file'/package thingy that copies a set of files with directory structure, api's, startup files and everything to CC in one command. />
#4
Posted 04 June 2012 - 04:26 PM
#5
Posted 04 June 2012 - 09:19 PM
Kazagistar, you seem motivated to expand your and mine project further on, so I would definitely like you to work off of it in the future. /> c++ really is the wise choice here. />
If you have any questions about my (uncommented) source code, PM me. Or better, ask your questions here so everyone can benefit from it. />
[EDIT]
Source code is also in this spoiler for quick access:
#6
Posted 09 June 2012 - 12:32 PM
So although I have set window_name to 'Tekkit', it would try to type into Minecraft.
I replaced shell.AppActivate('Minecraft') with shell.AppActivate(window_name) so it should work.
I hope Python uses variables like this...
#7
Posted 10 June 2012 - 01:50 AM
Leo Verto, on 09 June 2012 - 12:32 PM, said:
So although I have set window_name to 'Tekkit', it would try to type into Minecraft.
I replaced shell.AppActivate('Minecraft') with shell.AppActivate(window_name) so it should work.
I hope Python uses variables like this...
#8
Posted 10 June 2012 - 10:07 AM
I would suggest actually using java to do it, as people using it are guaranteed to hava java...
#9
Posted 10 June 2012 - 05:56 PM
#10
Posted 09 July 2012 - 07:06 AM
ryanf@Fahy-ThinkCentre-A52:~/Downloads/minecopy$ python minecopy.py startup
Select minecraft window manually and make sure a computercraft terminal is open!
You have 10 seconds or bad things will happen!!!
Traceback (most recent call last):
File "minecopy.py", line 96, in <module>
copyfile(filename)
File "minecopy.py", line 83, in copyfile
typeout("rm "+filename+"nedit "+filename+"n")
File "minecopy.py", line 33, in typeout
xdo.xdo_type(xdo_context, 0, string, key_press_delay*1000000) # microseconds
ctypes.ArgumentError: argument 4: <type 'exceptions.TypeError'>: Don't know how to convert parameter 4
ryanf@Fahy-ThinkCentre-A52:~/Downloads/minecopy$
Any Help? Im on ubuntu
edit :
nvm, fixed by adding line
from ctypes import *
now CC forums, im not so clueless
Edited by ryan7136, 09 July 2012 - 11:31 PM.
#11
Posted 11 July 2012 - 12:48 AM
#12
Posted 17 August 2012 - 07:54 AM
#13
Posted 18 August 2012 - 03:31 PM
just saying...
#14
Posted 03 September 2012 - 08:46 PM
#15
Posted 17 September 2012 - 02:34 PM
#16
Posted 17 September 2012 - 09:37 PM
#17
Posted 25 September 2012 - 11:13 AM
Orwell, on 04 June 2012 - 09:19 PM, said:
Kazagistar, you seem motivated to expand your and mine project further on, so I would definitely like you to work off of it in the future. /> c++ really is the wise choice here. />
If you have any questions about my (uncommented) source code, PM me. Or better, ask your questions here so everyone can benefit from it. />
[EDIT]
Source code is also in this spoiler for quick access:
#18
Posted 26 September 2012 - 10:35 AM
tdlab, on 25 September 2012 - 11:13 AM, said:
Orwell, on 04 June 2012 - 09:19 PM, said:
Kazagistar, you seem motivated to expand your and mine project further on, so I would definitely like you to work off of it in the future. /> c++ really is the wise choice here. />
If you have any questions about my (uncommented) source code, PM me. Or better, ask your questions here so everyone can benefit from it. />
[EDIT]
Source code is also in this spoiler for quick access:
Indeed, you need to run it from command prompt. Make sure you're in the directory where my program is stored and then run 'cc-typer filename'.
I put a version up for Tekkit as an attachment.
#19
Posted 27 September 2012 - 12:15 AM
Could you make a video/ tutorial on how it works? I made a folder in my downloads called "Cc auto typer" In there i have the cc-typer.exe and a test.txt, When i open the exe, it automatically closes. I dont know why? Please reply, ~Tdlab.
Thanks again!
#20
Posted 27 September 2012 - 12:55 PM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users