Originally Posted by kesawea
I use both, SCAR+AutoIt.
Thanks to Jinong81 for the autopot.
Bot -> skill (buton), loot (buton), revive (hack), autotarget (pixelsearch)
ah! leave the char on the mob spot first :P
this bot doesn't wait for any thing, so try to don't teleport with it activated :P
EDIT: Translated and better commented.
EDIT2: Added atck speed hack and run speed hack buttons :P ->atck speed doesn't get freezed on 100, and the buttons only works before the BOT button.
EDIT3: Added more hotkeys :) -> works before BOT button.
EDIT4: Scan from bottom to top to get the near mob first :P , autoOpen the autopot script made by Jinong81 :3 (read the bottom of this post).
EDIT5: Scan from bottom tested.
ToDo:
- Freeze atck spd
- Fix Hotkeys
- Add a button to stop the bot without closing it :P
- Add more stuff, like multiple mob attacking, NPC selling (gate master), etc.
Code:
;Ok, here is the code...
;This bot was build to bot with the following conditions:
; i.- Jinong-Female char ; ii.- Aeria games ; iii.- F1-Loot, F4 skill, F9 to exit.
; iv.- Red mob ; v.- R55 mob
;This bot uses action hack to revive.
; Special thanks to UPSman2, I used some of his code :P : http://www.elitepvpers.com/forum/co2-guides-templates/118159-autoit-memory-address.html
; Made by me, Kesawea. (don't PM me questions about the code, unless u have made a contribution on this thread)
; Translated to english (and add some comments) because XiaoBao requested.
#include <GUIConstants.au3>
#include <NomadMemory.au3> ;because you need this for _memread functions
#include <Process.au3> ; to write on a DOS console.
HotKeySet("{F9}", "MyExit") ;Hit F9 to exit the script.
HotKeySet("{F10}", "FAtckspeed") ;Hit F10 to apply atck hack.
HotKeySet("{F11}", "FRunspeed") ;Hit F11 to apply run hack.
GUICreate("12Sky2",-1,150)
$Button_1 = GUICtrlCreateButton ("BOT", 10, 20, 150)
$Button_2 = GUICtrlCreateButton ("Revive!", 160, 20, 80)
$Button_3 = GUICtrlCreateButton ("Hack Attack spd on 100% (F10)", 160, 70, 160)
$Button_4 = GUICtrlCreateButton ("Hack Run spd on 50% (F11)", 160, 120, 160)
$Label_1 = GUICtrlCreateLabel("(Nš of times ressurected)",160, 0) ; Just to show how many times u died.
GUISetState ()
;the window to get PID
$Process1 = WinGetProcess("TwelveSky2")
Const $accion = 0x00C85D17, $revive = 1, $muerte1 = 6556776, $muerte2 = 3072, $muerte3 = 6556712, $muerte4 = 6556904, $muerte5 = 6556840 ; Death = muerte xD (those are the values of the animation addss. when this char dies, there might be more)
Const $nada[3] = [0,0,1], $sCommand = "start C:\autopot"
Global $contador = 1, $xTop = 5, $yTop = 82, $xBot = 1023, $yBot = 736, $mobGreen = "0x5C5672", $contador2 = 0, $x, $y ; contador = counter, mobgreen = mob color
Global $atkspdA = 0x00C85D73, $runspdA = 0x00C60770, $atkspd = 100, $runspd = 50, $comodin[3] = [0,0,1], $coord[2] = [0,0], $coordm[3] = [0,0,0]
; _RunDOS ( $sCommand ) ; runs the autopot script :P
While 1 ;main loop
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE ; this doesn't work when you activate the bot.
ExitLoop
Case $msg = $Button_1 ; on click button "BOT", do:
while 1
buscamob()
loot()
revive()
Wend
Case $msg = $Button_2 ;Force ressurection, but doesn't work when the char dies in the loop execut. (for that it's the "revive()" funct)
$Mem_Open = _MemoryOpen($Process1)
_MemoryWrite($accion, $Mem_Open, $revive)
_MemoryClose($Mem_Open) ;close it afterwards
GUICtrlSetData($Label_1,$contador) ; sets label to value of read memory
$contador = $contador + 1
Case $msg = $Button_3 ;Atck Speed hack
$Mem_Open = _MemoryOpen($Process1)
_MemoryWrite($atkspdA, $Mem_Open, $atkspd)
_MemoryClose($Mem_Open) ;close it afterwards
Case $msg = $Button_4 ; Moving speed hack
$Mem_Open = _MemoryOpen($Process1)
_MemoryWrite($runspdA, $Mem_Open, $runspd)
_MemoryClose($Mem_Open) ;close it afterwards
EndSelect
Wend
Func ataca() ; Attack Function
$vivo2 = estavivo()
While $vivo2 = "1"
Send("{F4 down}")
Sleep(100)
Send("{F4 up}")
$vivo2 = estavivo()
WEnd
EndFunc
Func loot() ; Loot Function
Send("{F1 down}")
Sleep(100)
Send("{F1 up}")
Send("{F1 down}")
Sleep(100)
Send("{F1 up}")
Send("{F1 down}")
Sleep(100)
Send("{F1 up}")
Send("{F1 down}")
Sleep(100)
Send("{F1 up}")
Send("{F1 down}")
Sleep(100)
Send("{F1 up}")
Send("{F1 down}")
Sleep(100)
Send("{F1 up}")
EndFunc
Func estavivo() ; checks if the mob is alive/sellected , esta vivo = it's ALIVE! xDDD
PixelSearch(456, 36, 531, 49,"0xFF0000",2)
$r=@error
if Not @error Then
Return ("1")
Else
Return ("2")
EndIf
EndFunc
Func revive() ; revive = resurrects
$Mem_Open = _MemoryOpen($Process1)
$check = _MemoryRead($accion, $Mem_Open) ;reads value at memory address
_MemoryClose($Mem_Open) ;close it afterwards
If $check = $muerte1 Or $check = $muerte2 Or $check = $muerte3 Or $check = $muerte4 Or $check = $muerte5 Then ;if it dies with any of this animations.
$Mem_Open = _MemoryOpen($Process1)
_MemoryWrite($accion, $Mem_Open, $revive)
_MemoryClose($Mem_Open) ;close it afterwards
GUICtrlSetData($Label_1,$contador) ; sets label to value of read memory
$contador = $contador + 1
EndIf
EndFunc
Func buscamob() ;Auto clicking function.
$coordm = bottomtotop()
If $coordm[2] = 0 Then; If the pixel color was found, then:
while $coordm[2] = 0 ;Mientras el pixel exista, hace:
$x = Random($coordm[0], $coordm[0]+10, 1) ; random for randomness xDD (make click around the original coord).
$y = Random($coordm[1], $coordm[1]+10, 1)
MouseClick("left", $x, $y, 1, 0); Click on the coords obtained on the previous lines.
$vivo = estavivo()
Sleep(500)
If $vivo = "1" Then ; CHecks if the mob is selected.
ExitLoop ; If it's true then exit the loop
EndIf
$coordm = bottomtotop()
revive()
wend
If $vivo = "1" Then ; checks again if the mob is selected.
while $vivo = "1" ; while the mob it's selected, do:
ataca()
$vivo = estavivo()
wend
$contador2 = 0
Else
$contador2 = $contador2 + 1
If $contador2 = 8 Then ; if i fool around with a pixel in the ground that looks like the mob color, do...
MouseClickDrag("left", 515, 388, 352, 388, 6) ; turns the camera to the right.
MouseClick("left", $x, $y, 1, 0) ; move to the last position of the mouse, I whould disable this if the char gets too far.
EndIf
revive()
EndIf
Else ; if there is no mob then...
MouseClickDrag("right", 515, 388, 352, 388, 6) ; turns the camera to the left.
Endif
EndFunc
Func MyExit() ; What does the F9? -> exit
Exit
EndFunc
Func FAtckspeed() ; What does the F10? -> atck speed
$Mem_Open = _MemoryOpen($Process1)
_MemoryWrite($atkspdA, $Mem_Open, $atkspd)
_MemoryClose($Mem_Open) ;close it afterwards
EndFunc
Func FRunspeed() ; What does the F11? -> Run speed
$Mem_Open = _MemoryOpen($Process1)
_MemoryWrite($runspdA, $Mem_Open, $runspd)
_MemoryClose($Mem_Open) ;close it afterwards
EndFunc
Func bottomtotop() ; i search for the mob with $mobGreen color with a tolerance of 5
$ymov = 732
While 1
$coord = PixelSearch($xTop,$ymov,$xBot,$yBot,$mobGreen,5)
$n = @error
If Not @error Then
$comodin[0] = $coord[0]
$comodin[1] = $coord[1]
$comodin[2] = 0
Return $comodin
Else
$ymov = $ymov - 10
If $ymov = $yTop Then
Return $nada
EndIf
EndIf
WEnd
EndFunc
To make the Autopot works u need to make a file on the C:\ with the name "autopot.bat" with the following lines inside (the autpot script i have it's named autopotTS2.scar and its located on the Scripts folder of the SCAR root):
Code:
cd "C:\Archivos de programa\SCAR 3.20"
scar.exe -open scripts\autopotTS2.scar -run
I u wan't to PM me a question about this script, post a hack contribution here first.
GL, ^_^
|