Jump to content
  • 0

Card Recycle Need input and getinfo form cards


Question

Posted (edited)

Hi guys, this is my Card Recycle but i cant make it work as i want (5 poring coins and 1 card = enriched elunium or enriched oridecon ) this npc let me choose if i want ori or elu but this are my 2 problems 

1: This npc take the poring coins and doesnt let you decide how many you want

2: I cant make it "read" any random card you have in your inventory 

The server i play is in spanish if you need english code i can translate it 

prontera,148,152,4    script    Reciclador    89,{

//ID 7539 Poring Coin, 7619 Enriched Elunium, 7620 Enriched Oridecon

mes "Te dare un Enriched Oridecon o un Enriched Elunium ";
  next;    
mes "Lo que necesitas para este intercambio es:";
mes "1 Card y 5 Poring Coins";
  next;
    switch(select("Enriched Oridecon","Enriched Elunium","Nada Gracias.")) { 
case 1:
    if(countitem(7539) < 5 ){
mes "Necesitas los items";
  close;
}
  next;
    .Amount = countitem(7539);
    .Amount2 =  countitem(7539)/5;
    switch(select("Si","No")) {     
 case 1:  
    .Amount = countitem(7539);     
    .Amount2 =  countitem(7539)/5;
    for (  .i = 5; .i <= countitem((7539)); ) {
         delitem 7539, 5;
         getitem 7619, 1; 
}
    .Offset = .Amount-countitem(7539);
mes "Veamos cuanto tienes("+.Offset+") for Enriched Elunium x "+.Amount2+".";
  close;
case 2:
mes "No vuelvas a molestar más";
close;
}
 case 2:
    if ( countitem(7539) < 5 ) {
mes "Te Faltan items";
close;
}
  next;
mes "Quieres Enriched Oridecon";
  next;
    switch(select("Si","No")) {
  case 1:
    .Amount = countitem(7539);
    .Amount2 =  countitem(7539)/5;
    for (  .i = 5; .i <= countitem((7539)); ) {
        delitem 7539, 5;
        getitem 7620, 1;
}
    .Offset = .Amount-countitem(7539);
mes "Veamos cuanto tienes("+.Offset+") for Enriched Oridecon x "+.Amount2+".";
close;
  case 2:
  mes "No vuelvas a molestar mas";
    close;

case 3:
    mes "Vuelve si me necesitas";
    close;
}}}


 

Edited by Emistry
codebox

3 answers to this question

Recommended Posts

  • 0
Posted

change these 

    .Amount = countitem(7539);     
    .Amount2 =  countitem(7539)/5;
    for (  .i = 5; .i <= countitem((7539)); ) {
		delitem 7539, 5;
		getitem 7619, 1; 
	}

into this

	input .@amount, 0, (countitem(7539)/5);
	if (.@amount) {
		delitem 7539, (.@amount * 5);
		getitem 7619, .@amount; 
	}

 

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...