Jump to content

ithelast

Members
  • Posts

    7
  • Joined

  • Last visited

ithelast's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. I am trying to input three numbers (1,2,3 for example) into a form in a random order. Currently I am manually sending this information as follows: Send("1") Send("3") Send("2") Very simple but not random at all. I would like to be able to send these in a random order each time.
  2. Eureka! I had to define the variable $randomsleep as a global variable (I think that is the term) then I can just call (I think that is the term also please correct me if I am wrong) it when I want to use it. Thanks for all the help guys really appreciate it!
  3. Hey twitchyliquid64 1. Thanks for the ConsoleWrite() tip that is super handy. 2. I am trying to create a program that will sleep for X amount of time given a specific die roll. "Example if you roll a 6 then you take a Random 5-10 Minute Break". Thank you somdcomputerguy I made some modifications based on your suggestions and the script is running! The problem I am running into is that the Sleep duration is very short (almost zero). Global $Paused HotKeySet('0', 'Quit') HotKeySet('', 'Pause') While 1 If Random (1, 6, 1) = 6 Then $randomsleep = Random(10000, 60000, 1) Sleep($randomsleep) ConsoleWrite("Its Working Rolled a 66666666666666666666");This is just to show me that its working and should be deleted or commented out afterwards Else ConsoleWrite("Its Working Rolled a 11111111111111111111");This is just to show me that its working and should be deleted or commented out afterwards Endif WEnd Func Pause() $Paused = Not $Paused While $Paused Sleep(100) WEnd EndFunc ;==>Pause Program Func Quit() Exit EndFunc ;==>Quit Program Thanks John I also tried inserting this into my modified code but it seems to give the same output, in that the sleep timer does not seem to be taking affect
  4. The idea is that you roll a die. If it comes up with a 6 then you sleep for $RandomSleep. It does not give an error when you run it. So technically the syntax is correct but the logic must be flawed? Global $Paused HotKeySet('{0}', 'Quit') HotKeySet('{\}', 'Pause') Pause() While 1 IF Random (1, 6) = 6 then If Not @error Then $randomsleep = Random(1000, 6000, 1) Sleep($randomsleep) Send("Its Working Rolled a 6") ;This is just to show me that its working and should be deleted or commented out afterwards Else Send("Its Working Rolled a 1 to 5") ;This is just to show me that its working and should be deleted or commented out afterwards Endif Endif WEnd Func Pause() $Paused = Not $Paused While $Paused Sleep(100) WEnd EndFunc ;==>Pause Program Func Quit() Exit 0 EndFunc ;==>Quit Program
  5. I simply want to make a utility (Pixel Conversion Calculator?) that will allow you to convert pixel coordinates between resolutions. It does not seem anything like this exists. You totally put me in the right direction: Thank you! Here is the code I have been using: #include <array.au3> Global $aResult = _ConvertCoords(1920, 1080, 800, 600) _Arraydisplay($aResult) Func _ConvertCoords($a, $b, $c, $d, $x = 960, $y = 540) Local $ret[2] = [($x * ($c / $a)), ($y * ($d / $)] Return $ret EndFunc ;==>_ConvertCoords This converts the pixel coordinates given in $x and $y. From resolution a, b (in this case 1920 by 1080) to the desired resolution pixel coordinates (in this case 800 x 600). Example: [($x * ($c / $a)), ($y * ($d / $)] is 960 (1920/800), 540(1080/600) = 960(.4166), 540(.4166) = 400, 300 1. Ideally the array would allow you to input the values for $x and $y so it could be a stand alone utility. 2. Even better If you could also change the values for $a,$b,$c,$d then you would also be able to modify the resolution on the fly as well.
  6. Wow that was a fast reply! Thank you for the warm welcome... Much appreciated. Would something like this work? ;convert coords (x,y) from (a,b ) screen resolution to (c,d) screen resolution Func_ConvertCoords( $x, $y, $a, $b, $c = @DesktopWidth, $d = @DesktopHeight ) Local $ret[2] = [( $c * $x ) / $a, ( $d * $y ) / $b] Return $ret EndFunc How to I get Autoit to allow a way to input these cords and then provide an output for it? Please forgive the ignorance as I a complete AutoIt newbie.
  7. I am looking for a way to convert the relative coordinates on a 1920 x 1080 resolution to the equivalent coordinates in 800 x 600. This formula works to do it manually however its extremely inefficient if you are looking to convert a large number of cordiantes: (new_x = old_x * (new_screen_width / old_screen_width)), (new_y = old_y * (new_screen_width / old_screen_width)). Is there a good Autoit script to do this? Or maybe with another utility?
×
×
  • Create New...