tradertt Posted December 7, 2007 Share Posted December 7, 2007 #include<IE.au3> #include <File.au3> #RequireAdmin $Links="Links.txt" $Subject="subject.txt" $Description="description.txt" _IELoadWaitTimeout(25000) _IEErrorHandlerRegister() $oIE=_IECreate("about:blank",1,1,1,-1) For $r=1 to _FileCountLines($Subject) For $i=1 to _FileCountLines($Links) ;$oIE=_IECreate(FileReadLine($Links,$i),0,1,1,-1) _IENavigate($oIE, FileReadLine($Links,$i)) $oBBCode=_IEGetObjById($oIE,"bbcodemode") _IEAction($oBBCode,"click") $Title=_IEGetObjById($oIE,"subject") _IEFormElementSetValue($Title,FileReadLine($Subject,$r)) $PostEdit=_IEGetObjById($oIE,"posteditor_textarea") _IEFormElementSetValue($PostEdit,FileReadLine($Description,$r)) $oSubmit=_IEGetObjById($oIE,"postsubmit") _IEAction($oSubmit,"click") _IELoadWait($oIE,5000) _IEQuit($oIE) Next Next Hi guys, Having a problem with this code. I have a description file and a subject file with 3 lines in each. However, when I run this macro, it opens up a window and the macro ends there without doing anyhting. Does anyone know why? I am on Vista but I have disabled UAC My other macro is running fine when it has almost the same code: see below #include<IE.au3> #include <File.au3> #RequireAdmin $Links="Links.txt" $loginid="loginid.txt" _IELoadWaitTimeout(25000) _IEErrorHandlerRegister() $oIE=_IECreate("about:blank",1,1,1,-1) For $i=1 to _FileCountLines($Links) ;$oIE=_IECreate(FileReadLine($Links,$i),0,1,1,-1) _IENavigate($oIE, FileReadLine($Links,$i)) $username=_IEGetObjById($oIE,"username") _IEFormElementSetValue($username,FileReadLine($loginid,$i)) $password=_IEGetObjById($oIE,"password") _IEFormElementSetValue($password,"123456") $oSubmit=_IEGetObjById($oIE,"loginsubmit") _IEAction($oSubmit,"click") _IELoadWait($oIE,5000) ;_IEQuit($oIE) Next Run('AutoIt3.exe discuzforumcurrent.au3') Free Flash Games Online | Car Modifications Articles | Free Arcade Games Online Link to comment Share on other sites More sharing options...
tradertt Posted December 7, 2007 Author Share Posted December 7, 2007 I have found out that it seems that the For $r=1 to _FileCountLines($Subject) is giving me problem. As the Subject.txt has Chinese characters in it, it seems that it caused the filecountlines to have an error. Can anyone provide a workaround? Free Flash Games Online | Car Modifications Articles | Free Arcade Games Online Link to comment Share on other sites More sharing options...
DaleHohm Posted December 7, 2007 Share Posted December 7, 2007 Suggest you turn on SciTe debug mode #AutoIt3Wrapper_run_debug_mode=Y and share the output. Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
tradertt Posted December 7, 2007 Author Share Posted December 7, 2007 !> Starting in DebugMode.. Line: @error-@extended: Line syntax 0001: 0-0: #include<IE.au3> 0002: 0-0: #include <File.au3> 0003: 0-0: #RequireAdmin 0004: 0-0: #AutoIt3Wrapper_run_debug_mode=Y 0005: 0-0: $Links="Links.txt" 0006: 0-0: $Subject="subject.txt" 0007: 0-0: $Description="description.txt" 0008: 0-0: _IELoadWaitTimeout(25000) 0009: 0-0: _IEErrorHandlerRegister() 0010: 0-0: $oIE=_IECreate("about:blank",1,1,1,-1) --> IE.au3 V2.3-1 Warning from function _IEAttach, $_IEStatus_NoMatch 0011: 0-0: For $r=1 to _FileCountLines($Subject) +>10:57:26 AutoIT3.exe ended.rc:0 +>10:57:27 AutoIt3Wrapper Finished >Exit code: 0 Time: 2.801 IS this the correct way to do the debug mode? These are the results I got. Free Flash Games Online | Car Modifications Articles | Free Arcade Games Online Link to comment Share on other sites More sharing options...
tradertt Posted December 7, 2007 Author Share Posted December 7, 2007 Did I do the debug the correct way. Does anyone know why the filereadline does not capture the chinese characters and any workaround? Free Flash Games Online | Car Modifications Articles | Free Arcade Games Online Link to comment Share on other sites More sharing options...
DaleHohm Posted December 7, 2007 Share Posted December 7, 2007 Yes, you did the debug correctly. Your next step should be to strip your code down to just the lines that cause you trouble - which looks like #include <File.au3> $Subject="subject.txt" _FileCountLines($Subject)oÝ÷ Øâ¶+-ábæ®Ý@ŶÈZ¾)ය.nW²¢ç(ºWljeü¢Øb±«¢+Ù]¡¥±Ä(ÀÌØí±¥¹ô¥±I1¥¹ ÀÌØíÍթФ(%ÉɽÈô´ÄQ¡¸á¥Ñ1½½À(ì¼ÍÑÕ)]¹ Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
tradertt Posted December 7, 2007 Author Share Posted December 7, 2007 #include<IE.au3> #include <File.au3> #RequireAdmin $Links="Links.txt" $Subject="subject.txt" $Description="description.txt" _IELoadWaitTimeout(25000) _IEErrorHandlerRegister() $oIE=_IECreate("about:blank",1,1,1,-1) While 1 $line = FileReadLine($subject) If @error = -1 Then ExitLoop For $i=1 to _FileCountLines($Links) ;$oIE=_IECreate(FileReadLine($Links,$i),0,1,1,-1) _IENavigate($oIE, FileReadLine($Links,$i)) $oBBCode=_IEGetObjById($oIE,"bbcodemode") _IEAction($oBBCode,"click") $Title=_IEGetObjById($oIE,"subject") _IEFormElementSetValue($Title,FileReadLine($Subject,$r)) $PostEdit=_IEGetObjById($oIE,"posteditor_textarea") _IEFormElementSetValue($PostEdit,FileReadLine($Description,$r)) $oSubmit=_IEGetObjById($oIE,"postsubmit") _IEAction($oSubmit,"click") _IELoadWait($oIE,5000) _IEQuit($oIE) Next Wend So would the code be this way? Thank you Free Flash Games Online | Car Modifications Articles | Free Arcade Games Online Link to comment Share on other sites More sharing options...
corey822 Posted December 7, 2007 Share Posted December 7, 2007 wats this macro actually suppose to do ? cheers C.W C.Wnew rules:1.dont use plz in a post or title use please instead2.always use help file as it is now muchly over rated3. dont think where not watching u4.please wait 24 hours after last post ot bump XD i use to make that mistake Link to comment Share on other sites More sharing options...
Confuzzled Posted December 15, 2007 Share Posted December 15, 2007 wats this macro actually suppose to do ?cheers C.WRead his other posts - he's developing spamming software... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now