+ Post New Thread
Results 1 to 5 of 5
Scripts Thread, Autoit - Select variables in Coding and Web Development; Hi everyone, I'm in need of a little help. I'm trying to use Autoit to select some variables in an ...
  1. #1

    Join Date
    Apr 2010
    Posts
    3
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Autoit - Select variables

    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 ?

  2. #2

    SimpleSi's Avatar
    Join Date
    Jun 2005
    Location
    Lancashire
    Posts
    5,808
    Thank Post
    1,476
    Thanked 592 Times in 444 Posts
    Rep Power
    168
    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

  3. #3

    Join Date
    Apr 2010
    Posts
    3
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    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

  4. #4


    Join Date
    Feb 2007
    Location
    51.405546, -0.510212
    Posts
    8,754
    Thank Post
    221
    Thanked 2,627 Times in 1,937 Posts
    Rep Power
    779
    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...

    Code:
    #include <IE.au3>
    $oIE = _IECreate ("http://www.edugeek.net")
    Sleep(3000)
    _IENavigate ($oIE, "http://www.bbc.co.uk")
    Sleep(3000)
    _IENavigate ($oIE, "http://www.facebook.com")
    Quote Originally Posted by AcidBurn View Post
    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.

    Quote Originally Posted by AcidBurn View Post
    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.

  5. #5
    superfletch's Avatar
    Join Date
    Nov 2007
    Location
    South
    Posts
    434
    Thank Post
    146
    Thanked 77 Times in 61 Posts
    Rep Power
    31
    I would take a day off and surf the web all day.

    Then multiply what you've done by 30.

    One months heavy traffic.

SHARE:
+ Post New Thread

Similar Threads

  1. adding Environment Variables?
    By GiantEnemyAnt in forum Scripts
    Replies: 7
    Last Post: 11th August 2009, 08:17 PM
  2. Environment Variables Again
    By Reaper in forum Scripts
    Replies: 2
    Last Post: 19th February 2009, 04:45 PM
  3. PHP variables
    By Hightower in forum Web Development
    Replies: 8
    Last Post: 2nd December 2008, 01:54 PM
  4. using variables in wget etc
    By RabbieBurns in forum *nix
    Replies: 6
    Last Post: 31st July 2008, 09:23 PM
  5. Server Variables on CC3
    By gibbo_ap in forum Web Development
    Replies: 2
    Last Post: 24th April 2008, 02:48 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •