
PcExpert
Active Members-
Posts
614 -
Joined
-
Last visited
About PcExpert
- Birthday 08/01/1990
Profile Information
-
Member Title
AutoIT Scripter
-
Location
The Netherlands
-
WWW
http://www.pcbase.eu
PcExpert's Achievements

Universalist (7/7)
1
Reputation
-
raman004 reacted to a post in a topic: Make a program remotely managable
-
Hi all, I am trying to resize a Firefox 4 window on Windows 7 x64. But it doesn't work when using WinMove() like this: WinMove("[firefox window name goes here]", -1, -1, 706, 728) or this WinMove("[firefox window name goes here]", Default, Default, 706, 728) I also tried it with a Word 2010 window, but same results. Hmm, MouseClickDrag() doesnt seem to work well either, it does work, but it drags at the wrongs coords. Though the coord mode is correct Any ideas why this happens? Thanks! P.S. I set '#RequireAdmin' in the script.
-
I have a flash application for which I would like to automate some things. my autoitscript uses PixelgetColor to 'see' if there is some action needed (a mouseclick). Sometimes however, the mouseclick doesn't come through, or is not being done or so. The scriptpart lloks like While 1 If Pixelgetcolor($x, $y) = $color then mouseclick($mousex, $mousey, 1) Endif WEnd But I need pixelgetcolor to timeout after some seconds so I can redo the action (mouseclick) if the mouseclick isn't done. But how do I do this? I know that the WinWait() commands can have timeouts, but that doesn't work here. Any ideas how this can be done? Thank you!
-
GUICtrlSetOnEvent() executes before doing anything
PcExpert replied to PcExpert's topic in AutoIt General Help and Support
Hmm, okay.. I think I can live with that ... thanks for the quick help Why is it not possible actually? -
GUICtrlSetOnEvent() executes before doing anything
PcExpert replied to PcExpert's topic in AutoIt General Help and Support
This is what I have so far: #include<string.au3> #include <GUIConstantsEx.au3> Global $INI_General = "Database\settings.ini" Global $TITLE = "Servicedesk" Global $CurrentPage = "Incident_overview" Opt("GUIOnEventMode", 1) $gui_main = GUICreate($TITLE, 680, 395) GUISetOnEvent($GUI_EVENT_CLOSE, "GUIExit") GUICtrlCreateMenu("&Bestand") $incident_listview = GUICtrlCreateListView("Incident nr.|Aanmelder|Datum|Probleem Omschrijving ", 90, 35, 580, 330) $incident_view_type_label = GUICtrlCreateLabel("Incident status:" , 400, 10) $incident_view_type = GUICtrlCreateCombo("Afgemeld" , 490, 8, 100) GUICtrlSetData(-1, "Niet afgemeld", "Niet afgemeld") GUICtrlCreateButton("Incidenten", 5, 25, 80, 25) GUICtrlCreateGroup("Klanten",2, 60, 86, 102) GUICtrlCreateButton("Toevoegen", 5, 80, 80, 25) GUICtrlSetOnEvent(-1, ChangePage("Klant toevoegen")) GUICtrlCreateButton("Wijzigen", 5, 105, 80, 25) GUICtrlCreateButton("Verwijderen", 5, 130, 80, 25) GUISetState(@SW_HIDE, $gui_main) StartUp() while 1 Sleep(10) WEnd Func startup() if FileExists("Database\settings.ini") Then ShowGUI() Else DirCreate("Database") $NewPass = InputBox("Wachtwoord", "Voer a.u.b een nieuw wachtwoord in voor de admin gebruiker", "", "*", 250, 140) If $NewPass = Not "" Then IniWrite($INI_General, "General", "Password", _StringEncrypt(1, $NewPass, "ndgJet591Xvk0lPq2nStndP83ld", 6)) Else startup() EndIf EndIf EndFunc Func ShowGUI() GUISetState(@SW_SHOW, $gui_main) EndFunc Func GUIExit() Exit EndFunc Func ChangePage($Pagename) If $CurrentPage = "Incident_overview" Then GUICtrlSetState($incident_listview, $GUI_HIDE) GUICtrlSetState($incident_view_type, $GUI_HIDE) GUICtrlSetState($incident_view_type_label, $GUI_HIDE) EndIf If $Pagename = "Incident_overview" Then GUICtrlSetState($incident_listview, $GUI_SHOW) GUICtrlSetState($incident_view_type, $GUI_SHOW) GUICtrlSetState($incident_view_type_label, $GUI_SHOW) ElseIf $Pagename = "Klant toevoegen" Then MsgBox(0, "", "This is a test") EndIf EndFunc @SnowMaker Even when I assign a variable to the control, it still does the same -
Hi all, I have a script which uses the OnEventMode. In this script I have the following line: GUICtrlSetOnEvent(-1, ChangePage("Do this")) Directly above that line, I have a button, which should execute the function when I click on it. I don't know why, but this line executes before I'm doing anything, when I comment the line the problem is gone. The function that is called handles the ' Do this' part. Does anyone know why this happens?
-
Hi all, I have some trouble with submitting a form. The form is filled in correctly (it checks a radiobutton), but it doesnt submit. I tried it with _IEFormSubmit($oForm) and _IEAction($oForm, "click") (found on the forum) but both just check the radiobutton but won't submit. Any ideas why? SOLVED! The solution was to do it like this: $buy = _IEFormElementGetObjByName($oForm, "koop") _IEAction($buy, "click")
-
By the way, do you really have to ask this twice? First topic THe aswer to your question is also already in that topic.
-
[offtopic]@PsaltyDS, If it is his homework, do you think that he will answer 'yes' to your question? [/offtopic]
-
I have a program which reads things from a textfile. The textfile can be like this: Protection: 0 uur but it can also be like this: Protection: 2 uur (tot 16-06 / 14:00u) My current script gives errors when you dont have protection anymore, so when its like this: Protection: 0 hours My Script (a part of): $beschermingstr = StringSplit(FileReadLine("tekst.txt", $l_bescherming), ": ", 1) $beschermingstr2 = StringSplit($beschermingstr[3], " (", 1) If $beschermingstr2 = Not @error Then If StringInStr($beschermingstr2[2], "tot") Then GUICtrlSetData($lbl_bescherming, "Bescherming: " & $beschermingstr2[1] & @CRLF & "(" & $beschermingstr2[2]) Else GUICtrlSetData($lbl_bescherming, "Bescherming: 0 uur") EndIf. . $l_bescherming just stands for the line the text is on and $beschermingstr[3] stands for everything after 'bescherming:' How to solve this? While you have protection everything works fine without any errors, but once you dont have protection anymore (Bescherming: 0 uur) it returns errors (because $beschermingstr2[1] and $beschermingstr2[2] dont exist anymore) . I thought that it should then read the else statement and do the things that are in there.
-
It only needs access to one external domain. Now that were talking about _IE, there's one other problem I ran into. When you login to a website using the Embedded IE window, and the page makes use of sessions, when you click a link then, which opens in a new window, the session is not there. Is there any way to solve that too (apart from using _IECreate()? (because as far as I know, _IEcreate just works with sessions, even with a popup opening...)
-
Is it possible to only disable it temporarily, I mean I could use regwrite to recreate the setting, but the disadvantage is that it diables the sound for windows explorer too... I have looked at propertyset, from the _IE Functions, but it didnt have that kind of feature.
-
Hi all, I currently have a program that runs a couple of automated webbased tasks. But every time the program clicks a link or refreshes the page, you hear the annoying clicksound. Is there any way to mute that sound? It is not an option to turn off my speakers. Thanks! P.S. I'm using _IECreateEmbedded(), not the normal _IECreate().
-
Yes, it certainly does work now. Thanks M23 and PSaltyDS for your help. Works like a charm, tested the code for a few days now to see if it really works, but it just does. Thanks again!
-
I need it because the RPG i'm making this client for (NOT a bot!) updates its site often, so the linenumbers where the text is on changes. So instead of using filereadline with a predifined linenumber i'd like to search for the string. An example: If I want to find this: Money: 20,- I currently use filereadline($MYFILENAME, $EXAMPLELINENUMBER) and after that, I use stringsplit() to make it only show the number, so its like this: '20'. But because of the reason mentioned earlier, I wanted to search for the word 'Money: " and then if its found, return the line number so I can use filereadline and stringsplit for further use. This way I dont have to change the predefined linenumbers to read. It saves me alot of work editing the code.
-
Hi all, I'm currently busy with making a client for a Online RPG. I was thinking for the following: is it possible to search the whole textdocument (created by _IEBodyReadText()) for a specific word and then return the line number? I have found this in the helpfile: $file = FileOpen("test.txt", 0) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop MsgBox(0, "Line read:", $line) Wend FileClose($file) This reads the whole file and returns the lines if theres anything on it. I thought about using the StingInStr() function to search the line for a specific string, which is the right way in my opinion. But how to get the linenumber where the string is on to preform a filereadline() after the word has been found? thanks!