Hello everybody,
First of all I need to say I am new to AutoIT language. I know Java and C++, but read all over the net that these are not ideal for mmorpg botting, and to top it all, also read that AutoIT has some cool features which makes life easier.
So long story short, I need your assistance for this very basic bot program, which just stands still, selects mobs, attack and then check Hp/Mp then loot and so on. The game is Rode Online btw, I'll post the screenshots for the pixels to make myself clear.
[Only registered and activated users can see links. Click Here To Register...]
These are my Functions, all in one class.
2 & 3. Well isMobDead and isMobSelected are in fact the same functions. I check the same pixel to decide true or false. And since I call isMobSelected earlier than the other one, I think it will work.
This is the location I look at:
[Only registered and activated users can see links. Click Here To Register...]
4, 5 & 6. isHpLow, isHpMid and isMpLow looks at the Hp and Mana bars ofc :D I selected the pixels to correspond to portions of Hp and Mp according to my resolution
7. targetMob uses the TAB button on the keyboard to select the nearest mob.
8. useSkill takes in some parameter and then sends the game that button.
This is the Main class I wrote. exit and pause options are not yet implemented I know, this is kinda an outline. But it doesnt work for some reason :/
Now the real question:
Bot selects mobs but does not attack them. Is there something wrong with the skill usage ? And any other suggestions critics are appreciated. I know the code is really noobish and sucks but this was my second attempt in AutoIT.
Thank you! :rolleyes:
Update: I edited the bot, and now it seems the checkHpMp thing does not work. When I comment the lines involve it the bot works fine. But I need to check my Hp ofc. Please Help!
First of all I need to say I am new to AutoIT language. I know Java and C++, but read all over the net that these are not ideal for mmorpg botting, and to top it all, also read that AutoIT has some cool features which makes life easier.
So long story short, I need your assistance for this very basic bot program, which just stands still, selects mobs, attack and then check Hp/Mp then loot and so on. The game is Rode Online btw, I'll post the screenshots for the pixels to make myself clear.
[Only registered and activated users can see links. Click Here To Register...]
These are my Functions, all in one class.
1. For the checkHpMp function, can I use other functions that are declared by me in a function declared by me? checkHpMp includes isHpLow and isMpLow, thats why Im asking.Quote:
Func checkHpMp();1
If isHpLow() Then
useSkill( 1) ;use hp potion
EndIf
If isMpLow() Then
useSkill( 2) ;use mana potion
EndIf
EndFunc
Func isMobDead();2
If Hex(PixelGetColor( 898, 74), 6) == "3B815A" Then
Return False
Else
Return True
EndIf
EndFunc
Func isMobSelected();3
If Hex(PixelGetColor( 898, 74), 6) == "3B815A" Then
Return True
Else
Return False
EndIf
EndFunc
Func isHpLow();4
If Hex(PixelGetColor( 863, 1011), 6) <> "151E34" Then
Return True
Else
Return False
EndIf
EndFunc
Func isMpLow();5
If Hex(PixelGetColor( 1053, 1011), 6) <> "125386" Then
Return True
Else
Return False
EndIf
EndFunc
Func isHpMid();6
If Hex(PixelGetColor( 869, 982), 6) <> "BD526C" Then
Return True
Else
Return False
EndIf
EndFunc
Func targetMob();7
Send("{TAB}")
Sleep(200)
EndFunc
Func useSkill( $skillNo);8
Send($skillNo)
Sleep(200)
EndFunc
2 & 3. Well isMobDead and isMobSelected are in fact the same functions. I check the same pixel to decide true or false. And since I call isMobSelected earlier than the other one, I think it will work.
This is the location I look at:
[Only registered and activated users can see links. Click Here To Register...]
4, 5 & 6. isHpLow, isHpMid and isMpLow looks at the Hp and Mana bars ofc :D I selected the pixels to correspond to portions of Hp and Mp according to my resolution
7. targetMob uses the TAB button on the keyboard to select the nearest mob.
8. useSkill takes in some parameter and then sends the game that button.
This is the Main class I wrote. exit and pause options are not yet implemented I know, this is kinda an outline. But it doesnt work for some reason :/
Well, my indentation is spoiled by e-pvp, I am sorry for that, please try to follow :(Quote:
#include <Color.au3>
#include "myFunctions.au3"
$exit = False
$paused = False
;Global $resting = false
$skillNumber = 3 ; Since hp and mp potions are 1 & 2
Sleep(4000)
While NOT $exit
If Not $paused Then
Sleep (100)
If isHpMid() Then
Send("{Z}") ; This is the rest button in the game
Sleep(20000)
EndIf
targetMob()
While isMobSelected()
checkHpMp() ; checks hp/mp before combat and uses pots if needed
useSkill( $skillNumber) ; spams 3-4-5-6-7, the mob would be dead by then
Sleep(500)
$skillNumber = $skillNumber + 1
If isMobDead() Then ; checks if the mob is dead
checkHpMp() ; looks again for hp and mp
Sleep(4000)
$skillNumber = 3 ; resets the skillnumber so that it will start from 3 again
Send("{V}"); for looting
EndIf
WEnd
EndIf
WEnd
Now the real question:
Bot selects mobs but does not attack them. Is there something wrong with the skill usage ? And any other suggestions critics are appreciated. I know the code is really noobish and sucks but this was my second attempt in AutoIT.
Thank you! :rolleyes:
Update: I edited the bot, and now it seems the checkHpMp thing does not work. When I comment the lines involve it the bot works fine. But I need to check my Hp ofc. Please Help!