(易语言) 求翻译,怎么翻译成au3问题不重要了,当做(已解决)
本帖最后由 qq123123 于 2011-4-19 19:11 编辑function nearest(type)
local p = getObjectAddrList();
local nearId = nil;
local distNear = 0;
if p == nil then
return nil;
end
for _, baseAddr in pairs(p)do
local object = getObjectInfo(baseAddr);
if object.type==type then
local distNow = distance(object);
if nearId ==nil then
nearId = object.id;
distNear = distNow;
elseif distNear>distNow then
nearId = object.id;
distNear = distNow;
end
end
end
return nearId;
end
function distance(object)
local cx, cy = Player:GetPos();
local xx = math.abs(cx-object.x);
local yy = math.abs(cy-object.y);
return math.sqrt(xx*xx+yy*yy);
end
local nearId = nearest("box");
if nearId~=nil then
SetNotifyTip("最近的箱子ID:"..nearId);
openBag(nearId); --可以使用openBox(nearId);试试..
else
SetNotifyTip("未找到箱子.");
end 这像D多过像E吧.
getObjxxxxx这些应该不是内置函数 易语言 不是中文的吗? 内置函数 不易转 内置函数多了 自己按照思路重新编写一个代码得了 呵呵,这个哪是易语言 简单而看不懂的语言=易语言{:1_402:} 雷锋精神传天下!谢谢分享!
页:
[1]