
Prab
Active Members-
Posts
90 -
Joined
-
Last visited
Everything posted by Prab
-
Am I misunderstanding the return value from _AD_Open? I just downloaded 0.37 and wanted to make my script error out during _AD_Open. I use all five parameters, and the first 2 are populated from InputBox. The other 3 are static. I use my username and my correct password and it returns 1. I then use my username and an incorrect password and it still returns 1. Seems to me like it shouldn't be able to connect. Any help is appreciated. Sidenote, might be a good idea to add this (untested) to the top of _AD_Open to enforce adding all three of the last parameters If $sAD_DNSDomainParam <> "" Then If $sAD_HostServerParam = "" OR $sAD_ConfigurationParam == "" Then Return SetError(SOME ERROR INFO) EndIf
-
Hi, I just downloaded the UDF from http://www.autoitscript.com/forum/index.php?app=downloads&showfile=66 and think it has a bug. I run _ADAddUserToGroup($group, $user) which returns -1 when it succeeds, but the documentation says it should return 1. I think the problem stems from Func _ADIsMemberOf($group, $user) $ObjGroup = _ADObjGet("LDAP://" & $strHostServer & "/" & $group) If Not IsObj($ObjGroup) Then Return -1 $ismember = $ObjGroup.IsMember("LDAP://" & $strHostServer & "/" & $user) $ObjGroup = 0 Return -$ismember EndFunc ;==>_ADIsMemberOfWhy does this return -$ismember instead of $ismember? Edit: Never mind, figured it out by using UDF found at http://www.autoitscript.com/forum/index.php?showtopic=106163.
-
@happy2help - Don't know about the first error. As you can see, my code is only about 5 lines long so it must be something else that is crashing. For your second problem try getting rid of FileDelete(@TempDir & "\test.mp3")then find the file in your temp dir and play it in Itunes/Windows Media Player/VLC. If the mp3 doesn't have all the letters, its a problem with google translate, if it does, its a problem with soundplay().
-
Found via techcrunch. Just a quick hack using an unofficial api. I could make it more pretty. It just doesn't play anything if you give it a string over 100 characters. textToSpeach("google is the best") Func textToSpeach($input) $temp = StringReplace($input, " ", "+") InetGet("http://translate.google.com/translate_tts?q=" & $temp, @TempDir & "\test.mp3") SoundPlay(@TempDir & "\test.mp3", 1) FileDelete(@TempDir & "\test.mp3") EndFunc Edit: Tested with over 100 characters
-
This script was made for a friend who has autism. Their doctor wanted them to by a program for almost $2000 that does pretty much the same thing as this. It reads a settings.ini file in the following format [files\Animals.jpg] files\Cat.jpg = files\Cat.wav files\JumpingHorse.jpg = files\Jump.wav [files\Traffic.jpg] files\Stopsign.jpg = files\Stop.wav files\GreenLight.jpg = files\Go.wav I figure it might be a good simple example for people that are trying to make a dynamic GUI. Any feedback is appreciated. SpeechTool.au3
-
I caught the window by moving my mouse very quickly. There is a race condition in the script. If you move your mouse fast enough you can exploit this and move the window a few pixels closer to your mouse per loop. By repeatedly swiping your mouse quickly one direction, then slowly the other, you can move the windows closer to your mouse. I don't feel that writing a script to do this is cheating (we are on a scripting forum), but I feel that I solved the real puzzle. Edit: Found diagonals are even more effective. I was able to beat it in about 20 seconds using this technique.
-
[SOLVED] When does a file "exist" ...
Prab replied to water's topic in AutoIt General Help and Support
Not 100% sure, but try FileOpen("Name", 1). I believe it will fail if the file is still being written to. -
Try adding the macro @CRLF to the end of the string.
-
Need a few simple telnet commands executed
Prab replied to emule's topic in AutoIt General Help and Support
Look at _RunDos() in the helpfile. Edit: and GUICtrlRead(). -
@JSThePatriot - You can't account for everything. I consider it a crash if somebody uses taskmanager to end the process. There is no way to add that error checking to your script. Make a helper script like this $return = RunWait("yourprog.exe")) If $return = 0 Then MsgBox(0,"","Script exited normally") Else MsgBox(0,"","Script crashed") EndIf Most programs/scripts will return 0 as success, just make sure that yours does the same. Edit: Just reread . My solution doesn't, but by using Fileinstall() you could only have one exe.
-
I have used IE.au3 with both IE6 and IE7 under Windows XP with success. I have never tried it with IE8 or under Vista.
-
I think if you change $file = GUICtrlRead($Group1) to $file = GUICtrlRead($Input1) it will work.
-
I noticed, but didn't want to bite the hand that feeds. Again thanks for the help. I'll post the whole script in the example forum when its done. Nothing spectacular, but, hey, its just an example.
-
Many thanks. Your solution is simple and elegant. It will only have to add one line to my Resume() code to make it work. I still sort of wonder what went wrong with mine. Oh well. I already took care of when seconds are <= 9. I just took that part of the code out to shorten the post.
-
Hi, I'm writing a countdown timer, but am having trouble getting it to pause. I have trimmed down my script as much as possible, but it is still pretty large. The main line in question is $startTime = $newStartTime - $savedTime. I can get the script to come closer to working by changing it to $startTime = $newStartTime - $savedTime * 10000000, but that doesn't feel right (and doesn't work). Thanks for your help. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <file.au3> Dim $startTime = -1 Dim $maxTime = 300 Dim $oldDisplay = "" Dim $started = False Dim $savedTime = -1 Opt("GUIOnEventMode", 1) #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 804, 454, 192, 114) $Label1 = GUICtrlCreateLabel("5:00", 8, 8, 783, 300) GUICtrlSetFont($Label1, 240) $Button1 = GUICtrlCreateButton("Start/Stop", 8, 352, 97, 89, $WS_GROUP) GUICtrlSetOnEvent($Button1, "Start") GUISetOnEvent($GUI_EVENT_CLOSE, "Close") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 If $started Then If $startTime <> 0 Then $miliSecondsPassed = TimerDiff($startTime) $secondsPassed = $miliSecondsPassed / 1000 $timeRemaining = $maxTime - $secondsPassed $minRemaining = Floor($timeRemaining / 60) $secRemaining = Floor(Mod($timeRemaining, 60)) $display = $minRemaining & ":" & $secRemaining GUICtrlSetData($Label1, $display) EndIf EndIf Sleep(100) WEnd Func Start() If $started Then;button acts as stop $savedTime = TimerDiff($startTime) Else If $savedTime <> -1 Then;button acts as resume ;_FileWriteLog("timer.log",$savedTime & " " & $startTime) $newStartTime = TimerInit() $startTime = $newStartTime - $savedTime ;_FileWriteLog("timer.log", $newStartTime & " " & $startTime) Else;button acts as start $startTime = TimerInit() EndIf EndIf $started = Not $started EndFunc Func Close() Exit EndFunc Edit1: When I trimmed it down I introduce the flicker and some other minor display bugs. Edit2: I tried replacing all the TimerInit() and TimerDiff() with _Timer_Init() and _Timer_Diff(), but the results are the same.
-
I was able to accomplish a rough estimate using these functions TimerInit() FileExists() TimerDiff() Using these you can tell how long it takes to check if the file exists. I don't know how you would check an individual IO request, but its probably possible.
-
How to restart script by automaticly?
Prab replied to ocensound's topic in AutoIt General Help and Support
Lookup OnAutoItExit opt and the Run() function in the help file. -
1. You can encrypt the main password with another password using _StringEncrypt(). To do this you need the second password and the encrypted password to be in the script, so a determined hacker could figure both out eventually. Also note, I believe that _StringEncrypt() uses RC4, but you can find UDF at http://www.autoitscript.com/forum/index.php?showtopic=78745 that lets you use AES. 2. How would you authenticate with the DB? If you need to use a password, it would have to be in the script and then you are back to problem 1. On the other hand, this would allow you to do logging, so you would know which computers are accessing the DB. What do you mean by pump input into boxes? - I think you mean to use some password as the default text. If so, yes this is possible. Just look up inputBox() in the help file.
-
http://technet.microsoft.com/en-us/sysinte...s/bb897437.aspx TCPView from Sysinternals is very lightweight (94KB) and allows you to close the connection in 2 clicks. Between that and netstat (from command line), I think you should be able to do whatever you need.
-
Look at the send help file. The # is getting changed to {windows key}. Change Send($psswrd) to Send($psswrd, 1).
-
You have a couple of options. First you could use a UDP broadcast, but I have never written one myself. Basically there is a way to send a packet to all computers attached to a network switch. Your program would listen for this packet and reply with its IP address when it hears it. Second, your program could take a command line parameter or read an INI file to get the Hostname/IP. This would allow you to change it without recompiling your script. Third, you could scan the network for a system running your script. Just start at xxx.xxx.xxx.1 and start moving up to xxx.xxx.xxx.255 until you find the correct one. Hope this helps.
-
RegRead, RegWrite bugged in Windows 2000 Pro
Prab replied to ppat's topic in AutoIt General Help and Support
http://technet.microsoft.com/en-us/sysinte...s/bb896652.aspx might help you diagnose what is modifying the registry. I highly recommend it. -
Verify the success of an installation.
Prab replied to slickvim's topic in AutoIt General Help and Support
If you launch the main installer from within your script (runWait or runAsWait), it will return the error code of the installer. Usually an error code of 0 means that the install was successful. I have in the past used this logic. Run("helper script that uses control click to do install") $var = RunWait("real program") If $var <> 0 Then Msgbox(0,"","The install Failed") Endif Edit: Missed a ")" and it was bugging me. -
Start off by reading the help file. In particular, look at run command. Using that you can directly copy and paste lines from you .bat file. To compile it to an exe, right click on the .au3 file and there should be an option to compile. To make sure that you bring along certain .dll's, look into the fileInstall command. It may do what you want.