Jump to content

IamKJ

Members
  • Posts

    18
  • Joined

  • Last visited

Everything posted by IamKJ

  1. The second code you posted worked beautifully every time. It doesn't work all the time with the milliseconds, but that's fine, have found a way around that with using the sleep time and converting milliseconds into sleep time. Thanks a lot!
  2. It worked with the msgbox, but anything else I try to put after the Until statement just makes the original message box pop up.
  3. That worked perfectly. However, it won't allow me to use the _Msec function in _TimeToTicks, which returns milliseconds.
  4. Yes, but those only act from when it was called. I want to go off of system time. For example, this script would ask them to input time to execute, so I'd put "03:30:00:000", and I'd like for it to execute at 3:30 A.M. I can get the system time displayed fine and everything, but can't figure out how to get autoit to read the time as a string and execute when that system time string reaches to time specified. It might be possible/easier for it to read the time as a whole number, maybe if you add all the times (hh + mm + ss + ms) and get a whole number, that might work, but not sure how to get autoit to read the system time as a string or integer.
  5. I am trying to allow the GUI to gather info as to when to execute a function. I am having trouble doing this. So far this is what I have. ;Timer Func timer () If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(36,"Timer","Please format your answer in 00:00:00:000") Select Case $iMsgBoxAnswer = 6 ;Yes Global $infotime = InputBox ('Time', 'What time to execute?') Do $rawtimer = ToolTip(@Hour & ':' & @Min & ':' & @Sec & ':' & _MSec()) until $rawtimer = $infotime if $rawtimer = $infotime Then msgbox (0,'Worked','Worked') Else EndIf Case $iMsgBoxAnswer = 7 ;No Exit EndSelect EndFunc Func _MSec() Local $stSystemTime = DllStructCreate('ushort;ushort;ushort;ushort;ushort;ushort;ushort;ushort') DllCall('kernel32.dll', 'none', 'GetSystemTime', 'ptr', DllStructGetPtr($stSystemTime)) $sMilliSeconds = StringFormat('%03d', DllStructGetData($stSystemTime, 8)) $stSystemTime = 0 Return $sMilliSeconds EndFunc I have also tried _GUIToolTip_GetText in order to read the tooltip until the time specified, but it still doesn't work. Any help would be great.
  6. So I have a lot of different functions in the little program I'm making. Most of them use the Do statement, such as finding images, clicking buttons, etc. The question I have is how would I be able to both 1) Create a hotkey to pause whatever I am doing at the moment. If I have to put something into every function in the program, I don't mind. 2) Create a hotkey to exit whatever I am doing and stop all loops or commands and bring back the main GUI?
  7. Just upped the tolerance a bit, somewhere between 50-100 is a good start, if there aren't too many images like the one you are searching for.
  8. Basically I'm trying to figure out what would be the most efficient means of making multiple use buttons. What I'd like is to be able to click a button and pop up a msgbox to gather some info, or two message boxes, but upon entering that info and the msgbox dialogue being over, it'll then switch to a different function. I was thinking of using 1/0 to designate which is true or not, but not sure if that'd be the most efficient way. Still very new to coding, and autoit, any help would be great!
  9. No, I never received that message.
  10. Can be closed. Figured it out.
  11. I have ran into some issues with image search. Every time I run the script, it never finds the image in the browser, but if I open the image directly on the desktop, it'll find it no problem. Why is this? Any way around it?  Func ImageSearchFarm ()      Local $picture = 'C:\Users\Jammmesss\Desktop\AutoIt\New folder\Icon.png'      Local $x1 = 0      Local $y1 = 0      Do          $result = _ImageSearch($picture,1,$x1,$y1,0,0)          ConsoleWrite ($result)      until $result = 1;      if $result=1 Then          MouseMove($x1,$y1,50)      else          MsgBox (0,'MSG','End') EndIf      EndFunc
  12. Ahh, sent that premature, lmao.
  13. fghdg <form id="login_form" action="#" method="post"> <input type="submit" class="submit" id="login_submit_button"> <label for="user"> <input id="user" name="username" type="text" value=""> <span>User name:</span> </label> <label for="password"> <input name="clear" type="hidden" value="true"> <input id="password" name="password" type="password"> <span>Password:</span> </label> <label for="remember-me" class="remember_me"> <span class="remember-me">Remember me</span> <input id="remember-me" type="checkbox" name="remember-me" > </label> <div class="login-buttons"> <a class="login-facebook" href="https://ipp-facebook.******.de/?game=*****e&******t=en&ref=start&"></a> <div class="button small"><a class="btn-login" href="#">Login</a></div> </div> </form>
  14. All that is happening is that it's activating the window, but not actually clicking anything.
  15. Thanks for the tip. Just attempted to call this function, with no luck. Any ideas? Func logBtn () Local $oInputs = _IETagNameGetCollection($ie, "div") For $oInput In $oInputs     If $oInput.classname == "btn-login" Then _IEAction($oInput, "click") Next EndFunc
  16. Wouldn't that still require getting the objects name?
  17. I haven't. How would I identify this button as an object??
  18. Have been having some serious issues with clicking a website button. I have eventually tried to even call for pixel of the button and then click, but still not working. I would ideally like to get the element of the button and click it that way above all else, but can't find out how/don't know. The element doesn't have an ID and trying to get by class or tag is not working. This is the element in question <div class="button small"><a class="btn-login" href="#">Login</a></div> Any help would be amazing. Below is my current script $ie = ObjCreate("InternetExplorer.Application") AutoItSetOption ("MouseCoordMode", 0) Opt('SendKeyDelay', Random (16,80)); default 5. higher number = slower #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <ComboConstants.au3> #include <WinHttp.au3> #include <IE.au3> #include <GUIConstantsEx.au3> #include <GuiEdit.au3> #include <WinAPIFiles.au3> #Region ### START Koda GUI section ### Form=c:\users\jammmesss\desktop\autoit\login.kxf Global $nameInfo = IniRead('Userinfo.ini', 'Name', 'Name', 'No username on file') Global $passInfo = IniRead('Userinfo.ini', 'Pass', 'Pass', 'No password on file') Global $Login = GUICreate("Login", 244, 162, 483, 309) GUISetBkColor(0xA0A0A0) Global $Username = GUICtrlCreateInput($nameInfo, 8, 32, 105, 21) GUICtrlSetBkColor(-1, 0xFFFFFF) Global $Password = GUICtrlCreateInput($passInfo, 128, 32, 105, 21) GUICtrlSetBkColor(-1, 0xFFFFFF) Global $logBtn = GUICtrlCreateButton("Login", 16, 120, 75, 33) GUICtrlSetBkColor(-1, 0xFFFFFF) Global $UserT = GUICtrlCreateLabel("User name", 24, 8, 55, 17) Global $PassT = GUICtrlCreateLabel("Password", 152, 8, 50, 17) Global $saveBtn = GUICtrlCreateButton("Save Info", 152, 120, 75, 33) GUICtrlSetBkColor(-1, 0xFFFFFF) Global $WorldT = GUICtrlCreateLabel("World", 104, 56, 32, 17) Global $WorldMen = GUICtrlCreateCombo("92", 88, 80, 65, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))    ; Add additional items to the combobox.     GUICtrlSetData($WorldMen, "91|90|89|88") GUICtrlSetBkColor(-1, 0xFFFFFF) GUISetState(@SW_SHOW) Global $slpMed = Random (2000, 2500) Global $slpLow = Random (100, 350) Global $pWorld = GUICtrlRead ($WorldMen) #EndRegion ### END Koda GUI section ### While 1     $nMsg = GUIGetMsg()     Switch $nMsg         Case $GUI_EVENT_CLOSE             Exit         Case $saveBtn             $User = GUICtrlRead($Username)             IniWrite("Userinfo.ini", "Name", "Name", $User)             $Pass = GUICtrlRead ($Password)             IniWrite("Userinfo.ini", "Pass", "Pass", $Pass)         Case $logBtn             $User = GUICtrlRead($Username)             $Pass = GUICtrlRead ($Password)             With $ie                 .visible = True                 WinActivate ($ie)                 .navigate ("*********t")                 While ($ie.busy)                 WEnd                 Sleep ($slpLow)                 $txtUser = .document.getElementById('user')                 $txtUser.value = $User                 Sleep ($slpLow)                 $txtPass = .document.getElementById('password')                 $txtPass.value = $Pass                 Sleep ($slpMed)                 Call (SearchForColor)             EndWith     EndSwitch WEnd Func SearchForColor ()                 $left = 724                 $top = 421                 $right = 767                 $bottom = 432                 $color = 0x9C006F                 $pixLog = PixelSearch($left, $top, $right, $bottom, $color, 20)                 If not (@error) Then                     MouseClick('left',$pixLog[0],$pixLog[1],2,1)                 Else                     MsgBox(0,"Error","There has been an error with $pixLog")                 EndIf                 EndFunc
×
×
  • Create New...