
tele123
Members-
Posts
18 -
Joined
-
Last visited
Everything posted by tele123
-
In help file "static"
-
I have problem Line 1818 GuiCtrlCreateLabel("",0,120,373,48,$WS_DISABLED) ERROR: Variable used withhout being declared. next : Line 1823 --> $SS_Center next : Line 1824 ---> $SS_CENTER,$BS_DEFPUSHBUTTON I use xp What is wrong with my autoit? Edit: I paste this #include <StaticConstants.au3> ; ok #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GUIConstants.au3> #include <ComboConstants.au3> ; ok and working then Install -> Please check your internet connection and firewall setings and hit Retry .
-
Subscript used with non-Array variable
tele123 replied to upi's topic in AutoIt General Help and Support
I don't understant why I' can 't change name $jjdefault example : $jjdefaultXml = IniReadSection(@WorkingDir&"\Ustawienia\Tlumacz.ini", "Tlumacz" ) and this is the same $jjdefault and 1 Local I can not replace the other (of the same name ) Ok, I'm try . Thanks Edit: I placed each in a separate function IniReadSection Dim or local Now I read this http://www.autoitscript.com/wiki/Variables_-_using_Global,_Local_and_ByRef _______________________________________________ Edit2 : If can't use ... Func 1 variable = IniReadSection("The same name, path , etc. " ) EndFunc Func 2 variable other = IniReadSection("The same name, path , etc. " ) EndFunc ... Can I redeclare and again declare? How do you call a library that supports IniReadSection? For the evening, try with: #include <Array.au3> $var = IniReadSection("The same name, path , etc. ") Local $arr[$var[0][0]] For $i = 1 To $var[0][0] $arr[$i-1] = $var[$i][1] Next _ArrayDisplay($arr) _______________________ Edit: I don't know how , I can't use IniReadSection . I use FileOpen and _StringBetween for read $plik_xml = Fileopen(@WorkingDir&"\Ustawienia\Tlumacz.ini",0) $string1 = _StringBetween($plik_xml,'1=',@CRLF) $Ang = _StringBetween($plik_xml,($string1-1)&'=',@CRLF) $string3 = _StringBetween($plik_xml,'2=',@CRLF) $Pol = _StringBetween($plik_xml,($string3-1)&'=',@CRLF) Fileclose($plik_xml) Only , not working for me , but maybe will. I put If FileExists(@WorkingDir&"\Ustawienia\Tlumacz.ini") Then $plik_xml = FileOpen(@WorkingDir&"\Ustawienia\Tlumacz.ini", 0 ) Else MsgBox(4096, "File", "File:@WorkingDir&\Ustawienia\Tlumacz.ini, Does NOT exists") Endif And... I have "File:@WorkingDir&\Ustawienia\Tlumacz.ini, Does NOT exists" But file exist _____________________________________________________________ Edit. I have done differently, the program uses only one function IniReadFile, and resets there is only one drawback, pressing the "Start" program breaks down (do not see this) Then when you press the "combo" program closes, but will not start a new one. If you won try - "Run" working only with .exe files. Programik.zip -
Subscript used with non-Array variable
tele123 replied to upi's topic in AutoIt General Help and Support
Where I'm redeclaring $jjdefault? $jjdefault working inside Func Start_dalej_xml() , because I' don' understand - Can you explain or and change it? $jjdefault, is old $jjdefault, from first IniReadSection, and I can not put new IniReadSection. And when I use Func Start_dalej_xml() , I can not change the language in Combo1 and combo2. -
Subscript used with non-Array variable
tele123 replied to upi's topic in AutoIt General Help and Support
I ' clik "otwórz" test.xml and "Start " Line 221 $il_kluczyy1 = $jjdefaultXml[0][0] $il_kluczy1= ^ ERROR Error:Variable used without being declared. I changed a little, before I gave also Local #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GuiToolbar.au3> #include <ProgressConstants.au3> #include <StaticConstants.au3> #include <ToolbarConstants.au3> #include <WindowsConstants.au3> #Include <String.au3> #Region ### START Koda GUI section ### Form=C:Documents and SettingsgPulpitKalc-auttransgoog.kxf $GUI = GUICreate("Translator-.xml-.ini", 1174, 788, -1, -1) GUISetBkColor(0xF7EA9F) $edit731 = GUICtrlCreateEdit("", 8, 104, 486, 637) ; 1 edit ;GUICtrlSetData(-1, "1") $edit732 = GUICtrlCreateEdit("", 511, 104, 486, 637) ; 2 edit ;GUICtrlSetData(-1, "2") $label652 = GUICtrlCreateLabel("Orginalny tekst", 13, 59, 477, 31, $SS_CENTER) GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") $label214 = GUICtrlCreateLabel("Przetłumaczony tekst", 512, 60, 481, 31, $SS_CENTER) GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ;$combo35 = GUICtrlCreateCombo("", 1009, 297, 158, 25) ;GUICtrlSetData(-1, "Mein Text") ;$label640 = GUICtrlCreateLabel("Zmień kodowanie", 1008, 270, 153, 15, $SS_CENTER) $Otworz = GUICtrlCreateButton("Otwórz", 1029, 376, 119, 40) GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") $Start = GUICtrlCreateButton("Start", 1030, 478, 116, 39) GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") ;$Stop = GUICtrlCreateButton("Stop", 1032, 554, 113, 40) ;GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") $Zapisz = GUICtrlCreateButton("Zapisz", 1031, 640, 113, 40) GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") $label414 = GUICtrlCreateLabel("0 %", 939, 762, 70, 23, $SS_CENTER) $progressbar1 = GUICtrlCreateProgress(8, 760, 918, 16) ;---------------------------- If FileExists(@WorkingDir&"UstawieniaTlumacz.ini") Then $jjdefault = IniReadSection(@WorkingDir&"UstawieniaTlumacz.ini", "Tlumacz" ) Endif $il_kluczy =$jjdefault[0][0] $Combo1 = GUICtrlCreateCombo("", 1032, 104, 121, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) $Combo2 = GUICtrlCreateCombo("", 1032, 168, 121, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) $Jcombo1 = $jjdefault [($jjdefault [1][1])][1] $Jcombo2 = $jjdefault [($jjdefault [2][1])][1] For $x=4 to $il_kluczy step +2 GUICtrlSetData($Combo1, $jjdefault [$x][1],$Jcombo1) GUICtrlSetData($Combo2, $jjdefault [$x][1],$Jcombo2) Next ;--------------------------- $Label1 = GUICtrlCreateLabel("Z", 1032, 72, 115, 17, $SS_CENTER) $Label2 = GUICtrlCreateLabel("Na", 1032, 144, 114, 17, $SS_CENTER) ;$ToolBar1 = _GUICtrlToolbar_Create($GUI, 0) ;$Combo3 = GUICtrlCreateCombo("Otwórz plik", 1008, 8, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) $Input1 = GUICtrlCreateInput("Otwórz plik", 1008, 8, 145, 25) $Label3 = GUICtrlCreateLabel("Typ pliku:", 848, 8, 138, 17, $SS_RIGHT) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Otworz Otworz() Case $Start ; po nacisnieciu Start wykonuje Start() Case $Zapisz ;zapisz zapisz() Case $Combo1 combo1() Case $Combo2 combo2() EndSwitch WEnd ;Func combo1() ; FUNKCJA 1 ;EndFunc Func combo1() ; FUNKCJA 1 Local $jjdefault ; czyta combo6 i przyrównuje z tekstem $last='' $read = GUICtrlRead($Combo1) If $last <> $read Then $last = $read ;-----------------------PETLA------------------------------------------------------ ;If FileExists(@WorkingDir&"UstawieniaTlumacz.ini") Then ; $jjdefault = IniReadSection(@WorkingDir&"UstawieniaTlumacz.ini", "Tlumacz" ) ;Endif Local $jjdefault For $i = 4 to $jjdefault[0][0] Step +2 ; ma dodawać od 4 wartosci do konca co 2 If $read = $jjdefault[$i][1] Then ; Jezeli tekst z combo1 = tekstowi z pliku to... IniWrite(@WorkingDir&"UstawieniaTlumacz.ini", "Tlumacz", $jjdefault [1][0], $i) ;Zapisuje: plik,secja,klucz,wartosc EndIf Next ; --------------------------KONIEC PETLI ------------------------------------------ Endif EndFunc Func combo2() ; FUNKCJA 2 Local $jjdefault ; czyta combo6 i przyrównuje z tekstem $last='' $read = GUICtrlRead($Combo2) If $last <> $read Then $last = $read Endif ;-----------------------PETLA------------------------------------------------------ Local $jjdefault If FileExists(@WorkingDir&"UstawieniaTlumacz.ini") Then ; $jjdefault = IniReadSection(@WorkingDir&"UstawieniaTlumacz.ini", "Tlumacz" ) Endif For $i = 4 to $jjdefault[0][0] Step +2 ; ma dodawać od 4 wartosci do konca co 2 If $read = $jjdefault[$i][1] Then ; Jezeli tekst z combo1 = tekstowi z pliku to... IniWrite(@WorkingDir&"UstawieniaTlumacz.ini", "Tlumacz", $jjdefault [2][0], $i) ;Zapisuje: plik,secja,klucz,wartosc EndIf Next ; --------------------------KONIEC PETLI ------------------------------------------ EndFunc Func Otworz() ; funkcja wybierania pliku $File = FileOpenDialog("Wybierz pliczek",@WorkingDir, "Pliki .xml , .ini , .txt (*.xml;*.ini;*.txt)") ;otwiera okno dialogowe i umozliwia wybór pliki tekstowego ; "c:" GUICtrlSetData($edit731, FileRead($File)) ; wpisuje zawartoć pliku do okienka edit ;$odczytzpliku = 1 EndFunc ;---------------------------------------------------------------------------------------------------------------- Func Start() $plik_zrodlowy = GUICtrlRead($edit731) $stringbetween = _StringBetween($plik_zrodlowy,'<v>','</v>') ;$iloscWtablicy=UBound($stringbetween) ; liczy ilość słów w tablicy $stringbetween2 = _StringBetween($plik_zrodlowy,'[',']') If ((UBound($stringbetween)) <= 0 and (UBound($stringbetween2)) <= 0 ) then MsgBox(16, "Error ", "Nie rozpoznano pliku.") If (UBound($stringbetween)) > 0 then Start_dalej_xml() If (UBound($stringbetween2)) > 0 then Start_dalej_ini() EndFunc Func Start_dalej_xml() GUICtrlSetData($Input1, ".XML") $plik_zrodlowy = GUICtrlRead($edit731) $stringbetween = _StringBetween($plik_zrodlowy,'<v>','</v>') MsgBox(0, "Ilosc w tablicy" , UBound($stringbetween)) GUICtrlSetData($edit732, $plik_zrodlowy) $s = 0; progressbar-saveposition $msg = GUIGetMsg() ; $msg = $Start Then GUICtrlSetData($Start, "Stop") For $x = 0 To UBound($stringbetween) -1 ; sleep(500) $m = GUIGetMsg() If $m = -3 Then ExitLoop If $m = $Start Then ; GUICtrlSetData($Start, "Next") ; $s = $x ;save the current bar-position to $s ExitLoop Else $s = 0 $k= UBound($stringbetween) $ka = 100/$k $kl = $ka * ($x+1) $S1 = StringFormat("%d", $kl) ; zamiana na całe bez zaokraglania GUICtrlSetData($progressbar1, $S1) Endif $nazwa_en = $stringbetween[$x] ;combo1() ;combo2() If FileExists(@WorkingDir&"UstawieniaTlumacz.ini") Then $jjdefaultXml = IniReadSection(@WorkingDir&"UstawieniaTlumacz.ini", "Tlumacz" ) endif $il_kluczyy1 =$jjdefaultXml[0][0] MsgBox(0, "Postęp $x0: ",$il_kluczyy1 ) $1wartXml = $jjdefaultXml[1][1] MsgBox(0, "Postęp $x0: ",$1wartXml ) $Ang = $jjdefaultXml[$1wartXml-1][1] $Pol = $jjdefaultXml[$jjdefaultXml [2][1]-1][1] $read = BinaryToString(InetRead("http://translate.google.pl/m?hl=en&sl="&$Ang&"&tl="&$Pol&"&ie=UTF-8&q="& _URIEncode($nazwa_en)), 1) ; & _URIEncode ;sleep(1000) $regexp2 = StringRegExp($read, '<div dir="ltr" class="t0">(.*?)</div>', 1) $nazwa_pl1 =ISO88592_to_ANSI_1($regexp2[0]) ;$nazwa_pl1 = _ConvertAnsiToUtf8($nazwa_pl1a) $nazwa_pl = '<v>'&$nazwa_pl1&'</v>' $nazwa_en2 = '<v>'&$nazwa_en&'</v>' ;MsgBox(0, "Postęp tłumaczenia: ",$nazwa_en2 &'-'&$nazwa_pl ) $x0 = GUICtrlRead($edit732) ;MsgBox(0, "Postęp $x0: ",$x0 ) $tresc2 = StringReplace($x0 , $nazwa_en2, $nazwa_pl) GUICtrlSetData($edit732, $tresc2) GUICtrlSetData($label414, $S1 & "%") Sleep(1000) Next GUICtrlSetData($Start, "Start") EndFunc Func Start_dalej_ini() GUICtrlSetData($Input1, ".INI") $plik_zrodlowy = GUICtrlRead($edit731) ; = () $stringbetween = _StringBetween($plik_zrodlowy,'=', @CRLF ) MsgBox(0, "Ilosc w tablicy" , UBound($stringbetween)) GUICtrlSetData($edit732, $plik_zrodlowy) $s = 0; progressbar-saveposition $msg = GUIGetMsg() ; $msg = $Start Then GUICtrlSetData($Start, "Stop") For $x = 0 To UBound($stringbetween) - 1 ; sleep(500) $m = GUIGetMsg() If $m = -3 Then ExitLoop If $m = $Start Then ; GUICtrlSetData($Start, "Next") ; $s = $x ;save the current bar-position to $s ExitLoop Else $s = 0 $k= UBound($stringbetween) $ka = 100/$k $kl = $ka * ($x+1) $S1 = StringFormat("%d", $kl) ; zamiana na całe bez zaokraglania GUICtrlSetData($progressbar1, $S1) Endif $nazwa_en = $stringbetween[$x] ; $jen='en' ; $jpl='pl' Local $jjdefault combo1() combo2() If FileExists(@WorkingDir&"UstawieniaTlumacz.ini") Then $jjdefault = IniReadSection(@WorkingDir&"UstawieniaTlumacz.ini", "Tlumacz" ) Endif $Ang = $jjdefault[($jjdefault [1][1])-1][1] $Pol = $jjdefault[($jjdefault [2][1])-1][1] MsgBox(0, "Postęp tłumaczenia: ",$Ang ) MsgBox(0, "Postęp tłumaczenia: ",$Pol ) $read = BinaryToString(InetRead("http://translate.google.pl/m?hl=en&sl="&$Ang&"&tl="&$Pol&"&ie=UTF-8&q="& _URIEncode($nazwa_en)), 1) ; & _URIEncode ;sleep(1000) $regexp2 = StringRegExp($read, '<div dir="ltr" class="t0">(.*?)</div>', 1) $nazwa_pl1 =ISO88592_to_ANSI_1($regexp2[0]) ;$nazwa_pl1 = _ConvertAnsiToUtf8($nazwa_pl1a) $nazwa_pl = '='&$nazwa_pl1 &@CRLF $nazwa_en2 = '='&$nazwa_en &@CRLF ;MsgBox(0, "Postęp tłumaczenia: ",$nazwa_en2 &'-'&$nazwa_pl ) $x0 = GUICtrlRead($edit732) ;MsgBox(0, "Postęp $x0: ",$x0 ) $tresc2 = StringReplace($x0 , $nazwa_en2, $nazwa_pl) GUICtrlSetData($edit732, $tresc2) GUICtrlSetData($label414, $S1 & "%") Sleep(1000) Next GUICtrlSetData($Start, "Start") EndFunc ;---------------------------------------------------------------------------------------------------- Func zapisz() $var = FileSaveDialog ( "nazwa",@WorkingDir , "Pliki (*.txt)|(*.ini)|(*.xml)",4) If @error Then MsgBox(4096,"","Nie zapisano.") Else $plik_docelowy = GUICtrlRead($edit732) $file = FileOpen($var, 2 + 8) FileWrite($file, $plik_docelowy) FileClose($file) $var = StringReplace($var, "|", @CRLF) MsgBox(4096,"","Zapisano do: " & $var) EndIf EndFunc Func ISO88592_to_ANSI_1($sText = "") Local $sRet = "", $CODEPAGE[19][2] = [[179, "ł"],[163, "Ł"],[230, "ć"],[198, "Ć"],[166, "Ś"],[182, "ś"],[211, "ó"],[243, "ó"],[177, "ą"],[161, "Ą"],[202, "Ę"],[234, "ę"],[188, "ź"],[172, "Ź"],[175, "Ż"],[191, "ż"],[209, "Ń"],[241, "ń"]] For $iIter = 1 To StringLen($sText) Step 1 $itmp = StringMid($sText, $iIter, 1) For $iRep = 1 To 18 Step 1 If Asc($itmp) = $CODEPAGE[$iRep][0] Then $itmp = $CODEPAGE[$iRep][1] Next $sRet &= $itmp Next Return $sRet EndFunc ;==>ISO88592_to_UNICODE ; zrodlo: http://www.autoitscript.com/forum/topic/95850-url-encoding/page__view__findpost__p__689060 Func _URIEncode($sData) ; Prog@ndy Local $aData = StringSplit(BinaryToString(StringToBinary($sData, 4), 1), "") Local $nChar $sData = "" For $i = 1 To $aData[0] ;ConsoleWrite($aData[$i] & @CRLF) $nChar = Asc($aData[$i]) Switch $nChar Case 45, 46, 48 - 57, 65 To 90, 95, 97 To 122, 126 $sData &= $aData[$i] Case 32 $sData &= "+" Case Else $sData &= "%" & Hex($nChar, 2) EndSwitch Next Return $sData EndFunc ;==>_URIEncodeProgramik.zip Test.tra.xml -
Subscript used with non-Array variable
tele123 replied to upi's topic in AutoIt General Help and Support
Can I paste the whole code? program breaks when I use a second time IniReadSection again in "Start_dalej_xml Func ()" -
Subscript used with non-Array variable
tele123 replied to upi's topic in AutoIt General Help and Support
"Autoit code " in this forum created the stamps and put all the code in one line , and I needed edit. Ok.... So, how to read and write again, the same file and line in the ini file. many times? you're right But I use If FileExists(@WorkingDir&"UstawieniaTlumacz.ini") Then $jjdefault = IniReadSection(@WorkingDir&"UstawieniaTlumacz.ini", "Tlumacz" ) Endif $il_kluczy =$jjdefault[0][0] Next And working second If FileExists(@WorkingDir&"UstawieniaTlumacz.ini") Then $jjdefaultXml = IniReadSection(@WorkingDir&"UstawieniaTlumacz.ini", "Tlumacz" ) endif $il_kluczyy1 =$jjdefaultXml[0][0] I use other name " $ " because this same name too not working. Like , File not exist. File exist , but data in the file are different. ( Name [Tlumacz], in .ini file is this same ) -
Subscript used with non-Array variable
tele123 replied to upi's topic in AutoIt General Help and Support
I have this same , Func Start_dalej_xml() ... For ; For $x = 0 To UBound($stringbetween) -1 If FileExists(@WorkingDir"UstawieniaTlumacz.ini") Then $jjdefault = IniReadSection(@WorkingDir"UstawieniaTlumacz.ini", "Tlumacz" ) Endif $il_kluczyy1 =$jjdefault[0][0] MsgBox(0, "Postęp $x0: ",$il_kluczyy1 ) $1wartXml = $jjdefaultXml[1][1] Next ... EndFunc MsgBox =$jjdefault[0][0] = 16 MsgBox = $jjdefaultXml[1][1]= Error And I don't know , why? Ini file is ok , but when I use second, third time in program , I have error. I need paste IniReadSection because I need refresh $jjdefault from .ini file. -
hmm.... xB9 (utf-8)= ą ( ANSI ) = b9 (hex) xE6 (utf-8)= ć ( ANSI ) = e6 (hex ) ą, ń, ę, ż, dż, ź, ó, ł, ś, ć Ä…, Ĺ„, Ä™, ĹĽ, dĹĽ, Ĺş, Ăł, Ĺ‚, Ĺ›, ć, --> utf-8 to ANSI xB9, xF1, xEA, xBF, dxBF, x9F, xF3, xB3, x9C, xE6 --> ANSI to utf-8 Ok , now I know , I must change Format utf-8 to ANSI in notepad++ And I use Windows-1250 file , but from url ISO8859-2 is similar , but example, greatly helped. Thanks slawekc I have .txt in fiile <v>6, ą, ń, ę, ż, dż, ź, ó, ł, ś, ć</v> <v>6, Ą, Ń, Ę, Ż DŻ, Ź, ó, Ł, Ś, Ć</v> from google <v>6, a, n, ę, ż, dż, ź, ó, ł, ś, ć</v> <v>6, A, N, E, Z DZ, Z, O, L, S, C</v> I don't know...no matter, now it is a little better
-
I do not want. Koda is probably not develop, LastJuly 30, 2010. too few people, wants and knows how to improve it Maybethe author of ISN and autor KODA, would agree to join KODA, and ISN advantagesin whole. I do not know Delphi and maybe people also do not know. ISN have source code in autoit files. Everything depends on us... Others would be able to add something: - Files with translations into foreign languages - Various nice gui for the program - Code with new features that can be added or plug Editor and form can connect, but consist of several files, if everything was in one file, you can get lost. Sorry for my English.
-
url decoding working ? Because , I do not understand , how copy this : ą, ń, ę, ż, dż, ź, ó, ł, ś, ć from google translator When I copy text to autoit , I have ±, ę, ż, dż, Ľ, ó, ł, ¶, ć,
-
ISN AutoIT Form Studio http://www.isnetwork.at.pn/ from topic:
-
ą, ń, ę, ż, dż, ź, ó, ł, ś, ć, ( from file ) ---> ±, ę, ż, dż, Ľ, ó, ł, ¶, ć, ( from url ) How to change this? : ±, ę, ż, dż, Ľ, ó, ł, ¶, ć, ---> ą, ń, ę, ż, dż, ź, ó, ł, ś, ć,
-
Koda 1.7.3.0 (2010-07-30) is ok If something disappears in atTAGroup, it is sufficient F9 and I see all. I would like to in the new version was GUICtrlCreateListViewItem or GUICtrlCreateListViewItem . http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateListView.htm
-
After ";" is description Now the "metin.exe", working. :-)
-
I found it in the AutoIt Help, How to write Win+r ( keys {LWin} {r} ) (Previously, I have not noticed ,I'm sorry! ), it is:
-
Thank you, I will also look on youtube and wiki page
-
At the outset, to say I do not know English well, so I apologize for the grammar. ( I do not use English windows) I have a problem of learning how to use AutoIt. Learn best by example, but I do not go: (. Can someone write a tutorial on how to use the basic things ? how to write a program that: - He steered mouse that clicked for me - He clicked on the keyboard for me And paste in a separate section of the forum. ( Tutorials ) I Example: (example) : *** ; Run Notepad *** Ad. I my program is for example: metin2.exe *** *** but did not work , and I don't know . why opened false If it did not work , I can too , klik on the keyboard "Win+R", write on the keyboard link ("G:\ ... ") , Enter , mouse click or write on the keyboard, the end of the script. So I wrote: *** *** The result is only {LWIN}, why? , What am I doing wrong? I can still do this (click, this same) a mouse, but still I can not.