Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 11:57

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Help request for making my bot

Discussion on Help request for making my bot within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2008
Posts: 1
Received Thanks: 0
Unhappy Help request for making my bot

Hi everyone, im asking your help here because i want to finish my bot for a french game called Slayeronline, this game look like RPGMaker for thoses who know what it is.

Im a noob into programming,but i do my best and i do alot of search and try.

i try to make a auto moving/fighting bot but im stuck at the start of it.

The game mechanic is simple:
Arrow: to move but you need to keep pressing them to move
Q: to heal with pots
S: to attack
Only health/Mana/xp bar are shown. (see the picture)

NO MOUSE SUPPORTED!



This part i will talk about the bot,Here my code that i made:


This code i made was to know how to move my character, i tried to use only SEND ("{DOWN}") but that wasn't working very well as the game need to have the key hold down to move, so that what i came up with Opt("SendKeyDownDelay",3000) Before SEND ("{DOWN}") .
Now with this code,the bot walk for 3 sec before stoping to walk.

the SEND("{Escape}") was only to enter the menu of the game and trying to navigate in it.


Now for the bot part:I'm stuck.
I would like my bot to walk to a target and attack it (Movement by Arrowkey/Attack with S key,) generating the movement automatically to his target but I do not know how to do it
so i would like to get your help, i posted on some forum but none had reply me or just banned me (botting topic not allowed).

you can take a look at the picture of the game,the monster i would like to kill is the chicken,i am the cat named Pire (picture in attachment)



i would really apreciate your help, and if you could help me to make a code for the life bar (if below X pixel then use pots) it would be awesome,but if you don't want its ok, its really with the movement that i need help

Sorry for my bad english, im french and still learning the english, i know that im begging,but i try and still trying to make it.
its been 10 years i play this little game,i just want to be a little more wealthy in it.

Thanks you
Attached Images
File Type: jpg Screenies.jpg (21.3 KB, 40 views)
firecats is offline  
Old 03/22/2018, 20:48   #2
 
elite*gold: 0
Join Date: Mar 2018
Posts: 1
Received Thanks: 0
Sadly my home is python so I cannot really help you much, but for..
Autoit

Code:
PixelGetColor()
Wich solves your problem with the healthbar. See AutoIt documentation

So simply specify coordinates you want to get your Pixel from then check if it changed to black for example or whatnot and do presshealkey or similar.
That's it. Should be 2 code lines I guess.
princesskianpa is offline  
Old 09/10/2018, 20:08   #3
 
elite*gold: 0
Join Date: Nov 2009
Posts: 105
Received Thanks: 8
We still do not know how you wana walk with your character. If the MOBs are respawning, then you can make circles and kill them.

Use WinGetHandle (check it in the link above post) to get the window handle, then you can send messages to it even if the window is not active.

so something like:
$hWnd = WinGetHandle("Slayers Online")

Func YourFunc()
While WinExists($hWnd)

Here goes the logic of your BOT

WEnd

What i like to do before jumping in any project like this, is try to write down the logic, how it should work, what the code have to do. You can make something like this to visualize it. It help me a lot.

Example image:


For HP and Mana use the PixelGetColor function what princesskianpa alredy wrote.

It is require 3 argument.
1st: X coordinate on the screen
2nd: Y coordiante on your screen (u can get thise eighter make screen schot and load up in paint and hower over ur cursor there and it will wirtie the coordinate on bottom left corner or use the au3info.exe file what is located in your autoit folder)
3rd: it is optional parameter. If the game running full screen, then you not realy need this. If it is running in window, then you should get the window position with: WinGetPos function and use thise coordinates as a reference.

example:
window is on 100, 200 coordinate
ur hp bar where are u looking for color change is (inside the window 10, 500)

I do recomended to use Au3info.exe cause it give u a lot useful information for ur BOT.

You can use something like this. Just an example how and where you have to look for in AutoIT Help file.
The ImageSearch.au3 file is on the AutoIT forum, you can find it there with all the nessesery descriptions and files.

Quote:
#include <ImageSearch.au3>

$hWnd = WinGetHandle("Slayeronline") ; require for imagesearch on mobs

;hp location to search for:
$hp = [10, 500]
$hp_color = 0xFFFFFF ; Color what u are looking for

;Mob images:
$mob_front = "front.bmp"
$mob_back = "back.bmp"
$mob_left = "left.bmp"
$mob_right = "right.bmp"

$tolerance = 50 ; pixel color difference on images. 0 = exactly same image, max is 255. I recomend you to use like 50-150 value max

; or you can put this 4 image in 1 array like:
;$mob = ["front.bmp", "back.bmp", "left.bmp", "right.bmp"]


While WinExists($hWnd)
WinActivate($hWnd)

$winPos = WinGetPos($hWnd)

If PixelGetColor($hp[0], $hp[1], $hWnd) <> $hp_color Then ; same for the mana check
ControlSend($hWnd, "", "", "{buttonToHeal}")
EndIf

If _ImageSearchArea($hWnd, 1, $winPos[0], $winPos[1], $winPos[0] + $winPos[2], $winPos[1] + $winPos[3], $x, $y, $tolerance) = 1 Then
; you got the mob location on the screen, now you can calculate where is it from your character. (if your character always in center of the screen)
; if not in center, then you should find your character on the same way as well, then you can easily find out wich direction your character have to move
EndIf

WEnd
VitorCornelius is offline  
Reply


Similar Threads Similar Threads
[Request] Wine Making Bot?
05/23/2015 - Mabinogi - 2 Replies
Does anyone have a wine making bot script for autoit? Like, for the oak barrel minigame? The old links I found for wine bots don't work anymore and I don't trust myself to do the minigame on my own. Please & thank you
Request help for making a bot trader
11/02/2009 - Silkroad Online - 7 Replies
I have an idea about bot trader that can do a trade with only one click all u need r: 1)autopotion for trade transport which i got from acer20006(SLOKE PROGRAMMER) but it doesnt work well but at least it is better than nothing 2)Script reader like this u can find in bots i need to put my x and y and then recording them again<<<<which i couldnt find so i used auotit recorder for saving my clicks with intervals 5secs(cam must be fixed behind the charachter) thats it but my script wont...
help help help help help help
06/28/2009 - Say Hello - 0 Replies
how i can dowmload Mangos 6385 ??????????????????????????????????? please give me the limk i can't see that i know it is in www.elitepvpers.com/.../153716-release-mangos-relea ses-blackscorpian-win32-2-4-3-a.html - but give me link sent it to my email plz
[HELP]need help in making pps cards,adding new outfits,totems for new petz plz help
02/06/2009 - EO PServer Hosting - 10 Replies
hey need help plz i wanna make monsters drop bbs cards abd wabba know how 2 make eps cards all gonna on one like random portals and need help how 2 add new out fits if there any guides plz help me tysm :)
[Help request] Crc.dll? Making system.mrs :mad:
05/12/2008 - GunZ - 1 Replies
Ok im stuck, i made a system.mrs, compiled it, now ive been told to put it in Gunz folder, which ive done, now i need to inject crc.dll... WHERES CRC.DLL? just wondering because im following this tut: http://www.elitepvpers.com/forum/gunz/104222-tut-h ow-edit-system-mrs-clam.html stuck on number 21 Im new and have searched everwhere for crc.dll so i have the only alternate to post this. I cant find it anywhere, id appreciate some help!



All times are GMT +1. The time now is 11:58.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.