It is currently 28 Mar 2024, 14:53

All times are UTC + 2 hours [ DST ]




Post new topic Reply to topic  [ 15 posts ]  Go to page 1, 2  Next
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: 139
в 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 
Offline
Игрок

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


Top
 Profile  
 
PostPosted: 19 Jan 2019, 12:02 
Offline
Новичок

Joined: 20 Dec 2018, 10:41
Posts: 3
Спасибо. Полет нормальный.


Top
 Profile  
 
PostPosted: 16 Aug 2019, 11:25 
Offline
Игрок

Joined: 03 Aug 2019, 21:11
Posts: 122
Немного коряво задержка между повторными рубками реализована: если не может рубить дерево стоит и ждёт эту задержку прежде, чем идти к другому дереву; или в момент рубки дерева пытается рубить, пока ещё прошлая попытка не закончилась (это связано с тем, что каждый раз тратится рандомное время на рубку). Умеющие люди под себя исправят. А так отличный скрипт, спасибо! :)

_________________
Assassin [12 lvl] - Positive
Vampire [14 lvl] - Takezo
Craft [14 lvl] - Kuvalda


Top
 Profile  
 
PostPosted: 28 Aug 2019, 12:18 
Offline
Игрок

Joined: 06 Aug 2019, 09:58
Posts: 236
[удалено автором]


Last edited by black.cat on 14 Jun 2020, 16:53, edited 1 time in total.

Top
 Profile  
 
PostPosted: 28 Aug 2019, 12:21 
Offline
Игрок

Joined: 03 Aug 2019, 21:11
Posts: 122
black.cat wrote:
Странно, почему то не вырубает дерево, а после одной рубки переходит к следующему дереву.
p.s.: Swanky оформи скрипт
Code:
[code] ... тут скрипт ... [/code]

Там что-то с командами было. Могу скинуть подправленный скрипт

_________________
Assassin [12 lvl] - Positive
Vampire [14 lvl] - Takezo
Craft [14 lvl] - Kuvalda


Top
 Profile  
 
PostPosted: 09 Apr 2020, 22:09 
Offline
Новичок
User avatar

Joined: 26 Mar 2020, 22:01
Posts: 9
Positive wrote:
black.cat wrote:
Странно, почему то не вырубает дерево, а после одной рубки переходит к следующему дереву.
p.s.: Swanky оформи скрипт
Code:
[code] ... тут скрипт ... [/code]

Там что-то с командами было. Могу скинуть подправленный скрипт

Можешь скинуть рабочий скрипт?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ]  Go to page 1, 2  Next

All times are UTC + 2 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 176 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