New Pathing Addon

  • 239 Views
  • Last Post 22 March 2016
Chuckm posted this 12 March 2016

Hi All,

I've been working on a replacement addon that does pathing.  A consequence of my desire to 'walk' to a location also makes the script perfect for looping a path, i.e. scripting.  I also added an easier way to make paths, mostly because I don't have a numberpad.  Before I describe the detail, let me give the caveats:

  • I literally learned javascript creating this over the past two weeks.
  • Most of what's in here had to be reverse engineered by looking at chupon's script and reading the webmud.js code so I took some guesses about how things work.
  • I'm not a professional programmer so the code isn't super robust
  • This is the initial release.  I tested it, but you'll likely encounter bugs. Report them and I'll fix them.
  • The script uses some newer JavaScript functions so you'll need a current web browser.  I tested it on Chrome so I can say it works there for sure.  Otherwise your milage may vary.

Now, the good stuff, how does it work?

This script is primarily setup to allow a user to create paths between two points.  It then lets them either walk the path (combat), run the path (no combat), and loop the path (scripting).  All of the combat, resting, running when low, etc. is done by the AI (party run too).  I'm simply receiving those messages and acting accordingly.  There are two boxes you'll be immediately interested in.  First, load paths, click this after you enable the addon to load all of your existing paths from local storage.  Second, 'fine tune step delay'.  This is very important. I set it for basically a medium encumbered player.  If you're heavy, you'll probably want to set it to like 3000 or 4000. If you're lighter, you can play around with lowering it.  Basically this is the amount of time the script waits until going to the next room.  It needs some leeway to allow the AI to identify targets and engage so make sure you're conservative.

Other than that, it should be pretty straight forward.  It will load all of the current paths you have in your local database (probably Harvester's or Chupon customs).  I don't have any starter scripts, but it's pretty easy to add them.  One final note, if you're going to use a looping path for scripting, just make sure your path ends in the same room you started from.  Otherwise you'll end up somewhere random because it's just going to give the same directions over and over.

You load it the same way you loaded Chupon's:  create a bookmark (doesn't mater to where) then right click that book mark, edit it, and insert the following text in the URL box:

javascript: (function(){var s=document.createElement('script');s.setAttribute('src','https://googledrive.com/host/0B5nx3pQAHtSOVTBhWklKMEZBcEU');document.getElementsByTagName('body')[0].appendChild(s);})();

The source link is to the path on my google drive.  Feel free to open it directly and look at it.  Enjoy, and sorry for ruining your Saturday looking for new scripting spots  

-Chuck (Anu)

Order By: Standard | Newest | Votes
Chuckm posted this 12 March 2016

New version up, this one adds auto commands.  You can add multiple commands by seperating them with commas.  The same 'bookmark' code above will start it, but here it is again since it looks like the forums messed with the original.

javascript: (function(){var s=document.createElement('script');s.setAttribute('src','https://googledrive.com/host/0B5nx3pQAHtSOVTBhWklKMEZBcEU');document.getElementsByTagName('body')[0].appendChild(s);})();

-Chuck (Anu)

Chuckm posted this 13 March 2016

Appologies for the update spam, but my daughter is cooporating so I'm hammering out some code.  I posted a new version that has a mass path import/export function.  I'm trying to get the nice list that Harvester already put together for mass import.  Once I finish it, I'll post it in this thread.  That should be a good set of start scripts for everyone, but you're still on your own for looping spots.

-Chuck (Anu)

Chuckm posted this 13 March 2016

Ok, here's a pastebin link to an import for all of Harvester's paths.  A big thanks to him for letting me include them.  

Here's how you import.  Click the pastebin link and copy the full text.  Then go into webmud.  Once you load up the script, click "Mass Import'.  Then paste into the box and click ok.  You only have to do this once, the paths are stored in your brower's local storage.  Note: if you do the import and don't see any paths in the dropdown, add your own custom path using the 'add path' then try again.  

http://pastebin.com/afV21Ptu

-Chuck (Anu)

Harvester posted this 14 March 2016

Tried to get this working but have been having problems. Get the following error:

Uncaught SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode

Tried in Opera and in Chrome, while using the bookmarklet or copy/pasting into console, but had no luck. Tried a few things suggested at stackoverflow after doing some Googling, but didn't help, and it's all a bit beyond me.

Thoughts? Let me know if I can give more info!

Chuckm posted this 14 March 2016

It's odd that it didn't work in Chrome.  So far I've tested it in Chrome 49 and Firefox 45 on both mac and PC.  Make sure you're using the most recent version (may have to restart if you haven't used it in a while).  I made a change to the addon, so try loading it again and see if it works.  One other thing to check. With the bookmark method of loading it, make sure you replace the stupid smiley face with a : (    I edited the second post to remove the smiley so you should be able to copy/paste it.

-Chuck (Anu)

Chuckm posted this 16 March 2016

I just pushed a new version that fixed some bugs and added some new features:

Notes:

  • New feature - Groups!  Now you can create path groups to organize your growing path collection.  I haven't added groups to the import/export yet, but that will be coming soon.
  • New feature - Delete all paths!  If you want a fresh start before doing an import, click this button. It will delete all of your paths and groups  
  • Fixed an error that caused the script to not load on some browsers.  Harvester reports it fixed his problem so if you experienced this in the past, give it another try.
  • Fixed an issue where the script would stop looping if you happened to walk out of a room while a monster was spawning.
  • Updated some formatting and gave each box a name. 

As always, if you run into any problem, feel free to drop Anu a telepath or report them here in the forums.  Enjoy!

-Chuck (Anu)

  • Liked by
  • Harvester
Harvester posted this 16 March 2016

Just to let everyone know, due to some miscommunication on my part, half the paths from the original import dump aren't currently working (Chupon had a reverse path function built into his script). I've fixed all the original paths, and also added about 30 more, and am currently testing them out to find any errors. 

The new path groups are going to make it a lot nicer traveling around the realm, and when they are added to the mass import/export I'll get a new file posted for everyone to try out. With the new "Clear all paths" button it's quite easy to swap them out!

Huge thanks to Chuck for working on this. I know he says it's fun, but I'm sure it has it's tedious moments. I'm really happy with how well the script works already, and if you haven't tried it out yet you should! Feedback is great, and I'm sure he'd appreciate any you have to give.

Chuckm posted this 16 March 2016

Sorry all, it looks like I didn't fully fix the combat bug. I'll get something in tonight that makes it work for sure.

-Chuck (Anu)

Chuckm posted this 17 March 2016

A new version is posted, this time with what I think is a more robust fix for the combat bug.  I've been looping on my bard for hours without issue so I'm crossing my fingers.  The fixed ended up being me tracking combat rounds and resetting the combat flag if you haven't had an actual round for more than 10 seconds. I also added in group import/export. Here's the full detail

  • New feature - Path import/export now also includes your groups
  • Fixed an issue where the script would stop looping if you happened to walk out of a room while a monster was spawning. Now if it thinks you're in combat, but you haven't swung for more than 10 seconds, it'll reset the combat flag. (this time for realzies)
  • Fixed an issue with import/export where the size exceeded what could be included in a browser alert box. All import/export is now done through a text box below the buttons. 

-Chuck (Anu)

  • Liked by
  • Harvester
Jaeger posted this 18 March 2016

Hey guys,

I'm new here but I've been toying around with a pathing script + other stuff. At this point that your pathing system is much more mature than mine so I may abandon that for now (I'm still reading through what you've done to see if I can help improve anything). What I do have is a combat stats module that calculates the following: avg round damage, swings per round, average hit damage, hit percentage, average crit damage, crit percent, average bs damage, bs hit percentage, miss rate, dodge rate, glance rate.

Screenshot

I'm going to work on getting combat magic calulations in there next.

I'm going to see if I can integrate it in with your script real quick and post that code here. It basically uses the same methodology as your script and watches combat. I hope to have something up shortly.

-Andrew (Jaeger)

  • Liked by
  • Harvester
Jaeger posted this 18 March 2016

I suppose I could have waited 5 minutes and just posted the code...

anu_walker_with_stats.js

 

Attached Files

Chuckm posted this 18 March 2016

Very cool!

I'll add it in and push out an update.  I'm also more than happy to take suggestions.  Like I mentioned in the first message, I'm new to this.  

-Chuck (Anu)

Chuckm posted this 18 March 2016

Ok, testing looked good, I pushed a new version with Jaeger's stat monitoring.  Thanks for contributing!

-Chuck (Anu)

Chuckm posted this 19 March 2016

Just pushed a minor bugfix update.  Here are the changes:

  • Changed the way combat end is identified, the script now turns off combat only when you receive experience to better deal with group heals and other mid-fight combat breaks.
  • Fixed an issue with the way party run messages were handled, they should be working now
  • Slightly increased the size of the walk delay box size to better fit 4 digit numbers

-Chuck (Anu)

  • Liked by
  • Harvester
Chuckm posted this 20 March 2016

Just pushed another bugfix update.  This one "100% for real this time no foolin (probably)" fixes the looping bug where if a mob spawns after you start walking out of the room, you endlessly sit and wait for combat to end.  It turns out I almost had it fixed but I messed up when I typed in the code .  Then I encountered a weird webmud bug (maybe a feature?) where the monster was actually still sending me attack messages from the prior room.  I now filter those out so the addon knows when your actual last combat round occured. This all adds up to the addon code actually reseting the combat flag after 10 seconds of inactivity (fingers crossed). 

As a side note, this verison also implements a new player alerting method.  Addon messages go into text under the main screen (just above Show Conversations).  I think this will be more useful than the old way and it will let me put in cool things like loop count, steps left in path, etc.  Enjoy!

-Chuck (Anu)

  • Liked by
  • Harvester
Harvester posted this 20 March 2016

Alright all, real life beat me up a bit this week but was able to finally get the new path import finished. You're going to want to clear all your paths, so hopefully you've written down any custom paths you'd like to keep, else you can export your current paths and find them in the list to re-enter afterwards. After clearing your paths using the button in the path utilities box, copy/paste the entire contents of this import into the large box in that same section, and click the import button.

I put the contents up at pastebin, you can find it here: (removed, please see the new post for updates: http://forums.webmud.com/thread/major-update-of-pathing-scripting-addon/ )

The paths have been sorted into groups, and in total there are 54 paths, with return paths bringing that number over 100. I also created a group for loops, as I found it convenient to keep those together. All of the boss paths end outside the boss, with at least one I can think of ending three rooms away due to stacked regen rooms, so I had it stop before them.

All of these paths were created from the maps, but have been tested in game and verified to work. Notably missing is the path to the Ancient Green Dragon, as the map appears to have some errors, and I didn't have time to make one by hand, since wanted to get this out to all of you without any more delays. If you have a working path for it please feel free to share!

Any questions on the paths please feel free to ask! 

Chuckm posted this 20 March 2016

Thanks Harvester!

I also just pushed a new version that adds a bit of logic to better deal with multi-mob rooms while looping.  The script will now wait a second after killing a mob to see if another mob is engaged. If so, it won't move.  This should make scripting small areas with lots of mobs much better.  

I also updated the way path 'running' works.  You can now toggle AI combat on/off if you change your mind during the path.  So, for example, you can start running, then half way through re-enable the AI combat and 'walk' the path.  This is similar to how MegaMud worked.

As always, if you run into any issues, let me know!

-Chuck (Anu)

ebonbetta posted this 22 March 2016

The whole might look nice but is not particulary intuite.

1 - I tried making my own paths but when I loaded other characters I would only have some of the paths and other fell off...

2- I loaded the paths from harvester but I tried 3 tiimes to go from arcanhold to the forest edge and everytime my char would end up getting lost.

No iidea how to make it work...

ebonbetta posted this 22 March 2016

ok, tried harvesters paths says hidden caves2 forest edge. tried from the room with exits down and southeast. and the one below it. just get no exits in that direction.

just won't work for me . enough for now

.

Harvester posted this 22 March 2016

 Every path has been tested and verified, sorry you're having a hard time figuring it out. My guess is, you're starting in the wrong room. Might be a good idea to carry torches around and drop them in the rooms the path ends at, I.E.-Run from forest edge to arcanhold, drop a torch. Now you know where to run back from.

The starting town paths are the same exact one's we've been using since launch, so I can't imagine it's a problem with the path or the script. I have explanations for all the old path's starter rooms in the original post containing the update to chupon's script that I did, but for ease I'll tell you that every starter town path begins in a room with entrance in the title. In the one or two cases that there's multiple rooms w/that in title, start from the one closest to the forest (farthest from town).

Edit to add: The original import file has bad path's because chupon's script handled return trips differently. I talked about that above in a post, and in another post I posted a new import file. Make sure you're using that one, in case you didn't realize you should use the most current one. Can find it hereremoved, see the new post for updates: http://forums.webmud.com/thread/major-update-of-pathing-scripting-addon/ )

Show More Posts
Close