-
Posts
40 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Cybergon's Achievements

Seeker (1/7)
0
Reputation
-
Thanks for the answers, fellas. Sorry I kind of forgot about this thread, I'm just using RBTray so it's all good. Cheers!
-
Hi, I have a script that runs in a console user interface and I'd like for it to minimize to system tray or even better close to system tray. Most of the search results I find are related to GUI which doesn't quite work for me. Is it even possible? Or should I completely rewrite my code to work on GUI?
-
Wow that's pretty neat! Modified _LevelMeter() to return $iCurrentRead instead of showing it and it's working like a charm! Gracias :-)
-
Cybergon reacted to a post in a topic: Measure Speaker Volume
-
That code is just colored bars going up, down & randomly. I'm looking for a way to measure the volume output level of my pc.
-
Hi forum it's been a while since I posted, been pretty busy. I've been tinkering with a little script to make my pc behave how I want it to. So far so good but there is one variable I'd like to tap into, and that is how loud my speakers are playing. I've been searching sparingly for weeks trying to find a way to do this to no avail. Only now did I think about asking you guys, I hope its not a problem. You can actually see what I'm talking about if you go to your playback devices, I attached a picture of it. So how is this value measured (without using pixelgetcolor or any screen tricks) to use in a script?
-
Cybergon reacted to a post in a topic: why can't i use Exitloop in a function?
-
Yeah Melba don't worry I'm aware of that, the fact that it didn't happen on my old laptop confirms it. Martin's fix actually does work on this one, but as I said, it's only with his particular script. I think we should take that as a clue. As for a script to reproduce the problem, a plain GUI with an edit/input control inside seems like enough. It's just one of those things that some computers get and others don't, so I'll carry my script around and test it on several machines to see what I can see alright? I'll keep a spec log for each one so we can compare them later.
-
This glitch is still present to this day. Confirmed with a clean 3.3.8.1 install. Meltice's original comment still applies and martin's "fix" seems to only work with his particular example (no matter what I try I can't get it to work with a plain edit control on a plain form). It's not like the glitch is gonna ruin anyone's script, but hey it's kinda ugly.
-
I'm telling you to forget about the source code, trust me, there's no way to get what I want without opening an IE window and I already gave you the reasons why that is unpractical. Unless there's a way to hide it and do everything behind curtains with _IEAction or something?
-
I've looked at all of the _IE functions thoroughly but none seem to be of any use in my particular situation, is there any you'd recommend me? The particular one I'm interested in is only accessible from certain authorized places (as far as I understand) so there's no point, sorry.
-
Thanks TR, I'll be taking the web scraper approach then, I didn't know about that, wish me luck! If it was a simple page there'd be no problem, but in this one there's a lot of javascript magic going on and the info is all scattered in div tags that hide some stuff and show some other. It's pretty random and uses a lot of variables in the tags to make things worse. I wish I could explain it better, but it is frankly beyond me, sorry.
-
Hello everyone, the title is pretty much what I want to do but I'll elaborate below for details. I'm currently using a script to ease out my workload, it uses StringRegExp to extract certain bits of info out of a text file that I make and then makes a neat record with whatever it got that I can easily check out later. The only manual labor that I'm forced to do is open a web page in my browser, press ctrl+a ctrl+c, paste it in notepad, replace every double tab character with a semicolon and save the text file. Unfortunately sometimes things get too hectic and I don't get the chance to sit down and sort that out, and while I'm busy somewhere else those precious bits of info just go to waste. That's why I've decided to make the script completely autonomous, but after about two hours of searching through the forums, I've yet to find a definite solution for two reasons: -I can't rely on _InetGetSource because it would be more than a nightmare to figure out a reliable regular expression to get my info out of the page's source code; it would be impossible, considering how complex and dynamic it is, whereas the displayed text on the browser is perfectly manageable. -The pc is always being used, even when I'm not around and especially on hectic times, so automatically opening up the browser and making the mouse and keyboard fetch the displayed text into the clipboard would be a very unreliable approach (I tried it once, with BlockInput and everything, never again). If you could please help me or point me to the right thread where they can help me with my problem, I'd be forever in your debt. Thanks in advance!
-
@guinness I bet if someone rated those it would be a solid 5 star considering you're good unlike me. @blitzkrg I know, I started with something really simple but then I went 'oh what if I wanna do this or that, or do it this way, or if this happens, or put a progress bar because it looks like it froze etc' and so I ended up with the abomination you see here.
- 4 replies
-
- filename
- randomizer
-
(and 3 more)
Tagged with:
-
one star? I'm... I'm so sorry, I'm never gonna post such garbage again...
- 4 replies
-
- filename
- randomizer
-
(and 3 more)
Tagged with:
-
Hey guys! I tried looking for something like this in the web but could only find broken/impractical scripts or bogus download pages, so I made it and decided to share for future generations. The way it works is it takes all the files in the folder you run the script on, and given a choice it either turns the filename into "randomxx - filename.ext", "randomxx.ext" or you could use it to remove the "randomxx - " tag to undo what you did. Well at least I hope that's the way it works, so be careful and use at your own discretion! #include <File.au3> #include <Array.au3> $farray=_FileListToArray(@ScriptDir) Global $temp[UBound($farray)],$error=1,$count=0,$random[UBound($farray)+1],$ok=0 Do $flag=InputBox("Filename Randomizer","Hello, this script works in the folder you run it on, so be careful!"&@CRLF&@CRLF&"1 to randomize keeping name"&@CRLF&"2 to randomize ditching name"&@CRLF&"3 to remove randomized tag") If @error=1 Then Exit Switch $flag Case $flag = 1 $ok =1 Case $flag = 2 $ok =1 Case $flag = 3 $ok =1 Case Else $exit=MsgBox(5,"error","You must input a valid option") If $exit = 2 Then Exit EndSwitch Until $ok =1 If $flag=1 Or $flag=2 Then ProgressOn("Filename Randomizer","Organizing files...","0%") For $i=1 To UBound($farray)-1 ProgressSet(($i*100)/(UBound($farray)-1),Int(($i*100)/(UBound($farray)-1))&"%") If $farray[$i]=@ScriptName Then Sleep(1) Else $temp[$i]=$farray[$i] Local $crumps[UBound($farray)+1] If $farray[$i]=$i Then $error=1 Else $error=FileMove(@ScriptDir&""&$farray[$i],@ScriptDir&""&$i) EndIf $j=1 $k=$i If $error=0 Then Do $error=0 While $error=0 $crumps[$j]=$k For $index=1 to UBound($farray)-1 If $farray[$index] = $k Then ExitLoop Else If $k = UBound($farray)-1 Then MsgBox(0,"FATAL ERROR","One of the files is in use or something weird happened, sorry but I'm too lazy to work around this one, be more careful next time!") Exit EndIf EndIf Next $k=$index $error=FileMove(@ScriptDir&""&$farray[$k],@ScriptDir&""&$k) If $error=0 Then $j+=1 Else $farray[$k]=$k $j-=1 $k=$crumps[$j] If $j=0 Then FileMove(@ScriptDir&""&$farray[$i],@ScriptDir&""&$i) $farray[$i]=$i ExitLoop EndIf EndIf WEnd Until $j=0 Else $farray[$i]=$i EndIf EndIf Next EndIf $random=_RandomUnique($farray[0],0,$farray[0]-1,1) If $flag=3 Then ProgressOn("Filename Randomizer","Checking and renaming...","0%") For $i=1 To UBound($farray)-1 If $farray[$i]=@ScriptName Then Sleep(1) Else If $flag = 1 Then ProgressSet(($i*100)/(UBound($farray)-1),Int(($i*100)/(UBound($farray)-1))&"%","Renaming") FileMove(@ScriptDir&""&$farray[$i],@ScriptDir&""&"random"&$random[$i]&" - "&$temp[$i]) ElseIf $flag = 2 Then ProgressSet(($i*100)/(UBound($farray)-1),Int(($i*100)/(UBound($farray)-1))&"%","Renaming") $artempex=StringSplit($temp[$i],".") If @error=1 Then FileMove(@ScriptDir&""&$farray[$i],@ScriptDir&""&"random"&$random[$i]) Else $tempext=$artempex[UBound($artempex)-1] FileMove(@ScriptDir&""&$farray[$i],@ScriptDir&""&"random"&$random[$i]&"."&$tempext) EndIf ElseIf $flag = 3 Then ProgressSet(($i*100)/(UBound($farray)-1),Int(($i*100)/(UBound($farray)-1))&"%") $artempex=StringSplit($farray[$i]," - ",1) If Not @error=1 Then $rerror=StringInStr($artempex[1],"random",1) If Not $rerror=0 Then FileMove(@ScriptDir&""&$farray[$i],@ScriptDir&""&StringTrimLeft($farray[$i],3+StringLen($artempex[1]))) $count+=1 EndIf EndIf EndIf Next ProgressOff() If $count=0 And $flag=3 Then MsgBox (0,"","No files had that") Else MsgBox (0,"","Done! Press F5 on your folder") EndIf ; #FUNCTION# ==================================================================================================================== ; Version........: 1.1 - 2011/11/24 ; Name...........: _RandomUnique ; Description ...: Returns an array of unique random numbers ; Syntax.........: _RandomUnique($iCount, $nMin, $nMax, [$iInt = 0, [$nSeed = Default]]) ; Parameters ....: $iCount - The amount of numbers to generate Number between 1 and 10^6-1 ; $nMin - The smallest number to be generated. Number between -2^31 and 2^31-1 ; $nMax - The largest number to be generated. Number between -2^31 and 2^31-1 ; $iInt - [optional] If this is set to 1 then an integer result will be returned. Default is a floating point number. ; $nSeed - [optional] Seed value for random number generation. Number between -2^31 and 2^31-1 ; Return values .: Success - Returns a 1-dimensional array containing only unique numbers ; $Array[0] = count of generated numbers ; $Array[1] = first number ; $Array[2] = second number, etc ; Failure - Returns 0 and sets @error: ; | 1 - $iCount is too small ; | 2 - $iCount is too large ; | 3 - $nMin and $nMax are equal ; | 4 - $nMin is larger than $nMax ; | 5 - $nMin or $nMax exceeds limit ; | 6 - $nSeed exceeds limit ; Author ........: money ; Modified.......: ; Remarks .......: If $iInt is 1 and $iCount exceeds total unique numbers than @extend is set to 1 and item count is adjusted to the ; + maximum numbers that can be returned ; Related .......: ; Link ..........: ; Example .......: Yes ; =============================================================================================================================== Func _RandomUnique($iCount, $nMin, $nMax, $iInt = 0, $nSeed = Default) ; error checking Select ; $iCount is too small Case ($iCount < 1) Return SetError(1, 0, 0) ; $iCount is too large Case ($iCount > 10^6-1) Return SetError(2, 0, 0) ; $nMin and $nMax cannot be equal Case ($nMin = $nMax) Return SetError(3, 0, 0) ; $nMin cannot be larger than $nMax Case ($nMin > $nMax) Return SetError(4, 0, 0) ; $nMin or $nMax exceeds limit Case ( ($nMin < -2^31) Or ($nMax > 2^31-1) ) Return SetError(5, 0, 0) EndSelect ; user specific seed If IsNumber($nSeed) Then ; $nSeed exceeds limit If (($nSeed < -2^31) Or ($nSeed > 2^31-1) ) Then Return SetError(6, 0, 0) SRandom($nSeed) EndIf ; $iCount is equal too or exceeds maximum possible unique values Local $iCountInval = 0 If ($iInt) Then ; positive If ($nMin >= 0) Then If ($iCount > ($nMax-$nMin)+1) Then $iCountInval = 1 ElseIf ($iCount = ($nMax-$nMin)+1) Then $iCountInval = 3 EndIf ; negative to positive Else If ($iCount > ($nMax + Abs($nMin)+1)) Then $iCountInval = 2 ElseIf ($iCount = ($nMax + Abs($nMin)+1)) Then $iCountInval = 3 EndIf EndIf EndIf ; courtesy If ($iInt And $iCount = 1) Then Local $aArray[2] = [1, Random($nMin, $nMax, $iInt)] ; $iCount is too large so we will generate as much we can from $nMin to $nMax values ElseIf $iCountInval Then If $iCountInval = 1 Then $iCount = Int($nMax - $nMin)+1 ElseIf $iCountInval = 2 Then $iCount = Int($nMax + Abs($nMin))+1 EndIf ; $iCount is equal to total unique numbers If $iCountInval = 3 Then $iCountInval = 0 Local $aTmp, $iA, $iNumber = $nMin, $aArray[$iCount + 1] = [$iCount] ; add our numbers sequentially (from $iMin to $iMax) For $i = 1 To $aArray[0] $aArray[$i] = $iNumber $iNumber += 1 Next ; swap every x index value with a random index value For $i = 1 To $aArray[0] $iA = Random($i, $aArray[0], 1) If $i = $iA Then ContinueLoop If $iA = 0 Then $iA = $aArray[0] $aTmp = $aArray[$i] $aArray[$i] = $aArray[$iA] $aArray[$iA] = $aTmp Next Else ; everything else is ok, generate unique numbers Local $nRnd, $iStep = 0, $aArray[$iCount + 1] = [$iCount] While ($iStep <= $iCount-1) $nRnd = Random($nMin, $nMax, $iInt) ; check if the number already exist If IsDeclared($nRnd) <> -1 Then $iStep += 1 $aArray[$iStep] = $nRnd ; store our numbers in a local variable Assign($nRnd, '', 1) EndIf WEnd EndIf Return SetError(0, Number($iCountInval > 0), $aArray) EndFunc Thanks to money for such an efficient snippet!
- 4 replies
-
- filename
- randomizer
-
(and 3 more)
Tagged with:
-
Yeah you're right, my bad Here's what I changed: --------------------------------------------------------------- Hey people, is there a way to turn something like this WinWaitActive($firefoxhandle[$j-1]) Send("^{t}") Sleep(500) into this WinWaitActive($firefoxhandle[$j-1]) Send("^{t}") Sleep(500) so that a script isn't so vertical? of course without incurring in a syntax error.