Jump to content

Cue

Active Members
  • Posts

    84
  • Joined

  • Last visited

Everything posted by Cue

  1. Um... No i dont think so, I think its a hardware code for the key rather than a code for the character the key is mapped to.
  2. In the help file u will find 'Ubound' which I guess is short for upper bound so you could just put array[ubound-1] (i think)
  3. in ezzetabi's words from the following post
  4. This may be a stupid question but is it possible to create a function like _Ispressed but using scancodes. the reason I ask is because there are 4 programmable keys on a laptop and I want to make them do more than just what the default program allows. Only problem is all keys are returning a 'FF' virtual keycode so I can't distinguish which one has been pressed.
  5. Dim $MouseStep=0 $Keys2Set=StringSplit('{UP},{RIGHT},{DOWN},{LEFT}',',') for $i=1 to 4 HotKeySet($Keys2Set[$i],"Control_Mouse") Next while 1 WEnd Func Control_Mouse() $MouseStep+=1 Switch @HotKeyPressed Case $Keys2Set[1] MouseMove(MouseGetPos(0),MouseGetPos(1)-$MouseStep,0);up Case $Keys2Set[2] MouseMove(MouseGetPos(0)+$MouseStep,MouseGetPos(1),0);right Case $Keys2Set[3] MouseMove(MouseGetPos(0),MouseGetPos(1)+$MouseStep,0);down Case $Keys2Set[4] MouseMove(MouseGetPos(0)-$MouseStep,MouseGetPos(1),0);left EndSwitch Sleep(100) $MouseStep=0 Return 0 EndFunc right I simple got rid of the do...until. to be honest i dont even know why i added it in the first place. i think the time i write it was an importatnt factor again
  6. I am not very knowledgable about this subject what is a packet exactly. Are you trying to send a Magic Packet?
  7. _GetIP gets local ip i think, but i guess you know that right.
  8. in the help file look up "GUI Concepts" this should give you your answer
  9. look up GUISetOnEvent() this may solve you first problem.
  10. I wonder if you can attach a web cam to it and use pixelsearch to make it autoaim.
  11. Do you mean like this... I have not tested this code make sure they go in the right list. Func ProdList() $list = FileOpen("Pclist.txt", 0) $FileCount = _FileCountLines("PcList.txt") local $PingSuccess[1],$PingFail[1] for $i = 1 to $FileCount $area = FileReadLine($list) if @error= -1 Then ExitLoop ping($area,50) if @error <> 0 Then _ArrayAdd($PingSuccess,$area) Else _ArrayAdd($PingFail,$area) EndIf GUICtrlSetData ($progressbar1,($i/$FileCount)*100) Next For $i=1 to UBound($PingSuccess)-1 _GUICtrlListAddItem($List2, $PingSuccess[$i]) Next For $i=1 to UBound($PingFail)-1 _GUICtrlListAddItem($List1, $PingFail[$i]) Next EndFunc
  12. Iam not sure i understand what you mean? do you mean finish the ping process and store the results in a variable (an array or something) then populating the list with the results. _GUICtrlListAddItem((some other file), $area) this makes no sense by 'some other file' do you mean some other variable
  13. Your right this has nothing to do with autoit, so why exactly did you post here? anyway from what state did you wake on lan from what ive read iam guessing S5 (shutdown). check your bios for any wake on lan feature and enable it. go to device manager open properties of your nic then click on advanced tab. enable any wake on feature if its disabled.
  14. Hi Valuator, that code also suffurs from recursion and it seems to make the cursor behave very odd.
  15. lol, I dont even know anymore. it was 4 am when i posted that and for some reason I thought reoccurring and recursion were similiar things. Lame i know
  16. Func ProdList() $list = FileOpen("Pclist.txt", 0) $FileCount = _FileCountLines("PcList.txt") for $i = 1 to $FileCount $area = FileReadLine($list) if @error= -1 Then ExitLoop ping($area,50) if @error <> 0 Then _GUICtrlListAddItem($List2, $area) Else _GUICtrlListAddItem($List1, $node) EndIf GUICtrlSetData ($progressbar1,($i/$FileCount)*100) Next EndFunc Why dont you store the list in an ini then you can have 2 sections pingable and unpingable pc names as keys with extented information as values using 1 = Host is offline 2 = Host is unreachable 3 = Bad destination 4 = Other errors ping time
  17. so why dont you make it a percentage. I will assume you dont know how to do this so i will show you (no offense if you do). GUICtrlSetData ($progressbar1,($i/$FileCount)*100)
  18. Thanks Paulie I was begginig to think this was going to be another post that will get buried without a reply. Is there a way to make the mouse accelerate using your code like the one i posted without getting a stack overflow problem.
  19. $iniread_username = IniRead("C:\myfile.ini", "Login info", "Username", "Not_Found") $Username_Input = GUICtrlCreateInput($iniread_username, 60, 10, 80, 20) if $iniread_username=="Not_Found" then Guictrlsetdata($Username_Input,"") You could have just used "" instead of "Not_Found" unless you really needed "Not_Found" if key wasnt there.I havent read through all of your code. edit: had code as quote and quote as code edit 2: Valik beat me to it
  20. I have a problem which keeps reoccurring (no pun intended). I Need to figure out a way to exit a previous function call and start it again. Ive searched the forums far and wide and though the question has come up alot i cannot find a definite answer. code for an accelerating mouse Dim $MouseStep=0 $Keys2Set=StringSplit('{UP},{RIGHT},{DOWN},{LEFT}',',') for $i=1 to 4 HotKeySet($Keys2Set[$i],"Control_Mouse") Next while 1 WEnd Func Control_Mouse() $MouseStep+=1 Switch @HotKeyPressed Case $Keys2Set[1] MouseMove(MouseGetPos(0),MouseGetPos(1)-$MouseStep,0);up Case $Keys2Set[2] MouseMove(MouseGetPos(0)+$MouseStep,MouseGetPos(1),0);right Case $Keys2Set[3] MouseMove(MouseGetPos(0),MouseGetPos(1)+$MouseStep,0);down Case $Keys2Set[4] MouseMove(MouseGetPos(0)-$MouseStep,MouseGetPos(1),0);left EndSwitch Do $g = $MouseStep Sleep(100) until $g == $MouseStep $MouseStep=0 Return 0 EndFunc The problem with this code and many of my previous codes is that it is recurrsive which is a big problem. My previous post which is related: http://www.autoitscript.com/forum/index.ph...mp;#entry253581 even though the recurrsion limit of Autoit is fairly high MAXEXECUTERECURSE 384 I need to figure out a way to avoid it. So if there is anyone with good programming practice please can you give me some advice for this kind of senario Other posts http://www.autoitscript.com/forum/index.ph...mp;hl=Recursion http://www.autoitscript.com/forum/index.ph...mp;hl=Recursion
  21. Your welcome. it may come in handy for me in the future aswell
  22. Hmm... just one question what exactly is alpha Numeric
  23. I took the time to write it for you both functions _ArrayMinDiff and _ArrayMaxDiff return an array with 2 values elment [0] gives the index at which the min difference or max difference was found and [1] gives the min or max difference $Array = StringSplit("4,2,6,8,12,5",",") $min=_ArrayMinDiff($Array,6,1) $max=_ArrayMaxDiff($Array,6,1) ConsoleWrite('min:'&$min[0]&@CRLF&$min[1]&@CRLF&"max:"&$max[0]&@CRLF&$max[1]&@CRLF) Func _ArrayMinDiff($F_Array,$F_Value,$i_Base=0) If Not IsArray($F_Array) Then SetError(1) Return "" EndIf Local $ArrayMinDiff[2],$i,$i_DiffValue $ArrayMinDiff[0]=$i_Base Local $i_Upper = UBound($F_Array)-1 For $i= $i_Base To $i_Upper $i_DiffValue=Abs(Number($F_Array[$i])-$F_Value) if $i_DiffValue<Abs(Number($F_Array[$ArrayMinDiff[0]])-$F_Value) then $ArrayMinDiff[0]=$i $ArrayMinDiff[1]=$i_DiffValue EndIf Next SetError(0) Return $ArrayMinDiff EndFunc Func _ArrayMaxDiff($F_Array,$F_Value,$i_Base=0) If Not IsArray($F_Array) Then SetError(1) Return "" EndIf Local $ArrayMaxDiff[2],$i,$i_DiffValue $ArrayMaxDiff[0]=$i_Base Local $i_Upper = UBound($F_Array)-1 For $i= $i_Base To $i_Upper $i_DiffValue=Abs(Number($F_Array[$i])-$F_Value) if $i_DiffValue>Abs(Number($F_Array[$ArrayMaxDiff[0]])-$F_Value) then $ArrayMaxDiff[0]=$i $ArrayMaxDiff[1]=$i_DiffValue EndIf Next SetError(0) Return $ArrayMaxDiff EndFunc
  24. I would do this for you but iam feeling lazy.
  25. go through the array and do $x - element value then use Abs ( expression ) store the element number if smaller than previous element or continue if larger. hope that made sense
×
×
  • Create New...