Jump to content

Another question :)


Recommended Posts

Ok. Well I am making a bot, where it searches for monsters life bars, and attacks until there is no life, and repeats.

But, I want to get another pixelsearch going, to if my life goes below like 3/4 it will exit.

I just don't know how to make these things go at the same time? And how to go about having it read if it is like 3/4 down.

I was possibly thinking of doing it in 2 different scripts, and running both at the same time. But then, could I make it so 1 script would know to stop if I exit?

I am a noob still at AI, but I am trying to get better, so please be nice etc.

Thanks. I hope I explained this well enough.

Link to comment
Share on other sites

Would this happen to be ConquerOnline?

Nah. The game doesn't matter.

I just don't know how to set it up where it reads a bar of health (It pixelsearches it, which I know how to do), but I don't know how to make it so if the bar is <3/4 it will exit.

If that makes sence.

Link to comment
Share on other sites

Well heres my old bot I made for Conquer a long time back when I actually played the game.

Does exactly what your looking for but better... Press ctrl+i on your health bar and it will heal you when your health goes below that spot.

Opt("GUIOnEventMode", 1)
Opt("MouseCoordMode", 0)
Opt("PixelCoordMode", 0)
#include <GUIConstants.au3>

HotKeySet("{F5}", "On")
HotKeySet("{ESC}", "Terminate")
HotKeySet("^i", "_ToggleRun")

Global $Running = 0, $MPos, $PixelColor
Dim $SearchMob=0
Dim $Meteor=0
GUICreate("TUL- The Ultimate Leveler",150,122,100,100)
GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate")

$Label=GUICtrlCreateLabel("F5 to turn on bot.",10,5,130,15)
$Radio1=GUICtrlCreateRadio("Warrior/Trojan",10,35,130,15)
$Radio2=GUICtrlCreateRadio("Archer",10,65,130,15)


GUICtrlCreateLabel("Hours to d/c:",10,95,70,15)
$timelimit = GuiCtrlCreateCombo("1", 85, 91, 35, 21)
GuiCtrlSetData($timelimit, "2|3|4|5|6|7|8|9")


GUICtrlSetState ($Radio1, $GUI_CHECKED)
GUISetState()



While 1
    If $Running Then
     Pot()
    EndIf
    If $SearchMob Then
     pickmet()
     checktime() 
     Send("{F3}")
     Attack()
    EndIf
WEnd


Func checktime()
    $dif = TimerDiff($begin)   
    $maxtime = GUICtrlRead($timelimit) 
    $time = $maxtime*1000*3600; maxtime is in miliseconds * 1000 = seconds * 3600 = hours   
        If $dif > $time Then  
            WinClose("[Conquer2.0]", "")  
            Exit
        EndIf
EndFunc

Func pickmet()
    $metcoord=PixelSearch(200,100,825,600, 16758527,8)
    If NOT @error Then
    MouseClick("left",$metcoord[0], $metcoord[1],1,0)
    Sleep(5000)
    EndIf
EndFunc


Func Pot()
    If $PixelColor <> PixelGetColor($MPos[0], $MPos[1]) Then
        Send("{F2}")
        Sleep(1000)
    EndIf
EndFunc

Func _ToggleRun()
    $Running = NOT $Running
    If $Running Then
        $MPos = MouseGetPos()
        $PixelColor = PixelGetColor($MPos[0], $MPos[1])
    EndIf
EndFunc

Func On()
    $SearchMob=NOT $SearchMob
    If $SearchMob Then
        Global $begin = TimerInit();START THE TIME
        GUICtrlSetData($Label,"F5 to turn off bot.")
    Else
        GUICtrlSetData($Label,"F5 to turn on bot.")
    EndIf
EndFunc


Func Jump()
    $x=Random(0,1024,1)
    $y=Random(0,690,1)
    Send("{CTRLDOWN}")
    MouseClick("Left",$x,$y,1,0)
    Send("{CTRLUP}")
    Sleep(1500)
EndFunc

Func Attack()
    $Coords=PixelSearch(200,100,825,600,12059395,5)
    If NOT @error Then
        If BitAND(GUICtrlRead($Radio1), $GUI_CHECKED) = $GUI_CHECKED then
        MouseClick("left",$Coords[0]+10,$Coords[1]+20,1,0)
        Sleep(900)
        Else
        MouseClick("right",$Coords[0]+10,$Coords[1]+20,1,0)
        Sleep(1900)
        EndIf
    Else
        Jump()
    EndIf
EndFunc

Func Terminate()
    Exit
EndFunc;==> Terminate()

I'll let you change it to your needs >_< .

Edited by UnknownWarrior
Link to comment
Share on other sites

Well heres my old bot I made for Conquer a long time back when I actually played the game.

Does exactly what your looking for but better... Press ctrl+i on your health bar and it will heal you when your health goes below that spot.

Opt("GUIOnEventMode", 1)
Opt("MouseCoordMode", 0)
Opt("PixelCoordMode", 0)
#include <GUIConstants.au3>

HotKeySet("{F5}", "On")
HotKeySet("{ESC}", "Terminate")
HotKeySet("^i", "_ToggleRun")

Global $Running = 0, $MPos, $PixelColor
Dim $SearchMob=0
Dim $Meteor=0
GUICreate("TUL- The Ultimate Leveler",150,122,100,100)
GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate")

$Label=GUICtrlCreateLabel("F5 to turn on bot.",10,5,130,15)
$Radio1=GUICtrlCreateRadio("Warrior/Trojan",10,35,130,15)
$Radio2=GUICtrlCreateRadio("Archer",10,65,130,15)


GUICtrlCreateLabel("Hours to d/c:",10,95,70,15)
$timelimit = GuiCtrlCreateCombo("1", 85, 91, 35, 21)
GuiCtrlSetData($timelimit, "2|3|4|5|6|7|8|9")


GUICtrlSetState ($Radio1, $GUI_CHECKED)
GUISetState()



While 1
    If $Running Then
     Pot()
    EndIf
    If $SearchMob Then
     pickmet()
     checktime() 
     Send("{F3}")
     Attack()
    EndIf
WEnd


Func checktime()
    $dif = TimerDiff($begin)   
    $maxtime = GUICtrlRead($timelimit) 
    $time = $maxtime*1000*3600; maxtime is in miliseconds * 1000 = seconds * 3600 = hours   
        If $dif > $time Then  
            WinClose("[Conquer2.0]", "")  
            Exit
        EndIf
EndFunc

Func pickmet()
    $metcoord=PixelSearch(200,100,825,600, 16758527,8)
    If NOT @error Then
    MouseClick("left",$metcoord[0], $metcoord[1],1,0)
    Sleep(5000)
    EndIf
EndFunc


Func Pot()
    If $PixelColor <> PixelGetColor($MPos[0], $MPos[1]) Then
        Send("{F2}")
        Sleep(1000)
    EndIf
EndFunc

Func _ToggleRun()
    $Running = NOT $Running
    If $Running Then
        $MPos = MouseGetPos()
        $PixelColor = PixelGetColor($MPos[0], $MPos[1])
    EndIf
EndFunc

Func On()
    $SearchMob=NOT $SearchMob
    If $SearchMob Then
        Global $begin = TimerInit();START THE TIME
        GUICtrlSetData($Label,"F5 to turn off bot.")
    Else
        GUICtrlSetData($Label,"F5 to turn on bot.")
    EndIf
EndFunc


Func Jump()
    $x=Random(0,1024,1)
    $y=Random(0,690,1)
    Send("{CTRLDOWN}")
    MouseClick("Left",$x,$y,1,0)
    Send("{CTRLUP}")
    Sleep(1500)
EndFunc

Func Attack()
    $Coords=PixelSearch(200,100,825,600,12059395,5)
    If NOT @error Then
        If BitAND(GUICtrlRead($Radio1), $GUI_CHECKED) = $GUI_CHECKED then
        MouseClick("left",$Coords[0]+10,$Coords[1]+20,1,0)
        Sleep(900)
        Else
        MouseClick("right",$Coords[0]+10,$Coords[1]+20,1,0)
        Sleep(1900)
        EndIf
    Else
        Jump()
    EndIf
EndFunc

Func Terminate()
    Exit
EndFunc;==> Terminate()

I'll let you change it to your needs >_< .

Thanks I got it

But I just have one more question. How do I make it so I can do this

If PixelSearch(186,149,423,166,0xc81A1A) < ((Screen COORD)
Then MouseClick("left",xxx,xxx)

Here is example

If red pixel is less than 330,000 (coord on the screen) , then mouse click

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