Thread: Platinum tokens converting

Results 1 to 4 of 4
  1. #1 Platinum tokens converting 
    Banned
    Join Date
    Sep 2017
    Posts
    339
    Thanks given
    24
    Thanks received
    30
    Rep Power
    0
    Hello just wondering how to calculate the amount of coins being converted into platinum tokens i have no idea how to make it each 1000coins = 1 token can someone give me practice thanks if someone will be helpful
    Reply With Quote  
     

  2. #2  
    Respected Member

    Corey's Avatar
    Join Date
    Feb 2012
    Posts
    1,306
    Thanks given
    960
    Thanks received
    1,271
    Rep Power
    5000
    Code:
    final int platinumTokenValue = 1000;
    final int platinumTokenAmount = coinAmount / platinumTokenValue;
    
    if (platinumTokenAmount > 0) {
        player.getInventory().removeItem(995, platinumTokenAmount * platinumTokenValue);
    } else {
        // not enough coins to convert
    }
    what exactly do you need help with?
    [Only registered and activated users can see links. ]

    [Only registered and activated users can see links. ]
    Spoiler for .:


    Reply With Quote  
     

  3. #3  
    Registered Member
    I hate Guns's Avatar
    Join Date
    Mar 2009
    Posts
    7,001
    Thanks given
    2,006
    Thanks received
    2,776
    Rep Power
    5000
    You multiply the token amount by 1.000? Or you could just set the item's value to 1.000 and use that when converting the tokens to coins?

    I'm not actually sure I know what you're trying to do.

    Reply With Quote  
     

  4. #4  
    Banned
    Join Date
    Sep 2017
    Posts
    339
    Thanks given
    24
    Thanks received
    30
    Rep Power
    0
    Quote Originally Posted by Tesla View Post
    Code:
    final int platinumTokenValue = 1000;
    final int platinumTokenAmount = coinAmount / platinumTokenValue;
    
    if (platinumTokenAmount > 0) {
        player.getInventory().removeItem(995, platinumTokenAmount * platinumTokenValue);
    } else {
        // not enough coins to convert
    }
    what exactly do you need help with?
    Thanks i've been doing it wrong lol...

    Code:
    final int value = 1000;
    		final int size = player.getInventory().getItemAmount(995);
    		player.getInventory().remove(new Item(995, size * value));
    		player.getInventory().add(new Item(13204, size / 2));
    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. [OSRSPK/Elvarg] Platinum Token exchanging
    By VenomRS in forum Snippets
    Replies: 15
    Last Post: 03-17-2020, 08:41 PM
  2. Replies: 12
    Last Post: 02-24-2017, 03:56 AM
  3. Platinum Tokens? [PI]
    By zayuhh in forum Help
    Replies: 1
    Last Post: 02-14-2017, 12:12 AM
  4. [REQ] Platinum Tokens
    By pityer tank in forum Models
    Replies: 3
    Last Post: 02-20-2016, 01:55 AM
  5. [REQ Platinum tokens + ints]
    By White Vans in forum Models
    Replies: 3
    Last Post: 11-08-2015, 09:17 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •