Author Topic: Building a Lumberjacking Script  (Read 1243 times)

0 Members and 1 Guest are viewing this topic.

Offline altiricTopic starter

  • Jr. Member
  • **
  • Posts: 65
  • Activity:
    0%
  • Reputation Power: 2
  • altiric has no influence.
  • Referrals: 1
    • View Profile
Re: Building a Lumberjacking Script
« Reply #15 on: May 20, 2022, 07:40:06 PM »
Increasing the use item delay helped but it still gets stuck trying to chop a tree saying "you can't chop that with an axe" and when it unloaded all of the lumber and stuff, it also unloaded my runebooks lol.

Don't get me wrong, this is awesome and I cannot wait till the bugs are worked out. I really need to read up on javascript so I can get better. Thank you for sharing and working on this!

Ive really gotta figure out how to reproduce some of these lol, The only items it should know how to move are those listed in harvetTypes array. I'll try getting onto a free shard to test some of this out, might help just mixing things up so i can get a better sample size.

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1888
  • Activity:
    0.6%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Referrals: 0
    • View Profile
Re: Building a Lumberjacking Script
« Reply #16 on: May 20, 2022, 07:48:00 PM »
I tested on OSI, 

Offline altiricTopic starter

  • Jr. Member
  • **
  • Posts: 65
  • Activity:
    0%
  • Reputation Power: 2
  • altiric has no influence.
  • Referrals: 1
    • View Profile
Re: Building a Lumberjacking Script
« Reply #17 on: May 20, 2022, 07:50:46 PM »
I could be wrong, but i believe you two are having different issues (aside from the timing delays). Regardless, i think a different shard will give me more data to work with, more data, better ability to crunch other related bugs :)

Offline Crisis

  • Global Moderator
  • *
  • *
  • Posts: 2703
  • Activity:
    0.2%
  • Reputation Power: 38
  • Crisis has a powerful will.Crisis has a powerful will.Crisis has a powerful will.Crisis has a powerful will.Crisis has a powerful will.Crisis has a powerful will.Crisis has a powerful will.
  • Gender: Male
  • Scripting well enough to break things!
  • Referrals: 2
    • View Profile
Re: Building a Lumberjacking Script
« Reply #18 on: May 20, 2022, 08:04:54 PM »
The tree that cannot be chopped shows as a pear tree. Orion sees it as a tree but the game does not let you use an axe on it. It doesn't seem to ignore that when the journal shows "you can't use an axe on that" I am on UO Heritage which uses TRUEUO, OSI copy. Most things including the item numbers are the same.


There are 1 attachment(s) in this post. You must register and post an acceptable introduction to download
pear tree.bmp
« Last Edit: May 20, 2022, 08:06:34 PM by Crisis »

Offline altiricTopic starter

  • Jr. Member
  • **
  • Posts: 65
  • Activity:
    0%
  • Reputation Power: 2
  • altiric has no influence.
  • Referrals: 1
    • View Profile
Re: Building a Lumberjacking Script
« Reply #19 on: May 20, 2022, 08:08:49 PM »
Well... had not considered that one. Just adding the error message to the journal should be enough to get those out of the way after the first chop though. They'll automatically go into the chopped array after an attempt. But they will be tried again after it resets the trees. I'll have to keep that one in mind.

Offline Crisis

  • Global Moderator
  • *
  • *
  • Posts: 2703
  • Activity:
    0.2%
  • Reputation Power: 38
  • Crisis has a powerful will.Crisis has a powerful will.Crisis has a powerful will.Crisis has a powerful will.Crisis has a powerful will.Crisis has a powerful will.Crisis has a powerful will.
  • Gender: Male
  • Scripting well enough to break things!
  • Referrals: 2
    • View Profile
Re: Building a Lumberjacking Script
« Reply #20 on: May 20, 2022, 09:54:06 PM »
I have it moving on from the pear tree now

I added msg5 and changed the lowercase y to an uppercase:
Code: [Select]
// Language, Adjust these to suit your clients language
    var msg1 = "There's not enough wood";
    var msg2 = "You cannot see";
    var msg3 = "That is too far";
    var msg4 = "You chop some";
    var msg5 = "You can't use an axe";

and then added msg4 and msg5 here since it stopped at msg3:
Code: [Select]
while(!Orion.InJournal(msg1+'|'+msg2+'|'+msg3+'|'+msg4+'|'+msg5)){
I also added 0x3199 to this line since it wasn't putting this into the secure container:
Code: [Select]
harvest : '0x3191|0x2F5F|0x318F|0x3190|0x5738|0x3199' // fungi, switch, bark, plant, shards 
It is still slowly emptying all of my runebooks from my backpack a couple at a time each time it unloads. It also got stuck with the pack completely empty. It was trying to use the axe on something but as you can see in the picture, backpack is empty. This was immediately after unloading everything.

Post Merge: May 20, 2022, 10:09:46 PM
After updating the line with 0x3199 it didn't seem to put runebooks and BOD books into the secure container but it still get stuck trying to use the axe on something after emptying the lumber and stuff from the backpack.

There are 1 attachment(s) in this post. You must register and post an acceptable introduction to download
nothing.png
« Last Edit: May 20, 2022, 10:09:46 PM by Crisis »

Offline altiricTopic starter

  • Jr. Member
  • **
  • Posts: 65
  • Activity:
    0%
  • Reputation Power: 2
  • altiric has no influence.
  • Referrals: 1
    • View Profile
Re: Building a Lumberjacking Script
« Reply #21 on: May 20, 2022, 10:11:50 PM »
That's how i would have added it in!
I knew about this glitch, did not realize it could be an issue like this. After it unloads the pack, it goes back to trying to chop the last targeted tree as if it were still standing beside it. Typically, when it fails it should look for the next tree. Im thinking another journal scan..

var msg5 = 'cannot be seen'; added to the journal check
This should make the script pull the next tree out of the array and continue as normal. *hopefully*
I'll make sure all this gets ironed out in v0.3, appreciate the help finding these things!

I also realized why it may be emptying your pack... Are you using a pack animal? In the secureDrop function
Code: [Select]
    if(animal){
        Orion.RequestContextMenu(animal.Serial());
        Orion.WaitContextMenuID(animal.Serial(), 508);
        Orion.WaitForContainerGump();
        Orion.Wait('useitemdelay');
        Orion.FindTypeEx(any, any, lastcontainer).forEach(function(item){
            Orion.MoveItem(item.Serial(), 0, secure.serial);
            Orion.Wait('moveitemdelay');
        });
    }

Orion.FindTypeEx(any, any, lastcontainer)
should be
Orion.FindTypeEx(any, any, animal.Serial())

im thinking lastcontainer is somehow changing to your packpack insteal of the animals pack, this should be the fix.


**Edit: Never mind, pack animals pack Serial is different than the animals, i'll get back to you by morrning, i know there is a command for this in Orion lol, i cheated and skipped this step by using lastcontainer...
« Last Edit: May 20, 2022, 10:15:31 PM by altiric »

Offline Crisis

  • Global Moderator
  • *
  • *
  • Posts: 2703
  • Activity:
    0.2%
  • Reputation Power: 38
  • Crisis has a powerful will.Crisis has a powerful will.Crisis has a powerful will.Crisis has a powerful will.Crisis has a powerful will.Crisis has a powerful will.Crisis has a powerful will.
  • Gender: Male
  • Scripting well enough to break things!
  • Referrals: 2
    • View Profile
Re: Building a Lumberjacking Script
« Reply #22 on: May 21, 2022, 05:27:05 AM »
I am not using any pack animals, just my character. Once I made the adjustments to the line with Harvest, my pack no longer gets emptied. I ran 10 minutes before I hit the issue where it kept saying "target cannot be seen". I am liking it though, keep up the awesome job!

Post Merge: May 21, 2022, 07:40:57 AM
I think I have found out what is causing it to stall at "target cannot be seen". It seems like that is happening when my character was chopping wood more than 50 steps from my secure. Like it could not find the tree to go back to it.
« Last Edit: May 21, 2022, 07:40:57 AM by Crisis »

Offline Crisis

  • Global Moderator
  • *
  • *
  • Posts: 2703
  • Activity:
    0.2%
  • Reputation Power: 38
  • Crisis has a powerful will.Crisis has a powerful will.Crisis has a powerful will.Crisis has a powerful will.Crisis has a powerful will.Crisis has a powerful will.Crisis has a powerful will.
  • Gender: Male
  • Scripting well enough to break things!
  • Referrals: 2
    • View Profile
Re: Building a Lumberjacking Script
« Reply #23 on: May 29, 2022, 12:32:24 PM »
Any updates or is this on the back burner for the time being? No worries if it is, was just curious.  :D

Offline altiricTopic starter

  • Jr. Member
  • **
  • Posts: 65
  • Activity:
    0%
  • Reputation Power: 2
  • altiric has no influence.
  • Referrals: 1
    • View Profile
Re: Building a Lumberjacking Script
« Reply #24 on: May 29, 2022, 12:54:40 PM »
Its very close to making it on my priority list! Just got a couple things to finish off, should be able to focus on this one beginning next week. Already have most of the issues you and Gaderain were able to find solved.

Offline Gaderian

  • Elite
  • *
  • *
  • Posts: 420
  • Activity:
    0.8%
  • Reputation Power: 9
  • Gaderian has no influence.
  • Referrals: 2
    • View Profile
Re: Building a Lumberjacking Script
« Reply #25 on: May 29, 2022, 04:06:53 PM »
Its very close to making it on my priority list! Just got a couple things to finish off, should be able to focus on this one beginning next week. Already have most of the issues you and Gaderain were able to find solved.

While I have been keeping up on reading these Orion posts, not sure I have added much to any discussions. ;)

Gaderian
"Go ahead ask me: 'Should I use hard waits or timers?'"
You say:"Should I"
Gaderian:"Timers!"
You Say:"use hard waits or timers?"

The serious side of timer use is illustrated here: http://www.scriptuo.com/index.php?topic=12094.msg101926#msg101926

However, every time I go back and look at this [AutoLooter] script, I realize I had wrote it in my zen state of EUO scripting - so it makes my brain hurt.

Offline rex

  • Restricted
  • *
  • Posts: 1
  • Activity:
    0%
  • Reputation Power: 1
  • rex has no influence.
  • Gender: Male
  • Referrals: 1
    • View Profile
Re: Building a Lumberjacking Script
« Reply #26 on: June 13, 2022, 10:42:38 PM »
Спасибо, за работу, ты крутой
Русский=Честь

Offline nyre74

  • Newbie
  • *
  • Posts: 5
  • Activity:
    0%
  • Reputation Power: 1
  • nyre74 has no influence.
  • Referrals: 0
    • View Profile
Re: Building a Lumberjacking Script
« Reply #27 on: July 05, 2022, 12:23:41 PM »
Thank You for sharing   I can not wait till you update it more   

Post Merge: July 06, 2022, 08:11:34 AM
MwInc have a simple lumber and Minijg script that was easy to set up.   Did the leg work :)    This can be a good base of compassion.
12X have a nice mining as well,  have not used it as much.

If not already include,  can you ensure that you cut log into board plx.:) this way you can carry more.    thx in advance

Orion:  I notice that you can scan an area and get 50 tree load up and just walk to all of them .

Where can I find this Mining script by Mw1nc 

Thank You
« Last Edit: July 06, 2022, 08:11:34 AM by nyre74 »

Tags: