BananaFredSoft
Active Members-
Posts
462 -
Joined
-
Last visited
About BananaFredSoft
- Birthday 01/01/2006
Profile Information
-
Member Title
You will contradict this statement
-
WWW
http://www.bananafredsoft.com
BananaFredSoft's Achievements
Universalist (7/7)
0
Reputation
-
Read input from game controller?
BananaFredSoft replied to BananaFredSoft's topic in AutoIt General Help and Support
Actually, I think I've solved my own problem. I just found the Joystick UDFs and am using them now. Thanks anyways! -
So, I want to make a program that can take inputs from the Rock Band 2 controller and output MIDI to make guitar chords. The MIDI part comes later, obviously Luckily the guitar is plug and play USB and shows up as a game controller in the control panel. How can I read the inputs from buttons 1-13, the Z axis, and the Point of View Hat? I have no experience with calling DLLs or using objects so it seems like this would be a good way to learn it. Any advice or pointers is helpful too. Thanks in advance!
-
HID - USB Communication
BananaFredSoft replied to Adam1213's topic in AutoIt General Help and Support
Game controller. I basically need to be able to read the input from a HID. -
HID - USB Communication
BananaFredSoft replied to Adam1213's topic in AutoIt General Help and Support
Please help because I need this to write a script so I can tell when the Rock Band 2 controller buttons are pressed... -
Where did the file go??? That's really wierd!
-
The uninstallation wasn't clean because once the uninstaller deletes itself it obviously can't delete anything else. I can't figure out how to fix that. Thanks for the feedback.
-
I made a program almost exactly like this, except it had a GUI.
-
BananaFTP - File Rename fixed!
BananaFredSoft replied to BananaFredSoft's topic in AutoIt Example Scripts
I fixed File Rename! -
BananaFTP - File Rename fixed!
BananaFredSoft replied to BananaFredSoft's topic in AutoIt Example Scripts
OK, new version with port selection box! Thanks for the suggestion! -
BananaFTP - File Rename fixed!
BananaFredSoft replied to BananaFredSoft's topic in AutoIt Example Scripts
Thanks! Do you have any suggestions? -
This is my FTP client. The green "Up" arrow brings you to the root directory. Selecting a folder and then clicking on the bar at the top of the file list will bring you into that folder. Executable (with images): http://h1.ripway.com/bananafred/BananaFTP.exe Bugs: No file size (FTPGetFileSize wouldn't work for me) Rename won't work (this function didn't work either...) Can't get file download path (can't figure out how to do this) Note: This is a beta. I created a help topic that asked how to fix the bugs and bumped it for a couple weeks and no one helped out, so I'll release it bugs and all. Updates: 3/12/08: Port selection box added. 3/24/08: File Rename fixed. Tell me what you think! Code: #include <FTP.au3> #include <FTP2.au3> #include <GUIConstants.au3> #include <File.au3> #include <String.au3> #include <GuiListView.au3> $conts = _ArrayCreate(0) $dir = "/" If FileExists(@ScriptDir & "\up.bmp") = 0 Then FileInstall("G:\Au3 Programs\up.bmp", @ScriptDir & "\up.bmp") EndIf #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("BananaFTP Sign-in", 310, 187, 193, 115) $Combo1 = GUICtrlCreateCombo(IniRead(@ScriptDir & "\BananaFTPData.data", "Main", "SavedServer", ""), 48, 16, 257, 25) $Label1 = GUICtrlCreateLabel("Server:", 8, 16, 38, 17) $Label2 = GUICtrlCreateLabel("Username:", 8, 48, 55, 17) $Input1 = GUICtrlCreateInput(IniRead(@ScriptDir & "\BananaFTPData.data", "Main", "SavedUserName", ""), 64, 48, 233, 21) $Label3 = GUICtrlCreateLabel("Password:", 8, 80, 53, 17) $Input2 = GUICtrlCreateInput(_StringEncrypt(0, IniRead(@ScriptDir & "\BananaFTPData.data", "Main", "SavedPassword", ""), "12fHjkd73n"), 64, 80, 233, 21, $ES_PASSWORD) $Label4 = GUICtrlCreateLabel("Server Port:", 8, 114) $Port = GUICtrlCreateInput("21", 70, 112, 100) $Button1 = GUICtrlCreateButton("Sign In", 8, 152, 291, 25, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 If BitAND(GUICtrlRead($Input1) <> IniRead(@ScriptDir & "\BananaFTPData.data", "Main", "SavedUserName", ""), GUICtrlRead($Combo1) <> IniRead(@ScriptDir & "\BananaFTPData.data", "Main", "SavedServer", "")) Then If MsgBox(4, "Save Username/Server?", "Should the username,and server automatically be entered from now on?") = 6 Then IniWrite(@ScriptDir & "\BananaFTPData.data", "Main", "SavedServer", GUICtrlRead($Combo1)) IniWrite(@ScriptDir & "\BananaFTPData.data", "Main", "SavedUserName", GUICtrlRead($Input1)) If MsgBox(4, "Save password?", "Should the password be automatically entered from now on?") = 6 Then IniWrite(@ScriptDir & "\BananaFTPData.data", "Main", "SavedPassword", _StringEncrypt(1, GUICtrlRead($Input2), "12fHjkd73n")) EndIf EndIf EndIf $handle = DLLOpen('wininet.dll') $Session = _FtpOpen("MyFTP Control") $Connection = _FTPConnect($Session, GUICtrlRead($Combo1), GUICtrlRead($Input1), GUICtrlRead($Input2), GUICtrlRead($Port), 1, 0x8000000) If $Connection <> 0 Then $Server = GUICtrlRead($Combo1) $Password = GUICtrlRead($Input2) $UserName = GUICtrlRead($Input1) GUIDelete($Form1) ExitLoop Else MsgBox(0, "Connection Error", "There has been a connection error. The server, password, or account name may be incorrect.") EndIf EndSwitch WEnd #Region ### START Koda GUI section ### Form=C:\Documents and Settings\Colin\My Documents\ftp.kxf $Form1 = GUICreate("BananaFTP", 633, 449, 193, 115) $CurrentAdress = GUICtrlCreateLabel($Server, 192, 8, 300) $ListView1 = GUICtrlCreateListView("File Name", 8, 32, 513, 409) _GUICtrlListView_SetColumnWidth($ListView1, 0, 500) $Button3 = GUICtrlCreateButton("Delete", 528, 32, 99, 25, 0) $Button4 = GUICtrlCreateButton("Rename", 528, 64, 99, 25, 0) $Button5 = GUICtrlCreateButton("Download", 528, 96, 99, 25, 0) $Button6 = GUICtrlCreateButton("Copy Path", 528, 128, 97, 25, 0) $Button7 = GUICtrlCreateButton("Upload File", 528, 200, 97, 25) $UploadDirectory = GUICtrlCreateButton("Upload Folder", 528, 232, 97, 25) $CreateDirectory = GUICtrlCreateButton("Create Directory", 528, 264, 97, 25) $FileSize = GUICtrlCreateLabel("", 528, 160, 34, 17) $DirUp = GUICtrlCreateButton("", 10, 3, 25, 25, $BS_BITMAP) GUICtrlSetImage($DirUp, @ScriptDir & "\up.bmp") GUISetState(@SW_SHOW) $read = List("/") For $i = 1 to $read[0] $a = GUICtrlCreateListViewItem($read[$i], $ListView1) _ArrayAdd($conts, $a) $conts[0] += 1 Next #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE _FTPClose($Session) Exit Case $CreateDirectory $dirname = InputBox("Folder Name", "Please enter the name of the folder you want to create.") If not @error Then $return = _FTPMakeDir($Connection, $dirname) If $return Then RedoList($dir) MsgBox(0, "Folder Create", "The folder was successfully created.") Else MsgBox(0, "Folder Create", "The folder creation failed.") EndIf EndIf Case $Button5 $readC = GUICtrlRead($ListView1) If $readC <> 0 Then $readTC = StringTrimRight(GUICtrlRead($readC), 1) $save = FileSaveDialog("Download " & $readTC, "", "All Files (*.*)", -1, $readTC) $get = _FTPGetFile($Connection, $dir & $readTC, $save) If $get Then MsgBox(0, "File Download", "The file was successfully downloaded.") ShellExecute($save) Else MsgBox(0, "File Download", "The file download failed.") EndIf EndIf Case $Button7 $from = FileOpenDialog("Upload File", "", "All Files (*.*)") If FileExists($from) Then $upload = _FTPPutFile($Connection, $from, $dir & getname($from)) If $upload Then RedoList($dir) MsgBox(0, "File Uploaded", "Your file has been successfully uploaded.") Else MsgBox(0, "Upload Failed", "The file upload has failed.") EndIf EndIf Case $UploadDirectory $directory = FileSelectFolder("Choose a folder to upload.", "") If FileExists($directory) Then _FTPPutFolderContents($Connection, $directory, $dir, 1) RedoList($dir) EndIf Case $Button3 $readC = GUICtrlRead($ListView1) If $readC <> 0 Then $readTC = StringTrimRight(GUICtrlRead($readC), 1) If MsgBox(4, "Confirm File Delete", "Are you sure you want to delete " & $readTC & "?") = 6 Then $del = _FTPDelFile($Connection, $dir & $readTC) If $del = 1 Then RedoList($dir) MsgBox(0, "Deletion Successful", "The file you selected has been deleted.") Else MsgBox(0, "Deletion Failed", "The file deletion failed.") EndIf EndIf EndIf Case $Button4 $readC = GUICtrlRead($ListView1) If $readC <> 0 Then $readTC = StringTrimRight(GUICtrlRead($readC), 1) $newname = InputBox("Rename File", "Please enter the new name for this file.", $readTC) If Not @error Then $dload = _FTPGetFile($Connection, $dir & $readTC, @ScriptDir & "\" & $readTC) If $dload Then $del = _FTPDelFile($Connection, $dir & $readTC) $put = _FTPPutFile($Connection, @ScriptDir & "\" & $readTC, $dir & $newname) Else $del = 0 $put = 0 EndIf If $dload + $del + $put = 3 Then RedoList($dir) MsgBox(0, "File Rename", "The file has been successfully renamed.") Else MsgBox(0, "File Rename", "The file rename failed.") EndIf EndIf EndIf Case $DirUp $dir = "/" RedoList($dir) Case $ListView1 $readread = StringTrimRight(GUICtrlRead(GUICtrlRead($ListView1)), 1) If $readread Then If StringInStr($readread, ".") = 0 Then $dir = $dir & $readread RedoList($dir) EndIf EndIf EndSwitch WEnd Func List ($dir2) $array = _ArrayCreate(0) $first = _FTPFindFirstFile($Connection, $dir2) Do $next = _FTPFindNextFile($first, "*.*", 3) $error = @error _ArrayAdd($array, $next[6]) $array[0] += 1 Until $error _FTPClose($first) Return $array EndFunc Func getdir($filename) $split = StringSplit($filename, "\") If Not @error Then $dira = "" $num = 1 Do $dira &= $split[$num] & "\" $num += 1 Until $num = $split[0] Return $dira EndIf EndFunc ;==>getdir Func getname($filename) Return StringReplace($filename, getdir($filename), "") EndFunc Func RedoList($dir3 = "/") DllClose($handle) $handle = DLLOpen('wininet.dll') _FTPClose($Session) Global $Session = _FtpOpen("MyFTP Control") Global $Connection = _FTPConnect($Session, $Server, $UserName, $Password) GUICtrlSetData($CurrentAdress, $Server & $dir3) _FTPSetCurrentDir($Connection, $dir3) For $i = 1 To $conts[0] GUICtrlDelete($conts[$i]) Next $conts = _ArrayCreate(0) $read = List($dir3) For $i = 1 to $read[0] $a = GUICtrlCreateListViewItem($read[$i], $ListView1) _ArrayAdd($conts, $a) $conts[0] += 1 Next EndFunc Func S ($read) $StringSplitArray = StringSplit($read, "|") Return $StringSplitArray[0] EndFunc
-
Wow! Nice job! This works well, it just needs something to set it apart from explorer!
-
Thanks! I added it to the main post.
-
Bump. Could someone at least tell me why no one is replying?
-
Bump.