Jump to content

mihaibr

Active Members
  • Posts

    58
  • Joined

  • Last visited

Everything posted by mihaibr

  1. I don't know to write regular expressions . There are two other tags <date></date> and <user></user> . L.E.: Thanks mikell for that example, but there can be two poem with the same name but different authors .
  2. Wow, nice example, thanks again!
  3. Oh yea! Forgot about it (lol) ! Thanks guinness!
  4. Ok, I unrestand now. If i got this file: <poem> <name>poem1 name</name> <author>author1 name</author> <lyrics> line line line </lyrics> </poem> <poem> <name>poem2 name</name> <author>author2 name</author> <lyrics> line line line </lyrics> </poem> <poem> <name>poem3 name</name> <author>author3 name</author> <lyrics> line line line </lyrics> </poem> and all poems are stored in an array named $aPoems[] and I want to remove the poem that it's in $aPoems[2]: <poem> <name>poem3 name</name> <author>author3 name</author> <lyrics> line line line </lyrics> </poem> Which parameters should I use? (Which pattern)
  5. all the poems are stored in an array using StringRegExp(FileRead($hFile),'<(?i)POEM>(?s)(.*?)</(?i)POEM>',3)
  6. i don't know if you understand what I want I want to replace a section in the file: <poem> <name>poem3 name</name> <author>author3 name</author> <lyrics> line line line </lyrics> </poem>
  7. Hello, I'm working on a personal filetype parser. I'm using .poem files extension with a HTML-like syntax. An exemple file looks like this: <poem> <name>poem1 name</name> <author>author1 name</author> <lyrics> line line line </lyrics> </poem> <poem> <name>poem2 name</name> <author>author2 name</author> <lyrics> line line line </lyrics> </poem> <poem> <name>poem3 name</name> <author>author3 name</author> <lyrics> line line line </lyrics> </poem> I'm using this parser for a lyrics archive program. If the user want to delete a poem, I will use the _ReplaceStringInFile to delete the poem from the .poem file.
  8. Create the Pic control in your gui. then use GUICtrlSetImage to set the image there Edit:Erm,Melba was faster xD
  9. Hey MsgBox, you came here to learn yourself, lol Function MsgBox got 5 parameters(First three are necessarily and the other two are optional) 1.The first one is the flag. Flag is the parameter that indicates the type of message box. You find all flag values here: http://www.autoitscript.com/autoit3/docs/functions/MsgBox.htm 2.The second one is the Title. It refears to the title of the message box. 3.The third is Text. It refears to the text of the message box. The other two are optional. They are Timeout and Hwnd 4.Timeout Timeout in seconds. After the timeout has elapsed the message box will be automatically closed. 5.Hwnd The window handle to use as the parent for this dialog.
  10. Hi, Why InetRead() is not working if my url got a "#" into it? Example url: http://fatfinch.wordpress.com/2012/02/24/eight-steps-to-great-bird-photography/#comment-2649 Are there any alternatives to retrive the html source of a site?
  11. Why don't you use FTPEx functions?
  12. You should provide more informations. So, you got 10-20 values inside your script, and you want to compare them with other values retrived from some sites?
  13. Use Autoit Window Info tool or Also, you should read the Controls page.
  14. I think the $dirsize is the problem. Before you use it as array, check if it's an array using IsArray() If IsArray($dirsize) Then ;your code here Else MsgBox(0, "Error", "$dirsize is not an array") EndIf
  15. First, stop double posting, use the "Edit" button. I was talking about the button status. Can you post an screenshot of that application and the Error ?
  16. Hi, Today I bought a new keyboard and at home I noticed that it doesn't have buttons for the volume control(VolumeUP,VolumeDOWN and MUTE), so I created this script: #include "SoundGetSetQuery.au3" Global $bState=False,$aIcon[4]=["low.ico","med.ico","max.ico","mute.ico"] $iVolume=_SoundGet(0, "dSpeakers", 1, "Volume") If $iVolume<=33 Then TraySetIcon($aIcon[0]) If $iVolume>33 And $iVolume<=66 Then TraySetIcon($aIcon[1]) If $iVolume>66 And $iVolume<=100 Then TraySetIcon($aIcon[2]) HotKeySet("{PGUP}","up");VolumeUP HotKeySet("{PGDN}","down");VolumeDOWN HotKeySet("{INS}","mute");VolumeMUTE Func up() If $bState==False Then $iVolume=_SoundGet(0, "dSpeakers", 1, "Volume") Send("{VOLUME_UP}") If $iVolume<=33 Then TraySetIcon($aIcon[0]) If $iVolume>33 And $iVolume<=66 Then TraySetIcon($aIcon[1]) If $iVolume>66 And $iVolume<=100 Then TraySetIcon($aIcon[2]) EndIf EndFunc Func down() If $bState==False Then $iVolume=_SoundGet(0, "dSpeakers", 1, "Volume") Send("{VOLUME_DOWN}") If $iVolume>=1 And $iVolume<=33 Then TraySetIcon($aIcon[0]) If $iVolume>33 And $iVolume<=66 Then TraySetIcon($aIcon[1]) If $iVolume>66 And $iVolume<=100 Then TraySetIcon($aIcon[2]) If $iVolume==0 Then TraySetIcon($aIcon[3]) EndIf EndFunc Func mute() If $bState==True Then $iVolume=_SoundGet(0, "dSpeakers", 1, "Volume") Send("{VOLUME_MUTE}") If $iVolume>=1 And $iVolume<=33 Then TraySetIcon($aIcon[0]) If $iVolume>33 And $iVolume<=66 Then TraySetIcon($aIcon[1]) If $iVolume>66 And $iVolume<=100 Then TraySetIcon($aIcon[2]) If $iVolume==0 Then TraySetIcon($aIcon[3]) $bState=False Else Send("{VOLUME_MUTE}") TraySetIcon($aIcon[3]) $bState=True EndIf EndFunc While True Sleep(10) WEndHere you can find out the script with the original indentation: http://pastebin.com/cCerHina I attached the icon in this post. The include "SoundGetSetQuery.au3" can be found here: I chose the keys "PGUP","PGDN" and "INS" because I use them rare. I extracted the icons from this iconset: http://www.iconarchive.com/show/oxygen-icons-by-oxygen-icons.org.1.html icons.7z
  17. Are you sure that the button status is Active? Maybe that application got some kind of protection.
  18. Yes, MouseClick() (as the last method) There might be other method, ControlClick() ,maybe?
  19. Are you sure that the handle is ok? look at WinTitleMatchMode Can you take a picture of that "Error"? if is MsgBox(0, "","ネットワークに接続できません。" why dont you send "Enter" ? (or press the OK button) If that windows have the same handle everytime why don't you use WinClose(the handle value) ?
  20. Ok guys! Sorry about that,I was trying to help him but I was in a rush. @xboi209 can you post the full code?
  21. @Jos, the reason why I did'n post any comment is that I was hurrying. I was thinking that, in this case, will be good to add a Sleep there. The "IF change" do the same thing, but if he got just one expression in the "IF" is ok to write it like that, is easier.
  22. Func somefunction() If $variable = 1 Then MsgBox(0, "", "message") EndFunc While $Process > 1 somefunction() Sleep(10) WEnd
  23. code inside here
  24. you can do this using labels too $Form1 = GUICreate("Form1", 600, 400) $Label1 = GUICtrlCreateLabel("", 0, 0, 300, 400) GUICtrlSetBkColor(-1, 0x00FF00) $Label2 = GUICtrlCreateLabel("", 300, 0, 300, 400) GUICtrlSetBkColor(-1, 0xFFFF00) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case -3;$GUI_EVENT_CLOSE Exit EndSwitch Sleep(10) WEnd
×
×
  • Create New...