I made a command to show you the info of a Player. Note: the player must online. * lets say i do /lookup Huria it would show Code (text): (17:15:43) *** Huria's Infomation *** (17:15:43) Trainer Name: Huria (17:15:43) Name Color: #aa00ff (17:15:43) IP Address: 127.0.0.1 (17:15:43) Auth Level: 3 (17:15:43) ID: 33 (17:15:43) Alts: nesan,pokégerman,huria,huriax (17:15:43) Clauses: 72 (17:15:43) Rating: 1000 (17:15:43) Current Tier: LC Wifi (17:15:43) Gen: 5 (17:15:43) Battling: false (17:15:43) Enabled Ladder: true (17:15:43) Registered: true (17:15:43) Highest Auth: 3 yeah a pretty cool command c: the javascript command: Code (javascript): if(command == "lookup") { var ip = sys.ip(tar); var alts = sys.aliases(ip); var tier = sys.tier(tar); if (tar == undefined) { sys.sendMessage(src, "+Bot: Sorry, this person doesn't exist!"); return; } sys.sendMessage(src, "*** " + commandData + "'s Infomation *** "); sys.sendMessage(src, "Trainer Name: " + commandData + " "); sys.sendMessage(src, "Name Color: " + sys.getColor(tar) + " "); sys.sendMessage(src, "IP Address: " + sys.ip(tar) + " "); sys.sendMessage(src, "Auth Level: " + sys.auth(tar) + " "); sys.sendMessage(src, "ID: " + sys.id(sys.name(tar)) + " "); sys.sendMessage(src, "Alts: " + alts + " "); sys.sendMessage(src, "Clauses: " + sys.getClauses(tar) + " "); sys.sendMessage(src, "Rating: " + sys.ladderRating(tar) + " "); sys.sendMessage(src, "Current Tier: " + sys.tier(tar) + " "); sys.sendMessage(src, "Gen: " + sys.gen(tar) + " "); sys.sendMessage(src, "Battling: " + sys.battling(tar) + " "); sys.sendMessage(src, "Enabled Ladder: " + sys.ladderEnabled(tar) + " "); sys.sendMessage(src, "Registered: " + sys.dbRegistered(sys.name(tar)) + " "); sys.sendMessage(src, "Highest Auth: " + sys.maxAuth(sys.ip(tar)) + " "); return; } so yeah hope you guys like it :D Feel free to command.
TUO proposes you to make a thread like "-Arceus-'s scripting snippets & commads" instead of making a new thread for everything. I'm fine with either. And on topic: Good command, similar to PO's /whois. You might want to reuse your "ip" variable instead of calling sys.ip three times, because you already stored it – it's just a nitpick, there's no need to make it a variable if you are just going to call sys.ip every time you need the ip address.
What's the point of spaces at the ends of the lines? You might want to show the actuall colour instead of its hex representation and actual clauses instead of the vector (learn about bit-wise operators) And I don't think this info should be shown to every user.
Oh sorry for not creating 1 thread for all of this. Next time i will just make 1thread for like 3-4 commands/thingys.
sys.getClauses() returns the clauses of the parameter tier, if you pass it a user ID the behavior is undefined.
I agree with TUO, adding clauses in it is just a waste of space. You'll see someone's clauses when they challenge you, you don't really need another way to see their clauses.
Script Error line 6019: SyntaxError: too few arguments in call to tier(); candidates are tier(int,int) <anonymous>(src = 593, message = '/lookup w a r r', chan = 0) at scripts.js:6019 <global>() at -1 :c does not work
This was written for the old version for PO. The sys.tier argument takes two arguments now (as it says). sys.tier(id, team) You need to edit the script slightly to accommodate that. Easiest way is just replace sys.tier(tar) with sys.tier(tar, 0) It'll only return tier for the first team in this case, but it'll work at least. If you want more teams, you'll have to do a bit more editing.
q.q I just change what you said. I dont know anything about scripting :/ only what I have learned by myself. BTW :/ do you know of someone who can teach me a bit?