
blantek212
Members-
Posts
14 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
blantek212's Achievements

Seeker (1/7)
0
Reputation
-
GUICtrlCreateCombo change choose list
blantek212 replied to blantek212's topic in AutoIt General Help and Support
Excellent , it works -
Hello, I try make option list in GUI window, but option on the list are dependent from other parameter. If I choose heater CEAMIC then I would like have in type list - 2 option TYPE S and TYPE R, When I choose heater METAL - type list - TYPE K and TYPE W. Below part od my script, it work but not full correctly. If I choose ceramic and next metal heater- in type list I have all types. #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Global $HEATER, $HEATER_inp, $TYPE, $TYPE_inp, $CHECK, $Code Call("HT") Func HT() #Region ### START Koda GUI section ### Form=C:\Users\marcin.pawlak\Desktop\ROR-2.kxf $Form1_1 = GUICreate("HT", 555, 605, 239, 124) $HEATER = GUICtrlCreateCombo("", 88, 192, 177, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData($HEATER, "CEAMIC|METAL") GUICtrlSetBkColor(-1, 0xE3E3E3) $HEATER_inp = GUICtrlCreateInput("", 28, 192, 40, 24) GUICtrlSetBkColor(-1, 0xE3E3E3) $TYPE = GUICtrlCreateCombo("", 88, 256, 177, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) ;GUICtrlSetData($TYPE, "TYPE ?") GUICtrlSetBkColor(-1, 0xE3E3E3) $TYPE_inp = GUICtrlCreateInput("", 28, 256, 40, 24) GUICtrlSetBkColor(-1, 0xE3E3E3) $Input9 = GUICtrlCreateInput($Code, 24, 440, 313, 24) GUICtrlSetBkColor(-1, 0xE3E3E3) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $CHECK="A" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch If GUICtrlRead($HEATER)="CEAMIC" Then GUICtrlSetData($HEATER_inp, "C") EndIf If GUICtrlRead($HEATER)="METAL" Then GUICtrlSetData($HEATER_inp, "M") EndIf If GUICtrlRead($TYPE)="TYPE S" Then GUICtrlSetData($TYPE_inp, "S") EndIf If GUICtrlRead($TYPE)="TYPE R" Then GUICtrlSetData($TYPE_inp, "R") EndIf If GUICtrlRead($TYPE)="TYPE K" Then GUICtrlSetData($TYPE_inp, "K") EndIf If GUICtrlRead($TYPE)="TYPE W" Then GUICtrlSetData($TYPE_inp, "W") EndIf If $CHECK <> GUICtrlRead($HEATER_inp) Then If GUICtrlRead($HEATER_inp)="C" Then GUICtrlSetData($TYPE, "TYPE S|TYPE R") EndIf If GUICtrlRead($HEATER_inp)="M" Then GUICtrlSetData($TYPE, "TYPE K|TYPE W") EndIf $CHECK=GUICtrlRead($HEATER_inp) EndIf $Code = (GUICtrlRead($HEATER_inp)&"-"&GUICtrlRead($TYPE_inp)) GUICtrlSetData($Input9, $Code) WEnd EndFunc
-
blantek212 reacted to a post in a topic: Part of script in txt file
-
blantek212 reacted to a post in a topic: Part of script in txt file
-
Part of script in txt file
blantek212 replied to blantek212's topic in AutoIt General Help and Support
Great, that's what I was looking for CmdLine also work fine. Nine BrewManNH Thanks for help. -
Part of script in txt file
blantek212 replied to blantek212's topic in AutoIt General Help and Support
I made test with #include "partofmyscript.txt", it work nice, but there is any way after compile script to exe file, to update this partofmyscript.txt for every time when I run exe file? I need this in case when I modyfi partofmyscript.txt. I check, I can use also .au3 file instead .txt -
Part of script in txt file
blantek212 replied to blantek212's topic in AutoIt General Help and Support
These conditions will be totally different each time, different number, different structure if..... If $part_name="fan" Then FileWrite($handle,"780001"&@CRLF) EndIf If $part_name="fan" Then If $part_number="33" Then FileWrite($handle,"780002"&@CRLF) EndIf If $part_number="22" Then If $part_end="1"Then FileWrite($handle,"780003"&@CRLF) EndIf If $part_end="2"Then FileWrite($handle,"780008"&@CRLF) EndIf EndIf EndIf Only this paremeters are fixed $part_name="fan" $part_number="22" $part_place="WS" $part_end="2" $handle=FileOpen("C:\temp\Missing_positions.txt",1) -
Hello, I would like write script in autoit, but some part of script must be editable, and this part I would like put in txt file. That solution give me possibility to editing/change script without compile script every time when I change lines inside. I'm confused, is it possible to do? $part_name="fan" $part_number="22" $part_place="WS" $part_end="2" $handle=FileOpen("C:\temp\Missing_positions.txt",1) ;read script from script.txt ;start txt file If $part_name="fan" Then FileWrite($handle,"780001"&@CRLF) EndIf If $part_name="fan" Then If $part_number="33" Then FileWrite($handle,"780002"&@CRLF) EndIf If $part_number="22" Then If $part_end="1"Then FileWrite($handle,"780003"&@CRLF) EndIf If $part_end="2"Then FileWrite($handle,"780008"&@CRLF) EndIf EndIf EndIf ;end txt file FileClose($handle) MsgBox(0,"Info","Ready") Everything between ";start txt file" and ";end txt file" I would like have in file "script.txt" Every number "780...." which meet the conditions, I would like have save in "Missing_positions.txt" file.
-
Ok, but if I good understand, context menu is available when I click on the right mouse button, not when I click button in gui window. I try to made that, I create button and define rules, when click the button then this button send MouseClick, and shows context menu. This works but not so good. Sometimes I must click few times to show menu. Maybe is some simplier way to solwe this? #include <GUIConstantsEx.au3> #include <AVIConstants.au3> #include <TreeViewConstants.au3> #include <AutoItConstants.au3> GUICreate("GUI", 400, 600) $button =GUICtrlCreateButton("Start Menu", 10, 340, 100, 30) $contextMenu=GUICtrlCreateContextMenu($button) GUICtrlCreateMenuItem("Menu 1", $contextMenu) GUICtrlCreateMenuItem("", $contextMenu) GUICtrlCreateMenuItem("Menu 2", $contextMenu) GUISetState() While GUIGetMsg() <> $GUI_EVENT_CLOSE $nMsg = GUIGetMsg() If $nMsg=$button Then Sleep(300) MouseClick($MOUSE_CLICK_RIGHT) EndIf WEnd
-
Hello, I try to do some script, and I need to create something like GUICtrlCreateMenu. But this option creates menu on the top of GUI window, and I need something like this in the other place, something like a button with menu. I can't find any way, how to do this...?
-
blantek212 reacted to a post in a topic: Write few array to one file
-
Write few array to one file
blantek212 replied to blantek212's topic in AutoIt General Help and Support
This is exactly what I need, works great Thanks -
Hello everyone. I need help with scripts. I have some code which creates array, and next writes this array to a file (function _FileWriteFromArray). In the next step it creates second array. I would like to add this array to previous file, but function _FileWriteFromArray repleaces only content in the file. Is there any other way to solve this problem?
-
OK, thanks
-
Thanks for suggestion, but I don't have any idea how to use this in autoit
-
Hello, I'm trying to write code to check the date. The date of the Windows operating properly take, but is it possible to check a date online? If yes, then how to do it?
-
_Excel_RangeRead from active Excel file
blantek212 posted a topic in AutoIt General Help and Support
Hello, I have some problem with my code. I try to use command "_Excel_RangeRead", it works when AutoIt opens new excel file, code like below Local $oExcel = _Excel_Open() Local $oWorkbook = _Excel_BookOpen($oExcel, "path") $copy_cell = _Excel_RangeRead($oWorkbook, $oWorkbook.Activesheet, "A1") But I don't have any idea how read cell in excel (without open new file), when I have already opened excel file. I try to run code below, but it doesn't work correct, $copy_cell return 0. Local $oExcel = ObjGet("", "Excel.Application") $oExcel.Visible = 1 $copy_cell = _Excel_RangeRead($oExcel, Default, "A1") Has anybody any idea how to solve this?