Jump to content

Recommended Posts

Posted

Hi everyone, I'm in need of a little help. I'm trying to use Autoit to select some variables in an order, here is the code, to make you understand.

 

 

Dim $0,$1,$2,$3,$i,$t,$Link,$Linkverif,$Adress,$valid

 

$t = "$"

$u = 0

$0 = "http://www.linkbee.com"

$1 = "http://www.facebook.com"

$2 = "http://www.myyearbook.com"

$3 = "http://www.playingsince198x.fr"

 

Mouseclick ( "left", 185, 1035, 1, 0) ; Démarrage de Google Chrome

sleep (500) ; Sécurité pour avant sélection de la fenêtre

Winactivate ( "Nouvel onglet - Google Chrome")

WinSetState ( "Nouvel onglet - Google Chrome", "", @SW_MAXIMIZE) ; Mise de la fenêtre en plein en écran

 

For $i = 0 To 4

 

 

$valid = Random (0,1)

 

If $valid < 0.51 Then

Send ("^t")

sleep (100)

MouseMove (0,0,0)

$u = $t + $i

Send ($u)

Send ("{ENTER}")

sleep (50)

EndIf

 

Next

 

 

 

the aim of the program is to open Google Chrome, use CTRL + T to open new windows, and then enter a random adress. It must do it for many adresses, not only 4, but it's just the beginning of the coding.

I know what I wrote with $u (into the if function) is not correct, but I can't figure out a way to manage it. The first aim was to randomly choose X variables between $0 to $x but I couldn't find a way, so I used For...Next and use a random function to make it type an adress 1 out of 2 times (more or less, I don't care it must be random).

 

If you know either a way to randomly choose a variable or to make the For... Next thing works, could you help me please ?

Posted

Hi

I think you'd be much better off posting this is in an AutoIt forum as I can't see any educational use for your script at all :)

 

In fact - it looks like your trying to write some sort of pop-up generator and we are more in the business of blocking such things :)

 

regards

 

Simon

Posted
Let me explain, it's not a popup generator, this program is for personnal use, in fact, I don't even know if we can use autoit on other computers, without letting know to the user (because of the icon appearing on the side of the clock). No the aim is to simulate internet traffic, to know how much bandwidth I would use by surfing on internet (because in Belgium, the bandwidth is limited every month), so I want to simulate an extreme amount of connections, like if I had surfed during one month :)
Posted

If I was creating an AutoIt script like yours, I would use the IE UDFs simply because they do most of the hard work for you, like navigating to websites, clicking buttons, refreshing pages and so on (more details and examples in the help file). Here's a very simple script...

 

#include 
$oIE = _IECreate ("http://www.edugeek.net")
Sleep(3000)
_IENavigate ($oIE, "http://www.bbc.co.uk")
Sleep(3000)
_IENavigate ($oIE, "http://www.facebook.com")

 

I don't even know if we can use AutoIt on other computers, without letting know to the user (because of the icon appearing on the side of the clock).

Adding #NoTrayIcon to the top of your script will prevent that icon from appearing in the notification area.

 

No the aim is to simulate internet traffic, to know how much bandwidth I would use by surfing on internet (because in Belgium, the bandwidth is limited every month), so I want to simulate an extreme amount of connections, like if I had surfed during one month :)

Maybe I'm missing something but wouldn't it be much easier, not to mention more accurate, to use a bandwidth monitoring program like NetWorx instead of an AutoIt script to do this? Just leave it running in the background for a month while you surf the Internet and you will then have a good idea of how much bandwidth you use. :)

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



×
×
  • Create New...