All Activity

This stream auto-updates   

  1. Past hour
  2. Và tôi có một vấn đề Cần mọi người giúp đỡ : BlockInput (1) khóa cả chuột và bàn phím. Tôi muốn nút [ESC] trên bàn phím không bị khóa, làm thế nào?
  3. So, thinking abstractly about the question...Are you meaning a form of copy protection to not be used on another machine? add an encryption based on a hardware property(ie MAC address or HD serial number)... outside of that to make it not able to be copied have it encrypted so that the file can be copied but not read by another machine last thought regarding this, have the text actually be created by pixel dots or images, a simple copy/paste into an editor would not yield usable text... wish I was versed in Autoit a little better as to be able to provide snippets to get you started, but finding the solution to the idea is most of the fun anyway Good luck
  4. Yesterday
  5. Move this line to after the While loop or within your _Exit function -- AdlibUnRegister($_Timer)
  6. Hey everyone, I've been messing around with some new things and adlibs look extremely useful/interesting, however, I can't seem to get it to work.. Here's what I have HotKeySet("{F1}", "_Exit") $qCount = 1 Global $_Timer AdlibRegister($_Timer, 1000) AdlibUnRegister($_Timer) While 1 SoundPlay(@WindowsDir & "\media\tada.wav", 1) $qCount += 1 ToolTip('"Tada" has been played ' & $qCount & " times",200,200) WEnd Func _Timer() Local Static $iCount += 1 ConsoleWrite($iCount) If $iCount = 20 Then ConsoleWrite("iCount is at " & $iCount) EndFunc Func _Exit() Exit EndFunc Basically I want it to call the _Timer function but it doesn't seem to work :/ any ideas?
  7. How do I input as a parameter for the PixelSearch function? Search Area would be a rectangle/square Non-Search Area would be specific points... How do I feed this into PixelSearch? Create a for loop and iterate through all points?
  8. Solved. I ran FileGetShortcut to get the parameters that it was running when I made it manually. This works. FileCreateShortcut(@WindowsDir & "\system32\cmd.exe", @DesktopDir & "\" & $Unpack & ".lnk","","'/c start "" "' & @DesktopDir & "\" & $Unpack & '.exe"'","","","{F6}")
  9. Create a function which takes search area, and non search area, the rest is maths, which I'm lousy at.
  10. The excluded target area must be detected using program execution. Therefore I would ideally want to append the co-ordinates to an array then exclude all co-ordinates within this array when searching for pixels
  11. search a grid of rectangles, excluding your non target area.
  12. Title says all. How would I exclude pixel co-ordinates from the PixelSearch function? I.e.: At the moment it search a rectangular/square area. I want to exclude certain co-ordinates from it so that they are not checked for certain pixel colour values. Thanks in advance!
  13. In hind sight, my suggestion is unlikely to solve your issue. Suggest that you run the posted code in Scite and then show us the complete results from the Scite Output window.
  14. That is a correct conclusion indeed, but that sentence implied something else as well. Jos
  15. My point is that if you want to use Assign with an array element you need to do it manually or in case you do not know the variable name while developing the code you need to use a temporary array variable or use the code I shared, which shows an "Assign2()" function that works no matter what you pass a variable name or a array element name.
  16. Could you tell me how I do this?
  17. Your code runs fine for me. Perhaps you should try adding a COM error handler.
  18. Sorry. I will post the whole thing. It is pretty long. Here you go: #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <FileConstants.au3> #include <File.au3> #include <GUIListBox.au3> Main_Form() Func Main_Form() #Region ### START Koda GUI section ### Form=c:\users\elahr.vitacost\documents\autoit scripts\form1.kxf $Form1 = GUICreate("", 798, 401, 177, 114) $Label1 = GUICtrlCreateLabel("Display Request Form", 0, 8, 715, 41, $SS_CENTER) GUICtrlSetFont(-1, 24, 800, 0, "MS Sans Serif") $Input1 = GUICtrlCreateInput("0", 416, 120, 81, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER)) $Combo1 = GUICtrlCreateCombo("", 16, 120, 385, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) $Combo2 = GUICtrlCreateCombo("", 16, 152, 385, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) $Combo3 = GUICtrlCreateCombo("", 16, 184, 385, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) $Combo4 = GUICtrlCreateCombo("", 16, 216, 385, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) $Combo5 = GUICtrlCreateCombo("", 16, 248, 385, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) $Input2 = GUICtrlCreateInput("0", 416, 152, 81, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER)) $Label2 = GUICtrlCreateLabel("URL to Display", 120, 80, 139, 28, $SS_CENTER) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $Label3 = GUICtrlCreateLabel("Minutes", 417, 82, 77, 28, $SS_CENTER) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $Input3 = GUICtrlCreateInput("0", 416, 184, 81, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER)) $Input4 = GUICtrlCreateInput("0", 416, 216, 81, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER)) $Input5 = GUICtrlCreateInput("0", 416, 248, 81, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER)) $Button1 = GUICtrlCreateButton("Open Page and Configure", 645, 120, 139, 17) $Button2 = GUICtrlCreateButton("Begin Display", 168, 293, 355, 33) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $Button3 = GUICtrlCreateButton("Add or Remove URL", 205, 347, 291, 33) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $Button4 = GUICtrlCreateButton("Open Page and Configure", 645, 153, 139, 17) $Button5 = GUICtrlCreateButton("Open Page and Configure", 645, 187, 139, 17) $Button6 = GUICtrlCreateButton("Open Page and Configure", 645, 217, 139, 17) $Button7 = GUICtrlCreateButton("Open Page and Configure", 645, 251, 139, 17) $Label4 = GUICtrlCreateLabel("Refresh", 536, 80, 76, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $Radio1 = GUICtrlCreateRadio("", 566, 120, 17, 17) $Radio2 = GUICtrlCreateRadio("", 566, 152, 17, 17) $Radio3 = GUICtrlCreateRadio("", 566, 184, 17, 17) $Radio4 = GUICtrlCreateRadio("", 566, 217, 17, 17) $Radio5 = GUICtrlCreateRadio("", 566, 250, 17, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Local $oFile = @ScriptDir & "\URL_List.txt" FileOpen($oFile, 0) ; Check if file opened for reading OK If $oFile = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf For $ii = 1 to 5 ; Read in lines of text until the EOF is reached For $i = 1 to _FileCountLines($oFile) $line = FileReadLine($oFile,$i) ;MsgBox(0,'',$line) If $ii = 1 Then GUICtrlSetData($Combo1, $line) If $ii = 2 Then GUICtrlSetData($Combo2, $line) If $ii = 3 Then GUICtrlSetData($Combo3, $line) If $ii = 4 Then GUICtrlSetData($Combo4, $line) If $ii = 5 Then GUICtrlSetData($Combo5, $line) Next Next FileClose($oFile) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button3 GUIDelete($Form1) URL_Config() EndSwitch WEnd EndFunc Func URL_Config() Local $oFile = @ScriptDir & "\URL_List.txt" FileOpen($oFile, 0) ; Check if file opened for reading OK If $oFile = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf #Region ### START Koda GUI section ### Form=C:\Users\elahr.VITACOST\Documents\AutoIT Scripts\Form2.kxf $Form2 = GUICreate("Add or Remove URL", 543, 671, 250, 14) $List1 = GUICtrlCreateList("", 24, 40, 497, 344) $Label1 = GUICtrlCreateLabel("Select URL to Remove", 0, 8, 539, 32, $SS_CENTER) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $Button1 = GUICtrlCreateButton("Remove", 40, 392, 465, 33) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $Input1 = GUICtrlCreateInput("", 24, 504, 497, 21) $Label2 = GUICtrlCreateLabel("Enter URL to Add", 0, 472, 539, 32, $SS_CENTER) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $Button2 = GUICtrlCreateButton("Add", 43, 532, 465, 33) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $Button3 = GUICtrlCreateButton("Return to Display Setup", 39, 610, 465, 33) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### For $i = 1 to _FileCountLines($oFile) $line = FileReadLine($oFile,$i) GUICtrlSetData($List1, $line) Next While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $select = GUICtrlRead($List1) For $i = 1 to _FileCountLines($oFile) $line = FileReadLine($oFile,$i) If $line = $select Then _FileWriteToLine($oFile, $i, "", True) _GUICtrlListBox_ResetContent($List1) For $z = 1 to _FileCountLines($oFile) $oLine = FileReadLine($oFile,$z) GUICtrlSetData($List1, $oLine) Next ExitLoop EndIf Next Case $Button2 $new = GUICtrlRead($Input1) GUICtrlSetData($Input1, "") ;MsgBox(0, "", "Input: " & $new) If $new <> "" Then FileWriteLine($oFile, $new) _GUICtrlListBox_ResetContent($List1) For $z = 1 to _FileCountLines($oFile) $oLine = FileReadLine($oFile,$z) GUICtrlSetData($List1, $oLine) Next If $new = "" Then MsgBox(0, "Error", "There is nothing to add.") URL_Config() Case $Button3 GUIDelete($Form2) Main_Form() EndSwitch WEnd EndFunc
  19. Assign/Eval being pretty convoluted useless constructs, the point is not only seriously old but moot.
  20. Well, your posted code isn't complete so there is nothing to test with. Post a replicator script and we might be able to help. Jos
  21. Even now 8 years later, the Assign function still says you cannot use as an input an array element (like $Array[3]). In fact, if the variable name is given as a text this can be tricky to solve. I used the following. The idea is to obtain the arrayname (removing the trailing "[number]") and copying into an array variable that we know the name and therefore can modify its element position "number", to later revert to array again. Maybe not the best solution but at least now I have an Assign2 function that can work either with variables ($Var) or array elements ($Array[2]) #include <array.au3> Example() Func CheckIfVariableNameIsAnArray(const $ParamName) return (StringRegExp($ParamName, "(\[)([0-9]{1,2})(\])$"))? True : False Endfunc Func CheckIfVariableNameIsAnArrayAndReturnItsArrayIndex(const $ParamName) if StringRegExp($ParamName, "(\[)([0-9]{1,2})(\])$") Then local $ArrayPos=StringTrimLeft(StringTrimRight(_ArrayToString(StringRegExp($ParamName, "(\[)([0-9]{1,2})(\])$",1),""),1),1) ; This removes the "[]" covering number like: [number] return $ArrayPos Else return "" endif Endfunc Func Assign2(const $ParamName, const $Value) local $ArrayName="" local $ArrayPos="" if not CheckIfVariableNameIsAnArray($ParamName) or IsNumber($ParamName) Then Assign($ParamName, $Value) Else $ArrayPos=CheckIfVariableNameIsAnArrayAndReturnItsArrayIndex($ParamName) if $ArrayPos <> "" then $ArrayName=StringTrimRight($ParamName,2+StringLen($ArrayPos)) ; This removes the trailing "[number]" like: Array[number] -> Array local $ArrayTmp=Eval($ArrayName) $ArrayTmp[$ArrayPos]=$Value Assign($ArrayName, $ArrayTmp) endif endif EndFunc func Example() local $Array[3]=[1,2,3] local $VariableElementToChange="Array[2]" Assign2(VariableElementToChange, "7") endfunc
  22. Hello, I try to get the sourcecode for a specific site. The problem is that I only get an error: $oHTTP.Send()^ ERROR $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("GET", "https://www.amica-group.de", False) $oHTTP.Send() $oReceived = $oHTTP.ResponseText MsgBox("","",$oReceived) I really can not find a way how the server blocks me. I get the error instandly. I guess it is not the headder nor the IP. I really can not understand what the server is doing. Would be very nice if someone could explain this to me.
  23. This is one way of getting the type when object.GetType() is not working C# MyClass1 myClass1 = new MyClass1(); // Get the type referenced by the specified type handle. Type myClass1Type = Type.GetTypeFromHandle(Type.GetTypeHandle(myClass1)); Console.WriteLine("The Names of the Attributes :"+myClass1Type.Attributes); So this would become in AutoIt something close to??? $handle=$Type.GetTypeHandle($objPsCollection) $objectType=$Type.GetTypeFromHandle($handle) //Need objCreateInterface somehow in between????? $objectType.invokemethod_3("Count",$objPsCollection,$propertyget,0,0,0,$Count)
  24. Thanks for posting, that is exactly what I wanted !!
  25. Thanks for the reply! Actually, that is how I had it first. I made the change to use the GetHandle command to try to fix the problem but it made no difference. I will change it back but the problem remains. I have also tried using the $Form2 title "Add or Remove URL" which made no difference. As I said, it works fine if I don't type in $Input1. So weird.
  26. You could try checking the value of $oBtn.style.display
  1. Load more activity