Spirit Member
Posts : 61 Join date : 2012-03-30 Age : 27 Location : cm.getLocation();
| Subject: [Release]Currency Convertor Mon Apr 09, 2012 3:17 pm | |
| woohoo first to post in java/C++ this is one of my old npcs made from 4 selections where mesos can be traded to currency, vice versa as well as a sub currency being traded into a full currency rate please this was mine - Code:
-
var status;
function start() { status = -1; action(1, 0, 0); }
function action(mode, type, selection) { if (mode == -1) { cm.dispose(); } else { if (mode == 1) { status++; } else { status--; } } if(status == 0) { cm.sendSimple("Hello, I am the #v4000313# and #v4001126# exchanger." + "#k\r\n#L0#Trade 1000 maple leaves For A #v4000313##l" + "#k\r\n#L1#Trade A #v4000313# For 1000 maple leaves#l" + "#k\r\n#L2#Trade 1 Billion Mesos For 100 #v4001126##l" + "#k\r\n#L3#Trade 100 #v4001126# For 1 Billion Mesos#l"); } else if (status == 1) { if (selection == 0) { if(cm.haveItem(4001126, 1000)) { cm.gainItem(4000313, 1); cm.gainItem(4001126, -1000); cm.sendOk("Thanks, here is your #v4000313#."); } else { cm.sendOk("You don't have enough mesos!"); cm.dispose(); } } else if (selection == 1) { if(cm.haveItem(4000313, 1)) { cm.gainItem(4000313, -1); cm.gainItem(4001126, 1000); cm.sendOk("Thanks, here are your leaves."); } else { cm.sendOk("You don't have a #v4000313#!"); cm.dispose(); } } else if (selection == 2) { if(cm.getMeso() >= 1000000000) { cm.gainItem(4001126, 100); cm.gainMeso(-1000000000); cm.sendOk("Thanks, here are your 100 #v4001126#."); } else { cm.sendOk("You don't have enough mesos!"); cm.dispose(); } } else if (selection == 3) { if(cm.haveItem(4001126, 100)) { cm.gainItem(4001126, -100); cm.gainMeso(1000000000); cm.sendOk("Thanks, here are your mesos."); } else { cm.sendOk("You don't have 100 #v4001126#!"); cm.dispose(); } } } } // Ghost of SummerMStory/AllureStory
| |
|
Cliche Intern
Posts : 53 Join date : 2012-04-01 Age : 25 Location : Under Your Bed
| Subject: Re: [Release]Currency Convertor Mon Apr 09, 2012 3:31 pm | |
| Wow, I have always wanted to learn to do stuff like that, I've only done two things with this, one, was screw up a flash game. Once, however i made my own blank piece and copied this guy and made a GMS trainer with bots and stuff, but i basically copied and pasted. | |
|
Spirit Member
Posts : 61 Join date : 2012-03-30 Age : 27 Location : cm.getLocation();
| Subject: Re: [Release]Currency Convertor Mon Apr 09, 2012 9:04 pm | |
| I started out with experimenting trial and error but I told you this already | |
|
Sponsored content
| Subject: Re: [Release]Currency Convertor | |
| |
|