View difference between Paste ID: tL0QgSPR and YEE5sJjT
SHOW: | | - or go back to the newest paste.
1
Func TakeWP($tarChapter, $tarNum, $curChapter, $curNum)
2
local $Waypoint
3-
        While Not offsetlist()
3+
	While Not offsetlist()
4-
                Sleep(10)
4+
		Sleep(10)
5-
        WEnd
5+
	WEnd
6
   
7
   
8
   If FindActor("waypoint_arrival_ribbonGeo",80) then
9-
          $Waypoint = "waypoint_arrival_ribbonGeo"
9+
	  $Waypoint = "waypoint_arrival_ribbonGeo"
10-
           
10+
	   
11
   ElseIf FindActor("waypoint_neutral_ringGlow",80) then
12-
          $Waypoint = "waypoint_neutral_ringGlow"
12+
	  $Waypoint = "waypoint_neutral_ringGlow"
13
   ElseIf FindActor("Waypoint_Town",80) then
14-
          $Waypoint = "waypoint"   
14+
	  $Waypoint = "Waypoint_Town"	  
15-
        EndIf
15+
	  	  
16-
        
16+
	  
17
   else 
18
	  $Waypoint = "waypoint"   
19-
        Sleep(700)
19+
	EndIf
20-
        Local $wptry = 0
20+
	
21-
        While _checkWPopen() = False
21+
22-
                If $wptry <= 4 Then
22+
23-
                        _log('Fail to open wp')
23+
	Sleep(700)
24-
                        $wptry = $wptry + 1
24+
	Local $wptry = 0
25-
                        InteractByActorName($Waypoint)
25+
	While _checkWPopen() = False
26-
                EndIf
26+
		If $wptry <= 4 Then
27-
                If $wptry > 4 Then
27+
			_log('Fail to open wp')
28-
                        _log('Failed to open wp after 3 try')
28+
			$wptry = $wptry + 1
29-
                        ExitLoop
29+
			InteractByActorName($Waypoint)
30
		EndIf
31-
                EndIf
31+
		If $wptry > 4 Then
32-
        WEnd
32+
			_log('Failed to open wp after 3 try')
33
			ExitLoop
34
35-
        If $tarChapter <> $curChapter Or ($tarChapter = $curChapter And $tarChapter < $curChapter) Then
35+
		EndIf
36-
                For $i = 0 To $tarChapter - 1
36+
	WEnd
37-
                        $coord = UiRatio(35, 100 + ($i * 12.5))
37+
38-
                        MouseClick("left", $coord[0], $coord[1], 1, 3) ; Close chapters
38+
39-
                Next
39+
	If $tarChapter <> $curChapter Or ($tarChapter = $curChapter And $tarChapter < $curChapter) Then
40-
                $coord = UiRatio(145, 100 + ($tarChapter * 12.5) + 23 + ($tarNum * 32))
40+
		For $i = 0 To $tarChapter - 1
41-
                MouseClick("left", $coord[0], $coord[1], 1, 3) ; Click wp
41+
			$coord = UiRatio(35, 100 + ($i * 12.5))
42-
        EndIf
42+
			MouseClick("left", $coord[0], $coord[1], 1, 3) ; Close chapters
43-
        If $tarChapter = $curChapter And $tarChapter > $curChapter Then
43+
		Next
44-
                For $i = 0 To $tarChapter - 1
44+
		$coord = UiRatio(145, 100 + ($tarChapter * 12.5) + 23 + ($tarNum * 32))
45-
                        $coord = UiRatio(35, 100 + ($i * 12.5))
45+
		MouseClick("left", $coord[0], $coord[1], 1, 3) ; Click wp
46-
                        MouseClick("left", $coord[0], $coord[1], 1, 3) ; Close chapters
46+
	EndIf
47-
                Next
47+
	If $tarChapter = $curChapter And $tarChapter > $curChapter Then
48-
                $coord = UiRatio(145, 100 + ($tarChapter * 12.5) + 23 + 12 + ($tarNum * 32))
48+
		For $i = 0 To $tarChapter - 1
49-
                MouseClick("left", $coord[0], $coord[1], 1, 3) ; Click wp
49+
			$coord = UiRatio(35, 100 + ($i * 12.5))
50-
        EndIf
50+
			MouseClick("left", $coord[0], $coord[1], 1, 3) ; Close chapters
51-
        Sleep(1500)
51+
		Next
52
		$coord = UiRatio(145, 100 + ($tarChapter * 12.5) + 23 + 12 + ($tarNum * 32))
53-
        While Not offsetlist()
53+
		MouseClick("left", $coord[0], $coord[1], 1, 3) ; Click wp
54-
                Sleep(10)
54+
	EndIf
55-
        WEnd
55+
	Sleep(1500)
56
57
	While Not offsetlist()
58
		Sleep(10)
59
	WEnd
60
61
EndFunc   ;==>TakeWP