Jump to content

Need some help making script for a game


Recommended Posts

Hi everyone, I'm new to AutoIt scripting, but know how to program in VB.NET. I'd like to make an AutoIt script for a game that's already open. I got the title of the window using the AutoIt Window Info tool, but don't know how to make sure my script only runs in the game window. Basically I want to have several keys pressed automatically, at certain intervals, like every 20 minutes. Also, I want to move the mouse pointer to a certain location on screen, and press the left mouse button, after pressing one of the keys. To make things clearer, here's an example:

Step 1. Once I start script, I want it to switch to the game window

Step 2. Press F12

Step 3. Press F5

Step 4. Wait a couple seconds (between 7 and 10 seconds, not sure yet), then move the mouse to a certain location (it's the same location every time, but I'm not sure how to figure out how to get it) and press the left mouse button

Step 5. Press F12 again.

Then I want to repeat steps 2 through 5 every 20 minutes until I decide to stop the script(not sure how to do that either), or for a set number of times declared in the script.

I tried to search, but I'm still really confused by all this script stuff, I'm used to the easy drag-and-drop controls of VB.net, lol.

Thank you for any help.

Edited by evilbutterfly
Link to comment
Share on other sites

Hi there,

Here is something to you to find in help file :D

WinActivate

ControlSend or Send

MouseMove

Sleep

AdlibEnable

AdlibDisable

cheers.

Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Link to comment
Share on other sites

OK, I'm having problems, once I use WinActivate to switch focus to the game, nothing else in my script works, the buttons don't press and the mouse doesn't move, nothing happens, here's the code I have so far.

Opt( "SendKeyDownDelay", 1000)
Send( "{F12}", 1 )
Opt( "SendKeyDownDelay", 3000)
Send( "{F5}", 1 )
Sleep(7000)
MouseMove ( 960, 384)
MouseClick( "left")
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...