Thread: [508] Spinning wool & flax

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1 [508] Spinning wool & flax 
    Registered Member
    Join Date
    Feb 2016
    Posts
    60
    Thanks given
    13
    Thanks received
    8
    Rep Power
    11
    Hey Rune-Server!

    This is my first snippet, I was messing around with Berky-Scape 508 source.
    I aimed to re-emulate RuneScape 2008/2009 (Pre RS2HD).

    So when I googled around, 508 didin't have a lot of snippets/tutorials, and if it did, it had anti-leeches in it or were in the source already;

    Now to the snippet!

    Open up your Player.java and declare these ints;
    Code:
    public int WoolSpinTimer = 0;
    public int FlaxSpinTimer = 0;
    That wraps up the base timers for Wool&Flax, we will use this later on.
    Let's move on to ActionButtons.java
    Add this anywhere It'd fit, for me it fit below quests;
    Code:
    case 459:
    
    switch(buttonId) {
    case 17:
    if(Engine.playerItems.HasItemAmount(p, 1779, 1) && p.skillLvl[12] > 9) {
    	p.FlaxSpinTimer = 7;
    }
    else if (p.skillLvl[12] < 9) {
    	p.frames.sendMessage(p, "You need level 10 Crafting to spin flax!");
    }
    else {
    	p.frames.sendMessage(p, "You need to have flax in order to spin flax.");
    }
    break;
    case 19: // Ball of wool (Wool)
    if(Engine.playerItems.HasItemAmount(p, 1737, 1)) {
    	p.WoolSpinTimer = 7;
    }
    else {
    	p.frames.sendMessage(p, "You need to have wool in order to spin wool.");
    }
    break;
    case 23:
    p.frames.sendMessage(p, "ID:23"); // Magic amulet string (magic roots)
    break;
    case 27:
    p.frames.sendMessage(p, "ID:27"); // C'bow String (Sinew)
    break;
    case 31:
    p.frames.sendMessage(p, "ID:31"); // C'bow String (Tree Roots)
    break;
    case 35:
    p.frames.sendMessage(p, "ID:35"); // Rope (Yak Hair)
    break;
    }
    break;
    This checks for Crafting level and items before spinning.
    Additionaly, I put button IDs for those who want to continiue.

    Now, add this to your ObjectOption1.java;
    Code:
    case 36970: // Spinning Wheel
    p.frames.showInterface(p,459);
    break;
    To make this all work, you'll need to add this under your 'public void process()';
    Code:
    if (WoolSpinTimer == 7) {
    			WoolSpinTimer--;
    			stopMovement(this);
    			requestAnim(894, 0);
    			frames.removeShownInterface(this);
    		}
    		if (WoolSpinTimer < 7 && WoolSpinTimer > 1) {
    			WoolSpinTimer--;
    		}
    		if (WoolSpinTimer == 1 && Engine.playerItems.haveItem(this, 1737, 1)) {
    			WoolSpinTimer--;
    			Engine.playerItems.deleteItem(this, 1737, 1);
    			Engine.playerItems.addItem(this, 1759, 1);
    			addSkillXP(2, 12);
    			frames.sendMessage(this, "You spin the balls of wool.");
    		}
    		else {
    			WoolSpinTimer--;
    		}
    		if (FlaxSpinTimer == 7) {
    			FlaxSpinTimer--;
    			stopMovement(this);
    			requestAnim(894, 0);
    			frames.removeShownInterface(this);
    		}
    		if (FlaxSpinTimer < 7 && FlaxSpinTimer > 1) {
    			FlaxSpinTimer--;
    		}
    		if (FlaxSpinTimer == 1 && Engine.playerItems.haveItem(this, 1779, 1)) {
    			FlaxSpinTimer--;
    			Engine.playerItems.deleteItem(this, 1779, 1);
    			Engine.playerItems.addItem(this, 1777, 1);
    			addSkillXP(15, 12);
    			frames.sendMessage(this, "You spin the flax and get bow string.");
    		}
    		else {
    			FlaxSpinTimer--;
    		}
    Yes, I'm aware this has possible duplication,
    Now, I'm going off to sleep (Getting 2 AM here by time I posted this.)
    Last edited by Joann; 03-27-2016 at 11:13 AM. Reason: Fix skillXP ID. Sorry about that!
    Reply With Quote  
     

  2. Thankful user:


  3. #2  
    Registered Member

    Join Date
    Dec 2012
    Posts
    2,999
    Thanks given
    894
    Thanks received
    921
    Rep Power
    2555
    bruh its 2016
    Attached image
    Reply With Quote  
     

  4. #3  
    Donator


    Join Date
    Oct 2015
    Posts
    232
    Thanks given
    187
    Thanks received
    85
    Rep Power
    1516
    I can finally make bank on my server!
    Spoiler for Lolz:
    Attached image
    [Today 06:47 PM] Rusko: Shut uo ethernet ur moms a whore


    Reply With Quote  
     

  5. Thankful user:


  6. #4  
    Registered Member
    Join Date
    Feb 2016
    Posts
    60
    Thanks given
    13
    Thanks received
    8
    Rep Power
    11
    Quote Originally Posted by Kaleem View Post
    bruh its 2016
    So? Who said I can't do 508s in 2016, people are still doing 317 at 2016... People need to widen up their eyes, work on less-popular revisions, as it might be someone's favourite time of all RuneScape.. If you don't like this, sorry, play what YOU want.
    Quote Originally Posted by Photonized View Post
    I can finally make bank on my server!
    Sheep shearing will be next
    Reply With Quote  
     

  7. #5  
    Donator

    RSPSSam's Avatar
    Join Date
    Aug 2015
    Posts
    484
    Thanks given
    158
    Thanks received
    99
    Rep Power
    87
    looks quality, may try to convert this to pi. thanks!
    Quote Originally Posted by Songoty View Post
    in the beginning there was npcdrops.cfg. and xero said let there be drops, and he wrote in some drops.
    Selling YouTube advertisements! 2k+ subs and 600k+ RSPS views
    Reply With Quote  
     

  8. #6  
    Registered Member

    Join Date
    Dec 2012
    Posts
    2,999
    Thanks given
    894
    Thanks received
    921
    Rep Power
    2555
    Quote Originally Posted by Joann View Post
    So? Who said I can't do 508s in 2016, people are still doing 317 at 2016... People need to widen up their eyes, work on less-popular revisions, as it might be someone's favourite time of all RuneScape.. If you don't like this, sorry, play what YOU want.
    Not talking about the revision at all, I'm talking about the quality of code
    Attached image
    Reply With Quote  
     

  9. #7  
    Registered Member
    Join Date
    Mar 2016
    Posts
    56
    Thanks given
    9
    Thanks received
    10
    Rep Power
    11
    Quote Originally Posted by Kaleem View Post
    Not talking about the revision at all, I'm talking about the quality of code
    Then give him tips to improve instead of this, we all started somewhere.
    Reply With Quote  
     

  10. #8  
    Registered Member
    Join Date
    Mar 2016
    Posts
    34
    Thanks given
    7
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by Joann View Post
    Hey Rune-Server!

    This is my first snippet, I was messing around with Berky-Scape 508 source.
    I aimed to re-emulate RuneScape 2008/2009 (Pre RS2HD).

    So when I googled around, 508 didin't have a lot of snippets/tutorials, and if it did, it had anti-leeches in it or were in the source already;

    Now to the snippet!

    Open up your Player.java and declare these ints;
    Code:
    public int WoolSpinTimer = 0;
    public int FlaxSpinTimer = 0;
    That wraps up the base timers for Wool&Flax, we will use this later on.
    Let's move on to ActionButtons.java
    Add this anywhere It'd fit, for me it fit below quests;
    Code:
    case 459:
    
    switch(buttonId) {
    case 17:
    if(Engine.playerItems.HasItemAmount(p, 1779, 1) && p.skillLvl[12] > 9) {
    	p.FlaxSpinTimer = 7;
    }
    else if (p.skillLvl[12] < 9) {
    	p.frames.sendMessage(p, "You need level 10 Crafting to spin flax!");
    }
    else {
    	p.frames.sendMessage(p, "You need to have flax in order to spin flax.");
    }
    break;
    case 19: // Ball of wool (Wool)
    if(Engine.playerItems.HasItemAmount(p, 1737, 1)) {
    	p.WoolSpinTimer = 7;
    }
    else {
    	p.frames.sendMessage(p, "You need to have wool in order to spin wool.");
    }
    break;
    case 23:
    p.frames.sendMessage(p, "ID:23"); // Magic amulet string (magic roots)
    break;
    case 27:
    p.frames.sendMessage(p, "ID:27"); // C'bow String (Sinew)
    break;
    case 31:
    p.frames.sendMessage(p, "ID:31"); // C'bow String (Tree Roots)
    break;
    case 35:
    p.frames.sendMessage(p, "ID:35"); // Rope (Yak Hair)
    break;
    }
    break;
    This checks for Crafting level and items before spinning.
    Additionaly, I put button IDs for those who want to continiue.

    Now, add this to your ObjectOption1.java;
    Code:
    case 36970: // Spinning Wheel
    p.frames.showInterface(p,459);
    break;
    To make this all work, you'll need to add this under your 'public void process()';
    Code:
    if (WoolSpinTimer == 7) {
    			WoolSpinTimer--;
    			stopMovement(this);
    			requestAnim(894, 0);
    			frames.removeShownInterface(this);
    		}
    		if (WoolSpinTimer < 7 && WoolSpinTimer > 1) {
    			WoolSpinTimer--;
    		}
    		if (WoolSpinTimer == 1 && Engine.playerItems.haveItem(this, 1737, 1)) {
    			WoolSpinTimer--;
    			Engine.playerItems.deleteItem(this, 1737, 1);
    			Engine.playerItems.addItem(this, 1759, 1);
    			addSkillXP(2, 12);
    			frames.sendMessage(this, "You spin the balls of wool.");
    		}
    		else {
    			WoolSpinTimer--;
    		}
    		if (FlaxSpinTimer == 7) {
    			FlaxSpinTimer--;
    			stopMovement(this);
    			requestAnim(894, 0);
    			frames.removeShownInterface(this);
    		}
    		if (FlaxSpinTimer < 7 && FlaxSpinTimer > 1) {
    			FlaxSpinTimer--;
    		}
    		if (FlaxSpinTimer == 1 && Engine.playerItems.haveItem(this, 1779, 1)) {
    			FlaxSpinTimer--;
    			Engine.playerItems.deleteItem(this, 1779, 1);
    			Engine.playerItems.addItem(this, 1777, 1);
    			addSkillXP(15, 12);
    			frames.sendMessage(this, "You spin the flax and get bow string.");
    		}
    		else {
    			FlaxSpinTimer--;
    		}
    Yes, I'm aware this has possible duplication,
    Now, I'm going off to sleep (Getting 2 AM here by time I posted this.)
    i use different server, but im sure this will save me some time with adding this functionality to my server ( if not just the id's/interface ids etc alone ), so thanks mate .
    Reply With Quote  
     

  11. #9  
    Registered Member
    Join Date
    Feb 2016
    Posts
    60
    Thanks given
    13
    Thanks received
    8
    Rep Power
    11
    You don't need to quote the whole thing, I won't edit it out
    Reply With Quote  
     

  12. #10  
    Registered Member
    Join Date
    Mar 2016
    Posts
    34
    Thanks given
    7
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by Joann View Post
    You don't need to quote the whole thing, I won't edit it out
    huh? I just clicked quote, to let you know I was replying to you... I don't get your reference to editing.
    Reply With Quote  
     

Page 1 of 2 12 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. [pi] Spinning: flax/wool etc.
    By xEniigma in forum Help
    Replies: 7
    Last Post: 12-30-2012, 11:39 PM
  2. Flax spinning
    By ThatDarkMatter in forum Help
    Replies: 3
    Last Post: 08-11-2009, 06:40 PM
  3. Flax picking and spinning
    By pyrofox69 in forum Help
    Replies: 11
    Last Post: 11-05-2008, 01:06 AM
  4. Full Flax Spinning!
    By щ з خ خ ұ in forum Tutorials
    Replies: 18
    Last Post: 05-23-2008, 12:37 PM
  5. Auto Spinning flax.
    By Soulze in forum Tutorials
    Replies: 4
    Last Post: 04-17-2008, 02:37 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
  •