Christmas Item Exchanger [Even Better]

Results 1 to 15 of 15
  1. #1
    Account Upgraded | Title Enabled! jakesdexless is offline
    MemberRank
    Nov 2008 Join Date
    278Posts

    Christmas Item Exchanger [Even Better]

    I have no idea if it works. It should. If the items are incorrect fix them for me. I rushed on this after I saw the noobness of the other one. Well, here it is.

    Code:
    var status = 0;
    var itemsNeeded = [[4000000, 20],[4000015, 30],[4000033, 20],[4001042, 1],[4032190, 25]];
    
    function start() {
        var string = "Hello " + cm.getPlayer().getName() + ", I'm the Christmas item trader.\r\nIf you have any of the required items you can trade them in for some fabulous prizes.\r\nThe items are \r\n\r\n";
        for (var i = 0; i < itemsNeeded.length; i++)
            string += "#v" + itemsNeeded[i][0] + "#";
        string += ". \r\nDo you have any of the items?";
        cm.sendNext(string);
    }
    
    function action(made, by, jakesdexless) {
        if (made < 1)
            cm.dispose();
        else {
            status++;
            var prizes = [[1702008], [1000026 + 10 * cm.getPlayer().getGender()], [1082101], [1012007, 1000026 + cm.getPlayer().getGender()], [1012007]];
            if (status == 1) {
                var str = "What would you like to trade the items for?";
                for (var i = 0; i < itemsNeeded.length; i++)
                    str += "\r\n#L" + i + "#" + itemsNeeded[i][1] + " #t" + itemsNeeded[i][0] + "# for #t" + (i != 3 ? prizes[i][0] : (prizes[i][0] +"# and #t"+ prizes [i][1])) + "##l";
                cm.sendSimple(str);
            } else if (status == 2) {
                var item = itemsNeeded[jakesdexless][0];
                var quantity = itemsNeeded[jakesdexless][1];
                if (cm.haveItem(item, quantity)) {
                    cm.gainItem(item, -quantity);
                    for (var x = 0; x < prizes[jakesdexless].length; x++)
                        cm.gainItem(prizes[jakesdexless][x]);
                } else
                    cm.sendOk("You do not have " + quantity + " of the item #t" + item + "#.");
                cm.dispose();
            }
        }
    }
    Just kidding. I tested it and it worked. I'll point out some errors of StraMS's NPC

    1.
    Code:
    	    cm.sendNextPrev("What would you like to trade the items for? \r\n\r\n\r\n#L0##b20 Blue Snail Shells for Santa's Sack#k#l \r\n#L1##b30 Horny Mushroom Caps for a Santa Hat#k#l \r\n#L2##b20 Croco Skins for Santa Gloves#k#l \r\n#L3##b1 Slime Eraser for a full #r" + cm.getChar().getGender() + " Santa Set#k#l \r\n#L4##b25 Orange Mushroom Caps for Santa's Beard#k#l");
    This has to be cm.sendSimple(String text). You can't select from sendNextPrev(String text).
    2. It does not dispose. You click on it and you're stuck.
    3. #r" + cm.getChar().getGender() + " Santa Set#k is not correct. If you're male it would said 0 Santa Set, if you're female it would say 1 Santa Set.
    4. There's also a few style problems that are minor. You don't need to do #k and then change color without text. You also don't need the action(1, 0, 0); You don't need status = -1; Why not just do var status = -1; since that does the same thing. This part is also repetitive code:
    Code:
    		    if(cm.getChar().getGender() == 0) {
    		        cm.gainItem(4001042, -1);
    			cm.gainItem(1012007);
    			cm.gainItem(1000026);
    			cm.gainItem(1082101);
    			cm.gainItem(1050019);
    			cm.gainItem(1071003);
    		    } else if(cm.getChar().getGender() == 1) {
    			cm.gainItem(4001042, -1);
    			cm.gainItem(1012007);
    			cm.gainItem(1001036);
    			cm.gainItem(1082101);
    			cm.gainItem(1050019);
    			cm.gainItem(1071003);
    		    }
    Advantages of using this NPC as opposed to StraMS's
    1. This works.
    2. It's shorter and easier to modify. It's based on ids and not text.
    3. This NPC is from a parody thread.


  2. #2
    Infraction Banned ShoooootSource is offline
    MemberRank
    Nov 2009 Join Date
    32Posts

    Re: Christmas Item Exchanger [Even Better]

    okay.

  3. #3
    Account Upgraded | Title Enabled! maplepuppet is offline
    MemberRank
    Nov 2008 Join Date
    New JerseyLocation
    905Posts

    Re: Christmas Item Exchanger [Even Better]

    I don't think his NPC was intended to be this complicated. You just killed it.

  4. #4
    Account Upgraded | Title Enabled! X-Tasis is offline
    MemberRank
    Feb 2009 Join Date
    1,192Posts

    Re: Christmas Item Exchanger [Even Better]

    Quote Originally Posted by maplepuppet View Post
    I don't think his NPC was intended to be this complicated. You just killed it.
    Indeed, StraMS tho it was better that the script where long enough so people can find it more easy, since wall of code = better.

    That you are pretty much unadapted to any kind of coding language basic keywords doesn't means it's worse.

  5. #5
    Account Upgraded | Title Enabled! jakesdexless is offline
    MemberRank
    Nov 2008 Join Date
    278Posts

    Re: Christmas Item Exchanger [Even Better]

    Quote Originally Posted by maplepuppet View Post
    I don't think his NPC was intended to be this complicated. You just killed it.
    So basically multiple dimension arrays are complicated now?

  6. #6
    Account Upgraded | Title Enabled! maplepuppet is offline
    MemberRank
    Nov 2008 Join Date
    New JerseyLocation
    905Posts

    Re: Christmas Item Exchanger [Even Better]

    Quote Originally Posted by jakesdexless View Post
    So basically multiple dimension arrays are complicated now?
    I think you should take into consideration everyone scripts in different ways. So some peoples methods may take more time, but it works for them. And the guy said it was his first time. So to go and just take his NPC and put it into a format that you like. Well good for you but, I think all credits should go to him, and you can keep your format to yourself. Fair enough?

    Code:
    function action(made, by, jakesdexless) {
    Is that junk really necesarry. This NPC wasn't even your idea.
    Last edited by maplepuppet; 28-11-09 at 04:35 AM.

  7. #7
    Account Upgraded | Title Enabled! jakesdexless is offline
    MemberRank
    Nov 2008 Join Date
    278Posts

    Re: Christmas Item Exchanger [Even Better]

    Quote Originally Posted by maplepuppet View Post
    I think you should take into consideration everyone scripts in different ways. So some peoples methods may take more time, but it works for them. And the guy said it was his first time. So to go and just take his NPC and put it into a format that you like. Well good for you but, I think all credits should go to him, and you can keep your format to yourself. Fair enough?

    Code:
    function action(made, by, jakesdexless) {
    Is that junk really necesarry. This NPC wasn't even your idea.
    You missed the point. The point of this thread was to make fun of StraMS's failed attempt to copy travelms's NPC, which worked fine and wasn't coded really badly. As you can see, I have copied StraMS's text word for word and yes, my NPC works unlikes StraMS's.

    btw this NPC should run slower, if anything because of the for loop. I just made it so that you can modify it easily just by modifying IDs, making it a lot easier to work with.

    edit:
    that wasn't strams's first NPC, he's released other ones
    Last edited by jakesdexless; 28-11-09 at 04:58 AM.

  8. #8
    Valued Member Ex0n is offline
    MemberRank
    Jun 2008 Join Date
    136Posts

    Re: Christmas Item Exchanger [Even Better]

    Can upload a picture oF the NPC?
    ^.^

  9. #9
    Apprentice User235 is offline
    MemberRank
    Sep 2009 Join Date
    9Posts

    Re: Christmas Item Exchanger [Even Better]

    Quote Originally Posted by maplepuppet View Post
    I don't think his NPC was intended to be this complicated. You just killed it.
    i think to make a npc properly, sometimes i thas to be complicated

  10. #10
    Account Upgraded | Title Enabled! LuckySage is offline
    MemberRank
    Apr 2009 Join Date
    The NetherlandsLocation
    518Posts

    Re: Christmas Item Exchanger [Even Better]

    This versoin of the exchanger gets me dc'ed...

  11. #11
    Apprentice User235 is offline
    MemberRank
    Sep 2009 Join Date
    9Posts

    Re: Christmas Item Exchanger [Even Better]

    it works for me... what are your errors?

  12. #12
    bleh.... Shawn is offline
    MemberRank
    Oct 2008 Join Date
    Mississauga, CaLocation
    5,904Posts

    Re: Christmas Item Exchanger [Even Better]

    Quote Originally Posted by maplepuppet View Post
    I think you should take into consideration everyone scripts in different ways. So some peoples methods may take more time, but it works for them. And the guy said it was his first time. So to go and just take his NPC and put it into a format that you like. Well good for you but, I think all credits should go to him, and you can keep your format to yourself. Fair enough?

    Code:
    function action(made, by, jakesdexless) {
    Is that junk really necesarry. This NPC wasn't even your idea.
    I think you should do research before trying to defend someone. StraMS took someone elses' NPC and "tried" to make it better (at the same time, trying to make someone else look idiotic), similar to what jakesdexless did. The difference? jakesdexless actually gave a working script, StraMS didn't. Also...

    Code:
    function action(made, by, jakesdexless) {
    Is the same as...

    Code:
    function action(mode, type, selection) {
    As long as you follow through with it in the rest of the script.

  13. #13
    Account Upgraded | Title Enabled! maplepuppet is offline
    MemberRank
    Nov 2008 Join Date
    New JerseyLocation
    905Posts

    Re: Christmas Item Exchanger [Even Better]

    Quote Originally Posted by jakesdexless View Post
    You missed the point. The point of this thread was to make fun of StraMS's failed attempt to copy travelms's NPC, which worked fine and wasn't coded really badly. As you can see, I have copied StraMS's text word for word and yes, my NPC works unlikes StraMS's.

    btw this NPC should run slower, if anything because of the for loop. I just made it so that you can modify it easily just by modifying IDs, making it a lot easier to work with.

    edit:
    that wasn't strams's first NPC, he's released other ones
    I never noticed StraMS's NPC, so I really didn't get the point of this.

    Quote Originally Posted by bboy242 View Post
    I think you should do research before trying to defend someone. StraMS took someone elses' NPC and "tried" to make it better (at the same time, trying to make someone else look idiotic), similar to what jakesdexless did. The difference? jakesdexless actually gave a working script, StraMS didn't. Also...

    Code:
    function action(made, by, jakesdexless) {
    Is the same as...

    Code:
    function action(mode, type, selection) {
    As long as you follow through with it in the rest of the script.
    Well yeah I know that, what I meant was it's not necessary to put made by jakedexless. Especially when it wasn't his npc idea. But I guess it's intended to make fun of the other guys npc.
    Last edited by maplepuppet; 28-11-09 at 06:23 AM.

  14. #14
    Account Upgraded | Title Enabled! LuckySage is offline
    MemberRank
    Apr 2009 Join Date
    The NetherlandsLocation
    518Posts

    Re: Christmas Item Exchanger [Even Better]

    Well since this exchanger didn't work out for me, i made my own one. I'm not a pro coder, actually i've coded like 1,2 times.. So please don't hate if you don't like it.

    Code:
    var wui = 0;
    
    function start() {
        cm.sendSimple ("#dHello #h ##k\r\n#dWonder what these are for #v4000038 #?\r\nWell it are #bAlex#k #dhis prize winning Trophys!#k\r\n#dThis #gOld man#k #d on the left of me, hide them from #bAlex#k \r\n#bPlease bring them to me and choose a reward!#k\r\n#L0#200 of #v4000038# for a #rSanta's Hat:#k #v1002225##l\r\n#L1#250 of #v4000038# for a #rSanta's Boy Costume:#k #v1050019##l\r\n\r\n#L2#250 of #v4000038# for a #rSanta's Girl Overall:#k #v1051131##k#l\r\n\r\n#L3#150 of #v4000038# for a #rSanta's Sack:#k #v1702008##l\r\n\r\n#L4#100 of #v4000038# for a #rSanta's Gloves#k#v1082101##l\r\n\r\n#L5#100 of #v4000038# for #rSanta's Boy Boots#k #v1070005##l\r\n\r\n#L6#100 of #v4000038# for #rSanta's Girl Boots#k #v1071003#");
    }
    
    function action(mode, type, selection) {
    cm.dispose();
        if (selection == 0) {
    
    
                        if (cm.haveItem(4000038, 200)) {
    cm.gainItem(4000038, -200);
    cm.gainItem(1002225, 1);
    cm.sendOk("You have Exchanged 200 #rTrophys#k for 1 #rSanta's Hat!#k");
                          cm.dispose();
                } else {
                    cm.sendOk("Gather up more #rTrophys#k please.");
                    cm.dispose();
                    }
    
            } else if (selection == 1) {
    
    
                        if (cm.haveItem(4000038, 250)) {
    cm.gainItem(4000038, -250);
    cm.gainItem(1050019, 1);
    cm.sendOk("You have Exchanged 250 #rTrophys#k for 1 #rSanta's Boy Costume!#k");
                          cm.dispose();
                } else {
                    cm.sendOk("Gather up more #rTrophys#k please.");
                    cm.dispose();
                    }
    
            } else if (selection == 2) {
    
    
                        if (cm.haveItem(4000038, 250)) {
    cm.gainItem(4000038, -250);
    cm.gainItem(1051131, 1);
    cm.sendOk("You have Exchanged 250 #rTrophys#k for a #rSanta's Girl Overall!#k");
                          cm.dispose();
                } else {
                    cm.sendOk("Gather up more #rTrophys#k please.");
                    cm.dispose();
                    }
    
            } else if (selection == 3) {
    
    
                        if (cm.haveItem(4000038, 150)) {
    cm.gainItem(4000038, -150);
    cm.gainItem(1702008, 1);
    cm.sendOk("You have Exchanged 150 #rTrophys#k for a #rSanta's Sack!#k");
                          cm.dispose();
                } else {
                    cm.sendOk("Gather up more #rTrophys#k please");
                    cm.dispose();
                    }
    
    
    
            } else if (selection == 4) {
    
    
                        if (cm.haveItem(4000038, 100)) {
    cm.gainItem(4000038, -100);
    cm.gainItem(1082**** 1);
    cm.sendOk("You have Exchanged 100 #rTrophys#k for a #rSanta's Gloves!#k");
                          cm.dispose();
                } else {
                    cm.sendOk("Gather up more #rTrophys#k please.");
                    cm.dispose();
                    }
    
            } else if (selection == 5) {
    
    
                        if (cm.haveItem(4000038, 100)) {
    cm.gainItem(4000038, -100);
    cm.gainItem(1070005, 1);
    cm.sendOk("You have Exchanged 100 #rTrophys#k for #rSanta's Boy Boots!#k");
                          cm.dispose();
                } else {
                    cm.sendOk("Gather up more #rTrophys#k please.");
                    cm.dispose();
                    }
    
            } else if (selection == 6) {
    
                        if (cm.haveItem(4000038, 100)) {
    cm.gainItem(4000038, -100);
    cm.gainItem(1071003, 1);
    cm.sendOk("You have Exchanged 100 #rTrophys#k for #rSanta's Girl Boots!#k");
                          cm.dispose();
                } else {
                    cm.sendOk("Gather up more #rTrophys#k please.");
                    cm.dispose();
                    }
    
            } else if (selection == 9) {
    
    
    
            cm.dispose();
            }    
    
    
        
    }
    This works for me 100%.

  15. #15
    Banned SpottedCow is offline
    BannedRank
    Nov 2009 Join Date
    wtfdddddLocation
    208Posts

    Re: Christmas Item Exchanger [Even Better]

    funny



Advertisement