Maple Coin Item Exchanger

Joined
Jan 19, 2009
Messages
612
Reaction score
96
----------------------------
Maple Coin Item Exchanger
----------------------------
Code:
var status = 0;

function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (mode == -1) {
        cm.dispose();
    } else {
        if (mode == 0 && status == 0) {
            cm.dispose();
            return;
        }
        if (mode == 1)
            status++;
        else
            status--;
        if (status == 0) {
            cm.sendSimple("Hey there #b#hh##k i am the #rMaple Coin Item Exchanger#k.\r\n#L1# 15 #rMaple Coins#k for #b1 Billion Mesos#k!#l \r\n#L2# 1 #rMaple Coin#k for #b60% Glove Attack Scroll#k#l \r\n#L3# 5 #rMaple Coins#k for #bRat Mouth#k#l \r\n#L4# 100 #rMaple Coins#k for #bWizet Hat#k  \r\n\#L5# 2 #rMaple Coins#k for #bBalenced Furry#k#l  \r\n\#L6# 6 #rMaple Coins#k for #bOstrich Mount#k#l "); 
       } else if (status == 1) {
            if (selection == 1) {
                if (cm.haveItem(4001129, 15)) {
                    cm.gainMeso(+1000000000); 
                    cm.gainItem(4001129, -15); 
                    cm.sendOk("You have gained #b1 Billion Mesos#k.");
                } else {
                    cm.sendOk("Sorry #b#hh##k you dont have 15 #rMaple Coins#k.");
                }
   cm.dispose();
        } else if (selection == 2) {
                if (cm.haveItem(4001129, 1)) {
                    cm.gainItem(2040804, 1); 
                    cm.gainItem(4001129, -1); 
                    cm.sendOk("You have gained #b60% Scroll for Gloves for ATT#k.");
                }
                cm.dispose();
        } else if (selection == 3) {
                if (cm.haveItem(4001129, 5)) {
                    cm.gainItem(1012088, 1); 
                    cm.gainItem(4001129, -5); 
                    cm.sendOk("You have gained your #bRat Mouth#k.");
                } else {
                    cm.sendOk("You have gained your #bRat Mouth#k.");
                }
                cm.dispose();
        } else if (selection == 4) {
                if(cm.haveItem(4001129, 100)) {
                    cm.gainItem(1002140, 1); 
                    cm.gainItem(4001129, -100); 
                    cm.sendOk("You have gained your #bWizet Hat#k.");
                } else {
                    cm.sendOk("You have gained your #bWizet Hat#k.");
                }
                cm.dispose();    
        } else if (selection == 5) {
                if(cm.haveItem(4001129, 2)) {
                    cm.gainItem(2070018, 500); 
                    cm.gainItem(4001129, -2); 
                    cm.sendOk("You have gained your #bBalanced Furys#k.");
                } else {
                    cm.sendOk("You have gained your #bBalanced Furys#k.");
                }
                cm.dispose();    
        } else if (selection == 6) {
                if(cm.haveItem(4001129, 6)) {
                    cm.gainItem(1902009, 1);  
                    cm.gainItem(1912004 , 1); 
                    cm.gainItem(4001129, -6); 
                    cm.sendOk("You have gained your #bOstrich Mount Kit#k.");
                } else {
                    cm.sendOk("You have gained your #bOstrich Mount Kit#k.");
                }
                cm.dispose();            
            }
            else{
                cm.sendOk("See you later #hh#.");
            }
        }
    }
}

Hubba - Maple Coin Item Exchanger - RaGEZONE Forums


+1 Thanks if you like it :)
 
If its so simple for you, do something better.
This is shit man sorry. Just grab the chicken trader , delete some categorys and change the value.
 
Code:
var status = 0;

var cost = Array(**** 1, 5);
var reward = Array("100 Coins for a Wizet Hat", "1 Coin for a 60% Glove Attack Scroll", "5 Coints for a Rat Mouth");
var itemid = Array(1002140, 2040804, 1012088);
var itemam = Array(1, 1, 1, 1);
var choose = "Pick one!\r\n";

function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (mode == -1)
        cm.dispose();
    else {
        if (mode == 0 && status == 0)
            cm.dispose();
        if (mode == 1)
            status++;
        else
            cm.dispose();
        if (status == 0) {
            cm.sendOk("Hello #b#h ##k, do you want to trade in your#r Coins#k for rewards?");
        } else if (status == 1) {
            for (var i = 0; i < reward.length; i++) {
                choose += "\r\n#L" + i + "#" + reward[i] + "#l";
            }
            cm.sendSimple(choose);
        } else if (status == 2) {
            if (cm.getPlayer().haveItem(4001129, cost[selection], false, true)) {
                cm.gainItem(4001129, -cost[selection]);
                cm.gainItem(itemid[selection], itemam[selection]);
                cm.sendOk("Ok, here you go!");
                cm.dispose();
            } else {
                cm.sendOk("Come back when you have more coins please.");
                cm.dispose();
            }
        } else {
                cm.sendOk("All right. Come back later");
                cm.dispose();
        }
    }
}
 
@ 2010

PHP:
exch = [[15, 1000000000], [1, 2040804], [5, 1012088], [100, 1002140], [2, 2070018], [6, 1902009, 1912004]];

function start() {
	var text = exch[0][0] + "#t" + 4001129 + "# for " + exch[0][1] + " Mesos.";
	for (var i = 1; i < exch.length; i++)
	    text += "\r\n#L" + i + "#" + exch[i][0] + " #t" + 4001129 + "# for #t" + exch[i][1] + "#."
    cm.sendSimple("Hey there #b#h ##k, I am the #rMaple Coin Item Exchanger#k.\r\n#L0#" + text);
}

function action(mode, type, selection) {
    if (mode > 0) {
	    if (cm.haveItem(4001129, exch[selection][0])) {
		    cm.gainItem(4001129, -exch[selection][0]);
		    if (selection != 0)
		        for (var i = 1; i < exch.length; cm.gainItem(exch[selection][i], 1), i++);
		    else
			    cm.gainMeso(exch[selection][1]);
		    cm.sendNext("You have obtained a(n)" + (selection != 0 ? "#t" + exch[selection][1] + "#." : exch[selection][1] + " of mesos."));
		}
	}
	cm.dispose();
}
 
Last edited:
@ 2010

PHP:
exch = [[15, 1000000000], [1, 2040804], [5, 1012088], [100, 1002140], [2, 2070018], [6, 1902009, 1912004]];

function start() {
	var text = exch[0][0] + "#t" + 4001129 + "# for " + exch[0][1] + " Mesos.";
	for (var i = 1; i < exch.length; i++)
	    text += "\r\n#L" + i + "#" + exch[i][0] + " #t" + 4001129 + "# for #t" + exch[i][1] + "#."
    cm.sendSimple("Hey there #b#h ##k, I am the #rMaple Coin Item Exchanger#k.\r\n#L0#" + text);
}

function action(mode, type, selection) {
    if (mode > 0) {
	    if (cm.haveItem(4001129, exch[selection][0])) {
		    cm.gainItem(4001129, -exch[selection][0]);
		    if (selection != 0)
		        for (var i = 1; i < exch.length; cm.gainItem(exch[selection][i]), i++);
		    else
			    cm.gainMeso(exch[selection][1]);
		    cm.sendNext("You have obtained a(n)" + (selection != 0 ? "#t" + exch[selection][1] + "#." : exch[selection][1] + " of mesos."));
		}
	}
	cm.dispose();
}

Hi Osiris ;D. Have you tested your script ? It's not working for me.
 
Hi Osiris ;D. Have you tested your script ? It's not working for me.

PHP:
exch = [[15, 1000000000], [1, 2040804], [5, 1012088], [100, 1002140], [2, 2070018], [6, 1902009, 1912004]];

function start() {
    var text = exch[0][0] + "#t" + 4001129 + "# for " + exch[0][1] + " Mesos.";
    for (var i = 1; i < exch.length; i++)
        text += "\r\n#L" + i + "#" + exch[i][0] + " #t" + 4001129 + "# for #t" + exch[i][1] + "#."
    cm.sendSimple("Hey there #b#h ##k, I am the #rMaple Coin Item Exchanger#k.\r\n#L0#" + text);
}

function action(mode, type, selection) {
    if (mode > 0) {
        if (cm.haveItem(4001129, exch[selection][0])) {
            cm.gainItem(4001129, -exch[selection][0]);
            if (selection != 0)
                for (var i = 1; i < exch.length; cm.gainItem(exch[selection][i]), i++);
           } else
                cm.gainMeso(exch[selection][1]);
            cm.sendNext("You have obtained a(n)" + (selection != 0 ? "#t" + exch[selection][1] + "#." : exch[selection][1] + " of mesos."));
    }
    cm.dispose();
}

Fixed, I think :laugh:
 
Hi Osiris ;D. Have you tested your script ? It's not working for me.

Hi Beng ;D. You know that I don't test NPC's that I do in RZ.

Hmm, only mistake I see is the fact that I forgot the amount parameter in gainItem(ItemId, Quantity). The mesos check is something that I don't care about since it's not my propose for this thread.
 
Hi Beng ;D. You know that I don't test NPC's that I do in RZ.

Hmm, only mistake I see is the fact that I forgot the amount parameter in gainItem(ItemId, Quantity). The mesos check is something that I don't care about since it's not my propose for this thread.

LOL I haven't even tested it, tbh. addmeaddmeaddmeaddme
 
Back