Jump to content

Mison

Active Members
  • Posts

    229
  • Joined

  • Last visited

About Mison

  • Birthday 10/09/1981

Profile Information

  • Location
    Malaysia

Mison's Achievements

Polymath

Polymath (5/7)

1

Reputation

  1. Hi everyone. When running the example script, I got this error: "C:\Users\xxx\Downloads\JSON.au3" (80) : ==> Variable subscript badly formatted.: Local $o_Current[] Local $o_Current[^ ERROR Just wanted to let you know and thank you for the UDF.
  2. Use "run" command - ;master.au3 Run(@AutoItExe&" msg.au3") ;msg.au3 MsgBox(0,"","Printing...") If msg.au3 got terminated, your main script won't be affected. This will only works for one way call, say the main script calls the other script to do something without returning any value. For two way communication, and
  3. Try WinClose("title"[,"text"])
  4. Okay, I have added remarks to my earlier post. I also changed [^\v] to \V since they are basically the same.
  5. @GEOSoft I have tested this pattern and it works(strangely, if what you've said is true). I thought \R will match any newline sequence, thus \R = \r\n, or \r or \n. Taken from PCRE 7.8 help file - "Outside a character class, by default, the escape sequence \R matches any Unicode newline sequence." If it is not as what I think it is, then replace "\R" with "[\r\n]+"
  6. While $rec = 1 $readx1 = FileRead("Mousex.txt") $splitx1 = StringSplit($readx1, ":") $all1 = $splitx1[0] $mpos = MouseGetPos() FileWrite("Mousex.txt", $mpos[0] & ":") FileWrite("Mousey.txt", $mpos[1] & ":") Sleep(27) GUICtrlSetData($recording, "Recording: On Frame:" & $all1) Sleep(10) ;<-- recommended If GUIGetMsg() = $stop Then $rec = 0 ;<-- added line WEnd Assuming the value of $msg is of GUIGetMsg(),
  7. Just an addition to what is already there.. with the ability to edit every single <td>. Local $fileread = "<tr>" & @CRLF & _ "<td>asdf asdf asdf</td>" & @CRLF & _ "<td>qwer qwer qwer</td>" & @CRLF & _ "<td>zxcv zxcv zxcv</td>" & @CRLF & _ "<td>poiu poiu poiu</td>" & @CRLF & _ "</tr>" Local $new_fileread_1 = StringRegExpReplace($fileread,"(<tr>)(\R)(<td>)(\V*)(</td>)\2\3(\V*)\5\2\3(\V*)\5\2\3(\V*)\5\2(</tr>)","\1\2\3\4\5\2\3\6\5\2\3\7\5\2\3\7\5\2\9") Local $new_fileread_2 = StringRegExpReplace($fileread,"(<tr>)(\R)(<td>)(\V*)(</td>)\2\3(\V*)\5\2\3(\V*)\5\2\3(\V*)\5\2(</tr>)","\1\2\3\4\5\2\3\6\5\2\3\7\5\2\3New Element Here\5\2\9") ;~ \1 = <tr> ;~ \2 = \R - new line. If this doesn't works, try "(\v+|$)". Credit to GEOSoft. ;~ \3 = <td> ;~ \4 = 1st column's content ;~ \5 = </td> ;~ \6 = 2nd column's content ;~ \7 = 3rd column's content ;~ \8 = 4th column's content ;~ \9 = </tr> MsgBox(0,"",$fileread) MsgBox(0,"",$new_fileread_1) MsgBox(0,"",$new_fileread_2) Edit:Added some remarks.
  8. What is it for? Just curious.
  9. Hi OP, You can also use Function. Call it whenever you want to. FuncName() ; call it once For $i=1 to 11 ; call it 11 times FuncName() Next Func FuncName() Sleep (30000) MouseClick("left", 341, 614, 1) Sleep (30000) MouseClick("left", 341, 614, 1) EndFunc
  10. Display the array's index value just before the line where the error occurred. You can use either MsgBox or ConsoleWrite.
  11. Some applications, many of which are games, prevent your GUI from being topmost.
  12. You're right. Use Flag = 2 to disable the return of the count. $array = StringSplit($string,"",2)
  13. Just like what Spiff59 has said, FileOpen does nothing to the file content. What it does is creates a "handle". Here are some examples: 1. Read, Change, Save ; read data $data = FileRead("xxx.txt"); you can use FileOpen, if you want to. ;~ $file = FileOpen("xxx.txt",0) ;~ $data = FileRead($file) ;~ FileClose($file) $data = StringReplace($data,"b",""); Replace 'b' with empty string a.k.a delete char 'b' ;open file in erase previos data mode $file = FileOpen("xxx.txt",2) FileWrite($file,$data) FileClose($file) xxx.txt, before aaa bbb ccc xxx.txt, after aaa ccc 2. Save, append to end of file $file = FileOpen("xxx.txt",1) FileWrite($file,"ddd") FileClose($file) or simply FileWrite("xxx.txt","ddd") "xxx.txt" - before aaa bbb ccc "xxx.txt" - after aaa bbb cccddd
  14. Interesting topic, although I don't know if it's useful.
×
×
  • Create New...