Thread: [Help!] Squeal of fortune spin command?

Results 1 to 4 of 4
  1. #1 [Help!] Squeal of fortune spin command? 
    Registered Member
    Join Date
    Dec 2011
    Posts
    11
    Thanks given
    2
    Thanks received
    0
    Rep Power
    11
    I want to create a command that will let you spin x amount of spins from the squeal of fortune (718 Revision)

    For example I have 23 spins, I want to be able to do :pin 23.

    How would I set it up so that you can do :pin 23 and it will spin all of them on the sof without someone abusing it with 1 spin.

    If that makes sense!

    please help!
    Reply With Quote  
     

  2. #2  
    Avalon (718-742)
    _Harry's Avatar
    Join Date
    Nov 2013
    Posts
    112
    Thanks given
    14
    Thanks received
    6
    Rep Power
    11
    Quote Originally Posted by blue0wnz2 View Post
    I want to create a command that will let you spin x amount of spins from the squeal of fortune (718 Revision)

    For example I have 23 spins, I want to be able to do :pin 23.

    How would I set it up so that you can do :pin 23 and it will spin all of them on the sof without someone abusing it with 1 spin.

    If that makes sense!

    please help!

    I will give you some tips...

    Code:
    //to stop people doing it without the correct amount of spins
    if(player.getSpins() < X)
    
    
    
    //so it auto claims the item to your inventory
    player.getInventory().add(reward.getId(), reward.getAmount());
    //or
    player.getBank().addItem(reward.getId(), reward.getAmount(), true);
    
    
    //to make it cost 1 spin
    player.hasClaimed()
    Try and look around your SquealOfFortune.java, Player.java and ButtonHandler.java and see where you can go from what I've given you

    Hope this helped.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Dec 2011
    Posts
    11
    Thanks given
    2
    Thanks received
    0
    Rep Power
    11
    No matter how hard I try to make this command I don't know what I am doing wrong.

    case "spin":
    if(player.getSpins() < 0) {
    player.getPackets().sendGameMessage("You do not have enough spins");
    }
    else
    if(player.spins >= 0) {
    player.getPackets().sendConfigByFile(11026, player.spins + 1);
    player.getPackets().sendRunScript(5879);
    player.getPackets().sendConfigByFile(11155, 3);
    int amount = player.getBox().getAmount();
    player.getBank().addItem(reward.getId(), reward.getAmount(), true);
    player.hasClaimed();
    }
    Reply With Quote  
     

  4. #4  
    Avalon (718-742)
    _Harry's Avatar
    Join Date
    Nov 2013
    Posts
    112
    Thanks given
    14
    Thanks received
    6
    Rep Power
    11
    Try this, keep in mind I don't have a command for this and I'm by no means an expert in RSPS but by having a look around this MIGHT work...
    Code:
    case "spin":
    if(player.getSpins() < 0) {
    player.getPackets().sendGameMessage("You do not have enough spins");
    }
    else if(player.spins >= 0) {
    		int rewardType = Utils.random(1, 1000);
    		int slot = 0;
    		int slotchange = Utils.getRandom(6);
    		
    		if (rewardType >= 1 && rewardType <= 925) { // Common Slots
    			slot = slotchange == 1 ? 1 :
    				   slotchange == 2 ? 3 :
    				   slotchange == 3 ? 5 :
    				   slotchange == 4 ? 7 :
    				   slotchange == 5 ? 10 : 12;
    		} else if (rewardType >= 926 && rewardType <= 989) { // Uncommon
    			slot = slotchange >= 5 ? 6 :
    				   slotchange <= 2 ? 9 : 11;
    		} else if (rewardType >= 990 && rewardType <= 997) { // Rare
    			slot = slotchange >= 5 ? 0 :
    				   slotchange <= 2 ? 4 : 8;
    		} else if (rewardType >= 998) { // Super Rare
    			slot = 2;
    		}
    		
    		player.setSpins(player.getSpins() - 1);
    		player.getPackets().sendConfigByFile(11026, player.getSpins() + 1);
    		player.getPackets().sendConfigByFile(10860, slot);
    		player.getPackets().sendGlobalConfig(1781, 0);
    		player.getPackets().sendGlobalConfig(1781, 0);
    		this.reward = items.get(slot);
    		items.clear();
    		this.spinning = true;
    		if (reward != null && reward.getName() != null)
    			System.out.println(""+player.getDisplayName()+" has won "+reward.getName()+" from Squeal of Fortune.");
    		player.getBank().addItem(reward.getId(), reward.getAmount(), true);
    			player.sendMessage("<col=FF0000>You're reward has been placed in your bank.</col>")
    }
    Add my skype if it's still not working "QuickFindCode" i'll see if I can help you further
    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. 718 Rune-Evo Help!! Squeal Of Fortune-
    By rdaas3 in forum Help
    Replies: 4
    Last Post: 01-02-2014, 12:20 AM
  2. Squeal of fortune spins.
    By BigDawg in forum Requests
    Replies: 4
    Last Post: 11-02-2012, 10:24 PM
  3. Squeal of Fortune spin ticket claim config
    By Dumb Dork in forum Requests
    Replies: 0
    Last Post: 10-18-2012, 08:54 PM
  4. Over 10k Squeal of Fortune spins daily
    By Ravenheim123 in forum Media
    Replies: 32
    Last Post: 09-26-2012, 08:14 AM
  5. Squeal of Fortune - Spins Remaining
    By Walkable in forum Help
    Replies: 15
    Last Post: 05-06-2012, 08:22 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
  •