Jump to content
  • 0

input error


caspa

Question


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

i'm getting invalid data on this one..... i don't know how to properly execute this one.... can somebody fix it please..


 
    mes "[ Freebie Staff ]";
    mes "Enter the ^009900Set Number^000000 of the ^ff46bdItem^000000 you want.";
    mes "      ";
    mes "^ff0000Set #1 :^000000 Valkyrie";
    mes "^0000ffSet #2 :^000000 Diablo";
    input .@freeset$;
    if ( .@freeset$ == 0 || .@freeset$ >= 3 ) goto invalidset;
    else if ( .@freeset$ == 1 ) goto freevalk;
    else if ( .@freeset == 2) goto diablofree;
    end;
 
invalidset:
next;
mes "[ Freebie Staff ]";
mes "^ff0000Invalid Set Number^000000";
next;
goto setchoose;
 
diablofree:
    getitem 2374,1;
    getitem 2537,1;    
    getitem 2433,1;
    getitem 2375,1;    
    close;
 
freevalk:
    getitem 2357,1;
    getitem 2524,1;    
    getitem 2421,1;
    getitem 5171,1;    
    close;
Edited by caspa
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

input .@freeset$;
You're storing the input as a string, but then you're doing numeric comparisons.

if ( .@freeset$ == 0 || .@freeset$ >= 3 )

Instead, you should store the input variable in an integer:

input .@freeset;
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

thank sir..... [ solved ]

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