It is currently 16 Apr 2024, 11:52

All times are UTC + 2 hours [ DST ]




Post new topic Reply to topic  [ 15 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: 10 Apr 2020, 10:23 
Offline
Игрок

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


Top
 Profile  
 
PostPosted: 16 Dec 2021, 15:04 
Offline
Новичок

Joined: 18 Oct 2017, 07:37
Posts: 6
подскажите, как исправить скрипт, чтобы персонаж рубил несколько раз, а не один?
спасибо!


Top
 Profile  
 
PostPosted: 10 Oct 2022, 16:01 
Offline
Новичок

Joined: 10 Oct 2022, 16:00
Posts: 3
Прошу прощения. Но всё же... как прописать чтобы рубил несколько раз, а не один?


Top
 Profile  
 
PostPosted: 11 Oct 2022, 10:49 
Offline
Начинающий игрок

Joined: 19 Feb 2022, 10:56
Posts: 18
Подскажите как все таки сделать чтобы рубил не один раз ? и почему может скрипит отключаться через определенное не долгое время ?


Top
 Profile  
 
PostPosted: 21 Sep 2023, 19:08 
Offline
Начинающий игрок

Joined: 08 Aug 2016, 00:16
Posts: 41
Может кому пригодится исправленная версия скрипта. Сам берёт топоры из бекпака (нет необходимости с каждым новым топором, вводить новый айди топора), рубит деревья не по одному разу а пока не вырубит под 0. В общем более стабильная версия (в дополнительных настройках не нуждается, запустил и забыл пока не закончатся деревья или пока не переполнится)

Code:
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(2000);
Orion.UseType('0x0F43');
Orion.WaitTargetTile('tree',treeWorldLocation[i][0],treeWorldLocation[i][1],0);
Orion.Wait(8000);
if(Orion.InJournal('in 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=50;
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 = 'nothing|chop|but fail to|there is nothing there to chop|That is too far away|no line of sight|place any wood into|lumberjacking';
while (!Player.Dead()){
Orion.UseType('0x0F43');
Orion.WaitTargetTile('tree',x,y,0);
var msg = Orion.WaitJournal(text, Orion.Now(), Orion.Now() + 7000, 'sys|my');
if(msg !=null) break;
Orion.Wait(100);
}
Orion.ClearJournal();
}


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

All times are UTC + 2 hours [ DST ]


Who is online

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