Randomness in AutoHotkey menu

User Tag List

Results 1 to 3 of 3
  1. #1
    KAPITANmocz's Avatar Member
    Reputation
    1
    Join Date
    Jun 2012
    Posts
    2
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Randomness in AutoHotkey

    I'm a big noob with scripting things and i need some help.

    How can i make these numbers below as randoms ones

    MouseClick, left, 841, 560
    SLeep, 300


    Thanks in advance :]

    Randomness in AutoHotkey
  2. #2
    SpamBearz's Avatar Banned
    Reputation
    1
    Join Date
    Jun 2012
    Posts
    10
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've never used autohotkey before, but a quick google search brought me to here: Random

    Code:
    Random, OutputVar [, Min, Max]
    Random, , NewSeed
    So, to do something like that, you should make 2 variables. RandX and RandY. Then simply use the format below:
    Code:
    Random, rand, 1, 10
    .

    So, for the coords in your post, something like:

    Code:
    Random, RandX, 839, 844
    Random, RandY, 555, 565
    MouseClick, left, RandX, RandY
    Sleep, 300
    Again, I've never used autohotkey, so I can't test that. But it should be working. Cheers!

  3. #3
    Chucksta's Avatar Member
    Reputation
    1
    Join Date
    Mar 2007
    Posts
    34
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As SpamBears says, plus:

    if I wish to have the bot click on a random location on a button, I find the coordinates of:
    The button's top left X, Y coordinates, e.g. 85, 401
    The button's bottom right X, Y coordinates, e.g. 367, 438

    Then generate the X and Y coordinates I wish the script to use:
    Random, Xcoord, 85, 367
    Random, Ycoord, 401, 438

    And finally make the click
    MouseClick, left, Xcoord, Ycoord

    The above example is for the START button in a game window with resolution of 800, 600

    For the sleep part, you could just:
    Random, randSleep, 250, 350
    Sleep, randSleep

Similar Threads

  1. random phrases
    By soulstruck11 in forum Community Chat
    Replies: 4
    Last Post: 02-04-2007, 10:52 PM
  2. funny/random pics
    By Ark in forum World of Warcraft General
    Replies: 5
    Last Post: 01-19-2007, 07:21 PM
  3. Random WoW Guide ($9.00)
    By Amedis in forum World of Warcraft Guides
    Replies: 14
    Last Post: 01-02-2007, 05:14 PM
  4. Bugged Head, and random help needed.
    By Painhurtz in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 12-19-2006, 06:47 PM
  5. random video i think is funny
    By WOWISFUN in forum World of Warcraft General
    Replies: 3
    Last Post: 11-26-2006, 06:29 PM
All times are GMT -5. The time now is 09:47 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search