Blizzhackers

Home of the Dupe since 2001

* Login   * Register    * FAQ    * Search

Join us on IRC: #bh@irc.synirc.net (or Mibbit Web IRC)


MuleFactory


It is currently Sat Dec 20, 2014 10:28 pm


All times are UTC [ DST ]





Post new topic Reply to topic  [ 47 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: [AutoIt] Creating Bots (for newbies)
PostPosted: Thu Sep 11, 2008 2:13 am 
 
Banned
Banned
User avatar

Joined: Sat Sep 06, 2008 7:18 am
Location: USA, TX
I created this post because I want to suck up space and waste peoples time who read it, if you don't like what I have to say, just move on and ignore me hence-fourth, thank you.

Bots are created for generic routines for any game. I'll list examples (a couple):

1) Diablo II -- Chaos running, Baal running, "Magic Finding," etc.
2) RuneScape -- "Fishing," "Cutting trees," and "Cooking" to make higher skill levels.

If you're new to programming, AutoIt (a scriptting language) would be a great start.

The main things that you (I personally) use the most is:
- Pixel detection
- Mouse emulation
- Keyboard emulation
If you want to go a few steps further, you can use packets which I suppose would give you a faster/better reaction, for multiplayer games.

AutoIt can be found here: http://www.autoitscript.com/autoit3/

You can use AutoIt for just about every type of game, you can even use it for the most basic of things, for example:

The beginning of a game on StarCraft. Have AutoIt create an SCV instantly and have all SCVs mine individual mineral packs so they gather faster.
Or on Age of Empires, you can have it build a (pretty and) organized row of Houses, in a split second. Which I used to use VBS for that in 1998.
You could even use AutoIt to notify people you're about to create a game, and then have it create it -- It beats using a bot in a channel to tell everybody what game name/pass/number you're on.

The list can become endless, there are many repeditive things on games of every genre.

You could even use bots to beat games entirely without lifting a finger! Like The Incredible Machine (aka TIM), and Jazz Jack Rabbit.

If you're serious about wanting to learn how to make bots for games, pick the stupidest but most simple things.

Projects for people who are 100% new and want to create bots (Diablo II):
- Use AutoIt and have it spam "Welcome to" so and so's "runs!"
- Use AutoIt and have it drop X amount of gold repeatedly until you press a hotkey to stop.

Projects for people who are 100% new and want to create bots (RuneScape):
- Use AutoIt and have it click on a tree every X seconds
- Use AutoIt and have it create a fire every X seconds

It's the little things in life that make the best improvements.

AutoIt has a help file which explains nearly every command (with examples) in great detail. Very helpful.

_________________
Image

Top
 Profile  
 Post subject: Re: [AutoIt] Creating Bots (for newbies)
PostPosted: Fri Sep 12, 2008 1:32 pm 
 
User
User
User avatar

Joined: Sat Jun 21, 2008 7:07 am
Muted wrote:
I created this post because I want to suck up space and waste peoples time who read it, if you don't like what I have to say, just move on and ignore me hence-fourth, thank you.

Bots are created for generic routines for any game. I'll list examples (a couple):

1) Diablo II -- Chaos running, Baal running, "Magic Finding," etc.
2) RuneScape -- "Fishing," "Cutting trees," and "Cooking" to make higher skill levels.

If you're new to programming, AutoIt (a scriptting language) would be a great start.

The main things that you (I personally) use the most is:
- Pixel detection
- Mouse emulation
- Keyboard emulation
If you want to go a few steps further, you can use packets which I suppose would give you a faster/better reaction, for multiplayer games.

AutoIt can be found here: http://www.autoitscript.com/autoit3/

You can use AutoIt for just about every type of game, you can even use it for the most basic of things, for example:

The beginning of a game on StarCraft. Have AutoIt create an SCV instantly and have all SCVs mine individual mineral packs so they gather faster.
Or on Age of Empires, you can have it build a (pretty and) organized row of Houses, in a split second. Which I used to use VBS for that in 1998.
You could even use AutoIt to notify people you're about to create a game, and then have it create it -- It beats using a bot in a channel to tell everybody what game name/pass/number you're on.

The list can become endless, there are many repeditive things on games of every genre.

You could even use bots to beat games entirely without lifting a finger! Like The Incredible Machine (aka TIM), and Jazz Jack Rabbit.

If you're serious about wanting to learn how to make bots for games, pick the stupidest but most simple things.

Projects for people who are 100% new and want to create bots (Diablo II):
- Use AutoIt and have it spam "Welcome to" so and so's "runs!"
- Use AutoIt and have it drop X amount of gold repeatedly until you press a hotkey to stop.

Projects for people who are 100% new and want to create bots (RuneScape):
- Use AutoIt and have it click on a tree every X seconds
- Use AutoIt and have it create a fire every X seconds

It's the little things in life that make the best improvements.

AutoIt has a help file which explains nearly every command (with examples) in great detail. Very helpful.


n1 :)

and feel free to drop me pm if someone needs help or something..
i'm pretty advanced and stuff with autoit :) i think O,o

but if you need some help/example or something drop me pm..

Top
 Profile  
 Post subject: Re: [AutoIt] Creating Bots (for newbies)
PostPosted: Fri Sep 12, 2008 11:58 pm 
 
Banned
Banned
User avatar

Joined: Sat Sep 06, 2008 7:18 am
Location: USA, TX
thunderi1 wrote:
n1 :)

and feel free to drop me pm if someone needs help or something..
i'm pretty advanced and stuff with autoit :) i think O,o

but if you need some help/example or something drop me pm..


It'd be better if somebody (anybody *) had a question or problem, to just post.

_________________
Image

Top
 Profile  
 Post subject:
PostPosted: Sun Sep 14, 2008 3:24 pm 
 
User
User

Joined: Fri Jan 18, 2008 12:53 am
If I may add to easy projects to get started, in this case D2.

Try for example a auto bo script, auto bonewaller for UT etc. Pretty easy to do and you get the feeling for functions.

I'm pretty new to it aswell but what I sofar have is a d2starter with a gui where I can start 4 diablo's with specific name and either with or without plugins. And a little prog from where I can start the bw sequince or bo sequince without needing to have those screens up. Not that advanced stuff but was nice screwing around with and very usefull at the start of the ladder for UT's.

Also for GUI's I recomend Kodac because it's easy to use and helps alot imo.

As for questions, so far pretty much all answers I found quick and easy on the autoit forums by using the search and just typing in terms of what I wanted to do. Usually you will find someone who posted a script with similair questions and answers which also gives some extra to see how others fix problems.

Top
 Profile  
 Post subject:
PostPosted: Mon Sep 15, 2008 5:18 pm 
 
User
User

Joined: Tue Apr 15, 2008 3:59 pm
im pretty new in autoit, but i need help... im playing in browser game ( like laddershasher, but other one), this game hasnt any anti-hacks protection, sometimes admis sends pm's to ppl.... and here is my question, where pm box window pops up, script should answer him...always he asks-" Hi, r u there?". is it possible?

Top
 Profile  
 Post subject:
PostPosted: Mon Sep 15, 2008 6:11 pm 
 
Banned
Banned
User avatar

Joined: Sat Sep 06, 2008 7:18 am
Location: USA, TX
Grucha-Bks wrote:
im pretty new in autoit, but i need help... im playing in browser game ( like laddershasher, but other one), this game hasnt any anti-hacks protection, sometimes admis sends pm's to ppl.... and here is my question, where pm box window pops up, script should answer him...always he asks-" Hi, r u there?". is it possible?


Yes, it should be very possible. Does the new window that pops up, have a new title, like, is it a "new browser" in essence?

Oh, and Grucha-Bks, thank you for PMing me letting me know that you'd posted here but, when I check my e-mail, it notifies me.

_________________
Image

Top
 Profile  
 Post subject:
PostPosted: Mon Sep 15, 2008 6:49 pm 
 
User
User

Joined: Tue Apr 15, 2008 3:59 pm
Muted wrote:
Grucha-Bks wrote:
im pretty new in autoit, but i need help... im playing in browser game ( like laddershasher, but other one), this game hasnt any anti-hacks protection, sometimes admis sends pm's to ppl.... and here is my question, where pm box window pops up, script should answer him...always he asks-" Hi, r u there?". is it possible?


Yes, it should be very possible. Does the new window that pops up, have a new title, like, is it a "new browser" in essence?

Oh, and Grucha-Bks, thank you for PMing me letting me know that you'd posted here but, when I check my e-mail, it notifies me.

the msg windows pops up on tha main page... hmmm... u makes something and windows pops in the middle of window, and it called "messages". it isnt "new browser" window.

Top
 Profile  
 Post subject:
PostPosted: Mon Sep 15, 2008 6:50 pm 
 
Banned
Banned
User avatar

Joined: Sat Sep 06, 2008 7:18 am
Location: USA, TX
Does the new window that pops up, have a different title than the main-window (with the game)?

EDIT: Here's example code that *might* work for you...


#cs ----------------------------------------------------------------------------

AutoIt Version: 3.2.2.0
Author:         Danielle

Script Function:
   To automatically reply to an Admin Message (web-based game) checking if I'm a bot. :D

#ce ----------------------------------------------------------------------------

; Endless loop to keep the program running

While (1)

   Sleep(1000)
   
   ;; Checks to see if the window exists -- if it does, it activates it (puts it in focus, up front) and types text and clicks the OK button
   If WinExists("Edit post - ") Then
      WinActivate("Edit post -")
      
      ;; Click on the place to type
      MouseMove(600,600,0)
      MouseClick("left", 600, 600, 1, 0)
      
      ;; Type the message, wait a bit so it doesn't look suspicious -- You could randomize the time with a variable (within 10 seconds to reply)
      Send("Yeah, why?")
      Sleep(500)
      
      ;; Click on the send button! Presto!
      MouseMove(400,400,0)
      MouseClick("left", 400, 400, 1, 0)

   EndIf

WEnd


That should help you get in the right direction. I'm unsure if it works with other web-browsers like Firefox, Mozilla, Opera, etc

_________________
Image

Top
 Profile  
 Post subject:
PostPosted: Mon Sep 15, 2008 7:19 pm 
 
User
User

Joined: Tue Apr 15, 2008 3:59 pm
Muted wrote:
Does the new window that pops up, have a different title than the main-window (with the game)?

EDIT: Here's example code that *might* work for you...


#cs ----------------------------------------------------------------------------

AutoIt Version: 3.2.2.0
Author:         Danielle

Script Function:
   To automatically reply to an Admin Message (web-based game) checking if I'm a bot. :D

#ce ----------------------------------------------------------------------------

; Endless loop to keep the program running

While (1)

   Sleep(1000)
   
   ;; Checks to see if the window exists -- if it does, it activates it (puts it in focus, up front) and types text and clicks the OK button
   If WinExists("Edit post - ") Then
      WinActivate("Edit post -")
      
      ;; Click on the place to type
      MouseMove(600,600,0)
      MouseClick("left", 600, 600, 1, 0)
      
      ;; Type the message, wait a bit so it doesn't look suspicious -- You could randomize the time with a variable (within 10 seconds to reply)
      Send("Yeah, why?")
      Sleep(500)
      
      ;; Click on the send button! Presto!
      MouseMove(400,400,0)
      MouseClick("left", 400, 400, 1, 0)

   EndIf

WEnd


That should help you get in the right direction. I'm unsure if it works with other web-browsers like Firefox, Mozilla, Opera, etc


i love ya :) it should works, we'll se, we'll be in touch :) thank you very much

Top
 Profile  
 Post subject:
PostPosted: Mon Sep 15, 2008 7:25 pm 
 
Banned
Banned
User avatar

Joined: Sat Sep 06, 2008 7:18 am
Location: USA, TX
Welcome, and hey! If you get it working, care to post the source-code...

So everybody who reads this in the future can have a copy (or to possibly learn with)?

EDIT: Here's a utility I wrote (and use often) to find mouse coordinates real easy!

Opt("CaretCoordMode", 0)
Opt("MouseCoordMode", 0)
Opt("PixelCoordMode", 0)

#include <File.au3>
#include <String.au3>
#include <Misc.au3>

HotKeySet("{HOME}", "MousePos")
HotKeySet("{END}", "Terminate")
HotKeySet("{INSERT}", "TestMe")

While 1
   Sleep(100)
WEnd

Func MousePos()

Global $pos = MouseGetPos()
MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1])
Sleep(5)
$var = PixelGetColor( $pos[0], $pos[1] )
MsgBox(0,"The decmial color is", $var)

_FileWriteLog(@SCRIPTDIR & "\Activity.log","[MOUSE POSITION] " & $pos[0] & " " & $pos[1])
_FileWriteLog(@SCRIPTDIR & "\Activity.log","")
_FileWriteLog(@SCRIPTDIR & "\Activity.log","[MOUSE COLOR] " & $var)
_FileWriteLog(@SCRIPTDIR & "\Activity.log","")
EndFunc

Func Terminate()
   Exit(0)
EndFunc

Func TestMe()
MouseClick("left", 315,480, 1, 0)
EndFunc


Modify it as needed (obviously)

_________________
Image

Top
 Profile  
 Post subject:
PostPosted: Mon Sep 15, 2008 7:32 pm 
 
Banned
Banned
User avatar

Joined: Sat Sep 06, 2008 7:18 am
Location: USA, TX
The Wicked wrote:
If I may add to easy projects to get started, in this case D2.

Try for example a auto bo script, auto bonewaller for UT etc. Pretty easy to do and you get the feeling for functions.

I'm pretty new to it aswell but what I sofar have is a d2starter with a gui where I can start 4 diablo's with specific name and either with or without plugins. And a little prog from where I can start the bw sequince or bo sequince without needing to have those screens up. Not that advanced stuff but was nice screwing around with and very usefull at the start of the ladder for UT's.

Also for GUI's I recomend Kodac because it's easy to use and helps alot imo.

As for questions, so far pretty much all answers I found quick and easy on the autoit forums by using the search and just typing in terms of what I wanted to do. Usually you will find someone who posted a script with similair questions and answers which also gives some extra to see how others fix problems.


You wanted help on making an AutoBO or AutoBW script, or were stating that you can and have written one?

_________________
Image

Top
 Profile  
 Post subject: Hi
PostPosted: Tue Sep 16, 2008 4:49 pm 
 
User
User

Joined: Tue Sep 16, 2008 4:31 am
I'm wondering if anyone is willing to give me a step by step way on how to make a simple bot (just so i get used to where to go with autoit) that would maybe be in a diablo game and be able to say "Hello Everyone" on command. I am so confused by AutoIt. I need help!

Top
 Profile  
 Post subject:
PostPosted: Wed Sep 17, 2008 6:32 am 
 
User
User

Joined: Fri Jan 18, 2008 12:53 am
Muted wrote:
You wanted help on making an AutoBO or AutoBW script, or were stating that you can and have written one?


No I got it thank you. Btw there is a collection off au3 samples here: http://www.edgeofnowhere.cc/viewtopic.php?t=185429

Here the functions off the autoit script I was talking about, don't mind the silly msgs this more came up while doing UT's at the start of the ladder (hence the bo barb, no hrs for cta :p)

$w = "D1"
$wB = "D2"
$wN = "D3"
$t = "test"
$bwsleep = Random(24800, 25200)
$x=1
$msgsleep = Random(300, 350)




Func bw()      ;Single bonewall to test fire, aimed at the nec window ($wN)
   Sleep(500)
   ControlClick ( $wN, "", "", "right", 1, 509, 216)
EndFunc

Func bo()      ;Bo sequince aimed at the barb window ($wB)
   $w = $wB
   $t = "This"   ;Text var
   Msg()
   ControlSend ( $wB, "", "", "w")
   Sleep(100)
   ControlSend ( $wB, "", "", "a")
   Sleep(250)
   ControlClick ( $wB, "", "", "right")
   $t = "is"
   Msg()
   Sleep(250)
   ControlSend ( $wB, "", "", "s")
   Sleep(250)
   ControlClick ( $wB, "", "", "right")
   Sleep(250)
   ControlSend ( $wB, "", "", "d")
   Sleep(250)
   ControlClick ( $wB, "", "", "right")
   Sleep(500)
   ControlSend ( $wB, "", "", "w")
   $t = "Spartaaaaaaa"
   Msg()
EndFunc

Func Msg()
   ControlSend ($w, "", "", "{ENTER}")   
   Sleep ($msgsleep)
   ControlSend ($w, "", "", $t )
   Sleep ($msgsleep)
   ControlSend ($w, "", "", "{ENTER}")   
   Sleep($msgsleep)
EndFunc

Func spam1()   ;Was usefull when already handling 3 windows and then the other hammers didn't do what they should.
   $w = $wB
   $t = "hammerdins close up"
   Msg()
   $t = "pretty pls"
   Msg()
   $t = "no making juices"
   Msg()
EndFunc

Func spam2()   ;See other spam comment
   $w = $wB
   $t = "Welcome to our UT"
   Msg()
   $t = "Please follow all the rules and don't screw around"
   Msg()
   $t = "We reserve the right to kick people at will"
   Msg()
   $t = "We do not owe you any explanation"
   Msg()
   $t = "for our word is divine"
   Msg()
   $t = "and if you get kicked you did something to deserve it"
   Msg()
   $t = "Now sit back and enjoy"
   Msg()
EndFunc

Func AW()      ;The part it throws it's bones, could be a lot shorter. Msgs where just wall 1/2/3/4/last wall but then the beers came out
   Sleep(500)
$w = $wN
$t = "Throwing a bone part one."
   Msg()
   bw()
   Sleep($bwsleep)
$t = "Skull and bone society part two."
   Msg()
   bw()
   Sleep($bwsleep)
$t = "Return of the mummy part three"
   Msg()
   bw()
   Sleep($bwsleep)
$t = "Vladimir's fourth birthday party."
   Msg()
   bw()
   Sleep($bwsleep)
$t = "The last samurai three months after the shooting"
   Msg()
   bw()
   Sleep($bwsleep)
$t = "Reform at former bluebarry the peasant"
   Msg()
EndFunc


Bit messy at some points and i just copied and commented a bit from the script I use, rest wouldn't be usefull for others (except for the gui but I can't make one fitting this right now) This script just came while doing UT's during the toilet breaks, slowly growing a bit. There where more functions like potions but as the team got better there wasn't need for that anymore.

Top
 Profile  
 Post subject:
PostPosted: Wed Sep 17, 2008 5:30 pm 
 
User
User
User avatar

Joined: Sat Jun 21, 2008 7:07 am
The Wicked wrote:
Muted wrote:
You wanted help on making an AutoBO or AutoBW script, or were stating that you can and have written one?


No I got it thank you. Btw there is a collection off au3 samples here: http://www.edgeofnowhere.cc/viewtopic.php?t=185429

Here the functions off the autoit script I was talking about, don't mind the silly msgs this more came up while doing UT's at the start of the ladder (hence the bo barb, no hrs for cta :p)

$w = "D1"
$wB = "D2"
$wN = "D3"
$t = "test"
$bwsleep = Random(24800, 25200)
$x=1
$msgsleep = Random(300, 350)




Func bw()      ;Single bonewall to test fire, aimed at the nec window ($wN)
   Sleep(500)
   ControlClick ( $wN, "", "", "right", 1, 509, 216)
EndFunc

Func bo()      ;Bo sequince aimed at the barb window ($wB)
   $w = $wB
   $t = "This"   ;Text var
   Msg()
   ControlSend ( $wB, "", "", "w")
   Sleep(100)
   ControlSend ( $wB, "", "", "a")
   Sleep(250)
   ControlClick ( $wB, "", "", "right")
   $t = "is"
   Msg()
   Sleep(250)
   ControlSend ( $wB, "", "", "s")
   Sleep(250)
   ControlClick ( $wB, "", "", "right")
   Sleep(250)
   ControlSend ( $wB, "", "", "d")
   Sleep(250)
   ControlClick ( $wB, "", "", "right")
   Sleep(500)
   ControlSend ( $wB, "", "", "w")
   $t = "Spartaaaaaaa"
   Msg()
EndFunc

Func Msg()
   ControlSend ($w, "", "", "{ENTER}")   
   Sleep ($msgsleep)
   ControlSend ($w, "", "", $t )
   Sleep ($msgsleep)
   ControlSend ($w, "", "", "{ENTER}")   
   Sleep($msgsleep)
EndFunc

Func spam1()   ;Was usefull when already handling 3 windows and then the other hammers didn't do what they should.
   $w = $wB
   $t = "hammerdins close up"
   Msg()
   $t = "pretty pls"
   Msg()
   $t = "no making juices"
   Msg()
EndFunc

Func spam2()   ;See other spam comment
   $w = $wB
   $t = "Welcome to our UT"
   Msg()
   $t = "Please follow all the rules and don't screw around"
   Msg()
   $t = "We reserve the right to kick people at will"
   Msg()
   $t = "We do not owe you any explanation"
   Msg()
   $t = "for our word is divine"
   Msg()
   $t = "and if you get kicked you did something to deserve it"
   Msg()
   $t = "Now sit back and enjoy"
   Msg()
EndFunc

Func AW()      ;The part it throws it's bones, could be a lot shorter. Msgs where just wall 1/2/3/4/last wall but then the beers came out
   Sleep(500)
$w = $wN
$t = "Throwing a bone part one."
   Msg()
   bw()
   Sleep($bwsleep)
$t = "Skull and bone society part two."
   Msg()
   bw()
   Sleep($bwsleep)
$t = "Return of the mummy part three"
   Msg()
   bw()
   Sleep($bwsleep)
$t = "Vladimir's fourth birthday party."
   Msg()
   bw()
   Sleep($bwsleep)
$t = "The last samurai three months after the shooting"
   Msg()
   bw()
   Sleep($bwsleep)
$t = "Reform at former bluebarry the peasant"
   Msg()
EndFunc


Bit messy at some points and i just copied and commented a bit from the script I use, rest wouldn't be usefull for others (except for the gui but I can't make one fitting this right now) This script just came while doing UT's during the toilet breaks, slowly growing a bit. There where more functions like potions but as the team got better there wasn't need for that anymore.


only problem is that: Controlclick doesnt work for Diablo.. nor any control commands :)

Top
 Profile  
 Post subject:
PostPosted: Wed Sep 17, 2008 9:35 pm 
 
User
User

Joined: Fri Jan 18, 2008 12:53 am
Well it worked perfectly fine for me however the in game cursor has to be in the screen. If I find time I'll make a movie of how I use it and upload that but that won't be in the coming days.

ps. I didn't post it out of theory crafting, I used it myself...

Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 47 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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

Search for:
Jump to:  
cron