Thread: How to have player do a list of tasks? (e.g. Mine ore then bank)

Results 1 to 4 of 4
  1. #1 How to have player do a list of tasks? (e.g. Mine ore then bank) 
    Registered Member Tonymndz's Avatar
    Join Date
    Aug 2015
    Posts
    9
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    I am trying to figure out how do I go about creating a list of tasks for if a player clicks a button.

    A player will mine ore till full inventory and then bank and repeat until stop button is clicked.

    I can't figure out how to create a specific function that will locate the ores in area, mine it, and bank when full.

    I have been searching the forums but I have no luck. Any help will be greatly appreciated.
    Reply With Quote  
     

  2. #2  
    Boy Wonder


    Join Date
    Mar 2012
    Posts
    849
    Thanks given
    139
    Thanks received
    80
    Rep Power
    99
    create a task that runs every tick, check player position and make the player walk to ore, for clicking i think you can manually send the packet or something (i dont really know, figure it out) then if they have a full inv tele them, open bank, or walk them to bank then open interface, and repeat.

    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Nov 2016
    Posts
    1
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    I almost wondering the same thing and using Vencillo as a base. however, i am unable to figure out how to create function/task based on same tick or how to create a function that finds the specific ore on a area. Any snippet code would greatly be appreciated to help me and OP.
    Reply With Quote  
     

  4. #4  
    Boy Wonder


    Join Date
    Mar 2012
    Posts
    849
    Thanks given
    139
    Thanks received
    80
    Rep Power
    99
    Quote Originally Posted by elguyboy View Post
    I almost wondering the same thing and using Vencillo as a base. however, i am unable to figure out how to create function/task based on same tick or how to create a function that finds the specific ore on a area. Any snippet code would greatly be appreciated to help me and OP.
    Ill post a snippet in a bit when i have a chance. ill have to do some testing myself.

    Code:
    package com.vencillio.core.task.impl;
    
    import com.vencillio.core.cache.map.Region;
    import com.vencillio.core.task.Task;
    import com.vencillio.rs2.content.skill.mining.Mining;
    import com.vencillio.rs2.entity.Entity;
    import com.vencillio.rs2.entity.Location;
    import com.vencillio.rs2.entity.player.Player;
    
    public class MiningBankTask extends Task {
    
    	public MiningBankTask(Entity entity, int delay) {
    		super(entity, delay);
    	}
    
    	private boolean bank = false;
    	
    	@Override
    	public void execute() {
    		Entity player = getEntity();
    		Location miningLocation = new Location(0, 0, 0); //put location of tile right next to mining rock here
    		Location bankLocation = new Location(0, 0, 0); //same as above except for bank
    		if(player instanceof Player) {
    			if(!player.getLocation().equals(miningLocation)  && !bank) {
    				player.getMovementHandler().addToPath(miningLocation);
    				player.getMovementHandler().finish();
    				//(The above 2 lines will make a player move but im not sure how to make it so it clips correctly, don't have time to look into code for it lol
    			} else if(player.getLocation().equals(miningLocation) && bank) {
    				Mining.clickRock((Player)player, Region.getObject(0, 0, 0));
    				//Click the rock at x, y, z
    			}
    			
    			//check for inventory slots and when no more free slots do the same thing above and go to bank and deposit items then restart
    		}
    	}
    
    	@Override
    	public void onStop() {
    		super.stop();
    	}
    
    }
    You can improve the code if you want i don't really care of the quality of it as of now, its just to show a very bare example of what to do.

    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 20
    Last Post: 11-19-2011, 02:47 AM
  2. Replies: 5
    Last Post: 11-05-2011, 02:35 AM
  3. Replies: 0
    Last Post: 05-13-2009, 03:02 AM
  4. How to make " Players Online " in quest list
    By Cizentia in forum Tutorials
    Replies: 32
    Last Post: 03-15-2009, 05:35 PM
Tags for this Thread

View Tag Cloud

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •