Rebirth limit warp NPC

Results 1 to 7 of 7
  1. #1
    Member mixta11 is offline
    MemberRank
    Jan 2012 Join Date
    UKLocation
    56Posts

    Rebirth limit warp NPC

    So i have been trying to code an NPC that can warp people to a map with good exp mobs for lower level rebirths. I have done what i think should be the correct function but i get a .bat error tell me that a } is missing in compound function. Can someone look at the script and see whats wrong for me please.

    PHP Code:

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

    function 
    action(modetypeselection) {
        if (
    mode == -1) {
            
    cm.dispose();
        } else {
            if (
    mode == && status == 0) {
                
    cm.dispose();
                return;
            }
            if (
    mode == 1)
                
    status++;
            else
                
    status--;
            if (
    status == 0) {
                
    cm.sendSimple ("#r I'm the StarterMap Warper of MixtaMS!#b \r\n#L1#Starter Map");
                    } else if (
    selection == 1) {
                      
    cm.warp(30000);
                          if(
    cm.getPlayer().getReborns() < 200) {
                    
    cm.sendOk("Sorry, You have exceeded the Rebirth limit to train in this map now");
                    
    cm.dispose();



  2. #2
    Coder in-training lordpeter is offline
    Grand MasterRank
    Dec 2008 Join Date
    CanadaLocation
    612Posts

    Re: Rebirth limit warp NPC

    is there "getReborns" in npcconversationmanager?

  3. #3
    Member mixta11 is offline
    MemberRank
    Jan 2012 Join Date
    UKLocation
    56Posts

    Re: Rebirth limit warp NPC

    no i just noticed it isnt. ill add to code now and post result

    Quote Originally Posted by lordpeter View Post
    is there "getReborns" in npcconversationmanager?
    getreborns is in npcconversation and still get error on .bat for } missing in compound. No idea at all

    ok so i got the NPC working except one thing i need next. I need it to drop a message saying what i need to say after 200 rb. My script is

    PHP Code:
    function start() { 
        
    status = -1
        
    action(100); 


    function 
    action(modetypeselection) { 
        if (
    mode == -1) { 
            
    cm.dispose(); 
        } else { 
            if (
    mode == && status == 0) { 
                
    cm.dispose(); 
                return; 
            } 
            if (
    mode == 1
                
    status++; 
            else 
                
    status--; 
            if (
    status == 0) { 
                
    cm.sendSimple ("#r I'm the StarterMap Warper of MixtaMS! I only work for people under 200 rebirths. After 200 RB i will be useless to you!#b \r\n#L1#Starter Map"); 
                    } else if (
    selection == 1) { ; 
                          if (
    cm.getPlayer().getReborns() <= 200) {  
                     
    cm.warp(30000);
                    
    cm.sendNext("Sorry, You have exceeded the Rebirth limit to train in this map now");
                    
    cm.dispose();
    }
    }



  4. #4
    Sorcerer Supreme hecari is offline
    Member +Rank
    Dec 2008 Join Date
    336Posts

    Re: Rebirth limit warp NPC

    Quote Originally Posted by mixta11 View Post
    no i just noticed it isnt. ill add to code now and post result


    getreborns is in npcconversation and still get error on .bat for } missing in compound. No idea at all

    ok so i got the NPC working except one thing i need next. I need it to drop a message saying what i need to say after 200 rb. My script is

    PHP Code:
    function start() { 
        
    status = -1
        
    action(100); 


    function 
    action(modetypeselection) { 
        if (
    mode == -1) { 
            
    cm.dispose(); 
        } else { 
            if (
    mode == && status == 0) { 
                
    cm.dispose(); 
                return; 
            } 
            if (
    mode == 1
                
    status++; 
            else 
                
    status--; 
            if (
    status == 0) { 
                
    cm.sendSimple ("#r I'm the StarterMap Warper of MixtaMS! I only work for people under 200 rebirths. After 200 RB i will be useless to you!#b \r\n#L1#Starter Map"); 
                    } else if (
    selection == 1) { ; 
                          if (
    cm.getPlayer().getReborns() <= 200) {  
                     
    cm.warp(30000);
                    
    cm.sendNext("Sorry, You have exceeded the Rebirth limit to train in this map now");
                    
    cm.dispose();
    }
    }


    Assuming that the StarterMap MapID is 30000,
    PHP Code:
    function start() {  
        
    status = -1;  
        
    action(100);  
    }  

    function 
    action(modetypeselection) {  
        if (
    mode == -1) {  
            
    cm.dispose();  
        } else {  
            if (
    mode == && status == 0) {  
                
    cm.dispose();  
                return;  
            }  
            if (
    mode == 1) { // in the above script, you did not open and close bracket for mode == 1 and else.
                
    status++;  
            } else {
                
    status--;
            }
            } 
    // I added a } to indicate the closing of the entire mode if statement as you didnt close properly in the above script; I assumed the bat error was indicating this. Please reply if this work for you. Thanks.
            
    if (status == 0) {  
                
    cm.sendSimple ("#r I'm the StarterMap Warper of MixtaMS! I only work for people under 200 rebirths. After 200 RB i will be useless to you!#b \r\n#L1#Starter Map");  
                    } else if (
    status == 1) {
                           if(
    selection == 1) { 
                                 if (
    cm.getPlayer().getReborns() <= 200) {   
                                          
    cm.warp(30000);
                                          
    cm.dispose();
                                 } else {
                                          
    cm.sendNext("Sorry, You have exceeded the Rebirth limit to train in this map now");
                                          
    cm.dispose();
                                 } 
    // closing bracket of getReborn If statement
                         
    // closing bracket of selection if statement
                 
    // closing bracket of status if statement
    // closing bracket of action function 
    This should be working, I did not check for syntax error.

    Edit: This script is assuming that what you want the script to do is when you click the NPC, you are given a choice whether to go to the StarterMap, assuming that you click that you want to go, it will check whether you have less than 200 or 200 rebirth, if you fit the criteria of having less than or equal to 200 rebirth, you get warp to the Map with MapID: 30000. If you doesnt fit the criteria which mean you have more than 200 rebirth, it output the message saying that you exceeded the rebirth limit for training at the map.
    Last edited by hecari; 21-03-13 at 09:09 AM.

  5. #5
    Member mixta11 is offline
    MemberRank
    Jan 2012 Join Date
    UKLocation
    56Posts

    Re: Rebirth limit warp NPC

    Quote Originally Posted by hecari View Post
    Assuming that the StarterMap MapID is 30000,
    PHP Code:
    function start() {  
        
    status = -1;  
        
    action(100);  
    }  

    function 
    action(modetypeselection) {  
        if (
    mode == -1) {  
            
    cm.dispose();  
        } else {  
            if (
    mode == && status == 0) {  
                
    cm.dispose();  
                return;  
            }  
            if (
    mode == 1) { // in the above script, you did not open and close bracket for mode == 1 and else.
                
    status++;  
            } else {
                
    status--;
            }
            } 
    // I added a } to indicate the closing of the entire mode if statement as you didnt close properly in the above script; I assumed the bat error was indicating this. Please reply if this work for you. Thanks.
            
    if (status == 0) {  
                
    cm.sendSimple ("#r I'm the StarterMap Warper of MixtaMS! I only work for people under 200 rebirths. After 200 RB i will be useless to you!#b \r\n#L1#Starter Map");  
                    } else if (
    status == 1) {
                           if(
    selection == 1) { 
                                 if (
    cm.getPlayer().getReborns() <= 200) {   
                                          
    cm.warp(30000);
                                          
    cm.dispose();
                                 } else {
                                          
    cm.sendNext("Sorry, You have exceeded the Rebirth limit to train in this map now");
                                          
    cm.dispose();
                                 } 
    // closing bracket of getReborn If statement
                         
    // closing bracket of selection if statement
                 
    // closing bracket of status if statement
    // closing bracket of action function 
    This should be working, I did not check for syntax error.

    Edit: This script is assuming that what you want the script to do is when you click the NPC, you are given a choice whether to go to the StarterMap, assuming that you click that you want to go, it will check whether you have less than 200 or 200 rebirth, if you fit the criteria of having less than or equal to 200 rebirth, you get warp to the Map with MapID: 30000. If you doesnt fit the criteria which mean you have more than 200 rebirth, it output the message saying that you exceeded the rebirth limit for training at the map.
    I'll test this now. Will thanks and like if works but looks like i=t should work to me. Thank you :)

  6. #6
    Sorcerer Supreme hecari is offline
    Member +Rank
    Dec 2008 Join Date
    336Posts

    Re: Rebirth limit warp NPC

    No problem. You're welcome but I still recommend you to use program that will help you identify missing bracket, syntax error.

  7. #7
    Member mixta11 is offline
    MemberRank
    Jan 2012 Join Date
    UKLocation
    56Posts

    Re: Rebirth limit warp NPC

    Quote Originally Posted by hecari View Post
    No problem. You're welcome but I still recommend you to use program that will help you identify missing bracket, syntax error.
    yeah ill look into a syntax software. Thank you i tested and works like a charm. Thank you



Advertisement