Leaderboard
Popular Content
Showing content with the highest reputation on 10/26/2012 in all areas
-
timerinit - can i have the $dif numbers i seconds?
Scripty reacted to caleb41610 for a topic
divide by 1000 $seconds = timerdiff($timer) / 10001 point -
jdelaney, I quite agree with you, which is why I asked the OP what he actually expects as a return. M231 point
-
Scripty, The "speed" parameter in MouseClick determines the speed with which the mouse moves from its current position to the new position and then clicks. The mouse does not move with ControlClick and so there is no speed to change. If you are looking to change the time between mouse clicks, then you need to look at the Opt("MouseClickDelay", #) function. And what do you mean by a MouseMove "sent to a window"? The mouse moves on the display - if the window is on the display then the mouse can be moved over it. M231 point
-
Scripty, Once Notepad is active, you need to reactivate Skype - so add "WinActivate($hwnd)" at the end of that snippet. M231 point
-
time/date into notepad
somdcomputerguy reacted to caleb41610 for a topic
I hope I didn't come off as mean. But trying it, more often than not, leads to an answer. Also if you flat out state your goal, generally people will provide you with a pretty thorough answer for how to achieve it, or let you know where to start looking. The help on this forum is amazing! Just have to give things a shot first or you may start getting annoyed responses from some people. Good luck!1 point -
Edit: I didn't understand the question correctly on the first read, and removed my post, but maybe it is something you or anyone finding this post can use so here it is... Generating random strings: #region - EOU $iLength = 12 $iLoops = 1000 $t = TimerInit() For $i = 1 To $iLoops Step 1 $s = _StringRand($iLength) ConsoleWrite("S " & $i & " : " & $s & @LF) Next ConsoleWrite($iLoops & " random strings of " & $iLength & " characters : " & (TimerDiff($t) / 1000) & " seconds" & @LF) #endregion - EOU ; #FUNCTION# ==================================================================================================================== ; Name ..........: _StringRand ; Description ...: Generate a random string of a given length. ; Syntax ........: _StringRand($iLen[, $sChars = Default]) ; Parameters ....: $iLen - The length of the random string to generate. ; $sChars - [optional] A string of characters to pick from then generating a random string. ; Return values .: The generated random string. ; Author ........: Robjong ; Modified ......: ; Remarks .......: ; =============================================================================================================================== Func _StringRand($iLen, $sChars = Default) If Not $sChars Or $sChars == Default Then $sChars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" If Not IsString($sChars) Or StringLen($sChars) <= 1 Then Return SetError(1, 0, 0) EndIf Local $sRand = "", $iMax = StringLen($sChars) For $i = 1 To $iLen $sRand &= StringMid($sChars, Random(1, $iMax, 1), 1) Next Return SetError(0, 0, $sRand) EndFunc ;==>_StringRand and these are the times I got: ; 1000 random strings of 6 characters : 0.0827935853563691 seconds (1 = 0.0000827935853563691) ; 1000 random strings of 12 characters : 0.0850768985056386 seconds (1 = 0.0000850768985056386) ; 1000 random strings of 32 characters : 0.178991956002444 seconds (1 = 0.000178991956002444) For the a=a-z etc. look at the 2nd parameter of _StringRand.1 point
-
time/date into notepad
Scripty reacted to caleb41610 for a topic
Both of your topics could have been answered by yourself. Try it yourself! We would rather hear: "I tried doing this but it didn't work. Can someone show me where my errors are?"1 point -
Maybe is enough to send to notepad edit control just F5. By pressing this key the time and date will be insert in control.1 point
-
I want the script to count for me :)
Scripty reacted to caleb41610 for a topic
$count += 1 has to be inside the loop declaring $count = 0 could be anywhere you want, as long as it's declared before the loop starts. At the beginning of the function works.. I always add declares to the top of my script after #include stuff. If you have no use for $count outside the function, it's better to declare it inside the function as a Local variable. Otherwise declare it at the top of the script as Global1 point -
I want the script to count for me :)
Scripty reacted to caleb41610 for a topic
There's a Skype UDF that might help you, but honestly I still have no idea what you are trying to do with the counting part. You can count with += Using TimerInit() and TimerDiff() may help you more. or you could check the actual time with @Hour, @Min, @Sec1 point -
I would do it the other way round. First write your script and then see how you could do the counting. The function you have shown only fills Notepad with numbers very fast. Use something like this: Func test () $count = 0 while 1 $count += 1 ControlSend("[CLASS:Notepad]", "", "Edit1", "Finished round " & $Count & @CRLF) Sleep(1000) WEnd endfunc1 point
-
I want the script to count for me :)
Scripty reacted to caleb41610 for a topic
$count += 1 $count = $count + 1 either way will add 1 to whatever $count was Func test () $count = 0 while 1 $count += 1 ControlSend("[CLASS:Notepad]", "", "Edit1", "Finished round $Count") ControlSend("[CLASS:Notepad]", "", "Edit1", "{ENTER}") WEnd endfunc will indefinitely send 1, 2, 3... etc but depending on whatever it is you are trying to do.. I'm 99% sure there's a better way. Describe your goal if you can.1 point -
Can you please describe what this is for? Where do you define/set $Count? Can you post the whole script?1 point
-
Global $rack = 0 Global $key = 0 While 1 GetRack() GiveKey() WEnd Func GetRack() Do $rack = InputBox("Dain's Key Lookup Utility", "Please enter the rack that you need to get into. This utility will then tell you which key opens that rack.", "Type a rack in the format 'CO1 AB123'", " M9") If @error Then MsgBox(4096, "Peace out, homie", "Thanks for using Dain's Key Lookup Utility.") Exit Else $validate = (StringLen($rack) = 9) If Not $validate Then MsgBox(4096, "YOU BROKE IT!", "Oops - looks like you left the box empty. Please try again, or press Cancel to quit.") EndIf Until $validate EndFunc Func GiveKey() Switch $rack Case "CO1 AM123", "CO1 AM124" $key = "209 or 210" MsgBox(4096, "Dain's Key Lookup Utility", "To open the rack " & $rack & ", you need key number " & $key & "!") Case "CO1 AR111" $key = "171" MsgBox(4096, "Dain's Key Lookup Utility", "To open the rack " & $rack & ", you need key number " & $key & "!") Case "CO1 DN102", "CO1 DN103" $key = "133 or 134" MsgBox(4096, "Dain's Key Lookup Utility", "To open the rack " & $rack & ", you need key number " & $key & "! Please note that these racks are for FTEs only.") Case Else MsgBox(4096, 'Error', 'Error') EndSwitch EndFunc1 point
-
Hi, give this a try, it does allow .0 or .1 but not .01, the port can be between 80 and 8081. 'b(?:(?:25[0-5]|2[0-4][0-9]|1?[1-9][0-9]?|0).){3}(?:25[0-5]|2[0-4][0-9]|1?[0-9][0-9]?|0):(?:[8-9]d|[1-9]dd|[1-7]d{3}|80(?:[0-7]d|8[01]))b'1 point