Jump to content
  • 0

Coin Exchanger error


zmref

Question


  • Group:  Members
  • Topic Count:  148
  • Topics Per Day:  0.03
  • Content Count:  299
  • Reputation:   6
  • Joined:  06/14/12
  • Last Seen:  

This code here

if( @Amount < 99999 ){

mes "[Coin Manager]";

mes "Invalid Amount."; close;

}

is always popping out even if I correctly entered 100k

This was the coin exchanger

negel,222,254,4 script Coin Manager 573,{
// Your Server Max Zeny Amount
set .MaxZeny,2000000000;
// Coins Item ID and each Coins Costs
setarray .Coins[1],673,675,671,677,674;
setarray .Zeny[1],100000,1000000,10000000,100000000,1000000000;
setarray .@numbers$[1],100000,1000000,10000000,100000000,1000000000;
set @Menu$,"";
for( set .@a,1; .@a < getarraysize( .Coins ); set .@a,.@a+1 ){
set @Menu$,@Menu$ + getitemname( .Coins[.@a] )+":";
}
while( 1 ){
mes "[Coin Manager]";
mes "What do you want to do today?";
next;
switch( select( "Coin to Zeny:Zeny to Coin" ) ){
Case 1:
  mes "[Coin Manager]";
  mes "Very well. Here is the list on how much each coin is worth:";
  for( set .@a,1; .@a < getarraysize( .Coins ); set .@a,.@a+1 ){
mes "^0000FF"+getitemname( .Coins[.@a] )+" = ^FF0000"+.@numbers$[.@a]+"^000000 Zeny.";
}
  next;
  set .@a,select( @Menu$ );
  mes "[Coin Manager]";
  mes "Select the Amount of Coins you want to trade into Zeny.";
  mes "You have "+countitem( .Coins[.@a] )+" "+getitemname( .Coins[.@a] )+".";
  input @Amount,0,countitem( .Coins[.@a] );
  if( @Amount < 1 ){
  mes "[Coin Manager]";
  mes "You don't have enough coin to exchange.";
  }else if( ( Zeny + ( @Amount * .Zeny[.@a] ) ) > .MaxZeny ){
  mes "[Coin Manager]";
  mes "Sorry you can't hold this amount of Zeny. Max Zeny is 2b"; close;
  }else{
  set Zeny,Zeny + ( @Amount * .Zeny[.@a] );
  delitem .Coins[.@a],@Amount;
  mes "[Coin Manager]";
  mes "Done, you have traded "+@Amount+" of "+getitemname(.Coins[.@a])+" into "+( @Amount * .Zeny[.@a] )+" Zeny.";
  }
  next;
  break;
Case 2:
  mes "[Coin Manager]";
  mes "Very well. Here is the list on how much each coin is worth:";
  for( set .@a,1; .@a < getarraysize( .Coins ); set .@a,.@a+1 ){
mes "^0000FF"+getitemname( .Coins[.@a] )+" ^FF0000"+.@numbers$[.@a]+"^000000 Zeny.";
}
  next;
  set .@a,select( @Menu$ );
  mes "[Coin Manager]";
  mes "Select the Amount of Zeny you want to trade into "+getitemname( .Coins[.@a] )+".";
  mes "You can get maximum of "+Zeny/.Zeny[.@a]+" "+getitemname( .Coins[.@a] )+".";
  input @Amount,0,Zeny/.Zeny[.@a];
  if( @Amount < 99999 ){
  mes "[Coin Manager]";
  mes "Invalid Amount."; close;
  }
  else if( @Amount > readparam (Zeny)) {
mes "[Coin Manager]";
mes "Insufficient Zeny."; close;
  }else{
  set Zeny,Zeny - ( @Amount * .Zeny[.@a] );
  getitem .Coins[.@a],@Amount;
  mes "[Coin Manager]";
  mes "Done, you have traded "+( @Amount * .Zeny[.@a] )+"z into "+@Amount+" of "+getitemname(.Coins[.@a])+" .";
  }
  next;
  break;
 }
}
close;
}

or if you have another coin exchanger working and easy to configure please share it :D

Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  198
  • Reputation:   47
  • Joined:  08/01/12
  • Last Seen:  

Coin Exchanger by Mysterious.

Just edit things in:

// Set Coin Item ID's

// In Order coin_id1, coin_id2, coin_id3, coin_id4, etc...

setarray .coin_id[0],675, 671, 674, 677;

// Coin -> Zeny Value

// Change the Value you want the coins to be worth | Order: Silver Coin, Gold Coin, Mithril Coin, Platinum Coin

setarray .coin_to_zeny[0],10000000,50000000,150000000,300000000;

// Currency Formatted String of Zeny | Order: Silver Coin, Gold Coin, Mithril Coin, Platinum Coin

setarray .coin_to_zeny_format$[0],"10,000,000","50,000,000","150,000,000","300,000,000";

coinexchanger.txt

  • Upvote 5
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

i dont remember i have added a check for 99999 items....

the input command that i used here...it limited the value you can input..

so dont edit the script if you dont know what it does...else...this is what happen....

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  148
  • Topics Per Day:  0.03
  • Content Count:  299
  • Reputation:   6
  • Joined:  06/14/12
  • Last Seen:  

Thanks viole

i dont remember i have added a check for 99999 items....

the input command that i used here...it limited the value you can input..

so dont edit the script if you dont know what it does...else...this is what happen....

Just found this code somewhere in forums

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  198
  • Reputation:   47
  • Joined:  08/01/12
  • Last Seen:  

anyways, your script above is Emistry's Coin Manager except for the check if( @Amount < 99999 ){

that 99999 is not for zeny u have.. read post #3

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  148
  • Topics Per Day:  0.03
  • Content Count:  299
  • Reputation:   6
  • Joined:  06/14/12
  • Last Seen:  

Oh ok sorry

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...