Jump to content

weaponx

MVPs
  • Posts

    5,295
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by weaponx

  1. Why did you start another topic? You should have just continued in the existing one: http://www.autoitscript.com/forum/index.ph...c=95306&hl=
  2. Well considering I don't know if $user and $pass have a leading space I can't really tell, but I do know this is invalid syntax... $user = "jsmith" $pass = "12345" If $user<>"" Then $user="-u"&$user If $pass<>"" Then $pass="-p"&$pass $user: "-ujsmith" $pass: "-p12345
  3. These lines won't work at all... If $user<>"" Then $user="-u"&$user If $pass<>"" Then $pass="-p"&$pass Should be: If $user<>"" Then $user="-u " & $user If $pass<>"" Then $pass="-p " & $pass
  4. I would like to see more script breaking changes, keep these people on their toes.
  5. Brilliant! Eliminates the need for calling FileGetAttrib when searching for files.
  6. These functions have already been created a few times, and we already have _ProcessGetName included with AutoIt. http://www.autoitscript.com/fileman/users/Helge/udfs/_ProcessGetHWnd.au3
  7. PHP is a scripting language and it's not strongly typed, just like AutoIt. I'm not even sure why you would compare C to PHP. You should give some more specific examples of the problems you encountered.
  8. You need to learn to implement debugging aids into your functions. Any place in your function where something can fail insert "Return SetError(X,0,0)" where X starts at 1. So you would have this: Something() Switch @ERROR Case 1 ConsoleWrite("ERROR: DoStuff" & @CRLF) Case 2 ConsoleWrite("ERROR: DoMoreStuff" & @CRLF) Case 3 ConsoleWrite("ERROR: DoEvenMoreStuff" & @CRLF) EndSwitch Func Something() $result1 = DoStuff() If $result = "" Then Return SetError(1,0,0) $result2 = DoMoreStuff() If $result2 = "" Then Return SetError(2,0,0) $result3 = DoEvenMoreStuff() If $result3 = "" Then Return SetError(3,0,0) EndFunc Not rocket science.
  9. You need to get the frame object and then use that to access the button. #683178
  10. Easy just change to KÕRPÝXY
  11. You use _XMLGetValue which returns an array of matching values. You can also use this function just to grab the first match: ;_XMLGetValue returns an array this will return the first element Func _GetFirstValue($node) $ret_val = _XMLGetValue($node) If IsArray($ret_val) Then Return ($ret_val[1]) Return SetError(1,3,0) EndFunc
  12. It's not hidden, its in a different frame. Install the Microsoft Developer Toolbar for IE and you'll see it. Why they still use frames is beyond me.
  13. Yea your topic will be really helpful when someone searches titles for "StringRegExp" ...
  14. Topic title = Useless Topic description = Meaningless
  15. #include "_XMLDomWrapper.au3" $sXMLFile = "test2.xml" $result = _XMLFileOpen($sXMLFile) If $result = 0 Then Exit $value = _GetFirstValue("/root/myitem[@id='123456789']/text") MsgBox(0,"",$value) ;Get the first real value returned from the _XMLGetValue() return array. Func _GetFirstValue($node) $ret_val = _XMLGetValue($node) If IsArray($ret_val) Then Return ($ret_val[1]) Return SetError(1,3,0) EndFunc
  16. No need to include date.au3, just use @MON, @MDAY, @YEAR http://www.autoitscript.com/autoit3/docs/macros.htm
  17. Here I demonstrated a way to handle multiple radio groups: #542324
  18. Its all described in the help file.
  19. This is the html for the Send button in Hotmail: <a id="SendMessage" onclick="if(window.ComposeContactPicker)return Control.invokeStatic('ComposeContactPicker', 'sendMessagePrep', event, null);" href="java script:;" title="Send"><span class="Label">Send</span></a> It's also important to know that this element exists within an iframe. This code works for me: #include <IE.au3> $oIE = _IEAttach ("Windows Live Hotmail") If @ERROR Then MsgBox(0,"","Failed to attach IE instance") EndIf $oIFRAME = _IEFrameGetObjByName ($oIE, "UIFrame") $oA = _IEGetObjById ($oIFRAME, "SendMessage") If @ERROR Then MsgBox(0,"","Send button not present") Else MsgBox(0,"","Sending now") _IEAction ($oA, "click") EndIf
  20. The id is the id of the text element you want to click on. It would help if you posted the code for the link, not the full page but just that element.
  21. Try _IEAction ($o_object, "click")
  22. This method doesn't work the same in Vista as far as I know.
  23. Possibly with WMI: #334772
  24. $Msg = "" $aResult = DllCall("nvcpl.dll","int","NvGetWindowsDisplayState","int",1) If @ERROR Then $Msg = "@ERROR: " & @ERROR Else Switch $aResult[0] Case -1 $Msg = "Unknown state or view mode." Case 0 $Msg = "The call failed internal error" Case 1 $Msg = "Unrecognized Windows monitor number" Case 2 $Msg = "Graphics card not attached to desktop" Case 3 $Msg = "Graphics card attached to desktop but not an NVIDIA device" Case 4 $Msg = "Graphics card in Single-Display mode" Case 5 $Msg = "Graphics card in DualView mode" Case 6 $Msg = "Graphics card in Clone mode" Case 7 $Msg = "Graphics card in Horizontal Span mode" Case 8 $Msg = "Graphics card in Vertical Span mode" EndSwitch EndIf MsgBox(0,"",$Msg)
×
×
  • Create New...