MapleInfinity
Please login or register to join the community and begin posting!
Don't forget to vote!
MapleInfinity
Please login or register to join the community and begin posting!
Don't forget to vote!
MapleInfinity
Would you like to react to this message? Create an account in a few clicks or log in to continue.



 
HomePortalSearchLatest imagesRegisterLog in
FOR TEMPORARY USE PLEASE JOIN HAMACHI. THIS EFFECT WILL ONLY LAST UNTIL THE BEGINNING OF APRIL 1 OR AT THE LATEST APRIL 7TH! THANKS FOR YOU UNDERSTANDING AND PLEASE INTRODUCE YOU SELF AND GET TO KNOW THE COMMUNITY! CYA IN-GAME!

 

 [Release]Currency Convertor

Go down 
2 posters
AuthorMessage
Spirit
Member
Member
Spirit


Posts : 61
Join date : 2012-03-30
Age : 27
Location : cm.getLocation();

[Release]Currency Convertor Empty
PostSubject: [Release]Currency Convertor   [Release]Currency Convertor Icon_minitimeMon 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
Back to top Go down
Cliche
Intern
Intern
Cliche


Posts : 53
Join date : 2012-04-01
Age : 25
Location : Under Your Bed

[Release]Currency Convertor Empty
PostSubject: Re: [Release]Currency Convertor   [Release]Currency Convertor Icon_minitimeMon 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.
Back to top Go down
http://www.whoreadsthese.com
Spirit
Member
Member
Spirit


Posts : 61
Join date : 2012-03-30
Age : 27
Location : cm.getLocation();

[Release]Currency Convertor Empty
PostSubject: Re: [Release]Currency Convertor   [Release]Currency Convertor Icon_minitimeMon Apr 09, 2012 9:04 pm

I started out with experimenting trial and error but I told you this already
Back to top Go down
Sponsored content





[Release]Currency Convertor Empty
PostSubject: Re: [Release]Currency Convertor   [Release]Currency Convertor Icon_minitime

Back to top Go down
 
[Release]Currency Convertor
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
MapleInfinity :: GFX/Java Hangout :: Java/C++-
Jump to: