for all who want to learn something or create bots for browsergames, mmorpgs and other games
download Autoit here:
Now run the Scite Script Editor
this is where you type in your code, let check your code if errors are in it and compile it to executable exe file.
the first thing you need are the coordinates of your mouse to find locations on the screen, like skill buttons, status bars, or just positions which you have to click or watch.
for that copy this code in the scite editor and compile it into exe or just run it.
--------------------------------------------------------------------------
MsgBox(0, "Hi", "Press Ok to continue! ESC to Exit!") ; first message box
$timeInput = InputBox("Timer Settings", "How many second delay?", "3")
$time = $timeInput*1000
Global $Paused
HotKeySet("{ESC}", "Terminate")
Sleep(3000)
While 1
$pos = MouseGetPos()
MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1])
Sleep($time)
WEnd
Func Terminate()
Exit 0
EndFunc
-------------------------------------------------------------------------
you can also use a tool from autoit : C:\...\AutoIt3\Au3Info.exe
Its called "AutoIt Window Info" and can also be found in the
--- Startmenu\...\autoit v3\AutoIt Window Info ---
-------------------------------------------------------------------------
The only thing you need in Scite editor is the Tool button and the Help Button
-The "Tool" button for Compiling, Go, and Syntax Check.
-The "Help" button for looking up commands or any other things(just search)
PRACTICE 1:
Browsergame Account creater for Legend or Gondal or other games.(also included a attack to transfer money to your main account )
--------------------------------------------------------------------------
global $Paused
global $cnt = 1 ;variable declaration
global $z = 0
$bot = InputBox("name of bot", "ESC = CLOSE , F8 PAUSE , ENTER NAME FOR BOT", "botname") ; input box where you can enter a name which is used for the variable
$attackname = InputBox("5 sec until start", "ESC = CLOSE , F8 PAUSE WHO ATTACK?", "enter name") ; a name which will be attacked later to transfer money
HotKeySet("{F8}", "TogglePause") ; determines a hotkey --> the function is at the end of script
HotKeySet("{ESC}", "Terminate")
Sleep(5000)
mousemove(400,560) ; moves mouse to position X,Y
mouseclick("") ; left clicks one time
mousemove(400,576)
mouseclick("")
mousemove(526,557)
mouseclick("")
While 1 ; starts a LOOP --> everything inbetween WHILE and WEND will be repeated until you quit
sleep(4000) ; pauses 4 seconds
mousemove(511,464)
mouseclick("")
send($bot) ; sends the keys --> $bot means what you have entered at the inputbox
send($cnt) ; adds a number after your name --> test1 test2 test3 ...... and so on
send("{tab}password") ; presses TAB and then enters a password
mousemove(478,523)
mouseclick("")
send($bot) send($cnt)
send("@.") ; enters a email address and then the registration will be finished and account is created
mousemove(327,679)
mouseclick("")
mousemove(545,561)
mouseclick("")
sleep(350)
mousemove(116,665)
mouseclick("")
MouseClickDrag("",682,587,823,585) ; means he clicks and drags the mouse from position 1 to position 2 for scrolling or something like that
mousemove(787,648)
mouseclick("")
mousemove(103,586)
mouseclick("")
MouseClickDrag("",697,405,588,465)
sleep(500)
MouseClickDrag("",719,630,456,513)
mousemove(102,505)
mouseclick("")
sleep(50)
mouseclickdrag("",690,530,472,530)
send($attackname) ; types in the name which will be attacked for transferring money
mousemove(598,584)
mouseclick("")
sleep(14500)
mousemove(102,505)
mouseclick("")
sleep(50)
mouseclickdrag("",690,530,472,530)
send($attackname)
mousemove(598,584)
mouseclick("")
sleep(14500)
mousemove(915,177)
mouseclick("")
mousemove(470,46)
mouseclick("")
send("http://page-of-browsergame{enter}") ; for going to account creation page again
$z = $cnt + 1 ; the counter
$cnt = $z ; for counter to add new value
WEnd ;THIS IS LOOP END, everything between WHILE and WEND will be repeatet until ESC is pressed
Func TogglePause() ; the pause function
$Paused = NOT $Paused
While $Paused
ToolTip('Please press "F8" to resume!',600,200,"",1,2)
sleep(1000)
WEnd
ToolTip("")
EndFunc
Func Terminate() ; the exit function
Exit 0
EndFunc
-------------------------------------------------------------------------
COPY THIS TO YOUR SCITE EDITOR AND READ THROUGH IT, COMMENTS ARE SHOWN IN GREEN NEXT TO THE COMMANDS!!!
Find out your coordinates and change the code to whatever you want.
PRACTICE 2:
BOT FOR COUNTER STRIKE : HOW TO HAVE REACTION TIME = 0
for example you aim at a door and someone moves in your crosshair. also good with sniper. this means as soon as if enemy is in the crosshair the bot will press left mouse button to fire. funny at LAN partys because it can not be detected but is little hard to use
--------------------------------------------------------------------------
#include <GUIConstants.au3> ; include whatever you want, the more you include the more functions and commands you can use
#include <GUIComboBox.au3>
#include <File.au3>
#include <Array.au3>
#Include <Misc.au3>
Global $Paused
hotkeyset("{c}", "_shootingtest") ; hotkeys are set this means c
hotkeyset("^{c}", "_shootingtest") ; this means CTRL+c (for being ducked that you can activate it)
hotkeyset("{esc}", "_exit")
_waituntilstart() ; starts the whole thing and jumps to Func_waituntilstart() one line below
Func _waituntilstart() ; Function starts with FUNC and ends with ENDFUNC
while 1
sleep(300)
wend
EndFunc ; this will only sleep and wait until you press C or CTRL+C
func _shootingtest() ; this FUNCTION will check if any movement is in the center of the screen(means crosshair here)
$check = pixelchecksum(505,382,519,386)
Do
$test = pixelchecksum(505,382,519,386)
sleep(10)
Until $check <> $test or _ispressed("46") ; DO XXX until YYY means he checks pixels until the colors change in the center(means that enemy is now with his head in your aim)
if $check <> $test Then
_fire() ; jumps to FIRE FUNCTION
endif
sleep(300)
_waituntilstart()
EndFunc
func _fire() ; will press left mouse button 3 times
sleep(10)
mouseclick("")
sleep(200)
mouseclick("")
sleep(200)
mouseclick("")
sleep(200)
_waituntilstart() ; jumps back to the wait function until you press C or CTRL C to start the thing again
EndFunc
func _exit()
Exit
EndFunc
--------------------------------------------------------------------------
Now lets learn something more about Pixel functions, conditions and other commands needed for complicated bot creating:
---WinMove("Rappelz", "", 0, 0)
moves Rappelz Window to the top left corner, position 0,0 (X,Y)
---$coordXY = PixelSearch($coord1, $coord2, $coord3, $coord4, 0x000000, 120)
searches a pixel in a defined color in a defined rectangle, 0x000000 means black, and 120 means the shader variation because little variations in colors are happening. 0 means only exact this one color, and the bigger the value the more variations are accepted.
FOR MORE DETAILS CHECK ALWAYS THE HELP FILE. ITS VERY VERY GOOD
---ControlClick("Rappelz","","","left", 1, X,Y)
performs a left click in the rappelz window at the X,Y position
---ControlSend("Rappelz", "", "", "{F7 DOWN}{F7 UP}")
performs a F7 in the rappelz game ( F7 is pressed down, and then released)
this is the same as {F7} but you can let him press CTRL ALT and F7 and then release one after the other again to perform a CTRL+ALT+F7
---if $monster ==1 Then
_attack()
Else
send("{tab}")
EndIf
IF variable is 1 he will jump to attack functon, Else he will press TAB
---WinActivate("Rappelz")
gives focus to the Rappelz window or any other window you like to choose
that should be enough for now and i hope you now understand more about autoit and scripting and writing bots
if you have questions or suggestions just let me know
HAVE FUN