DSChaos Posted January 18, 2015 Share Posted January 18, 2015 (edited) evening everyone, I would ask a help with something ... I'm working on a project with the server, and create the client I encountered the following problem: After you start the software, and clic on Upload, I get a window , close that window and try again to Clic on Upload but NOT this time I open the window no more ... and this is also true for the other buttons. I tried to use exitloop for infinite loops for not working .... Script: expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <IE.au3> #include <File.au3> #include <FTPEx.au3> #include "ftp.au3" #Region ### START Koda GUI section ### Form=c:\users\daniel_2\desktop\sym\form1.kxf $Form1 = GUICreate("SYM", 881, 565, 186, 117) $MenuItem1 = GUICtrlCreateMenu("&Menu") $MenuItem2 = GUICtrlCreateMenuItem("Opzioni", $MenuItem1) $MenuItem10 = GUICtrlCreateMenuItem("Help", $MenuItem1) $MenuItem4 = GUICtrlCreateMenuItem("Exit", $MenuItem1) $MenuItem5 = GUICtrlCreateMenu("&I") $MenuItem6 = GUICtrlCreateMenu("&Abouth") $MenuItem7 = GUICtrlCreateMenuItem("Forum", $MenuItem6) $MenuItem8 = GUICtrlCreateMenuItem("Website", $MenuItem6) $MenuItem9 = GUICtrlCreateMenuItem("Abouth/Info", $MenuItem6) $Group1 = GUICtrlCreateGroup("My Info", 8, 8, 185, 113) $Label1 = GUICtrlCreateLabel("Benvenuto:", 16, 24, 59, 17) $Label2 = GUICtrlCreateLabel(@UserName, 88, 24, 36, 17) GUICtrlSetColor(-1, 0x0000FF) $Label3 = GUICtrlCreateLabel("I Miei Punti", 16, 40, 56, 17) $Label4 = GUICtrlCreateLabel("0", 16, 56, 10, 17) GUICtrlSetColor(-1, 0x0000FF) GUICtrlSetBkColor(-1, 0xFFFBF0) GUICtrlCreateGroup("", -99, -99, 1, 1) $Button2 = GUICtrlCreateButton("Upload", 8, 128, 187, 25) $Button3 = GUICtrlCreateButton("Upload 2", 8, 160, 187, 25) $Button4 = GUICtrlCreateButton("Upload 3", 8, 192, 187, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### #cs;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;controlo registrazion FileOpen("C:\Program Files (x86)\SYM\registrato.dat") If @error Then MsgBox(48,"Error","Impossibile trovare file.") EndIf If FileReadLine("C:\Program Files (x86)\SYM\registrato.dat",2) = "NO" Then FileReadLine("C:\Program Files (x86)\SYM\registrato.dat",1) Else If FileOpen("C:\Program Files (x86)\SYM\registrato.dat")=-1 Or FileReadLine("C:\Program Files (x86)\SYM\registrato.dat",1) Not = "registrated" Then #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=c:\users\daniel_2\desktop\sym\form2 ex.kxf $Form2 = GUICreate("Registrazzione.....", 587, 213, 192, 124) $Input1 = GUICtrlCreateInput("Email", 8, 24, 569, 21) $Button1 = GUICtrlCreateButton("Completa La Registrazione", 208, 48, 193, 25) $Button2 = GUICtrlCreateButton("Non desidero registrarmi/Non sono Interessato", 8, 104, 267, 25) $Checkbox1 = GUICtrlCreateCheckbox("Ricorda le preferenze per la prossima volta", 8, 136, 289, 17) $Label1 = GUICtrlCreateLabel("Registrandoti, avrai diritto a molte offerte,promozzioni e codici bonus. Oltre che ad un bonus addizionale di 50 LCrediti.", 8, 176, 557, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($Form2) ExitLoop Case $Button1 $lab15_email=GUICtrlRead($Input1) $Code_Bonus="SYMForLife" If $lab15_email="Email" Then MsgBox(48,"Error","L'e-mail NON e valida, Per Favore Inserisca un e-mail valido.") EndIf If $Code_Bonus="SYMForLife" Then _FileCreate("C:\Windows\Temp\"&@IPAddress1&"lsctemp.sft") $con=FileReadLine("C:\Windows\Temp\"&@IPAddress1&"lsctemp.sft",1) $tron=$con+"50" $trru=_filecreate("C:\Windows\Temp\"&@IPAddress1&"lsctemp1.tfs") FileWrite($trru,$tron) Sleep(1000) FileDelete("C:\Windows\Temp\"&@IPAddress1&"lsctemp.sft") _FileCreate("C:\Windows\Temp\"&@IPAddress1&"lsctemp.sft") $ex=FileReadLine("C:\Windows\Temp\"&@IPAddress1&"lsctemp1.tfs",1) FileWriteLine("C:\Windows\Temp\"&@IPAddress1&"lsctemp.sft",$ex) $ftrt=_FTP_Open("censored") $ftp=_FTP_Connect("Censored") if @error Then MsgBox(48,"Error","") Else MsgBox(64,"","") EndIf $con="C:\Windows\Temp\"&@IPAddress1&"lsctemp.sft" _FTP_FilePut($ftp,$con,"\") If @error Then MsgBox(48,"Error", " Server Non ragiungibile") Else MsgBox(64, "con Riuscita", "riuscita") EndIf EndIf Case $Button2 GUIDelete($Form2) ExitLoop Case $Checkbox1 FileWriteLine("C:\Program Files (x86)\SYM\registrato.dat","NO") EndSwitch WEnd EndIf EndIf #ce;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;fine controllo reg ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Daily bonus $dat01=@MDAY&@MON&@YEAR If $dat01=FileReadLine("C:\Program Files (x86)\SYM\dates.trr") Then FileRead("C:\Program Files (x86)\SYM\dates.trr") Else $Button1 = GUICtrlCreateButton("Free Daily Credits", 16, 88, 171, 25) GUICtrlSetBkColor(-1, 0x00FF00) FileWriteLine("C:\Program Files (x86)\SYM\dates.trr",$dat01) EndIf ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Fine daily bonus While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button2 #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=c:\users\daniel_2\desktop\sym\form3.kxf $Form1_1 = GUICreate("Carica Link", 475, 559, 184, 116) $MenuItem1 = GUICtrlCreateMenu("&Menu") $MenuItem3 = GUICtrlCreateMenuItem("Annulla", $MenuItem1) $MenuItem2 = GUICtrlCreateMenuItem("Exit", $MenuItem1) $Input1 = GUICtrlCreateInput("Link", 8, 48, 465, 21) $Label1 = GUICtrlCreateLabel("Per caricare link uno alla volta e consigliabbile usare la funzione sotto.", 8, 24, 333, 17) $Button1 = GUICtrlCreateButton("Carica", 8, 72, 75, 25) $Label2 = GUICtrlCreateLabel("Se invecce si desidera caricare più link, si può utilizare la funzioone sotto. Metta i link uno sotto", 8, 128, 450, 17) $Label3 = GUICtrlCreateLabel("l'altro, in verticale", 8, 144, 85, 17) $Edit1 = GUICtrlCreateEdit("", 8, 168, 289, 369) $Button2 = GUICtrlCreateButton("Carica", 304, 504, 169, 33) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($Form1_1) ExitLoop Case $Button1 $trax=_FileCreate("C:\Program Files (x86)\SYM\Temporal\tetra_link001.txt") $intrs=GUICtrlRead($Input1) FileWriteLine($trax,$intrs) #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=C:\Users\Daniel_2\Desktop\Sym\Form4 x.kxf $Form1x = GUICreate("Caricamento...", 747, 320, 192, 124) $Group1 = GUICtrlCreateGroup("", 8, 8, 113, 41) $Label1 = GUICtrlCreateLabel("Statto Caricamento:", 16, 24, 97, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("", 120, 8, 185, 41) $Label2 = GUICtrlCreateLabel("Waiting...", 128, 24, 68, 20) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xFF0000) GUICtrlCreateGroup("", -99, -99, 1, 1) $Label3 = GUICtrlCreateLabel("Loaded!", 128, 56, 61, 20) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x008000) $Label4 = GUICtrlCreateLabel("In questa Schermata in basso verrano llencatti tutti link caricati nel corso del tempo.", 312, 16, 396, 17) $List1 = GUICtrlCreateList("", 312, 48, 425, 266) GUICtrlSetData(-1, "trrr") $Button1 = GUICtrlCreateButton("Fine", 8, 280, 297, 33) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete($Form1x) ExitLoop Case $Button1 GUIDelete($Form1x) ExitLoop EndSwitch WEnd EndSwitch WEnd EndSwitch WEnd What am I doing wrong? Edited January 18, 2015 by DSChaos Link to comment Share on other sites More sharing options...
JohnOne Posted January 18, 2015 Share Posted January 18, 2015 I think you should explain more what your code is supposed to do, and what it does, as well as the main purpose of it. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
DSChaos Posted January 18, 2015 Author Share Posted January 18, 2015 OK, This code must upload files with links within on the server and download files from the server. But the problem is not this but rather that if I open a window and then tried again to reopen the window and clic the button "upload" does not work. ah I updated the code, so it should be better. I had forgotten to erase some parts of the script unnecessary in this case. im sorry for my english, i used the google translate. Link to comment Share on other sites More sharing options...
JohnOne Posted January 18, 2015 Share Posted January 18, 2015 I cannot run you code. Here's what I think you need to look at though. You are effectively starting and waiting for messages from a second gui, so take a look at GUISwitch. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
DSChaos Posted January 18, 2015 Author Share Posted January 18, 2015 I tried the source and it works, it should give you a screen like this. The source I posted and simplified to function better. Now if you try to on Upload and then close the window that opens, then try to clic the button on upload, the window that opened first,this run don't opens. Link to comment Share on other sites More sharing options...
JohnOne Posted January 18, 2015 Share Posted January 18, 2015 (edited) I'm sure it does run. I just do not have or am going to install AutoIt on this machine. Can you show where you edited your code to include GUISwitch? Edited January 18, 2015 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
DSChaos Posted January 19, 2015 Author Share Posted January 19, 2015 no no, I do not need that feature, I do not have to change the window d 'use but only to reopen the window closed. Now if you try to clic on Upload and then close the window that opens, then try to clic the button on upload, the window that opened first,this run don't opens. Link to comment Share on other sites More sharing options...
JohnOne Posted January 19, 2015 Share Posted January 19, 2015 When you click upload button, a new gui is created, but msgloop is waiting for msgs from first gui. You need GuiSwitch. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 19, 2015 Moderators Share Posted January 19, 2015 DSChaos, When you click upload button, a new gui is createdI am not sure GUISwitch is the answer - that sets the active GUI/tab for control creation. But a look at the Managing Multiple GUIs tutorial in the Wiki might be a good idea. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
DSChaos Posted January 19, 2015 Author Share Posted January 19, 2015 (edited) ok I think I understand, now I try . ok...not work OK i found the error, never use two variables equal. Edited February 5, 2015 by DSChaos Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now