[Client Scripting] Hot Potato Game

Discussion in 'Server and Client Scripting' started by Nightfall Alicorn, Apr 25, 2015.

  1. Nightfall Alicorn

    Nightfall Alicorn Left Pokémon Online, most likely not coming back.

    Joined:
    Oct 15, 2013
    Messages:
    491
    Likes Received:
    171
    PO Trainer Name:
    Nightmare Moon
    Hey, everyone. I've finally decided to release this script.

    This is basically a client script game of pass the bomb which is actually a potato. The objective of this game is to make sure you're not the person holding the potato when it explodes or you get kicked from the channel.

    Installing & Setting Up the Script
    The instructions on how to install and setup the script are found in the code in the links below.

    Download:
    v1.02
    Raw Code: http://pastebin.com/raw.php?i=Qr0y68Ls

    Server Version found here: http://pokemon-online.eu/threads/hot-potato-game-server-version.30966/

    Updates:
    v1.01
    • Added missing JSLint "use strict" lines.
    • Changed command symbol from - to ? for the time being by request. (Change the ? symbol on the line with var vgCommandSymbol = "?"; to change it to another symbol.)
    • /me messages removed. (Can be re-added by entering "/me[space]" in the double qoutes on the line var vgBotMsgPrefix = "";.)
    v1.00
    • First release.

    Questions and Answers:
    Q: What is this script?
    A: A client script game of pass the bomb which is actually a potato..

    Q: Where are the instructions to install and setup the script?
    A: They are found at the top of the script's code itself, with the settings you can edit under it. Saves users having to rapidly find this page.

    Q: Can I use samples of your code?
    A: Of course. I be happy if you can make something good with it.

    Q: The script isn't working.
    A: There are many reasons for this, here's the main ones:
    - Make sure you had copied all the raw code given from the link, even the instructions part.
    - If you had opened 2 server tabs on PC, try closing and opening Pokemon Online.
    - Make sure you pasted the code in the client script window and not the battle one by mistake.
    - Make sure Safe Scripts is off and Show Warnings is on, in the plugin script window, since Safe Scripts can disable functionality I think.
    - The script is set by default not to work in Pokemon Online's official channels. Also, it doesn't work in PM.
    - Are you getting a code line error? If so check that line of the code. You may had deleted something you shouldn't had.

    Q: Do you have a server version of this script?
    A: Yes, it can be found here, http://pokemon-online.eu/threads/hot-potato-game-server-version.30966/, but maybe more difficult to set up
     
    Last edited: Jul 7, 2015
  2. Fuzzysqurl

    Fuzzysqurl baa baa mareep I do what I want Server Owner Developer I do what I want Server Owner Developer

    Joined:
    Sep 12, 2012
    Messages:
    2,096
    Likes Received:
    967
    Just curious, why do you have
    Code (text):
    1. vChannelId = channel,
    and
    Code (text):
    1.   vZero = 0;
    The first one is just defining a variable longer than an already defined variable, the other just completely blows my mind and I don't have a vocabulary large enough to articulate my feelings about this.
     
  3. Joyverse

    Joyverse Back for a blast!

    Joined:
    Aug 23, 2014
    Messages:
    1,517
    Likes Received:
    909
    PO Trainer Name:
    Joyverse
    uh huh a Potato.
    why not an exploding pokeball?
     
  4. Nightfall Alicorn

    Nightfall Alicorn Left Pokémon Online, most likely not coming back.

    Joined:
    Oct 15, 2013
    Messages:
    491
    Likes Received:
    171
    PO Trainer Name:
    Nightmare Moon
    The first one is just a habit I got when I was learning how to script here from using Crystal's script. To be honest, I need to change that some point.

    The second one is an issue with JSLint error check plug-in thinking it's an error. Even I think it's just a waste. It likes a variable containing 0 but doesn't like the integer 0 itself. I'm trying to improve my way of coding.
    http://i.imgur.com/pvOtN22.jpg

    The script wasn't really my idea. But anyone, with coding knowledge, should be able to re-word the messages in the script if they wanted. I think a Voltorb or Electrode sounds fun too.
     
    Joyverse likes this.
  5. Fiery Espeon

    Fiery Espeon The fire never bothered me anyway ~

    Joined:
    Jul 26, 2013
    Messages:
    540
    Likes Received:
    129
    PO Trainer Name:
    Fiery Espeon
    I think it would be better if the /me before the messages were removed. Some colors can be annoying, and even without /me, it will be fine.
    Edit: And something other than -, because some people had said it was confusing for them, and they would much rather prefer ? (like the original).
     
    Last edited: Apr 26, 2015
  6. Nightfall Alicorn

    Nightfall Alicorn Left Pokémon Online, most likely not coming back.

    Joined:
    Oct 15, 2013
    Messages:
    491
    Likes Received:
    171
    PO Trainer Name:
    Nightmare Moon
    The /me messages is to help reduce flashes in channel. I could try add something so the user can choose to use them or not.

    As for the command symbol. I see if I can set it to allow either - and ? same time. If I can't, I set it to just ?.

    Thanks for your feedback.

    Edit: Script updated. Read update logs for info on changes. May add better methods if this script does well.
     
    Last edited: Apr 27, 2015
  7. Crystal Moogle

    Crystal Moogle Ayaya~ Administrator Administrator

    Joined:
    Jul 19, 2010
    Messages:
    3,205
    Likes Received:
    531
    PO Trainer Name:
    Hanako
    It probably doesn't like you using 0 pointlessly...

    Any why add 'Use Strict'? PO doesn't support it. JSlint isn't perfect, especially if you're not using it for web JS, which it's mainly defined for. JSHint is better.
    I use /*jshint "laxbreak":true,"shadow":true,"undef":true,"evil":true,"trailing":true,"proto":true,"withstmt":true*/ as my settings for JSHint. JSLint plugin has an option for switching between the two.
     
  8. Nightfall Alicorn

    Nightfall Alicorn Left Pokémon Online, most likely not coming back.

    Joined:
    Oct 15, 2013
    Messages:
    491
    Likes Received:
    171
    PO Trainer Name:
    Nightmare Moon
    I've done some research on those code comment JSHint settings effects, on http://jshint.com/docs/options/, but... laxbreak is to be removed in the next release and trailing isn't listed at all. I've found it been removed from a previous update.

    I didn't know about the "use strict" part but I thought I add it just in case for future proof. Since I thought it would get updated.

    I've switched between JSLint and JSHint but I thought JSLint was better since it picked up more errors. I always appreciate your coding advice.