Tutorial [Database] Change group text color, prefix, suffix, and more - SQLite editor basics

Discussion in 'Guides and Tutorials' started by Snirk Immington, May 21, 2012.

  1. Snirk Immington TShock Plugin Developer

    This is a tutorial that will show you how to change some information about a group in the database! Please note you need to have used TShock a little to understand this.

    Tshock's database is in the "tshock" folder that is in the folder you got TShock in. The database contains warps, regions, groups, login accounts, and plugin info (if they use it/you have plugins).

    This only works if you use SQLite as the name of your database. This is the default setting, in the config.json:
    Code:
    "StorageType": "sqlite",
    The other type, sql, has a previous tutorial http://tshock.co/xf/index.php?threads/tut-setting-up-mysql-for-tshock-by-gravemind.244/#post-8886 that I found using the search bar.

    We will be focusing on GROUPS, specifically Prefix, Color, and Suffix.
    At the moment, in order to edit these, there are no commands (like /modgroup add permission) so we need to edit the file directly.
    Being able to edit the file is a good thing, it allows stuff to go much faster.


    1. Get an SQLite manager:I use SQLiteManager (click this shiny blue text to download it) but I believe there is a plugin for Firefox too (I will not be covering use of that). You can get any one you want, but this tutorial is full of screenshots to help you.

    2. Open the SQLite manager: Using my editor, you will see this:

    SQL-programopen.JPG
    You don't need the full version! The "Queries" here will not be needed for TShock use. Just hit the "Use Demo" button. This is what pops up:
    SQL-openfile.JPG
    Obviously, the first time you will need to find "tshock.sqlite" (it's in the "tshock" folder from the download) then open it.

    3. Open the file and begin editing: At this point, you should get the window:
    SQL-filereading.JPG
    And here is where the fun begins! You can click on tables (if you like) to see what tables are stored in the tshock.sqlite (I'm using a brand new one):
    SQL-tableopen.JPG
    But this is just a preview.

    4. Open the "Group" Table: Go to Database > Edit Table > GroupList, like so:
    SQL-menuforedit.JPG
    (The zombie hand is from a game because I screenshotted this in front of Chrome, ignore it for now, I'll edit it out LATER, Plants vs Zombies FTW)

    5. You Will See Some Info: Here's what happens when you click (a popup)*The window is not orange on regular computers*: SQL-editgroups1.JPG
    Here's where you can edit the information about a group! The information:
    • GroupName: The name of the group, in this case "guest" (un /register-ed group in the default config)
    • Parent: This allows you to inherit permissions from another group. DO NOT USE SUPERAADMIN! Superadmin is not a group here. Superadmins is more like a state of awesomeness that ignores permissions, not a group.
    • Commands: These are the permissions the group has, separated by commas without spaces. Feel free to add/subtract to this.
    • ChatColor: In RGB format, three colors. Note that there should be commas without spaces between each number between 0 and 255.
    • Prefix and Suffix: I'm getting to those! Remember, these depend on config.json's "ChatFormat". Prefix is {1} and suffix is {2}.
    5. Get to editing already! So you can type stuff into the boxes! Because this is the "guest" group, I'll add a humiliating message to their chat, and change the color to red to make them feel worthless.
    SQL-editgroups4.JPG
    6. SAVE THE FILE! Here's the location of the save button:
    SQL-confirmsave.JPG
    7. Test it out! Here's what a "guest" chat color looks like:
    SQL-finishedproduct.JPG
    The "ChatFormat" can be changed how you like, spaces before/after the prefixes. Remember that it is in config.json.

    I hope you enjoyed the walkthrough! I spent a lot of time on it!
  2. WesleyMan000 New Member

    • Its in the guide, perhaps you should search before making requests.
    Whats the link for SQLite Manager?

    EDIT: Don't worry i got it from my old comp
  3. Snirk Immington TShock Plugin Developer

    When text is blue, it usually means it's a link. This means that clicking on it will take you to the place to download it!
  4. Olink TShock Developer

    Although im impressed you managed to fail to paste the link 100% correctly( excess stuff before and after ) twice :) I fixed it for you.
  5. Snirk Immington TShock Plugin Developer

    I have no idea how that happened, I usually do links in BB code :confused: so I made the text very clear that the link was a link.
  6. Olink TShock Developer

    the first had some weird url tags. the second had a " ' " at the end, which was probably just you fat fingering it.
  7. Snirk Immington TShock Plugin Developer

    I thought it needed to be [url='uuurrrrlllll']text[/url] but I don't know why the text was so messed up.
  8. ShadouIceAzure New Member

    Sorry for troubling you but when I use the SQL lite Manager and search for my sqlite file, it says it is encrypted and that I must enter the encrypted key. Help please?

    EDIT: Found out I kept trying to open the sqlite3 file. it's ok now :D
    Snirk Immington likes this.
  9. Alrof Member

    whan i put the color for exsample 255.000.000 it dosent do anything i have the prifix but no color
  10. Mr White TShock Plugin Developer

    try 255,000,000 I think it's comma , not fullstop .
    Edit: I KNOW it's comma, not fullstop
    Alrof likes this.
  11. Alrof Member

    Thankyou man ;)

    EDIT: it works and again THANKYOU!
    Snirk Immington likes this.
  12. Snirk Immington TShock Plugin Developer

    I've made the word commas more emphasized, maybe that will help you guys.
  13. Olink TShock Developer

    funny that it happens time after time :\

    Since when did periods have tails...
  14. Skryter Member

    Eh, my SQLite DB looks different, but it doesnt matter, i know how to do it
    ---Edit----
    i use FireFox one, i dont have to register or non ah that shit. Its much more easier ;)
  15. Mr White TShock Plugin Developer

    Yup :D SQLite manager all the way
  16. Wolfe Member

    I believe TShock's default group's color codes are all 255.255.255, so I think people get confused and think that's how that should be. Maybe it's just something to do with Firefox's SQLite manager, I dunno :/
  17. GlassGr3nade ®™ New Member

    Hi, I was wondering what you think of sqlitebrowser, I downloaded yours and it gave me a linux tar.gz which I could extract but there were no files for me to run, so I downloaded the sqlitebrowser and just wanted your opinion on it.
  18. Wolfe Member

  19. Snirk Immington TShock Plugin Developer

    Any SQL "viewer" will work, so long as it can open and edit .sqlite files.
    I got this but heard about the one for Firefox, got Firefox, got the editor, and I didn't know what to do so I wrote the walk through for the independent program.
    EDIT: Sorry about the confusion. The download link changed; or led to a .tar.gz file. The download link ( http://www.sqlabs.net/download/SQLiteManagerSetup.exe ) has been updated.
  20. ShadowDX New Member

    I have a weird problem, i used to work on tshock 3.7 for looooooong, but i decided to go on a higher version, I DIDN'T copied anything from the old tshock, I tested it and it worked properly, I edited the database of groups [as i did in 3.7] the 4.0 doesn't show me prefixes and suffixes, ever worse thing is that config.json doesn't seems to be corrupt, everything looks fine, on 3.7 everything is fine, 4.0 ... not! oh and in config.json I DID checked if the chat is setted properly: {1} {2} {3} {4}
    The only functions i enabled is chat above characters but my friend has it enabled too and he has properly showing up prefixes.

    other thing is that i am stuck on pink color for superadmin.
    Pink color looks like this:
    255.0
    145.0
    255.0
    And each time i modify it it loads up again to this ...
    I tried: "Run as Administrator" for sqlite manager, server, wordpad for config.json
    Tried different SQLite programms

    Nothing helped, so what might be wrong ??? And i need to get 4.0 to work cuz it enables a lot of new usefull functions.

Share This Page