|
本帖最后由 托托 于 2016-2-5 20:42 编辑
之前和老血聊天 说到FH解锁后 其实游戏所有功能都放开了 甚至于可以写出挂机的脚本 他让我写个试试 我就尝试写了一个
使用方法很简单:停在草药园门口 运行一次就行了 用GC的同学 加入到自定义脚本里点调试就行 点击一次是开始 再点一次结束
当然 仅仅是个测试 没有路线规划 所以有可能卡住。。。
废话不多说 上代码
- local CollectList={
- ["烁星花"]=true,
- ["寒霜草"]=true,
- ["炎火草"]=true,
- ["塔拉多幽兰"]=true,
- ["戈尔隆德捕蝇草"]=true,
- ["纳格兰箭叶花"]=true
- }
- local CollectDis=40
- function GetCollectObject()
- for i=1,GetObjectCount() do
- local thisObject = GetObjectWithIndex(i)
- if CollectList[ObjectName(thisObject)] and ObjectTypeFlags(thisObject)==33 and GetDistanceBetweenObjects("player",thisObject)<CollectDis then
- return thisObject
- end
- end
- return nil
- end
- T,F=T or 0,F or CreateFrame("frame")
- if X then
- print("停止采集")
- X=nil
- else
- print("开始采集")
- X=function()
- local t=GetTime()
- if t-T>1 then
- local CollectObject=GetCollectObject()
- if not CollectObject then
- print("没有待采集目标,脚本停止")
- X=nil
- F:SetScript("OnUpdate",nil)
- else
- if GetNumLootItems()>0 then
- print("正在拾取")
- for i=1,GetNumLootItems() do LootSlot(i) end
- end
- if not UnitCastingInfo("player") then
- if GetDistanceBetweenObjects("player",CollectObject)<=5 then
- print("点击["..ObjectName(CollectObject).."]")
- ObjectInteract(CollectObject)
- else
- print("移动到["..ObjectName(CollectObject).."]")
- MoveTo(ObjectPosition(CollectObject))
- end
- end
- end
- T=t
- end
- end
- end
- F:SetScript("OnUpdate",X)
复制代码
|
评分
-
查看全部评分
|