Sign in to follow this  
Followers 0
Disciples

2 quick questions

6 posts in this topic

Ok, here is my first question...

If you have more than 1 Func in a while loop, could you make it so they are running at the same time? Or are they already.

EX: I have a script, where it attacks in one func, but the other func exits if hit a certain amount of times. So If I have them in the same loop, would it be so the life func goes into effect as soon as I lost (x) amount of health? Or how does that work?

And my second one is how can I make it so if a rectangle has a color, then if it changes to a different color it will react.

I was thinking like this...

If (xxx,xxx,xxx,0xXXXXXX) = (0xXXXXXX) Then
MouseClick("left",xxx,xxx)

Would that work?

Thanks for your time!

Share this post


Link to post
Share on other sites



1. no

2. Check the helpfile for PixelChecksum()

kk thanks. So should I have them run in different loops? Or different scripts?

Share this post


Link to post
Share on other sites

kk thanks. So should I have them run in different loops? Or different scripts?

more then one script on one game isnt something that is easy to control

First sugestion: one loop with "Select...Case...EndSelect " (look in the help file)

example

While 1
    Select;select the first correct case, first r hp and mp so that you dont die
        Case "0x"&Hex(PixelGetColor ( x , y, 6) <> $hpcollor
            rechargehp()
        Case "0x"&Hex(PixelGetColor ( x , y, 6) <> $mpcollor
            rechargehp()
        Case "0x"&Hex(PixelGetColor ( x , y, 6) = $Selectedmob ;$Selectedmob = position and collor on last pixel so that you know that your not attacking mob that someone else is attacking first
            autoattackmob()
        Case Else
            selectmob()
    EndSelect
    Sleep(100)
WEnd

Func rechargehp()
    Send("{=}")
EndFunc

Func rechargemp()
    Send("{-}")
EndFunc

Func autoattackmob()
    Send("{1}")
    Do
        Sleep(100)
        If "0x"&Hex(PixelGetColor ( x , y, 6) <> $hpcollor Then ;$hpcollor = position and collor on minimal hp before recharging
            rechargehp()
            Sleep(1000)
            Send("{1}");start attacking if recharge stoped attack function
        ElseIf "0x"&Hex(PixelGetColor ( x , y, 6) <> $mpcollor Then ;$mpcollor = position and collor on minimal mp before recharging
            rechargehp()
            Sleep(1000)
            Send("{1}")
        EndIf
    Until "0x"&Hex(PixelGetColor ( x , y, 6) <> $Selectedmob_HP ;$Selectedmob_HP = position and collor on first pixel so that you know if you kiled mob
EndFunc

Func selectmob()
    Do
        $coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )
    Until IsArray($coord)
    MouseClick("",$coord[0],$coord[1])
EndFunc

Second sugestion: dont try to bot, play the game, youl have more fun when playing instead of looking to the screen while the bot is playing.


TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites

more then one script on one game isnt something that is easy to control

First sugestion: one loop with "Select...Case...EndSelect " (look in the help file)

example

While 1
    Select;select the first correct case, first r hp and mp so that you dont die
        Case "0x"&Hex(PixelGetColor ( x , y, 6) <> $hpcollor
            rechargehp()
        Case "0x"&Hex(PixelGetColor ( x , y, 6) <> $mpcollor
            rechargehp()
        Case "0x"&Hex(PixelGetColor ( x , y, 6) = $Selectedmob ;$Selectedmob = position and collor on last pixel so that you know that your not attacking mob that someone else is attacking first
            autoattackmob()
        Case Else
            selectmob()
    EndSelect
    Sleep(100)
WEnd

Func rechargehp()
    Send("{=}")
EndFunc

Func rechargemp()
    Send("{-}")
EndFunc

Func autoattackmob()
    Send("{1}")
    Do
        Sleep(100)
        If "0x"&Hex(PixelGetColor ( x , y, 6) <> $hpcollor Then ;$hpcollor = position and collor on minimal hp before recharging
            rechargehp()
            Sleep(1000)
            Send("{1}");start attacking if recharge stoped attack function
        ElseIf "0x"&Hex(PixelGetColor ( x , y, 6) <> $mpcollor Then ;$mpcollor = position and collor on minimal mp before recharging
            rechargehp()
            Sleep(1000)
            Send("{1}")
        EndIf
    Until "0x"&Hex(PixelGetColor ( x , y, 6) <> $Selectedmob_HP ;$Selectedmob_HP = position and collor on first pixel so that you know if you kiled mob
EndFunc

Func selectmob()
    Do
        $coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )
    Until IsArray($coord)
    MouseClick("",$coord[0],$coord[1])
EndFunc

Second sugestion: dont try to bot, play the game, youl have more fun when playing instead of looking to the screen while the bot is playing.

Thanks! I'll look into that. And TBH, I am most likely not gonna use the bot at all. I just want to have it accomplished etc.

Share this post


Link to post
Share on other sites

Hmm. Ok I tried the case one, but I don't think I am doing it right? Here is the script :

HotKeySet("{F3}", "_Start") ; ====> Start
HotKeySet("{F5}", "_Stop")  ; ====> Pause
HotKeySet("{ESC}", "_Exit") ; ====> Exit (terminate script)

Global $ON = False
    While 1
    $ON = True
    Sleep(10)
WEnd

Func _Start()
    MouseClick ("left", 610,223)
    sleep(100)
    $ON = True
EndFunc   ;==>_Start

Func _Stop()
    $ON = False
EndFunc   ;==>_Stop

Func _Exit()
    $ON = False
    Exit
EndFunc   ;==>_Exit
   While 1
    Select;select the first correct case, first r hp and mp so that you dont die
        Case  $checksum = PixelChecksum(220,151,232,165)

; Wait for the region to change, the region is checked every 100ms to reduce CPU load
While $checksum = PixelChecksum(220,151,232,165)
  Sleep(100)
WEnd
MouseClick("left", 745,327)
           LifeMonitor()
        Case  $checksum = PixelChecksum(417,151,420,164)
; Wait for the region to change, the region is checked every 100ms to reduce CPU load
While $checksum = PixelChecksum(417,151,420,164)
  Sleep(100)
WEnd
            enterfight()
        Case $Colors = StringSplit("0x6B0967,0x663340,0xffff93,0x4C4C00,0x9f772B,0xBfBf99", ",")

    For $x = 1 To $Colors[0]
        $coord = PixelSearch(445,339,689,381, $Colors[$x]) ;searches for monster, if not found keeps searching
      
        search()
    EndSelect
    sleep(100)
Wend

Func LifeMonitor()
    MouseClick("left", 745,327)
EndFunc

Func enterfight()
    MouseClick("left", 606,229)
EndFunc

Func search()
                        If Not @error Then
            
            MouseClick("left",503,349)
            sleep(50)
            MouseClick("left",502,365)
            sleep(50)
            MouseClick("left",508,355)
            sleep(50)
            MouseClick("left",510,375)
            sleep(50)
            MouseClick("left",513,371)
            sleep(50)
            Return
        EndIf
    Next
    If @error Then
        MouseClick("left",256,326)
        EndIf

Once again, thanks to anyone who has any time to possibly check over this to see what I am doing wrong, or if It is set up correct etc.

Share this post


Link to post
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
Sign in to follow this  
Followers 0