Jump to content
  • 0

how to check a no-string variable


Question

Posted (edited)

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

3 answers to this question

Recommended Posts

Posted

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
Posted

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;

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