Thread: Platinum tokens converting

Results 1 to 4 of 4
  1. #1 Platinum tokens converting 
    Registered Member replicant's Avatar
    Join Date
    Sep 2017
    Posts
    303
    Thanks given
    19
    Thanks received
    25
    Rep Power
    20
    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  
    Forum Moderator

    Corey's Avatar
    Join Date
    Feb 2012
    Posts
    1,224
    Thanks given
    877
    Thanks received
    1,069
    Discord
    corey#2147
    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. ]
    Spoiler for .:

    Reply With Quote  
     

  3. #3  
    Registered Member
    Jack's Avatar
    Join Date
    Mar 2009
    Posts
    6,878
    Thanks given
    1,859
    Thanks received
    2,577
    Discord
    TwistedBoner#2217
    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.
    [Only registered and activated users can see links. ]

    OS-Exile Discord: [Only registered and activated users can see links. ]

    Reply With Quote  
     

  4. #4  
    Registered Member replicant's Avatar
    Join Date
    Sep 2017
    Posts
    303
    Thanks given
    19
    Thanks received
    25
    Rep Power
    20
    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: 8
    Last Post: 06-14-2017, 01:46 AM
  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
  •