ฟอรั่มของบล็อก http://pssix.blogspot.com


ช่วยแกะ Code ใครหน่อยครับว่าตรงไหนมีหน้าที่อะไรนะครับผมแก้ไปแล้วบ้างส่วน

Share

bigcom1
มือใหม่เพิ่งสมัคร
มือใหม่เพิ่งสมัคร


จำนวนข้อความ : 8
ความนิยม : 0
เข้าร่วมเมื่อ : 11/10/2012

ช่วยแกะ Code ใครหน่อยครับว่าตรงไหนมีหน้าที่อะไรนะครับผมแก้ไปแล้วบ้างส่วน

ตั้งหัวข้อ by bigcom1 on 12/10/13, 03:58 pm


;================================================================================
;~ ;LastChaos - GameWorld (Window 800x600) Vertion 08-04-2012
;================================================================================
$Form1_1 = GUICreate("LastChaos - GameWorld (Window 800x600)", 306, 594, 489, 62)
$Slider1Hpbar = GUICtrlCreateSlider(55, 8, 188, 30)
GUICtrlSetLimit(-1, 289, 219)
GUICtrlSetData(-1, 255)
GUICtrlCreateLabel("Hp Hero :", 8, 10, 50, 17)
$Slider2Mpbar = GUICtrlCreateSlider(55, 40, 188, 30)
GUICtrlSetLimit(-1, 289, 219)
GUICtrlSetData(-1, 235)
GUICtrlCreateLabel("Mp Hero :", 8, 42, 51, 17)
;================================================================================
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("Hero Setting", 8, 80, 225, 155)
$CheckboxAutoHp = GUICtrlCreateCheckbox("Auto Hp Potion Key :", 24, 104, 118, 17)
GUICtrlSetState(-1, 1)
$CheckboxAutoMp = GUICtrlCreateCheckbox("Auto Mp Potion Key :", 24, 130, 118, 17)
GUICtrlSetState(-1, 4)
$CheckboxSelectEnemy = GUICtrlCreateCheckbox("Select Enemy", 24, 156, 97, 17)
GUICtrlSetState(-1, 1)
$CheckboxAttack = GUICtrlCreateCheckbox("Attack", 24, 182, 97, 17)
GUICtrlSetState(-1, 1)
$CheckboxMoveView = GUICtrlCreateCheckbox("Move View", 24, 208, 97, 17)
GUICtrlSetState(-1, 1)
$Combo1 = GUICtrlCreateCombo("5", 144, 104, 40, 25)
$Combo2 = GUICtrlCreateCombo("6", 144, 130, 40, 25)
;================================================================================
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("Skill Setting", 8, 240, 259, 158)
$Checkboxskill1 = GUICtrlCreateCheckbox("Skill 1 key :", 24, 264, 70, 17)
GUICtrlCreateLabel("Deley (Sec.)", 144, 267, 62, 17)
$Input1 = GUICtrlCreateInput("1", 208, 264, 40, 21)
$Checkboxskill2 = GUICtrlCreateCheckbox("Skill 2 key :", 24, 295, 70, 17)
GUICtrlCreateLabel("Deley (Sec.)", 144, 298, 62, 17)
$Input2 = GUICtrlCreateInput("2", 208, 295, 40, 21)
$Checkboxskill3 = GUICtrlCreateCheckbox("Skill 3 key :", 24, 326, 70, 17)
GUICtrlCreateLabel("Deley (Sec.)", 144, 329, 62, 17)
$Input3 = GUICtrlCreateInput("3", 208, 326, 40, 21)
$Checkboxskill4 = GUICtrlCreateCheckbox("Skill 4 key :", 24, 357, 70, 17)
GUICtrlCreateLabel("Deley (Sec.)", 144, 360, 62, 17)
$Input4 = GUICtrlCreateInput("4", 208, 357, 40, 21)
$Combo3 = GUICtrlCreateCombo("1", 96, 264, 40, 25)
$Combo4 = GUICtrlCreateCombo("2", 96, 295, 40, 25)
$Combo5 = GUICtrlCreateCombo("3", 96, 326, 40, 25)
$Combo6 = GUICtrlCreateCombo("4", 96, 357, 40, 25)
;================================================================================
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("Buff Skill Setting", 8, 404, 289, 94)
$CheckboxBuff1 = GUICtrlCreateCheckbox("Buff Skill 1 key :", 24, 432, 95, 17)
GUICtrlSetState(-1, 1)
$Combo7 = GUICtrlCreateCombo("0", 122, 432, 40, 25)
GUICtrlCreateLabel("Deley (Sec.)", 168, 435, 62, 17)
$Input5 = GUICtrlCreateInput("120", 232, 432, 50, 21)
$CheckboxBuff2 = GUICtrlCreateCheckbox("Buff Skill 2 key :", 24, 463, 95, 17)
$Combo8 = GUICtrlCreateCombo("9", 122, 463, 40, 25)
GUICtrlCreateLabel("Deley (Sec.)", 168, 466, 62, 17)
$Input6 = GUICtrlCreateInput("130", 232, 463, 50, 21)
;================================================================================
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("การใช้งาน", 8, 504, 289, 81)
GUICtrlSetFont(-1, 16, 400, 0, "AngsanaUPC")
GUICtrlSetColor(-1, 0x000000)
GUICtrlCreateLabel("สั่งโปรแกรมทำงาน/หยุดทำงาน = ปุ่ม PAUSE", 16, 528, 230, 30)
GUICtrlSetFont(-1, 14, 400, 0, "AngsanaUPC")
GUICtrlCreateLabel("ออกจากโปรแกรม = ปุ่ม END", 16, 550, 150, 30)
GUICtrlSetFont(-1, 14, 400, 0, "AngsanaUPC")
GUISetState(@SW_SHOW)
;================================================================================
;============================User Command=========================================
Global $Paused
Global $HpHero = 1
Global $MpHero = 1
Global $HpMon = 1
Global $Enemy = 0
Global $Skill = 0
Global $Power = 1
Global $times = TimerInit()
HotKeySet("{Pause}", "TogglePause")
HotKeySet("{END}", "Terminate")
;============================Check Program=========================================
Sleep(500)
;============================Run&Stop Program=======================================
TogglePause()
Func TogglePause()
$Paused = NOT $Paused
While $Paused
Sleep(100)
ToolTip(">>หยุดทำงาน<<",226,39)
WEnd
ToolTip("",0,0)
Sleep(100)
EndFunc
Func Terminate()
Exit 0
EndFunc
Func _Run()
WinActivate("LastChaos - GameWorld (Window 800x600")
Return
EndFunc
;================================================================================
;=============================Function Event=========================================
Func Check_HpHero()
$Pixel = PixelGetColor(GUICtrlRead($Slider1Hpbar),69)
If $Pixel <> 0x290000 Then
$HpHero = 0
Else
$HpHero = 1
EndIf
EndFunc

Func Check_MpHero()
$Pixel1 = PixelGetColor(GUICtrlRead($Slider2Mpbar),86)
If $Pixel1 <> 0x290000 Then
$MpHero = 0
Else
$MpHero = 1
EndIf
EndFunc

Func Check_Mon()
PixelSearch(560,56,718,60,0xFF0000,10)
If @error Then
$HpMon = 0
Else
$HpMon = 1
EndIf
EndFunc

Func Attack_Mon()
PixelSearch(560,56,718,60,0xFF0000,10)
If Not @error Then
$Enemy = 1
Else
$Enemy = 0
EndIf
EndFunc

Func Attack_Skill()
$Pixel2 = PixelGetColor(714,54)
If $Pixel2 = 0xDEDADA Then
$Skill = 1
Else
$Skill = 0
EndIf
EndFunc

Func Power_Low()
$Diff = Int(TimerDiff($times)/1000)
$Pixel3 = PixelGetColor(293,135)
If $Pixel3 <> 0x01B1B1 And $Enemy = 0 And $HpMon = 0 Then
ToolTip(">>Sleep<<",226,39)
Send("{E Up}")
$Power = 0
If Mod($Diff,10/1) = 0 Then Send ("{Tab}")
Else
$Pixel3 = PixelGetColor(317,135)
if $Pixel3 = 0x01B1B1 Then $Power = 1
EndIf
EndFunc

Func System_Run()
Check_HpHero()
Sleep(100)
Check_MpHero()
Sleep(100)
Check_Mon()
Sleep(100)
Attack_Mon()
Sleep(100)
Attack_Skill()
Sleep(100)
Power_Low()
Sleep(100)
EndFunc
;================================================================================
;================================System Main=======================================
_Run()
Sleep(500)
System_Run()
While True
If Not WinActive("LastChaos - GameWorld (Window 800x600") Then Exit 0
$Diff = Int(TimerDiff($times)/1000)
If Mod($Diff, GUICtrlRead($Input5)/1) = 0 and GUICtrlRead($CheckboxBuff1)=1 Then send ("{"& GUICtrlRead($Combo7)&"}")
If Mod($Diff, GUICtrlRead($Input6)/1) = 0 and GUICtrlRead($CheckboxBuff2)=1 Then send ("{"& GUICtrlRead($Combo8)&"}")
If (GUICtrlRead($CheckboxAutoHp)=1 And $HpHero = 0) Then
Auto_Hp()
EndIf
If (GUICtrlRead($CheckboxAutoMp)=1 And $MpHero = 0) Then
Auto_Mp()
EndIf
If (GUICtrlRead($CheckboxSelectEnemy)=1 And $Power = 1 And $HpMon = 0) Then
Send("{E Up}")
Select_Mon()
Else
If (GUICtrlRead($CheckboxAttack)=1 And $Enemy = 1) Then
Attack()
EndIf
EndIf
Sleep(100)
System_Run()
WEnd
;================================================================================
;=============================OutPut Function=========================================
Func Auto_Hp()
ToolTip(">>Auto Hp<<",226,39)
Send("{"& GUICtrlRead($Combo1)&"}")
Sleep(200)
EndFunc

Func Auto_Mp()
ToolTip(">>Auto Mp<<",226,39)
Send("{"& GUICtrlRead($Combo2)&"}")
Sleep(200)
EndFunc

Func Select_Mon()
ToolTip(">>ค้นหามอน<<",226,39)
Send("{TAB}")
Sleep(100)
If (GUICtrlRead($CheckboxMoveView) = 1) Then
Send("{right Down}")
Sleep(50)
Send("{right Up}")
Sleep(100)
EndIf
EndFunc

Func Attack()
ToolTip(">>โจมตี<<",229,39)
Send("{E Up}")
Sleep(100)
While Sleep(100)
$Diff = Int(TimerDiff($times)/1000)
Send("{E Down}")
If Mod($Diff, GUICtrlRead($Input1)/1) = 0 and GUICtrlRead($Checkboxskill1)=1 And $Skill = 1 Then send ("{"& GUICtrlRead($Combo3)&"}")
If Mod($Diff, GUICtrlRead($Input2)/1) = 0 and GUICtrlRead($Checkboxskill2)=1 And $Skill = 1 Then send ("{"& GUICtrlRead($Combo4)&"}")
If Mod($Diff, GUICtrlRead($Input3)/1) = 0 and GUICtrlRead($Checkboxskill3)=1 And $Skill = 1 Then send ("{"& GUICtrlRead($Combo5)&"}")
If Mod($Diff, GUICtrlRead($Input4)/1) = 0 and GUICtrlRead($Checkboxskill4)=1 And $Skill = 1 Then send ("{"& GUICtrlRead($Combo6)&"}")
Return
WEnd
EndFunc
;================================================================================

bigcom1
มือใหม่เพิ่งสมัคร
มือใหม่เพิ่งสมัคร


จำนวนข้อความ : 8
ความนิยม : 0
เข้าร่วมเมื่อ : 11/10/2012

Re: ช่วยแกะ Code ใครหน่อยครับว่าตรงไหนมีหน้าที่อะไรนะครับผมแก้ไปแล้วบ้างส่วน

ตั้งหัวข้อ by bigcom1 on 12/10/13, 04:45 pm

ตอนนี้แก้ไข ค้นหามอนแล้วตีเองได้แล้ว เหลือแต่ กินเลือดเอง

    เวลาขณะนี้ 11/12/16, 08:41 pm