Originally Posted by quoctinh
Global $pos, $off_def_x_pos,$off_def_y_pos,$common_x_pos,$commo n_y_pos,$buff_key1,$buff_key2,$buff_key1_down,$buf f_key1_up,$buff_key2_down,$buff_key2_up
Global $buff_colour,$common_colour,$n,$dragonfall_x,$drag onfall_y,$dmg_status_x,$dmg_status_y,$plus_dmg,$mi nus_dmg,$dragonfall
;colours
Global $df,$plus_hsb,$minus_hsb
HotKeySet("{F2}", "Start")
HotKeySet("{DEL}","Terminate")
$n=0
TogglePause()
Func Start()
HotKeySet("{F2}", "TogglePause")
ToolTip('Auto buffs/pick On: F2 to Pause, DEL to Quit',120, 75)
$buff_key1=IniRead ("Settings.ini", "BUFFS","buff_key1","")
$buff_key2=IniRead ("Settings.ini", "BUFFS","buff_key2","")
$df=IniRead ("Settings.ini", "COLOURS","df","")
$plus_hsb=IniRead ("Settings.ini", "COLOURS","plus_hsb","")
$minus_hsb=IniRead ("Settings.ini", "COLOURS","minus_hsb","")
If WinWaitActive("TwelveSky2") >0 Then
If $n<1 Then
;call function to check if DF and HSB status
DF_HSB_Check()
;def/off buff
$buff_key1_down = "{" & $buff_key1 & " down}"
$buff_key1_up = "{" & $buff_key1 & " up}"
Send($buff_key1_down)
Sleep(2500)
Send($buff_key1_up)
Sleep(100)
;common buff
$buff_key2_down = "{" & $buff_key2 & " down}"
$buff_key2_up = "{" & $buff_key2 & " up}"
Send($buff_key2_down)
Sleep(2500)
Send($buff_key2_up)
Sleep(100)
$common_colour = 0 & "x" & Hex(PixelGetColor($common_x_pos+$pos[0],$common_y_pos+$pos[1]),6)
$buff_colour = 0 & "x" & Hex(PixelGetColor($off_def_x_pos+$pos[0], $off_def_y_pos+$pos[1]),6)
EndIf
EndIf
While 1
$n=1
If WinWaitActive("TwelveSky2") >0 Then
;call function to check if DF and HSB status
DF_HSB_Check()
;call function to buff offensive or defensive skill
OBDB()
;call function to buff common skill
Common_Buff()
EndIf
Sleep(1000)
WEnd
EndFunc
;Pause game
Func TogglePause()
ToolTip('Auto buffs/pick off: Press F2 to Start, DEL to Quit',120, 75)
HotKeySet("{F2}", "Start")
While 1
sleep(100)
WEnd
EndFunc
Func Terminate()
Exit 0
EndFunc
;Offensive/Defensive Buff
Func OBDB()
Local $OBDB_buff
$buff_key1_down = "{" & $buff_key1 & " down}"
$buff_key1_up = "{" & $buff_key1 & " up}"
$OBDB_buff = PixelSearch($off_def_x_pos+$pos[0], $off_def_y_pos+$pos[1], $off_def_x_pos+1+$pos[0], $off_def_y_pos+1+$pos[1], $buff_colour)
If $OBDB_buff=1 Then ;color not found
Send($buff_key1_down)
Sleep(2400)
Send($buff_key1_up)
Sleep(100)
EndIf
EndFunc
;Common Buff
Func Common_Buff()
Local $CB
$buff_key2_down = "{" & $buff_key2 & " down}"
$buff_key2_up = "{" & $buff_key2 & " up}"
$CB = PixelSearch($common_x_pos+$pos[0], $common_y_pos+$pos[1], $common_x_pos+1+$pos[0], $common_y_pos+1+$pos[1], $common_colour)
If $CB=1 Then ;color not found
Send($buff_key2_down)
Sleep(2400)
Send($buff_key2_up)
Sleep(100)
EndIf
EndFunc
;function for check DF and HSB status
Func DF_HSB_Check()
$pos = WinGetPos("[active]")
If $pos[2]=1030 And $pos[3]=796 Then
$dragonfall_x=245
$dragonfall_y=34
$off_def_y_pos=39
$common_y_pos=31
$dmg_status_y=36
ElseIf $pos[2]=1030 And $pos[3]=800 Then
$dragonfall_x=245
$dragonfall_y=38
$off_def_y_pos=43
$common_y_pos=35
$dmg_status_y=40
Else
$dragonfall_x=242
$dragonfall_y=9
$off_def_y_pos=14
$common_y_pos=6
$dmg_status_y=11
EndIf
$dragonfall=PixelSearch($dragonfall_x+$pos[0], $dragonfall_y+$pos[1], $dragonfall_x+1+$pos[0], $dragonfall_y+1+$pos[1], $df)
Select
Case $dragonfall<>1 ; color found (have dragonfall)
If $pos[2]=1030 Then
$dmg_status_x=275
Else
$dmg_status_x=272
EndIf
$plus_dmg=PixelSearch($dmg_status_x+$pos[0], $dmg_status_y+$pos[1], $dmg_status_x+1+$pos[0], $dmg_status_y+1+$pos[1], $plus_hsb)
$minus_dmg=PixelSearch($dmg_status_x+$pos[0], $dmg_status_y+$pos[1], $dmg_status_x+1+$pos[0], $dmg_status_y+1+$pos[1], $minus_hsb)
Select
Case $plus_dmg<>1 or $minus_dmg<>1 ; color found (have dmg boost)
If $pos[2]=1030 Then
$off_def_x_pos=313
$common_x_pos=333
Else
$off_def_x_pos=310
$common_x_pos=330
EndIf
Case Else ; color not found (no dmg boost)
If $pos[2]=1030 Then
$off_def_x_pos=285
$common_x_pos=305
Else
$off_def_x_pos=282
$common_x_pos=302
EndIf
EndSelect
Case $dragonfall=1 ;color not found (no dragon fall)
If $pos[2]=1030 Then
$dmg_status_x=247
Else
$dmg_status_x=244
EndIf
$plus_dmg=PixelSearch($dmg_status_x+$pos[0], $dmg_status_y+$pos[1], $dmg_status_x+1+$pos[0], $dmg_status_y+1+$pos[1], $plus_hsb)
$minus_dmg=PixelSearch($dmg_status_x+$pos[0], $dmg_status_y+$pos[1], $dmg_status_x+1+$pos[0], $dmg_status_y+1+$pos[1], $minus_hsb)
Select
Case $plus_dmg<>1 or $minus_dmg<>1 ; color found (have dmg boost)
If $pos[2]=1030 Then
$off_def_x_pos=285
$common_x_pos=305
Else
$off_def_x_pos=282
$common_x_pos=302
EndIf
Case Else ; color not found (no dmg boost)
If $pos[2]=1030 Then
$off_def_x_pos=257
$common_x_pos=277
Else
$off_def_x_pos=254
$common_x_pos=274
EndIf
EndSelect
EndSelect
EndFunc
make a text file with name " settings.ini" without the quote and paste this in there. Put both file in same directory
Notes:
1. For all MP/HP/Pet keys: Just replace the # in between "{ }"
2. Hotkeys setting "1 to 0" to be used
[HP]
hp_percent=45
hp_key1="{1}"
hp_key2="{6}"
[MP]
mp_percent=10
mp_key1="{2}"
mp_key2="{8}"
[PET]
pethp_percent=10
PetHPKey="{9}"
[BUFFS]
buff_key1=w
buff_key2=e
[PICKUP]
pickup_key="{`}"
[COLOURS]
hp_bar=0x212421
mp_bar=0x212421
pet_bar=0x292429
df=0xBD20F7
plus_hsb=0xFFFF6B
minus_hsb=0xEFA2AD
|