Jump to content

Please help me to make my first script (2)


Recommended Posts

Hello,

I'd like to write a autoit script that basically goes to this forum, opens every topic of this forum, and copies/pastes all in a .txt.

The browser I'd like to use is not ie, it is Torpark (looks like Firefox) (you can download it from here ).

PLEASE don't try to persuade me to use ie, PLEASE don't tell me that other softwares can do the same work as the script I want to be written.

Don't even bother to post anything if it is for the above reasons. PLEASE just help me to make my first script, or do it for me.

I've been wanting that script for months, but nobody in that forum was able to help me so far.

I hope someone will be able to help me this time.

Regards.

Link to comment
Share on other sites

You might use the "tab around" method like this sample code:

http://www.autoitscript.com/forum/index.php?showtopic=14395

I installed the browser that you linked to, but it comes up in English, so I would not be able to script anything for you unless I changed the OS to use French - then I would be lost :-)

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

First of all, thanks a lot for your answer. You're the first that really seems to be willing to help me since a few months.

I haven't understood why you have a French/English problem. The browser I linked to is the very one I am using. I am using the English version too, so I don't think there is any issue regarding translations. Every window that concerns this browser is in English.

I'd rather use another method, if you don't mind : search a word (ctrl+F), and click the link right above that word. I really don't want to scare you, but I already made an algorithm. Can I post it, or will you be afraid if my algorithm is too long ?

Link to comment
Share on other sites

...French/English problem. The browser I linked to is the very one I am using. I am using the English version too,...

I made some incorrect assumptions about how the browser works :-(

Sure - post your code... maybe as an attached file - if it is really long.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Hello,

I'd like to write a autoit script that basically goes to this forum, opens every topic of this forum, and copies/pastes all in a .txt.

I'd like to use Torpark (you can download it from here .

Press the link that is in a red box, which is called 'lancer le telechargement' (it's French, but don't worry, the software is in English).

Don't forget to allow pop-ups).

Please help me, as I've tried really hard. This might be a bit complicated for a first script.

I'll take the autoitscript forum as an example for the site I'd like to go to, even though it's not the case.

Here is my algorithm (it can be improved - if you have some ideas, they're welcome, I have some ideas too - but for now, let's try to make a script with that algorithm) :

1- Run Torpark

2- If a window opens and says that Torpark is already running, press enter (it will close the Torpark that is running), and go to the step 1-.

3- Wait for 15 seconds for Torpark to open.

4a- First possibility: it didn't open. if a window opens and says that Add-on updates are available, then close that window, and continue to the next step (5-). Else, stop the whole script, and create a message window untitled Error saying that Torpark didn't open.

4b- Second possibility : it opened. Then continue to the next step (5-).

5- Maximize the Torpark window.

6- Press F6, and write the url. For example : http://www.autoitscript.com/forum/index.ph...orum=2&st=0.

7- Wait for the page to load completely (I wrote a function called _wait_load() in order to do that) (if you want to test my script, you might have to adapt this function for yourself)

8- If there's a problem loading page (connection issue), then close Torpark and go to the step 1-.

9- Search for a word, with ctrl+F. For example, "last post by".

10- Make the mouse go to the selected word. With Torpark, it's easy, as the word is overlined in green.

11- Click the word (in my case, it's actually a link right above the word) that was searched.

12- Same as 7-.

13- Same as 8-.

14- copy paste the topic into a .txt (let's assume this part is already done).

15- Come back to the previous page, that shows all the topics (alt+left).

16- Find the next "last post by" (ctrl+G) (Firefox saves the position of the last one that was overlined).

17- Redo the steps 10 to 16 included, 20 times (as there are 20 topics displayed).

18- Redo the steps 6 to 17 included, 2274 times (there are 2274 pages in the subforum "General Help"), but change the last part of the url of the step 6. In my case, the number just needs to be increased by 1, but in the case of the autoitscript forum, the number needs to be increased by 20 : st=0, st=20, st=40, ...

19- Make a message box saying that the script is finished.

This script only needs to be used by me. As a result, I sometimes used specific numbers, that "Autoit window info" gave me.

Thus, If you want to test my script, you will have to change these specific numbers

Here is the script that I made :

Func  _wait_load() ;->waits for the page to load
    $initialsum=1293582875 ;change that for yourself
    While PixelChecksum(1084,975,1180,988)=$initialsum ;change the 4 numbers for yourself
        Sleep(50)
    WEnd
    While PixelChecksum(1084,975,1180,988)=$initialsum
        Sleep(100)
    WEnd
EndFunc  ; ->_wait_load

Opt("WinTextMatchMode", 2) 

Global $p=0 ; this is the number of the pages that have already been done (see the url below).
Global $c=0 ; this is the number of the topics that have been dealt with successfully (it's just a variable that is meant to count the number of success operations).

While 1
Run("C:\Documents and Settings\John\Desktop\Torpark 2.0.0.3a\Torpark.exe") ;(or whereever your .exe is)
If WinWaitActive("Torpark  - Turn any terminal into an anonymous connection.") Then
    Send("{Enter}")
    continueLoop 
EndIf ; If Torpark is already running, shut it down and go to step 1.


If Not(WinWait("Mozilla",15)) Then 
    If WinExists("Firefox Add-on Updates") Then
        WinClose("Firefox Add-on Updates") ; close available updates.
    else
    MsgBox(0,"Error","Torpark didn't open") 
    EndIf
EndIf
WinSetState("Mozilla","",@SW_MAXIMIZE) 

While $p<=2274 ; number of pages
Sleep(3000)
Send("{F6}http://www.autoitscript.com/forum/index.php?showforum=2&st="&(20*$p)) ; 
_wait_load()
If WinActive("Problem loading page") Then
    Winclose("Problem loading page") 
    ContinueLoop 2
EndIf
Send("^f")
Send("last post by")
For t = 1 to 19 ; there are 20 topics, so this action must be redone 19 times.
local $coord=PixelSearch(400,300,700,950,0x38D878) ;you might want to change these 4 numbers if you want to test the script
If Not(@error) Then
    MouseMove($coord[0],$coord[1])
    EndIf
MouseClick("left")
_wait_load()
If WinActive("Problem loading page") Then
    WinClose("Problem loading page")
    ContinueLoop 3
EndIf
; 
; here will be the copy-paste into a .txt.
;
$c=$c+1 ; c is the number of successfull copies/pastes made during the whole script.
Send("!{LEFT}") ; go to previous page.
Send("^g") ;next research.
Next 
$p=$p+1
WEnd
    
ExitLoop ; If we reached this point, we did all we needed to do. Exit the main loop.
WEnd
MsgBox(0,"Congratulations","The script has ended successfully")

Please help me and tell me if there are any mistakes.

Thanks for your help.

PS: I know you would prefer me to use ie to visit all pages of a forum, but i've already had a discussion about that, and I want to use firefox (it's actually Torpark, but it works like firefox). Please help me to make my script as good as possible (even if it's not perfect, and even if some errors might occur).

PPS: I'm sorry my English is not perfect, I hope you understood me. Otherwise, tell me what you didn't understand, and I'll try to say it again.

Link to comment
Share on other sites

Please please please please don't be scared and help me.

Please please please please don't try to persuade me to use ie instead of Torpark.

Please please please please don't tell me that other softwares can do the same task as the one I want to be done.

^^

Link to comment
Share on other sites

  • Developers

Please please please please don't be scared and help me.

Please please please please don't try to persuade me to use ie instead of Torpark.

Please please please please don't tell me that other softwares can do the same task as the one I want to be done.

^^

you got to be kidding.

Maybe go and "play" somewhere else ?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

No I'm not kidding. It's just that this is the 3rd topic I open about this script, and in each and every one I said that I didn't want to use Torpark, that I wasn't interested in any other softwares, but yet many people posted and said "you should use ie", or "you should use this software...".

I just wanted to be sure that it wouldn't happen this time.

Can anyone help me please ?

Link to comment
Share on other sites

  • Developers

No I'm not kidding. It's just that this is the 3rd topic I open about this script, and in each and every one I said that I didn't want to use Torpark, that I wasn't interested in any other softwares, but yet many people posted and said "you should use ie", or "you should use this software...".

I just wanted to be sure that it wouldn't happen this time.

Can anyone help me please ?

Well, I wasn't kidding either.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

No I'm not kidding. It's just that this is the 3rd topic I open about this script, and in each and every one I said that I didn't want to use Torpark, that I wasn't interested in any other softwares, but yet many people posted and said "you should use ie", or "you should use this software...".

I just wanted to be sure that it wouldn't happen this time.

Can anyone help me please ?

If I was a mod I would have told you to shut your mouth after the first topic. Your intentions are clearly malicious.

Link to comment
Share on other sites

I seriously agree. Why not use Internet Explorer? AutoIt has built-in support for it, with the IE UDF, which was practically made for automating a web browser.

If you absolutely cannot use IE, can you please explain why? Is it some security feature Torpark has, which IE doesn't, which makes it imperative that you use it? If not, then you've got me wondering...

Edit:

Sorry, but I just cannot be assed to go through your other/older topics.. muttley

Edited by FreeFry
Link to comment
Share on other sites

@Elishac,

Jos is a developer of AutoIt as well as a moderator for these forums. He has suggested that you not continue to seek help for this project in this forum. You may be banned from the forum if you continue.

@weaponx,

You know me - I'm pretty suspicious of malicious scripts... and I did think of that for this thread. I'll send you a PM with things that should not be discussed in an open forum.

@FreeFry,

This is just a guess.... there are countries in the world that will not let you surf from point A to point B. So people use proxies that the government has yet to block. TorPark attempts to solve this problem of having to find a working proxy.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

I see, so It's part of the Tor network then?

nvm. I looked up Torpark..

I'd thought suggest that his goals might not be malicious... perhaps all he wants is to visit myspace at his schools place, which really ain't illegal in any way. :)

If anything though, I'd suggest him to use the Vidalia package instead(tor+privoxy+the vidialia control app), then he can use ie to do his browsing.

Thought, before I provide any more help, I'll want him to provide some semi-functional code, and prove that he's really determined to make this work. muttley

Edited by FreeFry
Link to comment
Share on other sites

Yes, herewasplato is right in his answer to FreeFry, and so is freefry.

Thought, before I provide any more help, I'll want him to provide some semi-functional code, and prove that he's really determined to make this work.

I made a whole script. See post 5. I don't know what else to do, but I can try to do it if you tell me what to do.

Thanks for helping me.

Link to comment
Share on other sites

You know what?? if you simply installed Tor and used IE or Firefox as have been recommended you would probably have been finished a long time ago. I myself doesn't feel for helping someone who ask for help and then refuse to listen.

Now please stop this and go to Tor's download page and get yourself the client and start working on automating IE or FF as has been adviced MANY MANY times.

Edited by AdmiralAlkex
Link to comment
Share on other sites

The FF.au3 should work with torpark, too as it uses firefox muttley

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Now please stop this and go to Tor's download page and get yourself the client and start working on automating IE or FF as has been adviced MANY MANY times.

I apologize. I had never understood that before. I thought you were all trying to persuade me to use internet explorer instead of torpark.

I didn't know that it is possible to use torpark inside internet explorer (and I still don't understand how to do it ??? - if it really is what you meant, please tell me more about it, and tell me how I can use the Tor network inside internet explorer).

Maybe that's what you all have been saying all the time, but I never understood that. I'm sorry I didn't understand it before, as my english is not perfect.

Thanks again for your help.

Link to comment
Share on other sites

You can't use Torpark inside Internet Explorer, nor FireFox, but you can use the Tor network(with a setup with the Tor client, and the Privoxy client). Just google on Vidalia, which is a package consisting of Vidalia(a control app. for Tor), and Privoxy(a forwarding web filter)). Basically you install the package, and then Vidalia runs Tor, and Privoxy, Privoxy forwards connections made to it, to Tor, making it possible to setup your webbrowser to use Privoxy, as a proxy.

You can read more of how it works on the Vidalia home page.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...