[Client Scripting] Crystal's Client Scripts

Discussion in 'Server and Client Scripting' started by Crystal Moogle, Jul 31, 2012.

  1. Crystal Moogle

    Crystal Moogle Ayaya~ Administrator Administrator

    Joined:
    Jul 19, 2010
    Messages:
    3,205
    Likes Received:
    531
    PO Trainer Name:
    Hanako
    I didn't post these before because well, a smaller userbase means easier to fix problems :3 But I've been asked to post them here, so what the hell~

    First thing's first, how to install:
    It used to be split up into separate scripts, with one "main" script, but it got tedious to maintain it all and well I kinda just worked on the main one solely. Though I decided it hardly mattered since (I think) every feature can be turned off.

    Now the actual script: https://raw.github.com/CrystalMoogle/PO-User-Scripts/master/script.js (https://github.com/CrystalMoogle/PO-User-Scripts)

    Just follow the installation instructions and you should be fine. Type ~commandslist after installing to check the commands!

    NOTE: Safe Scripts are needed to be turned off to save most of the settings. If you find friends/stalkwords/etc not saving, then you need to turn Safe Scripts off

    Also I don't pretend to be great or anything at scripting, so if you see anything that could be improved in this script, please post it here.

    Anyways feature list (I'll probably forget some)


    • Enriched Text which is (almost) 1:1 with the feature on PO 1.0.60
    • Stalkwords, these are words that will ping your client when mentioned
    • Autoidle, when activated it will idle you on log on (Though will be built into the client next version)
    • Ability to turn flashes on/off, though anything sent with <ping/> via the server will still flash I believe (Now able to toggle it in individual channels)
    • Ability to change the colour of bots and the name of your clientbot and now the style of it
    • Ability to change the symbol used for client commands (default is "~")
    • Font change commands
    • Friends list, will alert you when a certain player logs in, will also tell you their online status
    • Channel logging, can log chat from certain channels to txt files, thanks to Lamperi does leaving/joining too~
    • Check for updates/auto-updater, lets you see if there's an available update and view its changelog
    • Ignorelist, will auto-ignore anybody on this list when they log in
    • Authsymbols/style, allows you to change the auth symbol and their style (e.g. italics)
    • PM Autoresponse, works by time, or command
    • Basic damage calc (based off parts of http://www.smogon.com/smog/issue4/damage_stats)
    • Ignore no longer flashes you and no longer goes through /me or /rainbow (Only on servers using PO-Server-Scripts)
    • Pokédex command that lets you see details about a pokémon
    • Ability to ignore challenges without going idle
    • Converts Youtube links into their titles
    Anyways, if there's any problems using this, tell me here :x
     
    Last edited: Mar 25, 2013
  2. Nexus

    Nexus Legend Killer

    Joined:
    Oct 12, 2010
    Messages:
    1,287
    Likes Received:
    2
    Thanks(Though I got it from you long ago <3) these are awesome. Love the Friend list one. For anyone who's wondering what are the commands scroll down the scrips till you see client commands and you should get the idea
     
  3. Darklight

    Darklight Nothing is True

    Joined:
    Jan 8, 2011
    Messages:
    1,195
    Likes Received:
    1
    this is great Crystal, it'll really help me.
     
  4. zeroality

    zeroality Artificial Insanity

    Joined:
    Apr 22, 2010
    Messages:
    1,378
    Likes Received:
    1
    Is there anywhere in documentation which instructs them to make a folder for Channel Logs? I can't find it.
     
  5. Nexus

    Nexus Legend Killer

    Joined:
    Oct 12, 2010
    Messages:
    1,287
    Likes Received:
    2
    Not it isn't there. But yes you have to make one
     
  6. Crystal Moogle

    Crystal Moogle Ayaya~ Administrator Administrator

    Joined:
    Jul 19, 2010
    Messages:
    3,205
    Likes Received:
    531
    PO Trainer Name:
    Hanako
    Well if you try using channel logging and the folder doesn't exist, it tells them to make it :x
    I can add it as a separate instruction though if needed

    Just noticed ~goto and ~authstyle didn't work (goto worked if channelname was in little case and authstyle worked until you logged out :x). Fixed them now.
     
    Last edited: Aug 2, 2012
  7. PKMNTainerN

    PKMNTainerN Cookies :3

    Joined:
    Jul 4, 2012
    Messages:
    2
    Likes Received:
    0
    Hmmm... Helpful yet a little difficult .-.
     
  8. D-21

    D-21 Lurking

    Joined:
    Apr 11, 2011
    Messages:
    279
    Likes Received:
    0
    PO Trainer Name:
    D-21
    With the friends list, I'm assuming it will only be the name you put and no alts? So, if I add "Crystal Moogle", and you log on, on an alt I wont be notified? ...
     
  9. Crystal Moogle

    Crystal Moogle Ayaya~ Administrator Administrator

    Joined:
    Jul 19, 2010
    Messages:
    3,205
    Likes Received:
    531
    PO Trainer Name:
    Hanako
    Nope :x You'd have to add all the alts manually.
     
  10. Blitzamirin

    Blitzamirin Waluigi! Number one!

    Joined:
    Nov 25, 2011
    Messages:
    1,806
    Likes Received:
    276
    PO Trainer Name:
    Blitz
    Perhaps implementing it as using the user ID? I see this being impossible to be done though ._.
     
  11. Ethan

    Ethan Member

    Joined:
    Nov 6, 2011
    Messages:
    238
    Likes Received:
    0
    Don't think it's possible unless you use their IP (not sure if there is a way to get ip using client scripts, even so, you'd need to be auth to do that). Their ID changes every time they log in.
     
    Last edited: Sep 7, 2012
  12. Wild Tauros

    Wild Tauros Wild King

    Joined:
    Aug 5, 2012
    Messages:
    9
    Likes Received:
    0
    Difficult
    Fatal Script Error line 223: ReferenceError: Can't find variable: client
     
  13. Crystal Moogle

    Crystal Moogle Ayaya~ Administrator Administrator

    Joined:
    Jul 19, 2010
    Messages:
    3,205
    Likes Received:
    531
    PO Trainer Name:
    Hanako
    Are you definitely putting it in the client script window? From the error, it sounds like you're putting it in the server script window.
     
  14. Wild Tauros

    Wild Tauros Wild King

    Joined:
    Aug 5, 2012
    Messages:
    9
    Likes Received:
    0
    O yes u are right i put it in Server Script mod thankyou for solving how i can put it in client window ???
     
  15. Crystal Moogle

    Crystal Moogle Ayaya~ Administrator Administrator

    Joined:
    Jul 19, 2010
    Messages:
    3,205
    Likes Received:
    531
    PO Trainer Name:
    Hanako
    Following the instructions under "Installing"
     
  16. Wild Tauros

    Wild Tauros Wild King

    Joined:
    Aug 5, 2012
    Messages:
    9
    Likes Received:
    0
    Ok it works cool
     
  17. Zzyzx Road

    Zzyzx Road Member

    Joined:
    Feb 16, 2012
    Messages:
    572
    Likes Received:
    2
    PO Trainer Name:
    Zzyzx Road
    Is there something like an onChannelJoin event, activating when anyone joins a specified channel?
     
  18. Crystal Moogle

    Crystal Moogle Ayaya~ Administrator Administrator

    Joined:
    Jul 19, 2010
    Messages:
    3,205
    Likes Received:
    531
    PO Trainer Name:
    Hanako
    Not really :x
    Though if you keep the script user in one channel, you can just use onPlayerReceived~ (Not an ideal solution :x)
    Maybe I'm missing something, but I don't think there's a way to do it without some extremely convoluted method.
     
  19. Zzyzx Road

    Zzyzx Road Member

    Joined:
    Feb 16, 2012
    Messages:
    572
    Likes Received:
    2
    PO Trainer Name:
    Zzyzx Road
    oh, alright. Let me know if any easy solution comes to light. Thanks~
     
  20. Lamperi

    Lamperi I see what you did there

    Joined:
    Apr 25, 2010
    Messages:
    2,647
    Likes Received:
    11
  21. Crystal Moogle

    Crystal Moogle Ayaya~ Administrator Administrator

    Joined:
    Jul 19, 2010
    Messages:
    3,205
    Likes Received:
    531
    PO Trainer Name:
    Hanako
    Thanks <3 That worked fine for channel logging.

    Also added a basic damage calc, gonna add a proper one as an alternative later, plus made ignore not flash you/go through with rainbow/me

    I wish I had know sys.scriptFolder existed sooner :x It made the updatescripts command a lot easier to use
     
    Last edited: Aug 14, 2012
  22. Xinc

    Xinc Time for Oras?

    Joined:
    Aug 1, 2011
    Messages:
    1,569
    Likes Received:
    14
    Thanks Moogle.
     
  23. Firer

    Firer Owner

    Joined:
    Oct 28, 2010
    Messages:
    227
    Likes Received:
    2
    I have a problem with the /updatescripts command. It worked fine for me before the update came with the description "found a new command making /updatescripts alot easier to use".
    When I use /updatescripts it says everything is fine and its fetching the script but when i go online again it tells me again that theres a new update. It doesnt remember that I updated already or something. Maybe it didnt even updated idk, because idk what got fixed so I cant check. Also the message that there is a update always appears twice or thrice when I log in.

    None of that is really a problem (except if it isnt updating), but I wanted to go sure.

    EDIT: also is there a way to make my bot italic/bold? And I check which of my friends are currently online?
     
    Last edited: Aug 19, 2012
  24. Crystal Moogle

    Crystal Moogle Ayaya~ Administrator Administrator

    Joined:
    Jul 19, 2010
    Messages:
    3,205
    Likes Received:
    531
    PO Trainer Name:
    Hanako
    Right, that's an issue, I know what's causing, if you manually update (copy into script window again), then it shouldn't happen for any future updates after today. I probably should have warned people about that.
    I'll put them on the list for in the next few days.
     
  25. Firer

    Firer Owner

    Joined:
    Oct 28, 2010
    Messages:
    227
    Likes Received:
    2
    yay, perfect. Thanks :D
     
  26. Shiny_Thundurus

    Shiny_Thundurus [PR]Storm Wolf 19

    Joined:
    Aug 19, 2012
    Messages:
    16
    Likes Received:
    0
    Hy I Copy Paste this scripts but nothing happens ....???
     
  27. Crystal Moogle

    Crystal Moogle Ayaya~ Administrator Administrator

    Joined:
    Jul 19, 2010
    Messages:
    3,205
    Likes Received:
    531
    PO Trainer Name:
    Hanako
    Added these now
    ~changebotstyle will change the client bot's font style to whatever tags you put in (start tags only), so ~changebotstyle<b><i> will give it italics and bold (like default auth)
    ~friends will now show their online/offline status (no colours for it though, but I'll probably add that at some point)
    I also had some people say they somehow forgot their commandsymbol, typing in "reset symbol" (no quotes) in the main chat will reset it back to "~"
     
  28. Static

    Static New Member

    Joined:
    Sep 17, 2010
    Messages:
    5
    Likes Received:
    0
    I like this :3
     
  29. Altaria

    Altaria (':

    Joined:
    May 30, 2012
    Messages:
    214
    Likes Received:
    1
    Hey Crystal Moogle, I've been using your client scripts for about three days now, and all of a sudden each time after I entered the Pokemon Online server, PO would crash and I would be shown this error message: http://pastie.org/4794363. I am unable to access any other server either and PO would crash with the same crash message. I use a MacBook pro (if it's of any relevance). After I removed the plugin, the crashes stopped occurring.

    (I'm not sure if I'm supposed to post this here. If I'm not supposed to I apologise. COME AT ME INFRACTION)
     
  30. Blitzamirin

    Blitzamirin Waluigi! Number one!

    Joined:
    Nov 25, 2011
    Messages:
    1,806
    Likes Received:
    276
    PO Trainer Name:
    Blitz
    You aren't the only ones. I've seen users in VR complain about it, and it has happened to me. However, the cause is unknown, and this is evident when you hear of users that don't experience these crashes.
     
  31. Crystal Moogle

    Crystal Moogle Ayaya~ Administrator Administrator

    Joined:
    Jul 19, 2010
    Messages:
    3,205
    Likes Received:
    531
    PO Trainer Name:
    Hanako
    Yeah a fair few people have complained about it, but a lot more say they don't crash, I don't crash either which makes it incredibly hard to find a cause :x
    I've tried multiple things that could be causing it, and if it's still doing it now, then I'm out of ideas.

    One thing I didn't think of, is that it could actually be a problem with the plugin, rather than the scripts, but I don't know if that's the case
     
  32. TheUnknownOne

    TheUnknownOne Member

    Joined:
    Mar 28, 2011
    Messages:
    988
    Likes Received:
    3
    I'm pretty sure it's in the plugin because I had constant crashes with it in 2.0 "beta"
     
  33. Xinc

    Xinc Time for Oras?

    Joined:
    Aug 1, 2011
    Messages:
    1,569
    Likes Received:
    14
    Thanks, CM, but clientscripting.dll isn't available in the mac version, or am I missing something?
     
  34. Altaria

    Altaria (':

    Joined:
    May 30, 2012
    Messages:
    214
    Likes Received:
    1
    Xinc, I used libClientScripting.dll iirc. It worked until crash.
     
  35. DatXFire

    DatXFire Never gonna use an avatar

    Joined:
    Sep 4, 2012
    Messages:
    89
    Likes Received:
    9
    Tried using these and it started spamming: (01:33:52) "Script Error line 448: TypeError: Result of expression 'client.channel' [undefined] is not a function." over and over again.
     
  36. Crystal Moogle

    Crystal Moogle Ayaya~ Administrator Administrator

    Joined:
    Jul 19, 2010
    Messages:
    3,205
    Likes Received:
    531
    PO Trainer Name:
    Hanako
    You're using a slightly outdated client version.
     
  37. VPS

    VPS Theme Maker

    Joined:
    Jun 25, 2012
    Messages:
    15
    Likes Received:
    0
    How do you update your client?
     
  38. B. Rizzo

    B. Rizzo A relic of the past, given new life.

    Joined:
    May 1, 2010
    Messages:
    229
    Likes Received:
    0
    PO Trainer Name:
    B. Rizzo
    Download the newest version.
     
  39. Nicehat

    Nicehat PO client damage calc: preview.tinyurl.com/o8e7hss

    Joined:
    Jun 5, 2011
    Messages:
    373
    Likes Received:
    77
    Not too big of a deal, but I think you should change around the date format that channel logs are saved as to year/month/day instead of day/month/year.
    This makes it much easier to keep logs ordered by sorting alphabetically (otherwise you get the logs between months mixed up).
     
  40. Oh So Shoddy

    Oh So Shoddy Devil's Advocate

    Joined:
    Jul 19, 2011
    Messages:
    219
    Likes Received:
    0
    Just an official reminder to change settings on any applicable command so that typing the command by itself won't reset it to a blank setting. Like ~armessage for example.