AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [ANY] Web Shortcuts (Redux) (https://forums.alliedmods.net/showthread.php?t=173334)

KyleS 12-03-2011 21:13

[ANY] Web Shortcuts (Redux)
 
1 Attachment(s)
I'm perfectly happy with the existing Web Shortcuts, this is useless! :twisted:

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

KyleS 12-03-2011 21:13

Re: [ANY] Web Shortcuts (Redux)
 
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.

mrzor 12-25-2011 14:27

Re: [ANY] Web Shortcuts (Redux)
 
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 !

daleGEND 12-25-2011 14:43

Re: [ANY] Web Shortcuts (Redux)
 
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.

poppin-fresh 12-28-2011 20:58

Re: [ANY] Web Shortcuts (Redux)
 
Is it just me or does the plugin not generate the WebShortcuts.txt? nonetheless, great plugin!

KyleS 12-28-2011 20:59

Re: [ANY] Web Shortcuts (Redux)
 
The plugin doesn't generate any files.

kradalby 01-03-2012 06:35

Re: [ANY] Web Shortcuts (Redux)
 
I cant seem to figure out what to name the config file or where to put it?

i am a noob:P but i didnt think i was blind to:P

Snaggle 01-03-2012 07:00

Re: [ANY] Web Shortcuts (Redux)
 
Quote:

Originally Posted by kradalby (Post 1624350)
I cant seem to figure out what to name the config file or where to put it?

i am a noob:P but i didnt think i was blind to:P

Code:

configs/Webshortcuts.txt

kradalby 01-03-2012 07:39

Re: [ANY] Web Shortcuts (Redux)
 
Thanks dude, i swear i tried all combination of .cfg and .txt with or without capital letters except that one:P

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.

untamed0 01-07-2012 09:26

Re: [ANY] Web Shortcuts (Redux)
 
Works great :D, 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"
}



All times are GMT -4. The time now is 21:00.

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