Jump to content

Interaction with a GroundItem on a table


Recommended Posts

Posted (edited)

I'm working on my first script, a wine of zamorak grabber. Whenever the wine spawns, it calls this block of code:

GroundItem wine = groundItems.closest("Wine of zamorak");
    		if(wine != null){
    			magic.castSpellOnEntity(Spells.NormalSpells.TELEKINETIC_GRAB, wine);
                        sleep(random(400,600));
    		}

Whenever a wine spawns, however, it first tries to click underneath the table and then clicks the wine in the second run-through. How can I fix this?

 

 

I also have trouble when trying to walk from the bank to the temple. Whenever the program decides that the user is not in the temple and does not have a full inventory, it calls:

Position[] pathToWine = {
    			new Position(2954,3378,0), 
    			new Position(2965,3389,0), 
    			new Position(2962,3404,0),
    			new Position(2955,3417,0),
    			new Position(2949,3431,0), 
    			new Position(2947,3447,0), 
    			new Position(2945,3461,0), 
    			new Position(2942,3477,0),
    			new Position(2940,3493,0), 
    			new Position(2941,3508,0), 
    			new Position(2931,3515,0)
    		};
    		localWalker.walkPath(pathToWine);

The walker, however, only manages to get to one of the positions then clicks at its feet once before stopping. What am I doing wrong?

 

Thank you,

BTheBrave

Edited by bthebrave
Posted (edited)

For the walker you should make the distance between tiles shorter. I run into this problem often biggrin.png

 

Wow. I made the changes so the distance between tiles was shorter, and it worked. That gave me so much pain... Mr. Guru, do you have any advice for the GroundItem issue?

Edited by bthebrave

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...