AutoHotkey Community

It is currently May 27th, 2012, 1:54 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Game hacking
PostPosted: January 25th, 2010, 11:49 pm 
Offline

Joined: January 25th, 2010, 11:34 pm
Posts: 33
Hi,

This is my first thread and I'm new to AHK. Plz bare with me.

I play an online game call Zero Online. I created a simple hotkey to take out the manual clicking from A to B for 100 times. Such as, when I sell an item in my inventory (point A) to the market (point B). It works! The only problem is the the game developer think that I'm using an illegal autoclick program to cheat in the game; thus, locking me away in a botjail.

My question is, how does the game developer knows that I'm using an autoclick program? And, how do I script so that this seems like a real person sitting in front of their computer clicking and the game developer would approve it? This is done on Window 7 pro 64. Thanks!!

Here is my code in its simplest form:

^+d:: ; to sell inventories

$Right:: ; cancel loop with Right
Loop 100
{
If GetKeyState("Right", "P")
Break ; Break out of the loop
else
Click 843, 53 ; click on item to sell
Sleep 700
Click 214, 248 ; sell item
Sleep 500
}
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 26th, 2010, 12:29 am 
Offline

Joined: August 23rd, 2004, 10:06 pm
Posts: 276
Location: East Bay, California USA
on your Clicks change the place where is click ever so slightly so it still clicks on that box or what ever and then the next click to be in a slightly different area to make it look more like a human is using the mouse.
also i find that a set key delay will help to make it not run so super fast. but i see you have a sleep in the script there too, so maybe they can tell you are running that same thing every 1/2 second.
About the different mouse click area i think someone else here has written something like that changes the mouse clicks to move a bit each time.

_________________
----------------------------
Wingfool you fat! I mean, Wingfat you fool!
Line from Woody Allen's movie "What's Up Tiger Lilly?"
-----------------------------


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 26th, 2010, 1:40 am 
Offline

Joined: January 25th, 2010, 11:34 pm
Posts: 33
Thank you for your response. Since I'm only a few days old to AHK, if someone can point me in the right direction, that would be great.

I've thought about randomize my click too, but I have no idea how to code something that complicated. I'm not a programmer by nature, so AHK doesn't come naturally to me. If someone can help me modify my codes to add in a random plus/minus 5 in the xy coordinates of my clicks, that would be great. Or point me to the right thread and I'll read and study it. I know the codes will be hard to decipher, but I'll give it a shot.

Thanks again.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 26th, 2010, 6:52 am 
Offline

Joined: January 25th, 2010, 3:56 am
Posts: 11
I only started this 2 days ago but this should work
Code:
^d:: ; to sell inventories

$Right:: ; cancel loop with Right
Loop 100
{
If GetKeyState("Right", "P")
Break ; Break out of the loop
else
Random, RandomX , 1, 1000 ;make a random number between 1 and 1000
Random, RandomY , 1, 1000
Click 843, 53 ; click on item to sell
Sleep 700
Click 214, 248 ; sell item
Sleep 500
Click %RandomX%, %RandomY% ; Randomly clicks at X and Y
sleep 250
}
Return


Try this, it will generate a random mouse position each time it loops and click on it then make a new mouse position and click on it etc.

EDIT it works i just tried it =P, use [script][/script] to add your script in next time

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 26th, 2010, 4:08 pm 
Offline

Joined: July 6th, 2009, 9:58 pm
Posts: 678
That is going to get you banned again. If you continuously click in the same place on the buttons, in the same screen window positions, that 'warden' is going to know it.

You need to randomize the place that it actually clicks so that it still clicks the button but in a random location each time.

The random screen position click isn't a bad idea in theory, though...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 26th, 2010, 5:19 pm 
Offline

Joined: June 21st, 2009, 8:22 pm
Posts: 47
i made a bot some time ago with random clicks and random sleeps. i made them into functions looking like this:

Code:
sleepran( time, difference )
{
   min := time - difference
   max := time + difference
   random, rand, min, max
   sleep %rand%
}


sleepran( 500, 100 ) will sleep a random amount of time between 400 and 600 miliseconds.

Code:
clickran(xmin,xmax,ymin,ymax)
{
   random,x,xmin,xmax
   random,y,ymin,ymax
   click %x%, %y%
}


i made a little script for this one which generates the functions name and parameters:

Code:
x::
mousegetpos,x,y
return
y::
mousegetpos,x2,y2
clipboard = clickran(%x%,%x2%,%y%,%y2%)
return


if i run that and press X on the top left corner of the square to random click in and Y on the lower right corner it will put the function name and parametes in the clipboard so ou can paste it.

for eXample i do it on the preview button in here it will look like this:

Code:
clickran(882,949,537,548)


this will click random on a place in the preview button, a different place ever time i do it.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 26th, 2010, 6:02 pm 
Offline

Joined: January 26th, 2010, 4:01 pm
Posts: 8
you will need to measure the buttons that you need to press.
type the coordinates where QWAS are.
q is the top left
a is the bottom left
etc...

Code:
^d:: ; to sell inventories

$Right:: ; cancel loop with Right
Loop 100
{
If GetKeyState("Right", "P")
Break ; Break out of the loop
else
Random, RandomX , A, Q
Random, RandomY , S, W
Random, RandomX2 , A2, Q2
Random, RandomY2 , S2, W2
Random, Time, 500, 700
Click %RandomX%, %Randomy% ; click on item to sell
Sleep %time%

Click %RandomX2%, %RandomY2% ; sell item
Sleep %time%

}
Return


i hope that is not confuse and it works


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 26th, 2010, 6:12 pm 
Offline

Joined: January 25th, 2010, 11:34 pm
Posts: 33
Wow! These tips are AWESOME! Thank you.

I will try to decipher this randomize coding and try it out. It's ok if I get ban since it'll be a test character after a few hours of playing. I will report back with my script and the results to return the favor for your helps.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Your script works
PostPosted: January 26th, 2010, 7:22 pm 
Offline

Joined: January 25th, 2010, 11:34 pm
Posts: 33
Fredramone, your scripts works great! I drew 2 rectangles in paint, run your script and it put random dots at random time between 1 and 2 sec within those 2 boxes.

Can't wait to try it ingame. I just hope that the "warden" will not detect this. Thank you to all others for your valuable insights too.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 26th, 2010, 7:49 pm 
Offline

Joined: July 6th, 2009, 9:58 pm
Posts: 678
I've done a bit of thinking about this in the last six months... here's my rough treatise on the subject of game automation in AHK. I very openly invite anyone with additional or conflicting information to post your thoughts.

NOT GETTING BANNED
The first assumption that must be made is that the game that you are playing cannot detect the fact that you are using Send or ControlSend. You should first google the game that you are automating and see if others have been banned.

In all cases if possible you should use a 'trial' account for this. You must also be aware that many companies will investigate or even automatically ban other accounts by IP address - use an anonymous proxy for all of your testing.

Going further down this road (and you MUST go all the way down this road if you want to be safe about it) with that is that you should actually use a clean game install folder - preferably to a different drive letter entirely, than the one you normally use for playing the game. The reason for this is that, as I have 'friend' confirmation on it, is that at least two popular games will store client/account logon data locally and check for this as well.

A breakdown of true security for your main account: You should use a different machine under a different login name through an anonymous proxy to access the game for any automation testing before putting your beloved purples at risk.

NOT GETTING DETECTED
From my experience the most frequently used method for detection, especially by the web-based MMO's, is repetition. If you continually click in the same location repeatedly after taking an action in the game, i.e. you are (as above) selling objects from a place in your bag, clicking in the same bag location (same pixel location on that bag item) over and over to move it into the sell field or select it is going to be detected. The same goes for internal (game side) macro commands that are spammed into the console much faster than you could ordinarily do so. (runequest, I think)

You also don't want to hit the button EVERY SINGLE TIME on the first click. This is another method these games use to detect input.

Really what you are doing here is emulating human behavior in a way that a machine is UNLIKELY to detect. To that effect I recommend the following method for clicking buttons or controls: (untested)
Code:
ClickButtonRandom(TopLeftX, TopLeftY, BottomRightX, BottomRightY)
{
   Random, ExtraClicks, 0, 1
   Random, Sleep, 500, 1000
   Random, X, %TopLeftX%, %BottomRightX%
   Random, Y, %TopLeftY%, %BottomRightY%
   Random, DC, 0, 1
   
   
   Sleep, %sleep%
   Click, %X%, %Y%
   If DC ;randomly double click
   {
      Click, %X%, %Y%
   }
   
   
   If ExtraClicks ;half the time throw another click in there
   {
      Sleep, 100 ;
      While ExtraClicks
      Random, XSeed, 1, 8
      Random, YSeed, 1, 8
      X := X+Seed
      Y := Y+Seed
      Click, %X%, %Y%
   }
   
   Return      
      
}


Some of the random people behaviors you may want to think about emulating in your script:
-User accidentally clicks outside the box
-(in closed environments) user accidentally clicks the wrong button on occasion, and then cancels that window and goes back to what they were doing
-User occasionally opens their friends list for a random period of time, maybe clicking on a name
-User occasionally takes a break of 3-4 minutes
-User responds to tells (difficult to emulate I know)
-(in the bags case) user occasionally closes the bag window on accident and then randomly presses 'b' OR clicks on the bag button to open it back up

While scripts can be quite close-ended, when you know that all you have to emulate to get past the detectors is enough random human stupidity then it's not so impossible to sneak past the jailer.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 26th, 2010, 8:21 pm 
Offline

Joined: October 17th, 2009, 8:54 pm
Posts: 43
from a past project... I just used a center point and a random delta that I called jitter... the default is to click within 4 pixels radius of center. call it with a value for jitter if you want more than that...

if a warden examined human click patterns it would find that the distribution is NOT truly random, but more inclined to gravitate towards a theoretical center of the target. with decreasing probability as you move from the center point.


untested example...
Code:
;------------------------------------------
clickRand(axis,jitter=4){  ;//randomize the target locations
;------------------------------------------
 Random target1,axis-jitter,axis+jitter
 Random target2,axis-jitter,axis+jitter
 Random target3,axis-jitter,axis+jitter
 target=(target1+target2+target3)/3
 return target
 ;//the averaging of 3 random points causes a bell curve distribution
 ;//near the center to simulate more closely a human click pattern
}
;------------------------------------------
randWait(center=80,jitter=50){
;------------------------------------------
 ;//this causes a pause between 30ms and 130ms with a logrithmic probability towards the center, so on average it is around 80ms.
 pause:=0
 Random delay,center+jitter,center-jitter
 pause+=delay
 Random delay,center+jitter,center-jitter
 pause+=delay
 Random delay,center+jitter,center-jitter
 pause+=delay
 pause:=pause/3
 sleep pause
 return
}

;------------------------------------------
;USAGE....
;------------------------------------------

;//normal click patterns...
Xpos:=120    ; A target x position on screen
Ypos:=60      ; a target Y position on screen
mouseMove,clickRand(Xpos),clickRand(Ypos),0
randWait()
sendInput {click}

;//Shakey after a night on the booze....utilising the jitter....
Xpos:=120    ; A target x position on screen
Ypos:=60      ; a target Y position on screen
mouseMove,clickRand(Xpos,50),clickRand(Ypos,50),0
randWait(200,100)
sendInput {click}



Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo, Bing [Bot], engunneer, sjc1000, Yahoo [Bot] and 20 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group