Thread: 317 Mystery box spinner

Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 37
  1. #11  
    Endeavor

    Mikey`'s Avatar
    Join Date
    Dec 2007
    Posts
    4,434
    Thanks given
    715
    Thanks received
    1,435
    Rep Power
    1202
    Very nice release, thanks for this.
    Reply With Quote  
     

  2. #12  
    Software Developer

    Tyrant's Avatar
    Join Date
    Jul 2013
    Age
    24
    Posts
    1,562
    Thanks given
    678
    Thanks received
    423
    Rep Power
    1060
    Code:
    ItemDefinition.lookup
    might be performance costly. Should figure a way of caching this.

    Otherwise; could've been done cleaner and probably more efficiently but great release overall
    Reply With Quote  
     

  3. Thankful user:


  4. #13  
    Registered Member
    rebecca's Avatar
    Join Date
    Aug 2017
    Posts
    1,071
    Thanks given
    862
    Thanks received
    915
    Rep Power
    5000
    Quote Originally Posted by Tyrant View Post
    Code:
    ItemDefinition.lookup
    might be performance costly. Should figure a way of caching this.

    Otherwise; could've been done cleaner and probably more efficiently but great release overall
    could def improve the reward part of it, was just a quick write up to test the text and containers storing the names separately would be way better than looking through 20000 items
    Reply With Quote  
     

  5. Thankful user:


  6. #14  
    Registered Member Xeunosa's Avatar
    Join Date
    May 2018
    Age
    29
    Posts
    5
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Very cool release. maybe when I improve at code I can add it to my source
    Reply With Quote  
     

  7. #15  
    Banned
    Join Date
    Sep 2017
    Posts
    339
    Thanks given
    24
    Thanks received
    30
    Rep Power
    0
    Will use this for sure sooner thanks for this!
    Reply With Quote  
     

  8. #16  
    Owner of Dawntained

    Mgt Madness's Avatar
    Join Date
    Oct 2011
    Age
    28
    Posts
    3,380
    Thanks given
    1,429
    Thanks received
    958
    Rep Power
    2168
    fkkkkkkkk why this released gg
    nice yeri gif tho respeckt
    Attached image
    Reply With Quote  
     

  9. Thankful users:


  10. #17  
    Registered Member
    Join Date
    Jun 2014
    Posts
    51
    Thanks given
    1
    Thanks received
    1
    Rep Power
    11
    Can someone convert this to PI. I know everyone is gonna tell that PI is shit and it is. But please i need dis
    Reply With Quote  
     

  11. #18  
    Registered Member

    Join Date
    Oct 2017
    Posts
    649
    Thanks given
    6
    Thanks received
    119
    Rep Power
    161
    thanks for release
    Reply With Quote  
     

  12. #19  
    Registered Member
    Join Date
    Jun 2014
    Posts
    51
    Thanks given
    1
    Thanks received
    1
    Rep Power
    11
    Can anyone tell if i converted it right to my client and did i put it in right classes?
    RSInterface.java
    Code:
    public static void spinTab(RSFont[] wid) {
    		RSInterface list = addTabInterface(13000);
    		RSInterface items = addTabInterface(13100);
    		RSInterface reward = addTabInterface(13300);
    		reward.interfaceShown = true;
    		addTransparentSprite(13301, 546,  "SPINNER");
    		addSprite(13302, 547, "SPINNER");
    		addText(13304, "You won:", wid, 2, 0xff9040, true, true);
    		addText(13305, "name_here", wid, 1, 0xff9040, true, true);
    		RSInterface rewardContainer = addTabInterface(13303);
    		rewardContainer.spritesX = new int[1];
    		rewardContainer.spritesY = new int[1];
    		rewardContainer.inventoryValue = new int[1];
    		rewardContainer.inventory = new int[100000000];
    		rewardContainer.boxFilled = false;
    		rewardContainer.deletesTargetSlot = false;
    		rewardContainer.usableItemInterface = false;
    		rewardContainer.isInventoryInterface = false;
    		rewardContainer.interfaceShown = true;
    		rewardContainer.allowSwapItems = false;
    		rewardContainer.invSpritePadX = 0;
    		rewardContainer.invSpritePadY = 0;
    		rewardContainer.height = 1;
    		rewardContainer.width = 1;
    		rewardContainer.parentID = 41002;
    		rewardContainer.type = 4;
    		int rewardChild = 0;
    		reward.totalChildren(8);
    		reward.child(rewardChild++, 13301, 0, 0);
    		reward.child(rewardChild++, 13302, 140, 110);
    		reward.child(rewardChild++, 13003, 190, 42);
    		reward.child(rewardChild++, 13004, 190, 42);
    		reward.child(rewardChild++, 13007, 245, 47);
    		reward.child(rewardChild++, 13303, 230, 127);
    		reward.child(rewardChild++, 13304, 245, 172);
    		reward.child(rewardChild++, 13305, 244, 188);
    		items.width = 391;
    		addSprite(13001, 539, "SPINNER");
    		addSprite(13002, 538, "SPINNER");
    		addHoverButton(13003, "SPINNER", 542, 114, 25, "Spin", 250, 13004, 0);
    		addHoveredButton(13004, "SPINNER", 543, 114, 25, 4400);
    		addText(13007, "SPIN", wid, 2, 0xff9040, true, true);
    		addText(13009, "Spin to win!", wid, 2, 0xff9040, true, true);
    		addText(13010, "Possible rewards:", wid, 2, 0xff9040, true, true);
    		addHoverText(13011, "<u>Buy more spins", "Go to website", wid, 0, 0xff9040, true, false, 75);
    		addSprite(13101, 541, "SPINNER");
    		addSprite(13012, 544, "SPINNER");
    		addText(13014, "New items in:", wid, 2, 0xff9040, true, true);
    		addText(13015, "24:00", wid, 0, 0xff9040, false, true);
    		addText(13016, "Spins left:", wid, 2, 0xff9040, true, true);
    		addText(13017, "100", wid, 0, 0xff9040, false, true);
    		addText(13018, "Total gp won:", wid, 2, 0xff9040, true, true);
    		addText(13019, "1.5b", wid, 0, 0xff9040, false, true);
    		RSInterface container = addTabInterface(13200);
    		container.spritesX = new int[300];
    		container.spritesY = new int[300];
    		container.inventoryValue = new int[300];
    		container.inventory = new int[100000000];
    		container.boxFilled = false;
    		container.deletesTargetSlot = false;
    		container.usableItemInterface = false;
    		container.isInventoryInterface = false;
    		container.interfaceShown = true;
    		container.allowSwapItems = false;
    		container.invSpritePadX = 9;
    		container.invSpritePadY = 0;
    		container.height = 1;
    		container.width = 300;
    		container.parentID = 41002;
    		container.type = 4;
    		RSInterface possibleRewards = addTabInterface(13202);
    		possibleRewards.spritesX = new int[300];
    		possibleRewards.spritesY = new int[300];
    		possibleRewards.inventoryValue = new int[300];
    		possibleRewards.inventory = new int[100000000];
    		possibleRewards.boxFilled = false;
    		possibleRewards.deletesTargetSlot = false;
    		possibleRewards.usableItemInterface = false;
    		possibleRewards.isInventoryInterface = false;
    		possibleRewards.interfaceShown = true;
    		possibleRewards.allowSwapItems = false;
    		possibleRewards.invSpritePadX = 9;
    		possibleRewards.invSpritePadY = 0;
    		possibleRewards.height = 20;
    		possibleRewards.width = 4;
    		possibleRewards.parentID = 41002;
    		possibleRewards.type = 4;
    		RSInterface rewardScroll = addTabInterface(13201);
    		rewardScroll.width = 161;
    		rewardScroll.height = 133;
    		rewardScroll.scrollMax = 455;
    		int rewardScrollChild = 0;
    		rewardScroll.totalChildren(1);
    		rewardScroll.child(rewardScrollChild, 13202, 0, 0);
    		int listChild = 0;
    		int itemChild = 0;
    		items.totalChildren(2);
    		items.child(itemChild++, 13101, 0, 0);
    		items.child(itemChild++, 13200, 3, 3);
    		list.totalChildren(18);
    		list.child(listChild++, 13001, 10, 10);
    		list.child(listChild++, 13003, 200, 52);
    		list.child(listChild++, 13004, 200, 52);
    		list.child(listChild++, 13007, 255, 57);
    		list.child(listChild++, 13009, 252, 20);
    		list.child(listChild++, 13100, 58, 86);
    		list.child(listChild++, 13002, 250, 83);
    		list.child(listChild++, 13010, 145, 130);
    		list.child(listChild++, 13201, 60, 152);
    		list.child(listChild++, 13011, 27, 21);
    		list.child(listChild++, 13012, 265, 170);
    		list.child(listChild++, 13014, 337, 180);
    		list.child(listChild++, 13015, 385, 183);
    		list.child(listChild++, 13016, 345, 203);
    		list.child(listChild++, 13017, 385, 206);
    		list.child(listChild++, 13018, 345, 226);
    		list.child(listChild++, 13019, 392, 229);
    		list.child(listChild++, 13300, 10, 10);
    	}
    client.java
    Code:
    public void startSpinner() {	
    		RSInterface w = RSInterface.interfaceCache[13101];
    		RSInterface w2 = RSInterface.interfaceCache[13200];
    		RSInterface rewardInt = RSInterface.interfaceCache[13300];
    		RSInterface rewards = RSInterface.interfaceCache[13303];
    		if(w.xOffset >= -1000) {
    			w.xOffset -= 25;
    			w2.xOffset -= 25;
    		}
    		if(w.xOffset >= -1912 && w.xOffset <= -1001) {
    			w.xOffset -= (25 / spinSpeed);
    			w2.xOffset -= (25 / spinSpeed);
    			spinSpeed = spinSpeed + 0.07f;
    		}
    		if(w.xOffset >= -2000 && w.xOffset < -1913) {
    			w.xOffset -= (25 / spinSpeed);
    			w2.xOffset -= (25 / spinSpeed);
    			spinSpeed = spinSpeed + 2f;
    		}
    		if(w.xOffset <= -1913) {
    			rewardInt.interfaceShown = false;
    			amountValue += (w2.inventory[51] * ItemDef.forID((w2.inventoryValue[51]) - 1).value);
    			RSInterface.interfaceCache[13019].message = Integer.toString(this.amountValue);
    			RSInterface.interfaceCache[13305].message = ItemDef.forID((w2.inventoryValue[51]) - 1).name.replaceAll("_", " ");
    			rewards.inventoryValue[0] = w2.inventoryValue[51];
    			rewards.inventory[0] = w2.inventory[51];
    			startSpin = false;
    			
    		}
    	}
    Reply With Quote  
     

  13. #20  
    Registered Member
    rebecca's Avatar
    Join Date
    Aug 2017
    Posts
    1,071
    Thanks given
    862
    Thanks received
    915
    Rep Power
    5000
    Quote Originally Posted by audriukas13 View Post
    Can anyone tell if i converted it right to my client and did i put it in right classes?
    RSInterface.java
    Code:
    public static void spinTab(RSFont[] wid) {
    		RSInterface list = addTabInterface(13000);
    		RSInterface items = addTabInterface(13100);
    		RSInterface reward = addTabInterface(13300);
    		reward.interfaceShown = true;
    		addTransparentSprite(13301, 546,  "SPINNER");
    		addSprite(13302, 547, "SPINNER");
    		addText(13304, "You won:", wid, 2, 0xff9040, true, true);
    		addText(13305, "name_here", wid, 1, 0xff9040, true, true);
    		RSInterface rewardContainer = addTabInterface(13303);
    		rewardContainer.spritesX = new int[1];
    		rewardContainer.spritesY = new int[1];
    		rewardContainer.inventoryValue = new int[1];
    		rewardContainer.inventory = new int[100000000];
    		rewardContainer.boxFilled = false;
    		rewardContainer.deletesTargetSlot = false;
    		rewardContainer.usableItemInterface = false;
    		rewardContainer.isInventoryInterface = false;
    		rewardContainer.interfaceShown = true;
    		rewardContainer.allowSwapItems = false;
    		rewardContainer.invSpritePadX = 0;
    		rewardContainer.invSpritePadY = 0;
    		rewardContainer.height = 1;
    		rewardContainer.width = 1;
    		rewardContainer.parentID = 41002;
    		rewardContainer.type = 4;
    		int rewardChild = 0;
    		reward.totalChildren(8);
    		reward.child(rewardChild++, 13301, 0, 0);
    		reward.child(rewardChild++, 13302, 140, 110);
    		reward.child(rewardChild++, 13003, 190, 42);
    		reward.child(rewardChild++, 13004, 190, 42);
    		reward.child(rewardChild++, 13007, 245, 47);
    		reward.child(rewardChild++, 13303, 230, 127);
    		reward.child(rewardChild++, 13304, 245, 172);
    		reward.child(rewardChild++, 13305, 244, 188);
    		items.width = 391;
    		addSprite(13001, 539, "SPINNER");
    		addSprite(13002, 538, "SPINNER");
    		addHoverButton(13003, "SPINNER", 542, 114, 25, "Spin", 250, 13004, 0);
    		addHoveredButton(13004, "SPINNER", 543, 114, 25, 4400);
    		addText(13007, "SPIN", wid, 2, 0xff9040, true, true);
    		addText(13009, "Spin to win!", wid, 2, 0xff9040, true, true);
    		addText(13010, "Possible rewards:", wid, 2, 0xff9040, true, true);
    		addHoverText(13011, "<u>Buy more spins", "Go to website", wid, 0, 0xff9040, true, false, 75);
    		addSprite(13101, 541, "SPINNER");
    		addSprite(13012, 544, "SPINNER");
    		addText(13014, "New items in:", wid, 2, 0xff9040, true, true);
    		addText(13015, "24:00", wid, 0, 0xff9040, false, true);
    		addText(13016, "Spins left:", wid, 2, 0xff9040, true, true);
    		addText(13017, "100", wid, 0, 0xff9040, false, true);
    		addText(13018, "Total gp won:", wid, 2, 0xff9040, true, true);
    		addText(13019, "1.5b", wid, 0, 0xff9040, false, true);
    		RSInterface container = addTabInterface(13200);
    		container.spritesX = new int[300];
    		container.spritesY = new int[300];
    		container.inventoryValue = new int[300];
    		container.inventory = new int[100000000];
    		container.boxFilled = false;
    		container.deletesTargetSlot = false;
    		container.usableItemInterface = false;
    		container.isInventoryInterface = false;
    		container.interfaceShown = true;
    		container.allowSwapItems = false;
    		container.invSpritePadX = 9;
    		container.invSpritePadY = 0;
    		container.height = 1;
    		container.width = 300;
    		container.parentID = 41002;
    		container.type = 4;
    		RSInterface possibleRewards = addTabInterface(13202);
    		possibleRewards.spritesX = new int[300];
    		possibleRewards.spritesY = new int[300];
    		possibleRewards.inventoryValue = new int[300];
    		possibleRewards.inventory = new int[100000000];
    		possibleRewards.boxFilled = false;
    		possibleRewards.deletesTargetSlot = false;
    		possibleRewards.usableItemInterface = false;
    		possibleRewards.isInventoryInterface = false;
    		possibleRewards.interfaceShown = true;
    		possibleRewards.allowSwapItems = false;
    		possibleRewards.invSpritePadX = 9;
    		possibleRewards.invSpritePadY = 0;
    		possibleRewards.height = 20;
    		possibleRewards.width = 4;
    		possibleRewards.parentID = 41002;
    		possibleRewards.type = 4;
    		RSInterface rewardScroll = addTabInterface(13201);
    		rewardScroll.width = 161;
    		rewardScroll.height = 133;
    		rewardScroll.scrollMax = 455;
    		int rewardScrollChild = 0;
    		rewardScroll.totalChildren(1);
    		rewardScroll.child(rewardScrollChild, 13202, 0, 0);
    		int listChild = 0;
    		int itemChild = 0;
    		items.totalChildren(2);
    		items.child(itemChild++, 13101, 0, 0);
    		items.child(itemChild++, 13200, 3, 3);
    		list.totalChildren(18);
    		list.child(listChild++, 13001, 10, 10);
    		list.child(listChild++, 13003, 200, 52);
    		list.child(listChild++, 13004, 200, 52);
    		list.child(listChild++, 13007, 255, 57);
    		list.child(listChild++, 13009, 252, 20);
    		list.child(listChild++, 13100, 58, 86);
    		list.child(listChild++, 13002, 250, 83);
    		list.child(listChild++, 13010, 145, 130);
    		list.child(listChild++, 13201, 60, 152);
    		list.child(listChild++, 13011, 27, 21);
    		list.child(listChild++, 13012, 265, 170);
    		list.child(listChild++, 13014, 337, 180);
    		list.child(listChild++, 13015, 385, 183);
    		list.child(listChild++, 13016, 345, 203);
    		list.child(listChild++, 13017, 385, 206);
    		list.child(listChild++, 13018, 345, 226);
    		list.child(listChild++, 13019, 392, 229);
    		list.child(listChild++, 13300, 10, 10);
    	}
    client.java
    Code:
    public void startSpinner() {	
    		RSInterface w = RSInterface.interfaceCache[13101];
    		RSInterface w2 = RSInterface.interfaceCache[13200];
    		RSInterface rewardInt = RSInterface.interfaceCache[13300];
    		RSInterface rewards = RSInterface.interfaceCache[13303];
    		if(w.xOffset >= -1000) {
    			w.xOffset -= 25;
    			w2.xOffset -= 25;
    		}
    		if(w.xOffset >= -1912 && w.xOffset <= -1001) {
    			w.xOffset -= (25 / spinSpeed);
    			w2.xOffset -= (25 / spinSpeed);
    			spinSpeed = spinSpeed + 0.07f;
    		}
    		if(w.xOffset >= -2000 && w.xOffset < -1913) {
    			w.xOffset -= (25 / spinSpeed);
    			w2.xOffset -= (25 / spinSpeed);
    			spinSpeed = spinSpeed + 2f;
    		}
    		if(w.xOffset <= -1913) {
    			rewardInt.interfaceShown = false;
    			amountValue += (w2.inventory[51] * ItemDef.forID((w2.inventoryValue[51]) - 1).value);
    			RSInterface.interfaceCache[13019].message = Integer.toString(this.amountValue);
    			RSInterface.interfaceCache[13305].message = ItemDef.forID((w2.inventoryValue[51]) - 1).name.replaceAll("_", " ");
    			rewards.inventoryValue[0] = w2.inventoryValue[51];
    			rewards.inventory[0] = w2.inventory[51];
    			startSpin = false;
    			
    		}
    	}
    right class, need to rename variables, not hard to do if you compare the Widget class that came with the elvarg release to yours, should be close to identical when comparing them, and get rid of the 10000000, that was something i forgot to remove while testing something
    Reply With Quote  
     

Page 2 of 4 FirstFirst 1234 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. 317 PI Mystery Box (ADVANCED)
    By x USMC x in forum Tutorials
    Replies: 36
    Last Post: 04-23-2015, 03:35 AM
  2. [317] Mystery Box Help
    By SGS5 in forum Help
    Replies: 4
    Last Post: 08-21-2013, 08:42 PM
  3. Replies: 18
    Last Post: 08-17-2013, 01:18 AM
  4. Replies: 3
    Last Post: 03-30-2013, 08:05 AM
  5. [317] Mystery Box [317]
    By pyrotic in forum Tutorials
    Replies: 25
    Last Post: 08-18-2011, 12:24 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
  •