1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Guest, PO has ceased our separate tiering and adopted Smogon tiers for SM. More information and updates here.

    Dismiss Notice

[Server Scripting] [Plugin] Safari game

Discussion in 'Server and Client Scripting' started by IceKirby, Sep 9, 2015.

  1. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    Code: https://github.com/IceKirby/po-server-goodies/blob/patch-36/scripts/safari.js
    It uses the Hangman script as a base, so other than loading the plugin it only requires a 'safaribot' (I use Tauros) and it's good to go.

    A server plugin I made with the idea "making a script that uses the Pokémon sprites built in the client".
    A contest starts every 30 minutes. During a contest, wild Pokémon may suddenly appear in the channel's chat, and players can use a Safari Ball to catch it. It's basically a game about catching Pokémon and forming your own collection.

    There are also other mechanics like being able to sell a Pokémon you caught, buying more Poké Balls, trading Pokémon with another player and gaining a small amount of money and balls for logging in daily (kind of a resource management game).

    Obviously, I would like to see this on the main server, but even if it's not used I still accept suggestions and feedback.
     
  2. 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 give it a go. :o
     
  3. 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 thought I had to just add safaribot to the config in the main script. Got it working after seeing the errors in Indigo Plateau. Just place this near top of script if others struggle to use it.
    Code (JavaScript):
    1. var safaribot = {
    2.     sendMessage: function (src, message, channelId) {
    3.         sys.sendMessage(src, "±SafariBot: " + message, channelId);
    4.         return;
    5.     },
    6.     sendAll: function (message, channelId) {
    7.         sys.sendAll("±SafariBot: " + message, channelId);
    8.         return;
    9.     }
    10. };
    I think best method would be just using Config.safaribot for bot name though.

    This maybe a fun to have on main. Maybe for improvement add the number of balls that the player has got left after using a certain type of that ball and add the delay in seconds left till they can throw again.

    I gotta say great work, mate.

    Edit: Maybe add how much money the player has when viewing /buy too.
     
    Knalon Anime likes this.
  4. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    You can also just Ctrl+F for hangbot in script.js and use the same method :x

    EDIT: Suggestions implemented.
     
    Last edited: Sep 9, 2015
    Nightfall Alicorn likes this.
  5. 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
    Grats, Kirby. Your game been added to the official server.
     
  6. xD4rk

    xD4rk New Member

    Joined:
    Feb 14, 2016
    Messages:
    1
    Likes Received:
    0
    How can i able the shop? because mine doesn't work lol
     
  7. Strudels

    Strudels ・◡・ Super Moderator Server Administrator Super Moderator Server Administrator

    Joined:
    Oct 31, 2013
    Messages:
    282
    Likes Received:
    1,071
    PO Trainer Name:
    Strudels/Ripper Roo
    Shop wasn't implemented until later. If you're using the link up there then it's outdated, use the current Safari script running on the server.