Jump to content

Kammamuri

Members
  • Posts

    15
  • Joined

  • Last visited

Kammamuri's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. the default timeout should be 5 min (300000ms), so even if you leave it blank it should timeout after that much time. However, it happened to me too that it didn't time out at all with the default value edit: in http://www.autoitscript.com/autoit3/docs/libfunctions/_IELoadWaitTimeout.htm a zero is missing in the Remarks section
  2. ops didn't change the name of the program there!! well, that might be a problem! .. it's just the name of the child program edit: still the child program didn't crash so that line (with the wrong name) should not have been run
  3. Where can i find the "Windows event log"? searching that name in the pc gives only a bunch of txt files. unfortunately no cat (or dog) is involved .. I'll try to clean the pc and to run the program on another machine the parent program is: HotKeySet("{ESC}", "Terminate") Local $line Local $ErrorLog = FileOpen("ErrorLog.txt",2) FileClose($ErrorLog) While 1 If ProcessExists("TheBeast v0.75.exe") = 0 Then If ProcessExists("iexplore.exe") Then ProcessClose("iexplore.exe") Local $foo = Run('C:\Users\....\TheBeast v0.83.exe /ErrorStdOut', "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) EndIf While 1 $line = StdoutRead($foo) If @error Then ExitLoop Local $ErrorLog = FileOpen("ErrorLog.txt",1) FileWrite($ErrorLog, $line) FileClose($ErrorLog) WEnd Sleep(200) WEnd ;Terminate Func Terminate() Exit 0 EndFunc the child one now is over 3k lines long and i can't post it here basically what it does is: -browse to a website -refreshes some information that it has about the website -then checks the time every second (since it uses the time of the website it has to do a _iebodyreadhtml and some stringregexp every second) -if the time is right it does some actions, mainly _ieaction($oIE, "click"), some getobjects functions and formobjectsetvalue i don't think there is nothing wrong here, and even if there was something it would just crash and get launched again also, usually i use the IE window as "visible" so that i can see what the program is doing, but i can put it to "invisible" easily
  4. HI again! I'm running my autoit program (in truth 2 programs, if one stops/gets an error gets launched again by the other) on my laptop, a Sony Vaio FW. The programs work fine during the day but for some reason at night the computer goes nuts. Yesterday it was windows update which was scheduled for 3 am and for some reason it went to sleep after that, so the program stopped at 3 am and in the morning i found the pc sleeping. So i turned windows update off. This morning the pc was still working but the screen was frozen on a page of about 3 am! (the last verified activity, from a txt file which gets modified by the program, is at 2:52 am) so i guess something happened again at about 3 am. when i managed to get the screen refreshed i saw the program was still running (but had done nothing from 3am up to 7 am). Ah and the ErrorLog (a txt file that saves the errrors my main program encounters) was empty! Any idea what might be the problem?? Also, I've noticed that IExplorer (the program interacts with it) becomes very slow after it has run for maybe an hour, while GoogleCrome and Firefox don't get this lag issue. I've even thought to make the program relaunch IE periodically .. ideas to fix this? Thanks in advance!
  5. Just did and it seems to be working much better with _IEFormElementSetValue! Thanks a lot the reason why i was trying to do it the other way is that i'm not 100% sure i'll always need to interact with objects that are part of a "Form"
  6. Hi again, sorry for the time it took me to reply.. I finally managed to make it with ControlSend Example: $oForm = _IEFormGetObjByName($oIE, "login") $oInput = _IEFormElementGetObjByName($oForm, "name") _IEAction($oInput, "focus") _IEAction($oInput, "selectall") ControlSend($hIE, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", $accountname) _IEAction($oInput, "blur") Sleep($SleepTime1) $oInput = _IEFormElementGetObjByName($oForm, "password") _IEAction($oInput, "focus") _IEAction($oInput, "selectall") ControlSend($hIE, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", $accountpassword) ;Inserisce la password However I'm experiencing a problem with the following lines: $oForm = _IEFormGetObjByName($oIE, "snd") $oInput = _IEFormElementGetObjByName($oForm, "x") _IEAction($oInput, "focus") ControlSend($hIE, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", $X) $oForm = _IEFormGetObjByName($oIE, "snd") $oInput = _IEFormElementGetObjByName($oForm, "y") _IEAction($oInput, "focus") ControlSend($hIE, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", $Y) they cause the window i'm currently working on to lose focus, which is pretty annoying .. but i have no idea why, they seem the same to the ones above which work just fine. ps note that $hIE is running as "Invisible" please help!
  7. Hello! I'm currently using this code: $oInputs = _IETagNameGetCollection ($oIE, "input") For $oInput In $oInputs If ($oInput.type = "text" And $oInput.name = "name") Then _IEAction ($oInput, "focus") Next Send($accountname) However I'd like to be able to do other things on my pc while my program is running, so the IE window would be open but not on top of all other open windows (ideally i'd like to run also full screen games while the program is running in the background). So my question is how do i modify the above to work in that case? I've searched a bit and seen something with "ControlSend" but it doens't seem to work with ieobjects thanks in advance, Kamma
  8. I had something (I program with SciTE) but it must have been an old version. Anyway, I re-downloaded everything and now it works just fine! thanks a lot! I'll have to get used to the new light blue color of the back ground
  9. Thanks! I think i understand your explanation in the other topic, but how do I "run Obfuscator using the /STRIPONLY parameter, when compiling my script"? .. when i compile a script I usually go to the .au3 file I want to compile, right click on it and then click on "Compile Script (x64)".. I've looked at http://www.autoitscript.com/autoit3/scite/docs/Obfuscator.html but it says something about AutoIt3Wrapper (which I haven't heard before). I've added the lines #AutoIt3Wrapper_Run_Obfuscator=y #Obfuscator_Parameters=/so before the #include(s) in my program but when i compile it (using the above procedure) nothing happens. ps. sorry if I'm slow to understand but I autoit is the only programming language I "know" (except a little bit of Pascal and C) and English isn't may native language either
  10. I'm not sure why I was using it.. it seemed to be the only working syntax : thanks for the help this works: (i also had to remove @SystemDir) Local $foo = Run('C:\...\name.exe /ErrorStdOut', "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) now i correcly get the error on the txt file, for example: C:Users...ProgramName.exe (5103) : ==> Subscript used with non-Array variable.: problem is my program has about 2000 lines (so 5103 makes no sense), is it possible to get the right line at which the error occurs?
  11. Hi, thanks for the suggestion. I've tried the following code. #include <Constants.au3> Global $n HotKeySet("{ESC}", "Terminate") $n = 0 While 1 If ProcessExists("TheBeast v0.75.exe") = 0 Then If ProcessExists("iexplore.exe") Then ProcessClose("iexplore.exe") Local $foo = Run(@AutoItExe & ' /ErrorStdOut "direcotory\programname.exe"', @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) EndIf Local $line While 1 $line = StderrRead($foo) If @error Then ExitLoop Local $ErrorLog = FileOpen("ErrorLog.txt",2) FileWrite($ErrorLog, $line) FileClose($ErrorLog) WEnd Sleep(1000) WEnd ;Terminate Func Terminate() Exit 0 EndFunc but i'm experiencing the following issue. The first thing the child program should do is open a txt file, read some information and use it to browse to a web site (for instance it reads ".com" and goes to "google.com" or "it" and goes to "google.it") using the command FileOpen("name of file.txt") since this file is in the same folder. However, for some reason when the child program gets launched by the parent program it doesn't read the file! (it works correctly when i manually start it). any idea what may cause the problem/how to fix it? .. it works just fine with the code i've posted in the previous post too
  12. Hi! so..I understand that making a program without errors is better then just ignoring the errors and this is why i rarely use this method. However sometimes i need to test a program for longer periods of time without being able to check it so i've made this little shell-program: #include <Constants.au3> Global $n HotKeySet("{ESC}", "Terminate") $n = 0 While 1 If ProcessExists("iexplore.exe") Then ProcessClose("iexplore.exe") ;the program will open ie and i dont want to have too many opened at the same time RunWait(@AutoItExe & ' /ErrorStdOut "C:\Program Directory\Program Name.exe"') $n = $n + 1 WEnd ;Terminate Func Terminate() Local $ErrorLog = FileOpen("ErrorLog.txt",2) FileWrite($ErrorLog, "The program crashed " & $n & " times") FileClose($ErrorLog) Exit 0 EndFunc it gives me the number of times the program has crashed and was forced to restart on a txt file. I've tried to get on this txt file also the Error message by reading the stdout stream but i don't seem to be able to find a way to make it work. I've tried to use "run" instead of "runwait" in combination with "if processexists..." but it hasn't worked at all. If anyone could show me how to get the error message on a txt file it would be great! thanks in advance
  13. ops sorry .. well the question is theoretical, i can change the variables/function names but the problem persists .. otherwise close the topic asd I'm sorry, no offence was intended
  14. It's Travian 4.2 ... I'm doing it for fun, I hope that breaking games' rules is not against the forum rules :
  15. Hi everybody! I'm experiencing the following problem in the bot i'm programming and I don't seem to be able to find the reason why it doesn't work: I have a Global array TroopsInTown[101][10] which gets assigned a value in a function (TroopsInfo() ). If I call this function from the "main program" (i.e. not another function) the Global value of an element in TroopsInTown[101][10] gets saved correctly and i can access it again later. (as in the code below; the two msgboxes give the same output) However, if I call TroopsInfo() from inside another function (for istance I make the For loop in the code below a function, since i'm going to use the same sequence of functions a couple of times) then the value gets correctly assigned to TroopsInTown and it shows correctly in the message box inside "TroopsInfo", but the msgbox just after TroopsInfo is empty!! the only operation that it has done is exit the function and the value disappears as if it was a "Local variable" O.o here is the code: ;non relevant Global $TroopsInTown[101][10], $ReturningTroops[101][151][11], $OutGoingTroops[101][151][11], $Hero ;non relevant For $ControlloNumeroVilli = 1 To $NumeroVilli SelectVillageNumber($ControlloNumeroVilli) FieldView() GetResourceFieldInfo() ;Call only in field view VillageView() GetBuildingsInfo() ;Call only in town view BuildingUnderConstructionInfo() ;Both field and town view are fine BarracksTraningCheck() ;Call only inside town view TroopsInfo() ;Call everywhere MsgBox(0,"", $TroopsInTown[$ControlloNumeroVilli][3]) Next ;non relevant Func TroopsInfo() ;the value of $TroopsInTown[$ControlloNumeroVilli][3] changes MsgBox(0,"", $TroopsInTown[$ControlloNumeroVilli][3]) Endfunc thanks for the help
×
×
  • Create New...