Jump to content
  • 0

how to check a no-string variable


nunesb

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   0
  • Joined:  11/30/12
  • Last Seen:  

Which command is used to check a no-string variable of a character that is not my ?

mes "Enter the name of the character you want to check the "ABCDEFG" variable:";
input @tmp$;
next;
mes "<SHOW VARIABLE "ABCDEFG" OF @tmp$ CHAR>";

someone may help ?

Edited by nunesb
Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  587
  • Reputation:   104
  • Joined:  11/19/11
  • Last Seen:  

try this

not tested

mes "Enter the name of the character you want to check the "ABCDEFG" variable:";
input .@tmp$;
set .@taid,getcharid(3,.@tmp$);
if(!.@taid){
   mes "Char is offline or not exist";
   close;
}
set .@said,getcharid(3);
attachrid(.@taid);
set .@tvalue,ABCDEFG;
attachrid(.@said);
mes "VARIABLE "ABCDEFG" OF "+.@tmp$+"is"+.@tvalue;
close;

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   0
  • Joined:  11/30/12
  • Last Seen:  

Thanks a lot!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  205
  • Reputation:   19
  • Joined:  10/12/12
  • Last Seen:  

set .@taid,getcharid(3,.@tmp$);
if(!.@taid){
mes "Char is offline or not exist";
close;
}
set .@said,getcharid(3);
attachrid(.@taid);

You can optimize this part just by using attachrid. A little bit more tricky, but helps saving heap and lowers the C-O

(credits to you)

input .@tmp$;

set .@MyID, getcharid(3);
if( !attachrid(getcharid(3,.@tmp$)) ) {
   mes "Char is offline or not exist";
   close;
}

set .@value, ABCDEFG;
attachrid(.@MyID);
mes .@tmp$ + "'s ABCDEFG variable has value: " + .@value;

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