Jump to content

help with making a bot type script


Recommended Posts

Okay so recently I have been trying to create a bot for a game, but the only problem is that the game often goes back to the login screen and upon loging back in crashes, but I haven't been able to figure out how to program the autoit script how to detect that its at the login screen once again and to reboot the game. I was wondering if the pixelsearch command is what i needed and how i might use that?

If anyone could help me on this I would be really grateful, i also would love it if i could do a instant messaging session via AIM or MSN, i am willing to pm/post my account if that's an option with you.

Thanks so much.

Link to comment
Share on other sites

Okay so recently I have been trying to create a bot for a game, but the only problem is that the game often goes back to the login screen and upon loging back in crashes, but I haven't been able to figure out how to program the autoit script how to detect that its at the login screen once again and to reboot the game. I was wondering if the pixelsearch command is what i needed and how i might use that?

If anyone could help me on this I would be really grateful, i also would love it if i could do a instant messaging session via AIM or MSN, i am willing to pm/post my account if that's an option with you.

Thanks so much.

To check if your at the "login screen", you could do something like this with PixelCheckSum()

Dim $sum = PixelChecksum(left,top,right,bottom)
MsgBox(0,"PixelCheckSum()",$sum)

Edit the above and specify the area of the game, then run it, and copy down the text in the MessageBox.

Once you have the sum, you can do something like this: to see if your at the login screen.

Dim $sum = PixelChecksum(left,top,right,bottom)

    If $sum = "" Then
        MsgBox(0,"","We are at the login screen!")
    Else
        MsgBox(0,"","Seem to be logged in")
    EndIf

You will once again have to specify the area, and then fill in the empty quotes with the sum you got from before.

As for detecting the crashing, you could use ProccessExists() (if the game closes completely).

For re-opening the game, look up ShellExecute() / Run()

Edited by bill88
Link to comment
Share on other sites

ok yes you would have to use the pixel strings

i kinda did this for one game..

you also mightr need

WinExists(

to check if the game is running (if it closes when crashed)

and also to check if the crash window is up

then

Run(

to re run the program

winwait

to wait till the game has loaded

then you will need to use

PixelGetColor (

unique individual pixels on the login and loading screens. easyest way is to run the game full screen..

on one loading screen hit print screen .. minimise .. open paint.. copy paste then use the co-ords from paint and check the pixels color with Au3info.exe attached below.

do that for all the loading screens till its on the login screen then do the same for the login screen.

there are more tutorials around the forums on pixels wicxh you will find helpfull then there is the help file.

what you looking for is somet like

pixel get color

if color = blablabla then

sleep(100)

get color of the secon loading screen color. or login or what ever

if ect ect ect

i also advise a mous click befor you send the login data. as it doesnt always make the game the main sctive window...

hope this helped a little...

sorry if its confusing.. but its late at night here

Edited by Thornhunt

Budweiser + room = warm beerwarm beer + fridge = too long!warm beer + CO2 fire extinguisher = Perfect![quote]Protect the easly offended ... BAN EVERYTHING[/quote]^^ hmm works for me :D

Link to comment
Share on other sites

To check if your at the "login screen", you could do something like this with PixelCheckSum()

Dim $sum = PixelChecksum(left,top,right,bottom)
MsgBox(0,"PixelCheckSum()",$sum)

Edit the above and specify the area of the game, then run it, and copy down the text in the MessageBox.

Once you have the sum, you can do something like this: to see if your at the login screen.

Dim $sum = PixelChecksum(left,top,right,bottom)

    If $sum = "" Then
        MsgBox(0,"","We are at the login screen!")
    Else
        MsgBox(0,"","Seem to be logged in")
    EndIf

You will once again have to specify the area, and then fill in the empty quotes with the sum you got from before.

As for detecting the crashing, you could use ProccessExists() (if the game closes completely).

For re-opening the game, look up ShellExecute() / Run()

This worked incredibly well thanks, but i would love it if i could talk to you for further information on how i could do the reloading. would you be willing to instant message with me?

Link to comment
Share on other sites

This worked incredibly well thanks, but i would love it if i could talk to you for further information on how i could do the reloading. would you be willing to instant message with me?

reloading would consist of

winexist(cl;ient name)

if exisists then

make active or close

else

run (client path)

winwait(till the client has loaded up)

winactive(make active programe)

----then do the loading screen pixel checking ect ect

Budweiser + room = warm beerwarm beer + fridge = too long!warm beer + CO2 fire extinguisher = Perfect![quote]Protect the easly offended ... BAN EVERYTHING[/quote]^^ hmm works for me :D

Link to comment
Share on other sites

Thank you soo much for this help it is exactly what i needed to get it working. I don't mean to be of nuisance but what might the command be to send a full string of text, such as a password to a area where it's already clicked?

I just started learning AutoIt today so I'm still very new.

Link to comment
Share on other sites

Thank you soo much for this help it is exactly what i needed to get it working. I don't mean to be of nuisance but what might the command be to send a full string of text, such as a password to a area where it's already clicked?

I just started learning AutoIt today so I'm still very new.

send("blablabla")

>_<

if you get stuck on some of the strings. have a search in the helpfile.. or look at some of the example scripts that come with autoit.. you will find alot of help within them. there are also a few good small beginner tutorials around here

Budweiser + room = warm beerwarm beer + fridge = too long!warm beer + CO2 fire extinguisher = Perfect![quote]Protect the easly offended ... BAN EVERYTHING[/quote]^^ hmm works for me :D

Link to comment
Share on other sites

I've run into another snag, i was wondering if you might know what is wrong, i have the script so it will load that game and everything, and i have

Do

Sleep(200)

dim $sum = PixelChecksum(0,0,25,25)

Until $sum = "4166564611"

so that it will detect the login screen, but when it finally shows up the script just sits idle and doesn't do anything. What could be wrong with this?

Link to comment
Share on other sites

I've run into another snag, i was wondering if you might know what is wrong, i have the script so it will load that game and everything, and i have

Do

Sleep(200)

dim $sum = PixelChecksum(0,0,25,25)

Until $sum = "4166564611"

so that it will detect the login screen, but when it finally shows up the script just sits idle and doesn't do anything. What could be wrong with this?

You have an infinite loop that repeatability checks the sum.

You should only need to check it once in a while.

Edited by bill88
Link to comment
Share on other sites

Actaually i just figured this out and i feel really stupid the loop actually does work just like i wanted it to, it stops when game loads, but there is actually like a 10 second delay between the ability to login after it detects the screen =/....Solved

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...