All pastes #802895 Raw Edit

Zeug

public text v1 · immutable
#802895 ·published 2007-11-30 18:47 UTC
rendered paste body
function WalkTo(x,y)
{
	var _time = 0;
	var i = 0;
	
	_path = getPath(me.area, me.x, me.y, x,y);
	print(_path.length);
	while(i < _path.length)
	{
		if(me.mode != 5)
		{
			delay(100);
			continue;
		}
		if(_time == 0)
		{
			clickMap(0,0, _path[i][0], _path[i][1]);
			clickMap(1,0, _path[i][0], _path[i][1]);
		}
		else if(_time >= 13 && me.mode == 5)
		{
			clickMap(0,0, me.x+1, me.y);
			clickMap(1,0, me.x+1, me.y);
			while(me.mode != 5)
				delay(100);			
			_path = getPath(me.area, me.x, me.y, x,y);
			if(!_path)
				return false;	
		}
		if(getDistance(me.x, me.y, _path[i][0], _path[i][1]) <= 2)
		{
			i++;
			_time = 0;
			continue;
		}
		_time ++;
		delay(100);
	}
	return true;
}