Thread: OSRS PK Release | Elvarg Based | Amazing Combat | NPC Pk Bots | Custom Interfaces |

Page 16 of 40 FirstFirst ... 6141516171826 ... LastLast
Results 151 to 160 of 400
  1. #151  
    Registered Member AshleyRSPS's Avatar
    Join Date
    Mar 2017
    Posts
    54
    Thanks given
    2
    Thanks received
    1
    Rep Power
    36
    Quote Originally Posted by Mitver View Post
    Yes I am, maybe i shouldve mentioned '
    Im not sure if im importing it wrong or using wrong libraries or something.
    This laptop is a toaster but I can try running tiemviewer..



    Im getting alot of code errors, client and server.

    I got it too work now, looks good! Thanks again
    if u have any questions or anything let me know I'm working on a project with this since basically only combat is added figured i can learn alot by using what i know and practice my coding.
    Reply With Quote  
     

  2. #152  
    Best Rat Donor

    Australisch's Avatar
    Join Date
    Nov 2015
    Posts
    2,049
    Thanks given
    968
    Thanks received
    481
    Rep Power
    4962
    very nice, impressed lad
    Rsn: vEetswa
    Reply With Quote  
     

  3. #153  
    Registered Member Mitver's Avatar
    Join Date
    Jun 2011
    Posts
    176
    Thanks given
    8
    Thanks received
    3
    Rep Power
    4
    Quote Originally Posted by AshleyRSPS View Post
    if u have any questions or anything let me know I'm working on a project with this since basically only combat is added figured i can learn alot by using what i know and practice my coding.
    I will, thanks! Im working on this source too(obv)
    Looking too revert back the skills n such ;D
    Reply With Quote  
     

  4. #154  
    Registered Member AshleyRSPS's Avatar
    Join Date
    Mar 2017
    Posts
    54
    Thanks given
    2
    Thanks received
    1
    Rep Power
    36
    Quote Originally Posted by Mitver View Post
    I will, thanks! Im working on this source too(obv)
    Looking too revert back the skills n such ;D
    yeah same trying to write my own skills with what i'm learning with java and slowly improve them the better i get the source that has the skills already added is complete shit.
    Reply With Quote  
     

  5. #155  
    Registered Member
    Join Date
    Aug 2014
    Posts
    259
    Thanks given
    2
    Thanks received
    6
    Rep Power
    11
    No run panels?
    Owner of ThamenX
    Reply With Quote  
     

  6. #156  
    Banned

    Join Date
    Jun 2015
    Posts
    1,517
    Thanks given
    31
    Thanks received
    143
    Rep Power
    0
    Quote Originally Posted by blaxe View Post
    No run panels?
    Eclipse mate
    Reply With Quote  
     

  7. Thankful user:


  8. #157  
    Registered Member
    Join Date
    Aug 2014
    Posts
    259
    Thanks given
    2
    Thanks received
    6
    Rep Power
    11
    Quote Originally Posted by ColdBlood View Post
    Eclipse mate
    Yeah, i was tired.. my bad.
    Owner of ThamenX
    Reply With Quote  
     

  9. #158  
    Registered Member
    Join Date
    Mar 2011
    Posts
    218
    Thanks given
    130
    Thanks received
    45
    Rep Power
    0
    anyone know what this is from?

    Code:
    java.lang.ArithmeticException: / by zero
            at com.elvarg.engine.task.impl.ShopRestockTask.getRestockAmount(ShopRest
    ockTask.java:62)
            at com.elvarg.engine.task.impl.ShopRestockTask.execute(ShopRestockTask.j
    ava:46)
            at com.elvarg.engine.task.Task.tick(Task.java:142)
            at com.elvarg.engine.task.TaskManager.sequence(TaskManager.java:32)
            at com.elvarg.engine.GameEngine.run(GameEngine.java:21)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:51
    1)
            at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
    access$301(ScheduledThreadPoolExecutor.java:180)
            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
    run(ScheduledThreadPoolExecutor.java:294)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
    java:1142)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
    .java:617)
            at java.lang.Thread.run(Thread.java:748)
    Reply With Quote  
     

  10. #159  
    Banned
    Join Date
    Dec 2013
    Posts
    171
    Thanks given
    20
    Thanks received
    19
    Rep Power
    0
    Would you recommend using the one that was released with skills or this one? OR is it the same minus skills?
    Reply With Quote  
     

  11. #160  
    Extreme Donator


    Join Date
    Oct 2010
    Posts
    2,853
    Thanks given
    1,213
    Thanks received
    1,622
    Rep Power
    5000
    Quote Originally Posted by Akitheone View Post
    Would you recommend using the one that was released with skills or this one? OR is it the same minus skills?
    the skills are horrible lol, should just use this and write your own

    Quote Originally Posted by Tha Don View Post
    anyone know what this is from?

    Code:
    java.lang.ArithmeticException: / by zero
            at com.elvarg.engine.task.impl.ShopRestockTask.getRestockAmount(ShopRest
    ockTask.java:62)
            at com.elvarg.engine.task.impl.ShopRestockTask.execute(ShopRestockTask.j
    ava:46)
            at com.elvarg.engine.task.Task.tick(Task.java:142)
            at com.elvarg.engine.task.TaskManager.sequence(TaskManager.java:32)
            at com.elvarg.engine.GameEngine.run(GameEngine.java:21)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:51
    1)
            at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
    access$301(ScheduledThreadPoolExecutor.java:180)
            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
    run(ScheduledThreadPoolExecutor.java:294)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
    java:1142)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
    .java:617)
            at java.lang.Thread.run(Thread.java:748)
    Use this:

    Code:
    package com.elvarg.engine.task.impl;
    
    import com.elvarg.engine.task.Task;
    import com.elvarg.world.model.Item;
    import com.elvarg.world.model.container.impl.Shop;
    
    public class ShopRestockTask extends Task {
    
    	public ShopRestockTask(Shop shop) {
    		super(4);
    		this.shop = shop;
    	}
    
    	private final Shop shop;
    
    	@Override
    	protected void execute() {
    		if(shop.fullyRestocked()) {
    			stop();
    			return;
    		}
    		
    		if(shop.getDefinition().getId() == Shop.GENERAL_SHOP) {
    			
    			//General shop, simply delete items from the stock.
    			for(Item item : shop.getValidItems()) {
    				shop.delete(item.getId(), getDeleteRatio(item.getAmount()), false);
    			}
    			
    		} else {
    			
    			//Other shops, add or delete items.
    			for(int shopItemIndex = 0; shopItemIndex < shop.getDefinition().getOriginalStock().length; shopItemIndex++) {
    				int originalStockAmount = shop.getDefinition().getOriginalStock()[shopItemIndex].getAmount();
    				int currentStockAmount = shop.getItems()[shopItemIndex].getAmount();
    				
    				//Check if we have too many items in the shop.
    				//If that's the case, delete them step by step.
    				if(currentStockAmount > originalStockAmount) {
    					int toDelete = getDeleteRatio(shop.getItems()[shopItemIndex].getAmount());
    					shop.delete(shop.getItems()[shopItemIndex].getId(), toDelete, false);
    				} 
    				//Check if we have too few items in the shop.
    				//If that's the case, restock them step by step.
    				else if(currentStockAmount < originalStockAmount) {
    					int toRestock = getRestockAmount(originalStockAmount, currentStockAmount);
    					shop.add(new Item(shop.getItems()[shopItemIndex].getId(), toRestock), false);
    				}
    			}
    		}
    
    		shop.refreshItems();
    	}
    
    	@Override
    	public void stop() {
    		setEventRunning(false);
    		shop.setRestockingItems(false);
    	}
    
    	private static int getRestockAmount(int originalStockAmount, int currentStockAmount) {
    		int calc = originalStockAmount / currentStockAmount;
    		if(calc < 1) {
    			calc = 1;
    		} else if(calc > originalStockAmount) {
    			calc = originalStockAmount;
    		}
    		return calc;
    	}
    
    	private static int getDeleteRatio(int currentStock) {
    		int calc = currentStock / 10;
    		if(calc < 1) {
    			calc = 1;
    		}
    		return calc;
    	}
    }
    [Today 01:29 AM] RSTrials: Nice 0.97 Win/Loss Ratio luke. That's pretty bad.
    [Today 01:30 AM] Luke132: Ok u fucking moron i forgot i could influence misc.random
    Reply With Quote  
     

  12. Thankful user:


Page 16 of 40 FirstFirst ... 6141516171826 ... LastLast

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: 38
    Last Post: 04-24-2017, 04:43 AM
  2. Elvarg Base using diffrent NPC for shops
    By D E T H in forum Help
    Replies: 10
    Last Post: 04-18-2017, 10:35 PM
  3. Replies: 37
    Last Post: 08-15-2014, 06:27 AM
  4. Xero-Edition Pk Based | Amazing Combat
    By Guruu in forum Selling
    Replies: 42
    Last Post: 08-05-2014, 09:48 PM
  5. Replies: 36
    Last Post: 10-27-2012, 10:35 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •