Jump to content
  • 0
erick26

Pots Converter random stuck

Question

Hi everyone,

I am just wondering what is wrong with my script below as sometime randomly i get stuck at without a chance of inputting number or when someone just pressed enter and not inputting number. Below is my script.

vip_lounge,157,139,4    script    Potion Converter    100,{

   mes "Hi! I can convert your potions to your choice.";
   mes "Select which item you want to exchange.";
   next;
   switch(select("Segen White Potion 2x->Segen Blue Potion 1x:Segen Blue Potion 2x->Segen White Potion 1x:Siege White Potion 2x->Siege Blue Potion1x:Siege Blue Potion2x->Siege White Potion1x:Close")) {
    mes "How much?";
    input [email protected];
    case 1:
        if(countitem(11503) >= [email protected]) {
            delitem 11503, [email protected];
            getitem 11504, [email protected]/2;
        } else if (([email protected]) > 50){
            mes "Hmmmm... it seems you are overweight";
        } else if(countitem(11503) < [email protected]) {
            mes "Sorry You don't have the required item!";
        }
        close;
        break;
    case 2:
        if(countitem(11504) >= [email protected]) {
            delitem 11504, [email protected];
            getitem 11503, [email protected]/2;
        } else if (([email protected]) > 50){
            mes "Hmmmm... it seems you are overweight";
        }  else if(countitem(11504) < [email protected]) {
            mes "Sorry You don't have the required item!";
        }
        close;
        break;
    case 3:
        if(countitem(32007) >= [email protected]) {
            delitem 32007, [email protected];
            getitem 32008, [email protected]/2;
        } else if (([email protected]) > 50){
            mes "Hmmmm... it seems you are overweight";
        }  else if(countitem(32007) < [email protected]) {
            mes "Sorry You don't have the required item!";
        }
        close;
        break;
    case 4:
        if(countitem(32008) >= [email protected]) {
            delitem 32008, [email protected];
            getitem 32007, [email protected]/2;
        } else if (([email protected]) > 50){
            mes "Hmmmm... it seems you are overweight";
        }  else if(countitem(32008) < [email protected]) {
            mes "Sorry You don't have the required item!";
        }
        close;
        break;
    case 5:
        close;

    }
OnInit:
    waitingroom "Convert pots here",0;
    
}

 

Edited by Mael
Use a codebox
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
vip_lounge,157,139,4	script	Potion Converter	100,{

	mes "Hi! I can convert your potions to your choice.";
	mes "Select which item you want to exchange.";
	next;
	switch(select("Segen White Potion 2x->Segen Blue Potion 1x:Segen Blue Potion 2x->Segen White Potion 1x:Siege White Potion 2x->Siege Blue Potion1x:Siege Blue Potion2x->Siege White Potion1x:Close")) {
	
	case 1:
		mes "How much?";
		input [email protected], 1, 30000;
		if(countitem(11503) >= [email protected]) {
			delitem 11503, [email protected];
			getitem 11504, [email protected]/2;
		} else if (([email protected]) > 50){
			mes "Hmmmm... it seems you are overweight";
		} else if(countitem(11503) < [email protected]) {
			mes "Sorry You don't have the required item!";
		}
		break;
	case 2:
		mes "How much?";
		input [email protected], 1, 30000;
		if(countitem(11504) >= [email protected]) {
			delitem 11504, [email protected];
			getitem 11503, [email protected]/2;
		} else if (([email protected]) > 50){
			mes "Hmmmm... it seems you are overweight";
		}  else if(countitem(11504) < [email protected]) {
			mes "Sorry You don't have the required item!";
		}
		break;
	case 3:
		mes "How much?";
		input [email protected], 1, 30000;
		if(countitem(32007) >= [email protected]) {
			delitem 32007, [email protected];
			getitem 32008, [email protected]/2;
		} else if (([email protected]) > 50){
			mes "Hmmmm... it seems you are overweight";
		}  else if(countitem(32007) < [email protected]) {
			mes "Sorry You don't have the required item!";
		}
		break;
	case 4:
		mes "How much?";
		input [email protected], 1, 30000;
		if(countitem(32008) >= [email protected]) {
			delitem 32008, [email protected];
			getitem 32007, [email protected]/2;
		} else if (([email protected]) > 50){
			mes "Hmmmm... it seems you are overweight";
		}  else if(countitem(32008) < [email protected]) {
			mes "Sorry You don't have the required item!";
		}
	default:
		break;
	}
	close;
OnInit:
	waitingroom "Convert pots here",0;
	end;
}

just add a default minimum value to the input or add a checking to validate the minimum input amount.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.