Author Topic: SimpleCommands  (Read 16792 times)

0 Members and 1 Guest are viewing this topic.

Offline Zmaster

  • Full Member
  • ***
  • Posts: 235
  • Karma: 25
SimpleCommands
« on: July 13, 2015, 09:14:27 AM »
What is it
This addon is inspired by a plugin that my old friend made for Minecraft servers years ago, back in my Minecraft days. The idea behind it is that server owners can create chat commands without having any code knowledge. I expanded the idea a bit by making it not just show text, but also opening specified URLs in the Steam ingame browser.

Commands:
There's only one command, and it has no arguments
Chat commands: "!commands" or  "/commands" --opens the main commands window (Pictures below)

To Do:
I have an idea to condense the code a bit w/out removing any functionality, will be done in a later update.

Known Bugs:
N/A

Pictures:
Main commands window: http://i.imgur.com/CenrSni.jpg
Command options window (double click existing command to open): http://i.imgur.com/3DCjo9f.jpg
Add a command window: http://i.imgur.com/WDaObyl.jpg
Add a command window w/ existing command types: http://i.imgur.com/C1fOKzh.jpg

Configuration:
There is one config file, all you need to do in it is supply the color that text command types show up in chat with, and the usergroups that are allowed to add/edit/remove commands. By default, the color is yellow(255, 255, 0) and the ranks are admin&superadmin

Versions:
Code: [Select]
1.2 (3/2/16)
 - Added option in config to either open URL through Steam ingame web browser or DFrame.

1.1 (7/31/15):
 - Fixed bug where using the !commands command while not having access to it would return an error

1.0 (7/13/15):
 - Initial release

Download:
The addon is attached to this post as a .zip file
I think you need to be signed in to download it
« Last Edit: March 03, 2016, 03:09:52 AM by Zmaster »

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: SimpleCommands
« Reply #1 on: July 16, 2015, 07:14:05 PM »
Interesting idea. You should have a third option for advanced users to add commands that do use code.

It would require a little string fines, but its doable.


Ex:

Command: !killme
Type: Script

Script: ply:Kill()



You could have it parse the text for lua, doing a simple find and replace for ply (or whatever) for the player running the command.

You could use this: http://wiki.garrysmod.com/page/Global/CompileString
« Last Edit: July 16, 2015, 07:15:55 PM by MrPresident »

Offline Zmaster

  • Full Member
  • ***
  • Posts: 235
  • Karma: 25
Re: SimpleCommands
« Reply #2 on: July 17, 2015, 08:47:14 AM »
Hmm, sounds interesting
I'll try it out next time I'm working on it and try to work it in
Thanks for the idea

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: SimpleCommands
« Reply #3 on: July 17, 2015, 09:48:31 AM »
No problem. If you need any help with it, let me know.

Offline Naruu # Mr. Pink

  • Newbie
  • *
  • Posts: 3
  • Karma: 1
    • Website
Re: SimpleCommands
« Reply #4 on: July 30, 2015, 06:40:30 PM »
Hi!

When i am a "user" on my server and I write !commands in chat, the lua an error occurs.

Code: [Select]
[ERROR] LuaCmd:1: ')' expected near '<eof>'
  1. unknown - LuaCmd:0

but, it's a great release! it works great !
www.Game-State.com" style="border-style: none;

Offline Zmaster

  • Full Member
  • ***
  • Posts: 235
  • Karma: 25
Re: SimpleCommands
« Reply #5 on: July 31, 2015, 11:43:11 AM »
Thanks, Naruu, didn't notice that
I've updated the attached file on the OP with a fixed version of the addon

Offline Johnathan

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: SimpleCommands
« Reply #6 on: August 03, 2015, 09:42:56 AM »
Hey, I installed the addon onto my server, however !commands or /commands doesn't do anything!

Offline Zmaster

  • Full Member
  • ***
  • Posts: 235
  • Karma: 25
Re: SimpleCommands
« Reply #7 on: August 03, 2015, 06:06:38 PM »
Hey, I installed the addon onto my server, however !commands or /commands doesn't do anything!

Are you getting any errors? Also, did you edit the main file at all (shared.lua)? I just tested it and it worked fine

Offline Johnathan

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: SimpleCommands
« Reply #8 on: August 04, 2015, 11:17:52 AM »
Are you getting any errors? Also, did you edit the main file at all (shared.lua)? I just tested it and it worked fine

No errors as far as I'm aware, and I didn't touch the shared.lua

Offline M21z

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Re: SimpleCommands
« Reply #9 on: August 05, 2015, 04:42:23 AM »
Awesome addon keep up the good work :)

Offline Zmaster

  • Full Member
  • ***
  • Posts: 235
  • Karma: 25
Re: SimpleCommands
« Reply #10 on: August 07, 2015, 04:45:10 PM »
No errors as far as I'm aware, and I didn't touch the shared.lua

Hmm
I didn't see anything that would 'cause something like that in the code
Could you paste the contents of your config file so I can check that out

Offline Professor_Smiley

  • Newbie
  • *
  • Posts: 45
  • Karma: -24
Re: SimpleCommands
« Reply #11 on: September 28, 2015, 01:40:39 AM »
I had just an addon like this in mind. ::)

Offline Desasterx3

  • Newbie
  • *
  • Posts: 18
  • Karma: -1

Offline Zmaster

  • Full Member
  • ***
  • Posts: 235
  • Karma: 25
Re: SimpleCommands
« Reply #13 on: March 01, 2016, 12:55:08 PM »
Uhm....
https://scriptfodder.com/scripts/view/1241/command-manager-mysql-sqlite

This addon came from me wanting to make an addon that allowed server owners to create commands that will output text into the executor's chat w/o any code knowledge, so I started Googling around to see if something like that already existed and I found the page you linked, noticed how that one only did links, and figured I wouldn't restrict mine to text output but also an option for links
And of course since I'm terrible at designing things, I based my menu's design off of that one

If you're wondering, the code in use in this one isn't stolen

Sorry for any confusion

Offline Desasterx3

  • Newbie
  • *
  • Posts: 18
  • Karma: -1
Re: SimpleCommands
« Reply #14 on: March 01, 2016, 10:34:40 PM »
Oh i actually thought his is stolen, since your version is way better. Does your version open links ingame or in the steam browser? I would really need to have one opening it ingame.