- Joined
- Jun 5, 2016
- Messages
- 12
- Thread Author
- #1
I'm trying to have my bot path to something in a house, which can require opening a door.
For this particular bot, I also had to add a staircase to my web, and was able to do so successfully. However, my bot struggles with doors. This is what I have so far in my attempt. Note that the Web object I'm using was generated from a .nav file, which was generated when the door was closed.
Also, please note that I've tried running my bot using a Web object generated from a .nav with the door open (as opposed to with the door closed), and both attempts were unsuccessful.
Also, please note that this is in OSRS, so while the new RS3 web is awesome, it doesn't help me here.
Are bumps allowed? This really needs an answer.
For this particular bot, I also had to add a staircase to my web, and was able to do so successfully. However, my bot struggles with doors. This is what I have so far in my attempt. Note that the Web object I'm using was generated from a .nav file, which was generated when the door was closed.
Code:
// Get the door coordinate
final Coordinate doorPosition = new Coordinate(####, ####, #);
// Add the door as a BasicObjectVertex
final BasicObjectVertex door = new BasicObjectVertex(doorPosition, "Door", "Open", Collections.emptyList());
// Get the old inputs and outputs from the Door's position
Collection<WebVertex> inputs = web.getVertexOn(doorPosition).getInputs();
Collection<WebVertex> outputs = web.getVertexOn(doorPosition).getOutputs();
// Iterate through the inputs and outputs and add them to the Door vertex
inputs.forEach(door::addDirectedEdge);
outputs.forEach(door::addDirectedEdge);
// Connect the Door to the vertices nearest to it
web.getVertexNearestTo(doorPosition).addBidirectionalEdge(door);
// Finally, add the new object vertices to the web
web.addVertices(door);
Also, please note that I've tried running my bot using a Web object generated from a .nav with the door open (as opposed to with the door closed), and both attempts were unsuccessful.
Also, please note that this is in OSRS, so while the new RS3 web is awesome, it doesn't help me here.
Are bumps allowed? This really needs an answer.