[Client Scripting] "Bumble" - SongSing's (New) Client Scripts

Discussion in 'Server and Client Scripting' started by SongSing, Apr 12, 2014.

  1. SongSing

    SongSing KILLL

    Joined:
    Jan 2, 2013
    Messages:
    641
    Likes Received:
    191
    PO Trainer Name:
    SongSing
    "SongSing why build new ones so soon what is wron gwith u"

    the old ones were for learning mainly and had some fundamental flaws, these are more powerful

    Get them here: https://raw.githubusercontent.com/SongSing/ClientScripts/master/bumble.js

    They're cool and updated regulalrlaryly

    FEATURES:
    Clickable names

    Cool links and things
    customizable bot thing
    friends list
    stalkwords
    command typo protection
    enriched text
    emotes - now with poke icons
    update without leaving client
    nice n powerful plugin system
    channel logging to html and/or txt files
    usage stats and tier info
    customizable auth symbols, flash colours,
    autoresponse w/ optional external defining
    shortcuts
    (can set shortcuts like "bf" to change to things like "battle factory" when you send messages)
    probably more??

    SCREENSHOTS:
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]

    big thanks to theunknownone and crystal moogle for actively and passively guiding me through this

    yeah

    *If you find an emote you think should be in these scripts, just comment or pm me :)

    TODO:
    Group emotes so they're not as screen-crowding
     
    Last edited: May 10, 2014
  2. Kase

    Kase Member

    Joined:
    Mar 12, 2014
    Messages:
    148
    Likes Received:
    3
    I like you scripts.
    Can't wait for more functions your going to add.
     
  3. Yttrium

    Yttrium Well-Known Member Developer Developer

    Joined:
    Sep 29, 2010
    Messages:
    619
    Likes Received:
    283
    PO Trainer Name:
    Yttrium
    The clickable names seem cool :O
    I didn't know you could do <a href='po:send/whatever'> to send messages
     
  4. Bamarah

    Bamarah "Baton Pass Elite"

    Joined:
    Oct 16, 2010
    Messages:
    344
    Likes Received:
    16
    I'm loving the Clickable names!

    But you might wanna fix this:

    (00:26:42) ±Delibird: Downloading emotes...

    (00:26:42) Script Error line 532: TypeError: Result of expression 'emotesData' [undefined] is not an object. init() at scripts.js:532

    (00:26:42) ±Delibird: Couldn't download emotes. Turning emotes off.


    I also get an "undefined" next to auth names... maybe because I was using Moogle scripts before I added yours?

    Keep up the good work, I can't wait for you to complete them.
     
  5. SongSing

    SongSing KILLL

    Joined:
    Jan 2, 2013
    Messages:
    641
    Likes Received:
    191
    PO Trainer Name:
    SongSing
    Last edited: Apr 14, 2014
  6. Bamarah

    Bamarah "Baton Pass Elite"

    Joined:
    Oct 16, 2010
    Messages:
    344
    Likes Received:
    16
    Thanks for fixing the issues but I have another one...

    (20:58:33) ±Delibird: There was a problem checking for updates. (Are you connected to the internet?)
    (20:58:33) ±Delibird: Couldn't download emotes. Turning emotes off.

    Yet I'm on PO which uses the internet?

    Other than that your commands are great so far...


    [​IMG]


    Commands I would like to see:

    1) Ignore Challenges (Yes, like the Moogle Scripts command: ~ignorechallenges on/off)
    2) Being able to change the symbol by authority level (Instead of ~setauthsymbol more like ~setauthsymbol auth:symbol)
    3) Spell Check (Might be too much to ask but wouldn't hurt)

    When I think of more I'll post them...
     
  7. SongSing

    SongSing KILLL

    Joined:
    Jan 2, 2013
    Messages:
    641
    Likes Received:
    191
    PO Trainer Name:
    SongSing
    About that error - It shows when the response generated from attempting to get the online script is empty, usual because someone isn't connected to the internet. It could also probably be caused by a poor connection or something. I don't think it's a scripting error, but I could be wrong. I'll do some testing!

    As for your command suggestions:
    1) Sounds good, will do this today
    2) Good idea! I'll definitely add this in.
    3) I could try, but I'm not going to guarantee anything :p Do you have any ideas of how this would be done? (Maybe use a rly long list of words to match up with?? Or something user-defined??)

    Overall, great suggestions. I'm enjoying the feedback!
     
  8. Raducan

    Raducan Well-Known Member

    Joined:
    Jul 23, 2013
    Messages:
    1,366
    Likes Received:
    1,135
    omg songsing these scripts are gr8

    i rly like how i can stalk ppl's colors and pull up usage stats with a command!

    thanks for doing these : ]
     
    Finchinator likes this.
  9. SongSing

    SongSing KILLL

    Joined:
    Jan 2, 2013
    Messages:
    641
    Likes Received:
    191
    PO Trainer Name:
    SongSing
    glad you like 'em! :)
     
  10. SongSing

    SongSing KILLL

    Joined:
    Jan 2, 2013
    Messages:
    641
    Likes Received:
    191
    PO Trainer Name:
    SongSing
    BIG UPDATE
    now there's a /tier command which gives you infomation on a tier
    this is very useful!!!!
     
  11. SongSing

    SongSing KILLL

    Joined:
    Jan 2, 2013
    Messages:
    641
    Likes Received:
    191
    PO Trainer Name:
    SongSing
    ok time for version 0.9.4.0 - 0.9.5.1
    why arent we at 1.0 yet? who knows

    In this version:
    /makecommand has been replaced by a flexible plugins system (and by flexible i mean you're basically able to modify the source and add commands and things without it being lost on update)

    Code (javascript):
    1.  
    2. function sayBW(data)
    3. {
    4.     var ret = "";
    5.     var text = data[0];
    6.  
    7.     for (var i = text.length - 1; i >= 0; i--)
    8.     {
    9.         ret += text[i];
    10.     }
    11.  
    12.     say(ret);
    13. }
    14.  
    15. Commands.add("general", "saybw", [ "text" ], "Says [text] backwards", sayBW, "Say what backwards?");
    16.  

    The format for Commands.add is:
    Commands.add(category, name, paramnames, description, function, help);
    category
    - the category under which this command will be listed. "general", "social", and "settings" are used in the scripts, but you can do whatever. they'll have to do /commandslist category or /commandslist all
    name - the name of your command. they'll have to do /name
    paramnames - the params for your command. must be an array. they'll have to do /command param1;param2
    description - the description to be shown with your command on the commandslist
    function - refrence to a function that will be called when your command is used. the only param that will be used will be an array containing the params the user inputted. don't include the (), only the function name
    help - the string to be shown when something goes wrong when evaluating said function with whatever the user inputted. you can also handle errors in the function itself if you'd like to give specific messages for specific scenarios.

    Hooks:
    What are hooks?!??!
    Hooks allow you to run certain functions during certain events, such as when the scripts start up or before someone says something.

    This will make everybody scream everything they say:
    Code (JavaScript):
    1.  
    2. function yell(data)
    3. {
    4.     cache.bcmf = data.message.toUpperCase();
    5. }
    6.  
    7. Plugins.hook("beforeUserMessage", yell);
    8.  

    Format is: Plugins.hook(event, fn);
    where event is a string and fn is refrencing a function. the function gets one param, data, which is a json object containing data pertaining to the event.

    Events:
    "beforeSendMessage" - called before the user sends a message. properties are message and channel
    "beforeChannelMessage"
    - called before the client receives a channel-specific message. properties are message, channel, and html. channel is the id.
    "beforeUserMessage" - called before somebody says something. properties are message, user, and channel. the message here doesn't contain the user, unlike "beforeChannelMessage". channel is the id
    "onPlayerReceived"/"onPlayerRemoved" - called when someone gets on/off, properties are id and name
    "onPlayerJoinChan"
    /"onPlayerLeaveChan" - called when someone enters/leaves a channel, properties are id, name, and channel (channel gives the id, isn't a name!)
    "beforeChallengeReceived" - called when someone's about to challenge you. properties are challengeId, opponentId, tier, and clauses
    "init"
    - called when the scripts initialize. property is newUser, which is a bool telling whether or not this user is using the scripts for the first time or something
    "formattedMessage" - called when a message is being formatted, which would be when people are talking or an html log is being saved. this is pretty much exactly the same as the "beforeUserMessage", except this has formatting such as enriched text or emotes or flashes, and you can put html in it (unlike beforeUserMessage). the properties for this are user and message, which are unformatted strings containing the user and original message, and formattedMessage, which is the formatted message. you can use cache.formattedMessage to edit what will appear.

    for beforeUserMessage, you can change the value "cache.bcmf" to change the message that will appear. i don't remember what the "f" stands for.

    again, plugins are pretty flexible, so dont download anything that looks suspicious!
    also, they're not limited to commands. they can do whatever~

    plugins must be saved as .js files in the folder Bumble Plugins, which should be in your po folder.

    also there were some fixes and things, you can always use /whatsnew to check everything that's going on!~
     
    Last edited: May 11, 2014
  12. Wavy

    Wavy prince of the sea Server Moderator Server Moderator

    Joined:
    Aug 6, 2010
    Messages:
    394
    Likes Received:
    67
    These scripts are really good.

    I give them a 9.456 / 10.000
     
    Nightfall Alicorn and buny like this.
  13. SongSing

    SongSing KILLL

    Joined:
    Jan 2, 2013
    Messages:
    641
    Likes Received:
    191
    PO Trainer Name:
    SongSing
    ......................................no..............
     
    Nightfall Alicorn likes this.
  14. SongSing

    SongSing KILLL

    Joined:
    Jan 2, 2013
    Messages:
    641
    Likes Received:
    191
    PO Trainer Name:
    SongSing
    In this version: 0.9.7.0
    Fullwidth links are now clickable!
    There's a new /tiers command that shows you the tiers a pokemon's in! (it may not list all of them, po only lists if a poke is banned from a tier, so i had to go off that)
    The bot won't format the html you put in command params anymore!
    Also other things probaly!

    If you find buges tell me i'll fix em up

    man i forgot to post for 0.9.6.0
    oh well that was just self-flashing fix (thanks yagura!) and timerstuff
     
  15. 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'm just browsing around and noticed that screenshot with the clickable link "Remove from friends". I've done some research on po protocols (https://github.com/po-devs/pokemon-online/wiki/po:-Protocol) and was told it wasn't possible to make them call a function, which I presume it does. How you do that?
     
  16. Crystal Moogle

    Crystal Moogle Ayaya~ Administrator Administrator

    Joined:
    Jul 19, 2010
    Messages:
    3,205
    Likes Received:
    531
    PO Trainer Name:
    Hanako
    You use po:send to send the command
     
    Nightfall Alicorn likes this.
  17. 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 see. Thanks, Crystal. I thought beforeSendMessage couldn't be sys.stopEvent() if a client function like client.network().sendChanMessage(channelId, message) was used.
     
    Last edited: Jul 12, 2015
  18. SongSing

    SongSing KILLL

    Joined:
    Jan 2, 2013
    Messages:
    641
    Likes Received:
    191
    PO Trainer Name:
    SongSing
    my strength is infinite
     
    sulcata and Nightfall Alicorn like this.