I wrote this command to view player's info: Code (text): try { sys.sendMessage(src, sys.info(parseInt(sys.id(commandData))), chan); return; } catch(e){ sys.sendMessage(src, e, chan); } which, on the test subject results in an output of: (11:32:05) Here's a test info So, at some point, it's cast to a String to be printed right? Well when I try this: Code (text): if (sys.info(src) == "Here's a test info") //line 1492 { sys.sendAll("Passed!"); } else { sys.sendAll("Failed!"); } I get: (11:24:30) ~~Server~~: Script Error line 1492: TypeError: Result of expression 'sys.info(src)' [undefined] is not an object. So when I change that: Code (text): if (String(sys.info(src)) == "Here's a test info") //line 1492 { sys.sendAll("Passed!"); } else { sys.sendAll("Failed!"); } Now it doesn't print any errors, but the test never passes. Does anyone have any advice on working sys.info()? I want to treat it like a String.
When I used sys.info(src) I got my trainer info as "TOSHINOU KYOUKO~!". When I did print(sys.info(src) === "TOSHINOU KYOUKO~!") it returned true :x I'm not sure why it's not working for you Try printing out the output of sys.info(src), since the first part of the post refers to commandData where as the second refers to src. I'm assuming both pointed to the same person, but you can't be too careful!
undefined seems to indicate that the one you're trying to get info from is not logged on. Also to convert to string use ''+sys.info(src).
Ah, I see. Now it prints completely blank for everyone when I try to print it out just before the line marked 1492. EDIT: Ah, your post helped explain, Coyotte. EDIT 2: Yep, I moved it from beforeLogIn to afterLogIn and it works fine. Thanks!