本帖最后由 haebong87 于 2011-7-12 09:10 编辑
运行之后有一个问题就是当读取默认文件夹中的文本时,第一行和第二行都正常读取。但是在第三行开始就重复2,3次,不知道为什么,也找不出哪里有错。特请各位帮我查找一下,谢谢大家!
不知道发这些会不会找到的说。。。Func main()
$file = FileOpen("item_tc.txt", 0)
While 1
$line = FileReadLine($file)
If @error = -1 Then ExitLoop
If $count = 0 Then
$count = 1
ContinueLoop
EndIf
$item_id_array = StringSplit($line, '|',2)
;~ _ArrayDisplay($item_id_array);
If $item_id_array[1] = 1 Then
$make_type_id=$make_type1
$make_tool_x=30337
$make_tool_y=243
$make_tool_z=36417
ElseIf $item_id_array[1] = 2 Then
$make_type_id=$make_type2
$make_tool_x=35899
$make_tool_y=293
$make_tool_z=36235
ElseIf $item_id_array[1] = 3 Then
$make_type_id=$make_type3
$make_tool_x=30175
$make_tool_y=244
$make_tool_z=33449
ElseIf $item_id_array[1] = 4 Then
$make_type_id=$make_type4
$make_tool_x=34220
$make_tool_y=246
$make_tool_z=33339
ElseIf $item_id_array[1] = 5 Then
$make_type_id=$make_type5
$make_tool_x=35875
$make_tool_y=243
$make_tool_z=36853
EndIf
If StringLeft($line,1) <> StringLeft(FileReadLine($file,$N+1),1) Then
Send("/")
Sleep(500)
Send("admin")
Send("{enter}")
Send("{down 34}")
Send("{tab 2}")
Send($make_type_id)
Send("{enter}")
Sleep(1000)
Send("{tab 14}")
Sleep(1000)
Send("{up}")
Sleep(500)
Send("{tab 2}")
Send("10")
Sleep(1000)
Send("{enter 8}")
WinActivate("Admin Tool","")
Send("!{F4}")
Sleep(1000)
Send("{enter}")
Sleep(1000)
Send("/")
Sleep(500)
Send("admin")
Send("{enter}")
Sleep(1000)
Send("{down 31}")
Sleep(1000)
Send("{tab 2}")
Send($make_tool_x)
Send("{tab}")
Send($make_tool_y)
Send("{tab}")
Send($make_tool_z)
Send("{enter}")
Sleep(1000)
WinActivate("Admin Tool","")
Send("!{f4}")
$N+=2
EndIf
admin_tool($item_gold_id,$item_id_array[5])
$length = UBound($item_id_array)/7
For $i = 0 To $length - 1
admin_tool($item_id_array[3+7*$i],$item_id_array[4+7*$i])
Next
win_make()
Sleep(1000)
If $item_id_array[2] = 2 Then
MouseClick("left","180","340")
MouseClick("left","150","380")
ElseIf $item_id_array[2] = 3 Then
MouseClick("left","180","340")
MouseClick("left","150","400")
ElseIf $item_id_array[2] = 4 Then
MouseClick("left","180","340")
MouseClick("left","150","420")
EndIf
If $item_id_array[6] = 1 Then
item_make($item_make_y1)
ElseIf $item_id_array[6] = 2 Then
item_make($item_make_y2)
ElseIf $item_id_array[6] = 3 Then
item_make($item_make_y3)
ElseIf $item_id_array[6] = 4 Then
item_make($item_make_y4)
ElseIf $item_id_array[6] = 5 Then
item_make($item_make_y5)
ElseIf $item_id_array[6] = 6 Then
item_make($item_make_y6)
ElseIf $item_id_array[6] = 7 Then
item_make($item_make_y7)
ElseIf $item_id_array[6] = 8 Then
MouseClick("left","668","580")
item_make($item_make_y8)
ElseIf $item_id_array[6] = 9 Then
MouseClick("left","668","580")
Sleep(200)
MouseClick("left","668","580")
item_make($item_make_y9)
EndIf
Wend
EndFunc
|