Raised This Month: $12 Target: $400
 3% 

[ANY] Web Shortcuts (Redux)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
KyleS
SourceMod Plugin Approver
Join Date: Jul 2009
Location: Segmentation Fault.
Plugin ID:
2697
Plugin Version:
1.1
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    334 
    Plugin Description:
    Extended Web Shortcuts.
    Old 12-03-2011 , 21:13   [ANY] Web Shortcuts (Redux)
    Reply With Quote #1

    I'm perfectly happy with the existing Web Shortcuts, this is useless!

    Sounds like you've been lucky. Anyways, there are a lot more replacements in this. As well to this, in theory, it should be faster.

    Cool! I'll just throw my old file in there and load this!

    Whoa stop right there! The format has changed significantly! See the second post for examples.

    What kind of keywords can I use for specifying options for each chat hook?

    Good question! Here's a list of the current ones
    Quote:
    Big
    Hook
    Pointer
    Silent
    Title
    Url


    Big doesn't work for me. How come?!

    Big, as far as I know, works in TF2 only. So it's been masked to only function in TF2 and not do anything otherwise.

    With the old Webshortcuts if I typed GoOGlE when I specified google in the file it would still work. Why doesn't it work with this?!

    Well, Tries don't work that way sadly. Instead of taking the 'slow' route, comparing each string at a time. I figured ease of use and storage for new features would trump that.

    When using Pointer I specify it last and the hook doesn't work, what's going on?

    See the second post for examples. This usage is invalid as you cannot join tries, sadly. Pointer can however allow you to change data in another block. At the moment this shouldn't really be used.

    I've found an error.

    Oh boy, that's not good at all! Be sure to post it in the thread and to include the relevant blocks/sections so we can figure out what's going on. This alone shouldn't error out, so without provided sections, who knows what's going on!

    I want to request a feature!

    See I've found an error, same sort of concept. Use blocks to show what you mean so I can get the implementation right.

    Credits
    • Psychonic -Using his replacements from Dynamic MOTD.

    Current: 132 views
    Attached Files
    File Type: sp Get Plugin or Get Source (WebShortcuts.sp - 9966 views - 27.6 KB)

    Last edited by KyleS; 02-11-2012 at 03:55.
    KyleS is offline
    KyleS
    SourceMod Plugin Approver
    Join Date: Jul 2009
    Location: Segmentation Fault.
    Old 12-03-2011 , 21:13   Re: [ANY] Web Shortcuts (Redux)
    Reply With Quote #2

    Reserved for documentation

    Each section name works as a hook. So if you have a section that looks like the following:
    PHP Code:
    "rules"
    {
        
    "Url" "http://websitehere.com/rules/"
        "Title" "Rules and Regulations"

    If you typed 'rules' in chat, the Url, along with the Title would be displayed to the client using a VGUI panel.

    Now this is where things can get complicated, you can have the following
    PHP Code:
    "rules"
    {
        
    "Title"        "{NAME}"
        "Silent"    "Nope"
        "Url"        "http://SiteHere.com/index.php?id={FRIEND_ID}&Pickles={CURPLAYERS}"
    }

    "Rules2"
    {
        
    "Pointer"    "rules"
        "Title"     "{NAME}|{STEAM_ID}"
        "URL"        "http://SiteHerev2.com/index.php?IP={IP_ADDRESS}"
        "Big"        "Sure"

    Rules2 overwrites rules with it's information and adds a hook named Rules2. rules has a Silent field though, this field remains untouched in the above example with a valid value of "Nope". The two functioning chat hooks calling this same block are rules and Rules2. At the moment, there's no real purpose to do this. Just modify the rules block and add a rules hook (explained below), you should be solid.

    Here's a simple example of what you can do:
    PHP Code:
    "rules"
    {
        
    "Url" "http://websitehere.com/rules/"
        "Title" "Rules and Regulations"
        "Hook" "!rules"
        "Hook" "/rules"
    }

    "rulez"
    {
        
    "Pointer"    "rules"
        "Url"        "http://ADifferentWebsiteHere.com/Rules/
        "
    Title"        "Different Title"
    }

    "
    #RespectMahAuthoritahh"
    {
        
    "Silent"     "Yes"
        "Url"        "http://www.youtube.com/watch?v=D81vBcKfqpo"
    }

    "Authoriteh"
    {
        
    "Big"        "Yup"
        "Silent"    "Nope"
        "Url"        "http://www.youtube.com/watch?v=QDd07jhGcL0"
    }

    "%LoseIt"
    {
        
    "Big"        "Yup"
        "Title"        "Potato"
        "Url"        "http://www.youtube.com/watch?v=jI8gEU8-i8A"
        "Hook"        "LoseIt"
    }

    "GameMonitor"
    {
        
    "Title"        "Game Monitor Stats for {SERVER_NAME}"
        "Url"        "http://www.game-monitor.com/GameServer/{SERVER_IP}:{SERVER_PORT}/"
        "Big"        "Sure"
    }

    "!GameMonitor"
    {
        
    "Pointer"    "GameMonitor"
        "Hook"        "!Meh"
        "Hook"        "!Eggs"

    In this block, we introduce the Hook key. When someone types !Meh, or !Eggs in chat, they're pointed to the GameMonitor block from the Pointer. Again, at this time, using a Pointer in the same file is just wrong. As well to this, Pointing to yourself is a syntax violation, it's unknown what will happen at this time.

    You're more then welcome to not define keys, as a matter of fact, I suggest doing so. Nothing is required except for a URL and a Section name. Don't break the syntax!

    Anything starting with a 1, y, Y, T, t, s, S means the key is true.
    Anything starting with a 0, n, N, f, F means the key is false.

    Last edited by KyleS; 12-03-2011 at 21:32.
    KyleS is offline
    mrzor
    Member
    Join Date: Oct 2011
    Location: Paris, France
    Old 12-25-2011 , 14:27   Re: [ANY] Web Shortcuts (Redux)
    Reply With Quote #3

    Hi !

    I've been using this plugin for a week and it is working like a charm - I tried to avoid using the advanced hook/pointer features so far, and am only using simple statements such as

    Quote:
    "news"
    {
    "Url" "http://tf2.zorcellerie.fr"
    "Title" "Le Web"
    "Hook" "!news"
    "Hook" "/news"
    }
    I've noticed that when someone types "!news" it is swallowed by the plugin - nobody sees that this link is being opened. I would like this behavior to be customizable, that is, display that someone typed !something if set up that way.

    Cheers !
    mrzor is offline
    daleGEND
    AlliedModders Donor
    Join Date: Feb 2005
    Location: USA
    Old 12-25-2011 , 14:43   Re: [ANY] Web Shortcuts (Redux)
    Reply With Quote #4

    mySQL is a must for this. I am considering working with my developer to make a general UI integration for a lot of plugins that combines with XenForo. Will let you guys know the outcome.
    __________________
    Bor3d Gaming - A Mature Online Gaming Community

    Feel free to add me on STEAM as well: https://steamcommunity.com/id/b0r3d
    daleGEND is offline
    poppin-fresh
    AlliedModders Donor
    Join Date: Aug 2010
    Old 12-28-2011 , 20:58   Re: [ANY] Web Shortcuts (Redux)
    Reply With Quote #5

    Is it just me or does the plugin not generate the WebShortcuts.txt? nonetheless, great plugin!
    poppin-fresh is offline
    KyleS
    SourceMod Plugin Approver
    Join Date: Jul 2009
    Location: Segmentation Fault.
    Old 12-28-2011 , 20:59   Re: [ANY] Web Shortcuts (Redux)
    Reply With Quote #6

    The plugin doesn't generate any files.
    KyleS is offline
    kradalby
    Junior Member
    Join Date: Jun 2010
    Old 01-03-2012 , 06:35   Re: [ANY] Web Shortcuts (Redux)
    Reply With Quote #7

    I cant seem to figure out what to name the config file or where to put it?

    i am a noob but i didnt think i was blind to
    kradalby is offline
    Snaggle
    AlliedModders Donor
    Join Date: Jul 2010
    Location: England
    Old 01-03-2012 , 07:00   Re: [ANY] Web Shortcuts (Redux)
    Reply With Quote #8

    Quote:
    Originally Posted by kradalby View Post
    I cant seem to figure out what to name the config file or where to put it?

    i am a noob but i didnt think i was blind to
    Code:
    configs/Webshortcuts.txt
    Snaggle is offline
    kradalby
    Junior Member
    Join Date: Jun 2010
    Old 01-03-2012 , 07:39   Re: [ANY] Web Shortcuts (Redux)
    Reply With Quote #9

    Thanks dude, i swear i tried all combination of .cfg and .txt with or without capital letters except that one

    does anyone know if i can use links with html anchor? it workd for my motd but at first glance it does not look like it here.
    kradalby is offline
    untamed0
    Junior Member
    Join Date: Jan 2010
    Old 01-07-2012 , 09:26   Re: [ANY] Web Shortcuts (Redux)
    Reply With Quote #10

    Works great , I have a suggestion, would it be possible to have a 'msg' option, which is printed to the user when they run the hook? This would be useful for Silent blocks.

    For example:

    Code:
    "radio"
    {
        "Silent"    "Yes"
        "Url"    "http://websitehere.com/radio"
        "Hook"    "!radio"
        "Msg"    "You're now listening to the radio! say !stop to stop listening"
    }
    untamed0 is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 07:56.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode