Whats Wrong With This Npc Script?

Results 1 to 8 of 8
  1. #1
    Enthusiast JarrYDx is offline
    MemberRank
    Jan 2013 Join Date
    28Posts

    Whats Wrong With This Npc Script?

    nevermind, done ~
    Last edited by JarrYDx; 14-01-13 at 04:04 AM.


  2. #2
    Gamma Xerixe is offline
    MemberRank
    Apr 2008 Join Date
    MalaysiaLocation
    3,605Posts

    Re: Whats Wrong With This Npc Script?

    No errors at all in your batch files?

  3. #3
    Ass > Tits Lapje is offline
    MemberRank
    Feb 2009 Join Date
    nullLocation
    1,879Posts

    Re: Whats Wrong With This Npc Script?

    There were quite some syntax errors. You might want to check that you have all needed functions in your source. Also, are you aware of the fact that you only have functionality for two or three options? And that the other twelve simply do nothing?

    Thank me.

    PHP Code:
    /**By JarrYD
    **/
    var status 0;
    var 
    selected 1;


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

    function 
    action(modetypeselection) {
        if (
    mode 1)
            
    cm.dispose();
        else {
            if (
    mode == 1)
                
    status++;
            else
                
    status--;
        }
        if (
    status == 0) {
            
    cm.sendYesNo("Welcome to the SRB NPC. You need 30K of each stat (STR, DEX, INT, LUK) to do an SRB. Would you like a description of the SRB System?");
        } else if (
    status == 1) {
            
    cm.sendNext("decription.");
        } else if (
    status == 2) {
            
    cm.sendSimple("What SRB do you want to choose?#k\r\n#bSRB 1:#L0#STR Item#l\r\n#L1#DEX Item#l\r\n#L2#INT Item#l\r\n#L3#LUK Item#l\r\n#gSRB 2:#L4#STR Item#l\r\n#L5#DEX Item#l\r\n#L6#INT Item#l\r\n#L7#LUK Item#l\r\n#dSRB 3:#L8#STR Item#l\r\n#L9#DEX Item#l\r\n#L10#INT Item#l\r\n#L11#LUK Item#l\r\n#rSRB 4:#L12#STR Item#l\r\n#L13#DEX Item#l\r\n#L14#INT Item#l\r\n#L15#LUK Item#l");
        } else if (
    status == 3) {
            
    selected selection;
            if (
    selection == 0) {
                if (
    cm.getPlayer().getStr() > 29999 && cm.getPlayer().getDex() > 29999 && cm.getPlayer().getInt() > 29999) {
                    
    cm.sendSimple("Pick an Item:\r\n\r\n"+cm.EquipList(cm.getC()));
                } else {
                    
    cm.sendOk("You do not have the required stats or items.");
                    
    cm.dispose();
                } 
            } else if (
    selection == 1) {
                if (
    cm.getPlayer().getStr() > 29999 && cm.getPlayer().getDex() > 29999 && cm.getPlayer().getInt() > 29999) {
                    
    cm.sendSimple("Pick an Item:\r\n\r\n"+cm.EquipList(cm.getC()));
                } else {
                    
    cm.sendOk("You do not have the required stats or items.");
                    
    cm.dispose();
                } 
            }
        } else if (
    status == 4) {
            if (
    selection == 0) {
                
    cm.MakeSRB1STR(selected);
                
    cm.getPlayer().setStr(4);
                
    cm.getPlayer().setDex(4);
                
    cm.getPlayer().setInt(4);
                
    cm.getPlayer().setLuk(4);
                
    cm.reloadChar();
                
    cm.dispose();
            } else
                
    cm.dispose();
        }


  4. #4
    Enthusiast JarrYDx is offline
    MemberRank
    Jan 2013 Join Date
    28Posts

    Re: Whats Wrong With This Npc Script?

    Quote Originally Posted by Lapje View Post
    There were quite some syntax errors. You might want to check that you have all needed functions in your source. Also, are you aware of the fact that you only have functionality for two or three options? And that the other twelve simply do nothing?

    Thank me.


    PHP Code:
    /**By JarrYD
    **/
    var status 0;
    var 
    selected 1;


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

    function 
    action(modetypeselection) {
        if (
    mode 1)
            
    cm.dispose();
        else {
            if (
    mode == 1)
                
    status++;
            else
                
    status--;
        }
        if (
    status == 0) {
            
    cm.sendYesNo("Welcome to the SRB NPC. You need 30K of each stat (STR, DEX, INT, LUK) to do an SRB. Would you like a description of the SRB System?");
        } else if (
    status == 1) {
            
    cm.sendNext("decription.");
        } else if (
    status == 2) {
            
    cm.sendSimple("What SRB do you want to choose?#k\r\n#bSRB 1:#L0#STR Item#l\r\n#L1#DEX Item#l\r\n#L2#INT Item#l\r\n#L3#LUK Item#l\r\n#gSRB 2:#L4#STR Item#l\r\n#L5#DEX Item#l\r\n#L6#INT Item#l\r\n#L7#LUK Item#l\r\n#dSRB 3:#L8#STR Item#l\r\n#L9#DEX Item#l\r\n#L10#INT Item#l\r\n#L11#LUK Item#l\r\n#rSRB 4:#L12#STR Item#l\r\n#L13#DEX Item#l\r\n#L14#INT Item#l\r\n#L15#LUK Item#l");
        } else if (
    status == 3) {
            
    selected selection;
            if (
    selection == 0) {
                if (
    cm.getPlayer().getStr() > 29999 && cm.getPlayer().getDex() > 29999 && cm.getPlayer().getInt() > 29999) {
                    
    cm.sendSimple("Pick an Item:\r\n\r\n"+cm.EquipList(cm.getC()));
                } else {
                    
    cm.sendOk("You do not have the required stats or items.");
                    
    cm.dispose();
                } 
            } else if (
    selection == 1) {
                if (
    cm.getPlayer().getStr() > 29999 && cm.getPlayer().getDex() > 29999 && cm.getPlayer().getInt() > 29999) {
                    
    cm.sendSimple("Pick an Item:\r\n\r\n"+cm.EquipList(cm.getC()));
                } else {
                    
    cm.sendOk("You do not have the required stats or items.");
                    
    cm.dispose();
                } 
            }
        } else if (
    status == 4) {
            if (
    selection == 0) {
                
    cm.MakeSRB1STR(selected);
                
    cm.getPlayer().setStr(4);
                
    cm.getPlayer().setDex(4);
                
    cm.getPlayer().setInt(4);
                
    cm.getPlayer().setLuk(4);
                
    cm.reloadChar();
                
    cm.dispose();
            } else
                
    cm.dispose();
        }

    Awesome! So I cant add more selections under status 3 and 4?

    Quote Originally Posted by JarrYDx View Post
    Awesome! So I cant add more selections under status 3 and 4?
    And also, is it possible to make something like this work then? This one just does all the other things but doesnt let you select the item.
    \
    Last edited by JarrYDx; 14-01-13 at 04:05 AM.

  5. #5
    Gamma Xerixe is offline
    MemberRank
    Apr 2008 Join Date
    MalaysiaLocation
    3,605Posts

    Re: Whats Wrong With This Npc Script?

    You can add more selections.

  6. #6
    Enthusiast JarrYDx is offline
    MemberRank
    Jan 2013 Join Date
    28Posts

    Re: Whats Wrong With This Npc Script?

    Quote Originally Posted by Xerixe View Post
    You can add more selections.
    Alright thanks, so how would I do that from the script I have now

    Quote Originally Posted by Lapje View Post
    There were quite some syntax errors. You might want to check that you have all needed functions in your source. Also, are you aware of the fact that you only have functionality for two or three options? And that the other twelve simply do nothing?

    Thank me.

    PHP Code:
    /**By JarrYD
    **/
    var status 0;
    var 
    selected 1;


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

    function 
    action(modetypeselection) {
        if (
    mode 1)
            
    cm.dispose();
        else {
            if (
    mode == 1)
                
    status++;
            else
                
    status--;
        }
        if (
    status == 0) {
            
    cm.sendYesNo("Welcome to the SRB NPC. You need 30K of each stat (STR, DEX, INT, LUK) to do an SRB. Would you like a description of the SRB System?");
        } else if (
    status == 1) {
            
    cm.sendNext("decription.");
        } else if (
    status == 2) {
            
    cm.sendSimple("What SRB do you want to choose?#k\r\n#bSRB 1:#L0#STR Item#l\r\n#L1#DEX Item#l\r\n#L2#INT Item#l\r\n#L3#LUK Item#l\r\n#gSRB 2:#L4#STR Item#l\r\n#L5#DEX Item#l\r\n#L6#INT Item#l\r\n#L7#LUK Item#l\r\n#dSRB 3:#L8#STR Item#l\r\n#L9#DEX Item#l\r\n#L10#INT Item#l\r\n#L11#LUK Item#l\r\n#rSRB 4:#L12#STR Item#l\r\n#L13#DEX Item#l\r\n#L14#INT Item#l\r\n#L15#LUK Item#l");
        } else if (
    status == 3) {
            
    selected selection;
            if (
    selection == 0) {
                if (
    cm.getPlayer().getStr() > 29999 && cm.getPlayer().getDex() > 29999 && cm.getPlayer().getInt() > 29999) {
                    
    cm.sendSimple("Pick an Item:\r\n\r\n"+cm.EquipList(cm.getC()));
                } else {
                    
    cm.sendOk("You do not have the required stats or items.");
                    
    cm.dispose();
                } 
            } else if (
    selection == 1) {
                if (
    cm.getPlayer().getStr() > 29999 && cm.getPlayer().getDex() > 29999 && cm.getPlayer().getInt() > 29999) {
                    
    cm.sendSimple("Pick an Item:\r\n\r\n"+cm.EquipList(cm.getC()));
                } else {
                    
    cm.sendOk("You do not have the required stats or items.");
                    
    cm.dispose();
                } 
            }
        } else if (
    status == 4) {
            if (
    selection == 0) {
                
    cm.MakeSRB1STR(selected);
                
    cm.getPlayer().setStr(4);
                
    cm.getPlayer().setDex(4);
                
    cm.getPlayer().setInt(4);
                
    cm.getPlayer().setLuk(4);
                
    cm.reloadChar();
                
    cm.dispose();
            } else
                
    cm.dispose();
        }

    Tested, same problem as my last one, you select the item and then after you do nothing happens, No bat errors or anything, you just get disposed or something.

  7. #7
    Ass > Tits Lapje is offline
    MemberRank
    Feb 2009 Join Date
    nullLocation
    1,879Posts

    Re: Whats Wrong With This Npc Script?

    I don't quite get what you're trying to do with the script, but it lacks so much and is so inefficiently written that I wouldn't recommend continuing it. If you tell me what you want to happen and give me all the needed methods then I can write you a working one.

  8. #8
    Enthusiast JarrYDx is offline
    MemberRank
    Jan 2013 Join Date
    28Posts

    Re: Whats Wrong With This Npc Script?

    Quote Originally Posted by Lapje View Post
    I don't quite get what you're trying to do with the script, but it lacks so much and is so inefficiently written that I wouldn't recommend continuing it. If you tell me what you want to happen and give me all the needed methods then I can write you a working one.
    Edit:

    Nevermind finished off my code. Cheers man!
    Last edited by JarrYDx; 13-01-13 at 04:26 PM.



Advertisement