Gamble NPiC

Status
Not open for further replies.
Junior Spellweaver
Joined
Nov 14, 2008
Messages
142
Reaction score
59
PHP:
var pi = 0;
var status = 0;

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

function action(mode, type, selection) {

    if (mode == -1) {
        cm.dispose();
    }
    else {
        if (status >= 2 && mode == 0) {
            cm.dispose();
            return;
        }

        if (mode == 1) {
            status++;
        }
        else {
            status--;
        }

        if (status == 0) {
            cm.sendOk("Do you want " + "to " + "gamble some mesos? Press " + "yes " + "if you want to gamble.");
        } else if (status == 1) {
            cm.gainMeso(-31415926);
            var r = Math.floor((Math.random() * 5));
            if (r == 0) {
                cm.sendOk("You have lost. Please retry by paying 10M mesos");
                cm.dispose();
            } else if (r == 1) {
                cm.gainMeso(53589793);
                cm.sendOk("You have " + "won 53M. Pay 10M to retry.");
                cm.dispose();
            } else if (r == 2) {
                cm.gainMeso(238462643);
                cm.sendOk("You have won the jackpot " + "of 238M mesos");
                cm.dispose();
            } else if (r == 3) {
                cm.gainMeso(cm.getMeso());
                cm.sendOk("You have loss all of" + "your mesos. Please earn some more before retrying.");
            } else if (r == 4) {
                cm.sendOk("Press yes if you want to gamble some more mesos.");
                cm.dispose();
            }
        }
    }
}

Tut:
Copy the stuff in php tags.
Paste in notepad.
Save as 2040016.js
Put it in your scripts folder.
 
Last edited:
PHP:
 cm.sendOk("Do you want " + "to " + "gamble some mesos? Press " + "yes " + "if you want to gamble.");

what lol





Good job.
 
fixed your script by changing cm.gainMeso(cm.getMeso()); to cm.gainMeso(cm.getMeso())*-1

Also added in random prizes of 50-125M for normal prize and 100-300M for Jackpot :D:

PHP:
var pi = 0;
var status = 0;

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

function action(mode, type, selection) {

    if (mode == -1) {
        cm.dispose();
    }
    else {
        if (status >= 2 && mode == 0) {
            cm.dispose();
            return;
        }

        if (mode == 1) {
            status++;
        }
        else {
            status--;
        }

        if (status == 0) {
            cm.sendOk("Do you want " + "to " + "gamble some mesos? Press " + "yes " + "if you want to gamble.");
        } else if (status == 1) {
            cm.gainMeso(-31415926);
            var r = Math.floor((Math.random() * 5));
            if (r == 0) {
                cm.sendOk("You have lost. Please retry by paying 10M mesos");
                cm.dispose();
            } else if (r == 1) {
                cm.gainMeso(((Math.floor(Math.random()*75))*1000000)+50000000);
                cm.sendOk("You have " + "won A small amount of mesos. Pay 10M to retry.");
                cm.dispose();
            } else if (r == 2) {
                cm.gainMeso(((Math.floor(Math.random()*200)*1000000)+100000000);
                cm.sendOk("You have won the jackpot!");
                cm.dispose();
            } else if (r == 3) {
                cm.gainMeso((cm.getMeso())*-1);
                cm.sendOk("You have lossed all of" + "your mesos. Please earn some more before retrying.");
            } else if (r == 4) {
                cm.sendOk("Press yes if you want to gamble some more mesos.");
                cm.dispose();
            }
        }
 
it follows a very special type of format
1. horribly coded
2. uses fail strings
3. doesn't work as intended

and also there's some special numbers worked in discretely
 
Jake, you are so sarcastic. Stop defaming leechers who are learning to script. We aren't that bad.

You're the only smart one here.
This NPC was released for more than 1 reason though, not just for sarcasm. It has subtle references to pi.
1. var pi is defined.
2. count the words each in "" (3, 1, 4, 1, 5, 9, 2, etc)
3. count the mesos gained: 31415926, 5358979*** etc
4. notice the NPC used? the name is Pi

and myangel, if I tried, I can guarantee I could make a better NPC. unlike made4forum, you didn't see half the release
 
Last edited:
You're the only smart one here.
This NPC was released for more than 1 reason though, not just for sarcasm. It has subtle references to pi.
1. var pi is defined.
2. count the words each in "" (3, 1, 4, 1, 5, 9, 2, etc)
3. count the mesos gained: 31415926, 5358979*** etc
4. notice the NPC used? the name is Pi

and myangel, if I tried, I can guarantee I could make a better NPC. unlike made4forum, you didn't see half the release

Okay,sorry for the flaming
 
Been released about 50 times already.

Code:
                cm.sendOk("You have loss all of" + "your mesos. Please earn some more before retrying.");

Should be...
Code:
                cm.sendOk("You have lost all of" + "your mesos. Please earn some more before retrying.");

If you're going to try to be a show off, atleast get your grammar and spelling right. Maybe reviewing your scripts before releasing them pointlessly would help.
 
Last edited:
Status
Not open for further replies.
Back