 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Phlaude
Joined: 06 Apr 2005 Posts: 23
|
Posted: Wed Apr 06, 2005 2:21 am Post subject: My botting script |
|
|
Hello everyone. I have question that's a bit complicated, so I will try my best to explain it. I recently wrote a botting script for an RPG game to help level my character. So far it works pretty well, but has a few quirks I'm trying to iron out.
The script has several loops, the main loop simply switches between two other loops; the walk loop and the attack loop. I'm using PixelSearch to check a portion of the screen ahead and behind my character (he's an archer). So the script starts out in the walk loop and my character walks around, checking for enemies. When it finds one, it exits the walk loop and enters the attack loop. It first checks if the enemy is still there, then sends an attack, then checks again, and so on until the enemy is dead. (There are other checks for enemies behind, but that's not relevant to my problem.) Then it goes back to the walk loop and moves around again.
My problem lies in the game's attack key. It is set to 'a' on the keyboard. After an attack is sent, I have to wait a certain amount of time for the attack to finish, before I can do another check to see if the enemy is still alive. This introduces a small delay between attacks and sometimes the check happens too soon, causing my character to be idle. I was hoping to use {a down} while I do checks on the monster and then {a up} when it's dead. This would be the perfect way, because there would be no delay between attacks. Unfortunately the game doesn't allow this, it wants actual 'a' characters sent, not simply the state of the key.
Now, what I want to do is send the 'a' character continuously, while checking if the monster is still alive. Once it's dead, I need it to stop sending 'a' characters. After sifting through the AutoHotKey user manual, the only way I found was to use the Run command and start/stop another script which simply sends 'a' characters over and over.
I was wondering if someone could suggest a better way to do this. Is there some way to run two separate scripts from a single .ahk file and have them interact with each other? Also, if the above explanation sounds confusing, all I'm trying to do is continuously send the letter 'a' while I'm doing checks inside a loop using PixelSearch. Once a certain condition is met, I want to stop sending the letter 'a'. Any suggestions regarding this would be appriciated. |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2436
|
Posted: Wed Apr 06, 2005 5:54 am Post subject: |
|
|
One way might be to use a timer for pressing 'a'. Your timer could keep sending 'a' over and over until you stop the timer.
| Code: | ; ...
; if enemy found
SetTimer, KeepShooting, 250
; start code to test if shooting is still necessary
; if check = stop shooting
SetTimer, KeepShooting, Off
; ...
KeepShooting:
Send, a
Return |
|
|
| Back to top |
|
 |
Phlaude
Joined: 06 Apr 2005 Posts: 23
|
Posted: Wed Apr 06, 2005 6:34 am Post subject: |
|
|
| Thank you corrupt, that's pretty much what I wanted. I missed the timed subroutine section while skimming the help file. There are simply so many commands, I probably wouldn't have realized SetTimer was what I needed. I have a rather limited programming/scripting background, so the usefulness of certain things isn't always immediately apparent. Thanks again for pointing this out to me, it will definately help. >_> |
|
| Back to top |
|
 |
valenfor
Joined: 26 Feb 2005 Posts: 20
|
Posted: Mon Apr 11, 2005 5:54 pm Post subject: Gaming and Bots |
|
|
I just wanted to write a two cent piece for anyone who is thinking of botting a game. You had better think human instead of speed and here is why:
Every action, click and possible mouse movement can be tracked via the client software and sent back. Not a big deal right? Well how do bot'rs get caught then? Because everything is logged. If you are able to send that A key once every 100 ms then you OBVIOUSLY aren't a human.
Lets look at scenario number two - you decide to use a consistent pause time (say 2000ms or 2 seconds) so whats the chance a human is going to make a perfect 2 second keystroke 100 times?
Just points to ponder - there a million other ways we track (having worked with Bots used against the Casino and Gaming industry ALOT). But some things to keep in mind to keep your account from getting banned. Its not usual that a user agreement allows bot's etc.
V. |
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5390 Location: /b/
|
Posted: Mon Apr 11, 2005 8:09 pm Post subject: Re: Gaming and Bots |
|
|
| valenfor wrote: | | Every action, click and possible mouse movement can be tracked via the client software and sent back. |
This obviously depends on the game and it's security / anti-bot detection. Provided you use good use of Random, SetBatchLines/Sleep, SetKeyDelay, SetMouseDelay, SetDefaultMouseSpeed and etc, circumventing dectection would be easier. _________________
 |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|