It is currently 19 Nov 2018, 00:14

All times are UTC + 2 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Lumberjacking - Orion
PostPosted: 03 Dec 2017, 12:33 
Offline
Начинающий игрок

Joined: 18 Nov 2017, 12:23
Posts: 17
function CutTreeByWorldLoc()
{
Orion.ClearJournal();
var treeWorldLocation = FindTreesInSurrArea();
for(i=0;i<treeWorldLocation.length;i++){
Orion.WalkTo(treeWorldLocation[i][0],treeWorldLocation[i][1],0);
Orion.Wait(1000);
Orion.UseObject('0x405C797D');
Orion.WaitTargetTile('tree',treeWorldLocation[i][0],treeWorldLocation[i][1],0);
Orion.Wait(7000);
if(Orion.InJournal('into your pack|but fail to', 'sys|my') != null){
LumberAgain(treeWorldLocation[i][0],treeWorldLocation[i][1]);
}

if(Player.Weight() >= Player.MaxWeight()-60) break;
}
}

function FindTreesInSurrArea()
{
var maxSearchDistance=30;
var treeWorldLocations=createArr(200,200);
var trueWorldLocCounter=0;

for(i=(Player.X()-maxSearchDistance);i<(Player.X()+maxSearchDistance+1);i++){
for(j=(Player.Y()-maxSearchDistance);j<(Player.Y()+maxSearchDistance+0);j++){
//Orion.Print("Searching X= " + i + "and Y= " + j + " location");
if(Orion.ValidateTargetTile('tree', i, j)){
Orion.Print("Found a tree, location is saved as " + (trueWorldLocCounter+1));
treeWorldLocations[trueWorldLocCounter][0]=i;
treeWorldLocations[trueWorldLocCounter][1]=j;
trueWorldLocCounter++;
}
}
}
treeWorldLocations.length=trueWorldLocCounter;
return treeWorldLocations;
}

function createArr(x, y) {
var arr = new Array(x);

for (var i = 0; i < x; i++) {
arr[i] = new Array(y);
}

return arr;
}

function LumberAgain(x,y)
{
var text = 'in your pack|but fail to|not enough wood|That is too far away|no line of sight|place any wood into';
while (!Player.Dead()){
Orion.UseObject('0x405C797D');
Orion.WaitTargetTile('tree',x,y,0);
var msg = Orion.WaitJournal(text, Orion.Now(), Orion.Now() + 5000, 'sys|my');
if(msg !=null) break;
Orion.Wait(100);
}
Orion.ClearJournal();
}


Вот простой скрипт, буду рад если кто-то усовершенствует! ;)


Top
 Profile  
 
PostPosted: 14 Dec 2017, 16:56 
Offline
Новичок

Joined: 24 Nov 2017, 19:52
Posts: 5
Сюда бы дописать что б относил к банку/дому и складывал логи, было б вообще супер. )


Top
 Profile  
 
PostPosted: 14 Dec 2017, 20:03 
Offline
Игрок

Joined: 20 Dec 2016, 20:00
Posts: 118
в code теги вставляйте код что б не было дурацких X( смайликов посреди кода.


Top
 Profile  
 
PostPosted: 14 Dec 2017, 23:24 
Offline
Начинающий игрок

Joined: 18 Nov 2017, 12:23
Posts: 17
@-) :-B :-o


Top
 Profile  
 
PostPosted: 22 Sep 2018, 22:18 
Online
Новичок

Joined: 22 Sep 2018, 22:16
Posts: 4
Спасибо, работает.
Одно но, нужно поменять ID топора (_info) на свой, в двух местах.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 2 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group