Jump to content

Could u help me to complete my script...


 Share

Recommended Posts

I'm playing a MMORPG game named CABAL Online, and i tried to write a script for auto-attack and auto-heal for this game.

But it has a XTrap - GameGuard so i've got some problems.

- AutoIT Window Info Program cannot get "Color under Cursor" when the GameGuard is running

- Cannot send any keystroke to any program, even " 1 2 3 4 " for example...

I've written a small script, it works well with other program, but when Gameguard is ON, it cannot run <_< .

I've got other program written in AutoIT, It works well with CABAL game even if GameGuard is ON....

I dunt know what are my fails when writting script.

Here is the Program :

http://www.850mb.com/users/ares1206/HOLY-AUTOCABAL.rar

And below is my code.

Any bro can help me to fix my script ? maybe other Function ...

Or can u help me to decompile this working-attached-program to see what function the writter used.

Pls help me,

I'm newbie here, and sorry for my bad English. Thank you very much

Global Const $GUI_EVENT_CLOSE   = -3
Global Const $GUI_CHECKED       = 1
Global Const $GUI_UNCHECKED     = 4


Const $HP_Color = 0xF98466
Const $MOB_Color = 0xD43218
Const $COMBO_Color = 0xFFC6C6
Const $COMBO_EMPTY_X        = 436
Const $COMBO_EMPTY_Y        = 45
Const $MOB_EMPTY_X      = 355
Const $MOB_EMPTY_Y      = 18
Const $HP_EMPTY_X       = 54
Const $HP_EMPTY_Y       = 29
Const $short_key = "1|2|3|4|5|6|7|8|9|0| |"
Const $short_key_HP = "1|2|3|4|5|6|7|8|9|0| |"
Const $short_key_COMBO = "1|2|3|4|5|6|7|8|9|0| |"
Const $short_key_attack = "1|2|3|4|5|6|7|8|9|0| |"

Dim $startIT = False
Dim $auto_HP = True
Dim $auto_COMBO = False
Dim $auto_attack = False
Dim $SKILL_ATT_1 = 1        
Dim $SKILL_ATT_2 = 2    
Dim $SKILL_ATT_3 = 3    
Dim $SKILL_ATT_4 = 4        
Dim $SKILL_COMBO_1 = 1      
Dim $SKILL_COMBO_2 = 2  
Dim $SKILL_COMBO_3 = 3  
Dim $SKILL_COMBO_4 = 4  
Dim $keyHP = 5
Dim $HPdeg = 70
Dim $HPlength = 144

Func setKeys()
    HotKeySet("{F5}","startIt")
    HotKeySet("{F6}","stopIt")
    HotKeySet("{F7}","stopcombo")
EndFunc

Func startIt()   
    $startIT = True
    ToolTip("Bat dau Auto",0,0)
EndFunc
Func stopIt()
    $auto_HP = False
    $auto_COMBO = False
    $auto_attack = False    
    $startIt = False
    ToolTip("Dung Auto",0,0)
EndFunc

Func stopcombo()
    $auto_COMBo = False
    ToolTip("Dung Combo",0,0)
EndFunc

Func terminateIt()
    Exit 0
EndFunc

Func CheckMobSelected()

    $color_mob = PixelGetColor($MOB_EMPTY_X, $MOB_EMPTY_Y)

    If $color_mob = $MOB_COLOR Then
        Return True
    Else
        Return False
    EndIf

EndFunc

;Func CheckComboSelected()

;   $color_combo = PixelGetColor($COMBO_EMPTY_X, $COMBO_EMPTY_Y)

;   If $color_combo = $COMBO_COLOR Then
;       Return True
;   Else
;       Return False
;   EndIf
;EndFunc

Func showGUI()
    Local $gui_hWnd = GUICreate("Tu buff Cabal v1.01",265,230)
    
GuiCtrlCreateTab(0, 0, 265, 200)
GuiCtrlCreateTabItem("Auto HP")

    Local $gui_HP_check = GUICtrlCreateCheckbox("Auto HP",20,65)
    If ($auto_HP == True) Then
        GUICtrlSetState($gui_HP_check,$GUI_CHECKED)
    Else
        GUICtrlSetState($gui_HP_check,$GUI_UNCHECKED)
    EndIf

    
    GUICtrlCreateLabel("Tu dong bom mau:",10,90)
    GUICtrlCreateLabel("Phim tat:",10,105)
    Local $gui_key_HP = GUICtrlCreateCombo($keyHP,10,120,40)
    GUICtrlSetData($gui_key_HP,$short_key_HP,$keyHP)

    GUICtrlCreateLabel("% mau <",70,105)
    Local $gui_input_HP = GUICtrlCreateInput ($HPdeg,70,120,40)
    Local $gui_deg_HP = GUICtrlCreateUpdown($gui_input_HP)


GuiCtrlCreateTabItem("Auto Skill")

Local $gui_attack_check = GUICtrlCreateCheckbox("Auto Skill",50,25)
    If ($auto_attack == True) Then
        GUICtrlSetState($gui_attack_check,$GUI_CHECKED)
    Else
        GUICtrlSetState($gui_attack_check,$GUI_UNCHECKED)
    EndIf

    GUICtrlCreateLabel("Skill 1 :",50,55)
    GUICtrlCreateLabel("Phim tat:",130,55)
    Local $gui_attack_phep1 = GUICtrlCreateCombo($SKILL_ATT_1,180,50,30)
    GUICtrlSetData($gui_attack_phep1,$short_key_attack,$SKILL_ATT_1)

    GUICtrlCreateLabel("Skill 2:",50,85)
    GUICtrlCreateLabel("phim tat:",130,85)
    Local $gui_attack_phep2 = GUICtrlCreateCombo($SKILL_ATT_2,180,80,30)
    GUICtrlSetData($gui_attack_phep2,$short_key_attack,$SKILL_ATT_2)
    
    GUICtrlCreateLabel("Skill 3:",50,115)
    GUICtrlCreateLabel("phim tat:",130,115)
    Local $gui_attack_phep3 = GUICtrlCreateCombo($SKILL_ATT_3,180,110,30)
    GUICtrlSetData($gui_attack_phep3,$short_key_attack,$SKILL_ATT_3)
    
    GUICtrlCreateLabel("Skill 4:",50,145)
    GUICtrlCreateLabel("phim tat:",130,145)
    Local $gui_attack_phep4 = GUICtrlCreateCombo($SKILL_ATT_4,180,140,30)
    GUICtrlSetData($gui_attack_phep4,$short_key_attack,$SKILL_ATT_4)

    
GuiCtrlCreateTabItem("Auto Combo")

    Local $gui_auto_combo_check = GUICtrlCreateCheckbox("Auto Combo",70,30)
    If ($auto_combo == True) Then
        GUICtrlSetState($gui_auto_combo_check,$GUI_CHECKED)
    Else
        GUICtrlSetState($gui_auto_combo_check,$GUI_UNCHECKED)
    EndIf

    GUICtrlCreateLabel("Phep 1:",50,70)
    GUICtrlCreateLabel("phim tat:",110,70)
    Local $gui_key_skill1 = GUICtrlCreateCombo($SKILL_COMBO_1,170,65,30)
    GUICtrlSetData($gui_key_skill1,$short_key,$SKILL_COMBO_1)

    GUICtrlCreateLabel("Phep 2:",50,100)
    GUICtrlCreateLabel("phim tat:",110,100)
    Local $gui_key_skill2 = GUICtrlCreateCombo($SKILL_COMBO_2,170,95,30)
    GUICtrlSetData($gui_key_skill2,$short_key,$SKILL_COMBO_2)

    GUICtrlCreateLabel("Phep 3:",50,130)
    GUICtrlCreateLabel("phim tat:",110,130)
    Local $gui_key_skill3 = GUICtrlCreateCombo($SKILL_COMBO_3,170,125,30)
    GUICtrlSetData($gui_key_skill3,$short_key,$SKILL_COMBO_3)

    GUICtrlCreateLabel("Phep 4:",50,160)
    GUICtrlCreateLabel("phim tat:",110,160)
    Local $gui_key_skill4 = GUICtrlCreateCombo($SKILL_COMBO_4,170,155,30)
    GUICtrlSetData($gui_key_skill4,$short_key,$SKILL_COMBO_4)


GuiCtrlCreateTabItem("")
    Local $gui_save_data = GUICtrlCreateButton("SAVE",0,200,265,30)

    GuiSetState(@SW_SHOW)

    While (1)


        $msg = GUIGetMsg()
        Select
            Case $msg = $gui_save_data
                If (GUICtrlRead($gui_HP_check)==$GUI_UNCHECKED) Then
                    $auto_HP = False
                Else
                    $auto_HP = True
                EndIf
                
                If (GUICtrlRead($gui_attack_check)==$GUI_UNCHECKED) Then
                    $auto_attack = False
                Else
                    $auto_attack = True
                EndIf
                If (GUICtrlRead($gui_auto_combo_check)==$GUI_UNCHECKED) Then
                    $auto_combo = False
                Else
                    $auto_combo = True
                EndIf
                $keyHP = GUICtrlRead($gui_key_HP)
                $HPdeg = GUICtrlRead($gui_input_HP)
                $SKILL_ATT_1 = GUICtrlRead($gui_attack_phep1)
                $SKILL_ATT_2 = GUICtrlRead($gui_attack_phep2)
                $SKILL_ATT_3 = GUICtrlRead($gui_attack_phep3)
                $SKILL_ATT_4 = GUICtrlRead($gui_attack_phep4)
                $SKILL_COMBO_1 = GUICtrlRead($gui_key_skill1)
                $SKILL_COMBO_2 = GUICtrlRead($gui_key_skill2)
                $SKILL_COMBO_3 = GUICtrlRead($gui_key_skill3)
                $SKILL_COMBO_4 = GUICtrlRead($gui_key_skill4)
                    

            Case $msg = $GUI_EVENT_CLOSE
                terminateIt()
                ExitLoop
            EndSelect
        
        
        If ($startIt == True) Then
            If ($auto_attack == True) Then 
                AutoAtt()
            EndIf
            If ($auto_HP == True) Then
                $HP_Color_Now = PixelGetColor($HP_EMPTY_X + $HPlength*$HPdeg/100 , $HP_EMPTY_Y)     
                If Not ($HP_Color_Now == $HP_Color) Then
                    ControlSend("CABAL","","" ,$keyHP)
                    Sleep(5)
                EndIf
            EndIf
            
        ;If ($auto_COMBO == True) Then 
        ;   If CheckComboSelected() Then AutoCombo()
        ;EndIf

        EndIf
        
    WEnd
    GUIDelete()
    terminateIt()
    
    
EndFunc


Func AutoAtt()
    If ($auto_attack == True) Then
        ControlSend("CABAL","","" ,$SKILL_ATT_1)
        Opt("SendKeyDelay", 5)
        ControlSend("CABAL","","" ,$SKILL_ATT_2)
        Opt("SendKeyDelay", 5)
        ControlSend("CABAL","","",$SKILL_ATT_3)
        Opt("SendKeyDelay", 5)
        ControlSend("CABAL","","" ,$SKILL_ATT_4)
        Sleep(5)
    EndIf
EndFunc

Func AutoCombo()
;If ($auto_COMBO == True) Then
;   Send($SKILL_COMBO_1)
;   Opt("SendKeyDelay", 5)
;   Send($SKILL_COMBO_2)
;   Opt("SendKeyDelay", 5)
;   Send($SKILL_COMBO_3)
;   Opt("SendKeyDelay", 5)
;   Send($SKILL_COMBO_4)
;   Sleep(5)
;EndIf
EndFunc




setKeys()
showGUI()
Link to comment
Share on other sites

  • 3 weeks later...

ares1260

How u can detect color in cabal?

I try with window info but it false, i cant detect color.

BTW with auto buff u can read pointer from process to read the realtime HP

U can use this

#include <NomadMemory.au3>

Func _FindNewAddress(ByRef $P,ByRef $OSet)

$ID=_MemoryOpen(ProcessExists($Game_ID))

$New_Address=_MemoryRead($P,$ID) +$OSet

_MemoryClose($ID)

Return $New_Address

EndFunc

Func _ReadValue (ByRef $P,ByRef $OSet)

$ID=_MemoryOpen(ProcessExists($Game_ID))

$Address=_FindNewAddress($P,$OSet)

$value=_MemoryRead($Address,$ID)

_MemoryClose($ID)

Return $value

EndFunc

[center]Không có việc gì khó, chỉ sợ làm không đượcĐào núi và lấp biển, quyết chí ắc bị điên[/center]

Link to comment
Share on other sites

Khong co scrip nao qua duoc xtrap ca, van de la minh cho game chay truoc roi moi kich hoat script len sau thi se past duoc xtrap thoi.

[center]Không có việc gì khó, chỉ sợ làm không đượcĐào núi và lấp biển, quyết chí ắc bị điên[/center]

Link to comment
Share on other sites

Van de qua Xtrap co the giai quyet tam thoi nhu vay, bay gio AE tim cach lam sao de doc dc gia tri HP (current/total) de lam 1 cai auto heal HP :P

---------

meokhung co the noi ro~ hon ve cac ham readprocess o tren dc ko?

Cach dung nhu the nao vay?

Edited by Daredevil
Link to comment
Share on other sites

Van de qua Xtrap co the giai quyet tam thoi nhu vay, bay gio AE tim cach lam sao de doc dc gia tri HP (current/total) de lam 1 cai auto heal HP :P

---------

meokhung co the noi ro~ hon ve cac ham readprocess o tren dc ko?

Cach dung nhu the nao vay?

How to read realtime value in somegame:

At first you must know everyvalue in program (or game) will store in one address of memory, and that address will pointed by one pointer, so your work is find where is that pointer address.

I use Cheat Engine 5.3 (the tool so cool to find address) or you can use ArtMoney 7.0 Pro, i dont detail about how to use it, ;)

So after you got the pointer (must be a pointer, because when u reset game or quit game the address will be change) you can read/write by the function below.

NomadMemory.au3

Incluce this file at top of your page

Inside that file have 4 Function very powerfull to Open/Read/Write/Close the process or you can use my func (just a modify something follow NomadMemory.au3)

Now, about how to read/write:

As you know, if you want read/write to process have 3 step

Open Process

Read/Write value

Close Process

1 process can be call by ID like 0x0000000 or the window name (or title) or just a file :) ex: mytest.exe

1 value of process will have 2 thing: The address (pointer) and Offset

ex: I try open my game (Red alert 2 if you know ^^)

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=I:\New Form\Red Alert 2.kxf

$fMain = GUICreate("Red Alert 2 - Thuy Bui Chi", 265, 76, 303, 261)

$edMoney = GUICtrlCreateInput("0", 8, 8, 249, 21)

$bRead = GUICtrlCreateButton("Read", 8, 40, 123, 25, 0)

$bWrite = GUICtrlCreateButton("Write", 136, 40, 123, 25, 0)

GUISetState(@SW_SHOW)

Global $Pointer=0x00a1e0c4

Global $Offset=0x0000024c

Global $Game_ID="GAME.EXE"

;This func to complete address and offset

Func _FindNewAddress(ByRef $P,ByRef $OSet)

$ID=_MemoryOpen(ProcessExists($Game_ID))

$New_Address=_MemoryRead($P,$ID) +$OSet

_MemoryClose($ID)

Return $New_Address

EndFunc

;This func i do God Mod for game, everytime my gold capacity slow down than 100k it will refill up

;You can see i use func _MemoryRead to read the value and _MemoryWrite to write the value and _MemoryClose to close the process.

Func _RefillMoney()

$ID=_MemoryOpen(ProcessExists($Game_ID))

$Address=_FindNewAddress($Pointer,$Offset)

$MaxMoney=_MemoryRead($Address,$ID)

If $MaxMoney < 100000 Then

_MemoryWrite($Address, $ID, 100000)

EndIf

_MemoryClose($ID)

EndFunc

;or you can add money when you want by

Func ReadMoneyValue ()

$ID=_MemoryOpen(ProcessExists($Game_ID))

$Address=_FindNewAddress($Pointer,$Offset)

$MaxMoney=_MemoryRead($Address,$ID)

_MemoryClose($ID)

Return $MaxMoney

EndFunc

Func WriteMoneyValue(ByRef $gold)

If IsInt($gold) then

$ID=_MemoryOpen(ProcessExists($Game_ID))

$Address=_FindNewAddress($Pointer,$Offset)

_MemoryWrite($Address, $ID,$gold)

_MemoryClose($ID)

EndIf

EndFunc

Global $Golds

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case $msg = $bRead

GUICtrlSetData($edMoney,ReadMoneyValue())

Case $msg = $bWrite

$Golds = int(GUICtrlRead ($edMoney))

WriteMoneyValue($Golds)

;MsgBox(0,"Gold",$Golds)

EndSelect

WEnd

Thats all. Hope it usefull for you.

I send all attach below

RedAlert_Gold_Mode.au3

[center]Không có việc gì khó, chỉ sợ làm không đượcĐào núi và lấp biển, quyết chí ắc bị điên[/center]

Link to comment
Share on other sites

Meokhung, Cabal can not run with cheatengine ( include Newest version 5). I will disconnect when open Cheatengine while opening Cabal game.

Run cabal first and cheatengine after that. I'm using cheatengine 5.3 and dont have problem

PS: How can detect color in cabal >.< i cant detect by window info and i tried use code PixelColor(X,Y) to detect but still false

I writing auto auto comboskill now, hope can do it together. contact me at YM: mamut2100@yahoo.com or email: mamut2100@gmail.com

Edited by meokhung

[center]Không có việc gì khó, chỉ sợ làm không đượcĐào núi và lấp biển, quyết chí ắc bị điên[/center]

Link to comment
Share on other sites

sorry , i'm speaking language VietNAm .

Cái auto của holyknight không send key mà là send mouse click , xtrap ko block mouse nên dễ dàng send .

Còn câu hỏi của meokhung làm sao detect color trong cabal hay other game with gameguard , bạn chụp hình lại và paste vào paint ( chụp ngòai window , ko chụp trong game) , lấy tấm hình đó detect color, với cách này bạn có thể check color hp , mp của nhân vật và tự send mouse click ( ví dụ vị trí 0 thì có tọa độ riêng)

Link to comment
Share on other sites

  • Jos locked this topic
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...