1. These forums are still being retired! Please use GitHub discussions or Discord. You cannot create new threads or new accounts now. If you need to contact some user of the forums, you should do it sooner, rather than later. This notice was last updated on May 30th, 2021.

[PHP] Inventory Parser

Discussion in 'Unsupported / Outdated Plugins' started by Mr.Pineapple, Jan 16, 2013.

  1. Mr.Pineapple

    Mr.Pineapple Level 2

    Joined:
    Jan 8, 2013
    Messages:
    28
    [​IMG]

    Inventory Parser V.1.1

    Description:
    Have you noticed someone on your server using cheated stuff? You have always wanted to check out their inventory?
    Good... Keep reading ;)

    Sure, you can check out their stuff by looking at a long string of numbers. Now there's easier way!
    Send that a long string of numbers to our site and we'll do the rest!

    How to use? [VIDEO] [OLD VERSION]






    How to use?
    1. Find users inventory
    [​IMG] (Image seems to be broken atm, i need to fix that)

    2.Copy numbers
    [​IMG] (Image seems to be broken atm, i need to fix that)

    3.Paste numbers to site and you're done, now you can spy on your players stuff. :cool:

    [​IMG] (Image seems to be broken atm, i need to fix that)


    Changelog


    1.1
    -Fixed "EMPTY SLOT!" on page load.
    -Allow query using ?inv= (Normal inventory code not work yet, 'share inventory' code works)
    -Share inventory (Work, but string is long, update is coming soon...)
    -Disabled textarea resize
    -Debug mode (Not ready, update is coming soon...)
    -Inventory looks like "real terraria inventory" (Stylish, thanks popstarfreas)
    -Random backgrounds
    -Option to plain or design mode (?plain)
    -If browser too old, show message to update or use plain mode.
    -If ?inv disabled and try query doest show error.

    1.0
    - Relased


    What i can do with it?

    You can parse your inventory. It will show item picture, name and how many.
    You do not need to install anything to use this. (You may need a web browser.)


    ToDo
    -Code does not understand negative numbers. (Not me either :D)
    -Maybe bit stylish...[DONE]
    -Identify the tools made ​​of a different material (hammer, sword, pick)
    -MySQL Support
    -Few image fix
    -Fix SlotID [DONE]
    https://tshock.co/xf/index.php?threads/php-inventory-parser.1892/#post-19641 [DONE]
    Suggest something...

    Links
    Inventory Parser (TParser) (not working)
    Github (Source)

    MiniParser (working)
     
    • Like Like x 2
  2. DarkOS

    DarkOS tShock supporter and programming hack.

    Joined:
    Aug 17, 2011
    Messages:
    849
    this is a nice tool thanks for creating it. a slight challenge though will be that opening a SQLite database while its being used will result in crazy server behavior and/or crash.
     
  3. Ijwu

    Ijwu Level 11

    Joined:
    Apr 4, 2012
    Messages:
    644
    This is interesting, I like that it is online. It sets it apart from the plugin version of this.

    Here's my suggestion: set up an API. Allow for the receiving of strings from sources and sending back a formatted string, JSON would work. This would allow you or someone to write a plugin that would interface with the site without forcing the admins to open up their database and do it themselves.
     
  4. Snirk Immington

    Snirk Immington Level 9

    Joined:
    Jan 12, 2012
    Messages:
    378
    This is pretty cool :) An internet based UI is a new concept... and if you could open an internet browser to that web page with that text, it would be even cooler :p
    Not every day you see someone new to the forums with a plugin of their own :D welcome to the club!
    You'll need to give the source code, though, for it to be accepted. I'd add the html for the web page as well.
     
  5. Wolfe

    Wolfe Level 9

    Joined:
    Jan 3, 2012
    Messages:
    386
    I've never had any problems regarding viewing the database while the server is running. Did you mean SQL?
     
  6. Olink

    Olink Admin note: Actually a really nice person now

    Joined:
    Jul 21, 2011
    Messages:
    1,397
    I'll just leave this here:
    https://tshock.atlassian.net/wiki/d...I+Endpoints#RESTAPIEndpoints-/v2/players/read

    *cough*All tshock servers have a way to get players inventories so long as they are online, but this is a good plugin for offline players.*cough*

    I would ask that you replace [ONLINE] with the correct tags, i.e. whatever source your "plugin" is, such as [SQL\HTML], and you would need to open source it to be accepted. If you don't want it accepted, I can move this to a more appropriate subforum (Server Discussion etc)
     
  7. DarkOS

    DarkOS tShock supporter and programming hack.

    Joined:
    Aug 17, 2011
    Messages:
    849
    If you open tshock.sqlite while the server is running then weird things happen.. like people cant break tiles, rubberbanding to name a couple... also things cant save to the database while it is open.
     
  8. Mr.Pineapple

    Mr.Pineapple Level 2

    Joined:
    Jan 8, 2013
    Messages:
    28
    I will post source soon :)

    I can open tshock.sqlite while server is running and nothing weird happen.
     
  9. DarkOS

    DarkOS tShock supporter and programming hack.

    Joined:
    Aug 17, 2011
    Messages:
    849
    perhaps it is the tool I use then...

    I use sqlitebrowser
     
  10. Mr.Pineapple

    Mr.Pineapple Level 2

    Joined:
    Jan 8, 2013
    Messages:
    28
    Source added with few fixes done :)
    1.1 coming soon...
     
  11. aMoka

    Plugin Developer Zero Day Plugin Author

    Joined:
    Nov 14, 2012
    Messages:
    162
    I wonder if you can make it work in reverse...
     
  12. bippity

    Plugin Developer

    Joined:
    Jan 14, 2012
    Messages:
    300
    Do you think you can change the structure/design so it replicates the inventory of the character in-game? Like TerrariaViewer or whatever that inventory editor is called (not that I ever used it....:D) I combined/edited some pictures from the inventory-editor to show you what I meant.
    I asked this question because I was thinking it would be easier (at least to me) to look at players' inventories.
    Inventory check example.png
     
  13. Mr.Pineapple

    Mr.Pineapple Level 2

    Joined:
    Jan 8, 2013
    Messages:
    28
    If this is user current inventory:
    Code:
    0,0,0~0,0,0~
    And you change it to this:
    Code:
    10,1,0~0,0,0~
    It will change back to that first one when user join server, because item not exist on users inventory...

    Maybe it's possible whit REST API Endpoints (somehow)

    Yes. It is part of my plan. :)


    EDIT:
    1.1 may take some time, i have few problems and few other projects :)
     
    • Like Like x 1
  14. Snirk Immington

    Snirk Immington Level 9

    Joined:
    Jan 12, 2012
    Messages:
    378
    You mean feed it pictures/items and it makes text? The only way to change a player's inventory is to give them items...
     
  15. Mr.Pineapple

    Mr.Pineapple Level 2

    Joined:
    Jan 8, 2013
    Messages:
    28
    Added How to use video. And still wondering how im going to do that cool design :/
     
  16. popstarfreas

    Plugin Developer

    Joined:
    Feb 27, 2012
    Messages:
    357
    I'm going to mess around with the design myself. I might learn somethings :p

    EDIT : I have this so far : http://puu.sh/27QPm
    EDIT2 : Made it look a bit better : http://puu.sh/27RVr
    ^ The player in the middle is me I just didn't have time to do a better picture
     
    • Like Like x 1
  17. Mr.Pineapple

    Mr.Pineapple Level 2

    Joined:
    Jan 8, 2013
    Messages:
    28
    Awesome! I would like to include this to 'official' version if you do not mind. Then maybe few more backgrounds and option to use 'text' or design mode. ;)
    I have another project were i could use this too (*Winking*)
     
  18. DarkOS

    DarkOS tShock supporter and programming hack.

    Joined:
    Aug 17, 2011
    Messages:
    849
    nice work guys!
     
  19. popstarfreas

    Plugin Developer

    Joined:
    Feb 27, 2012
    Messages:
    357
    You might need to maybe optimize it a bit. I did not use any form of table and I used a numerous amount of divs to make it display right.

    You can download my edit here : https://www.dropbox.com/s/k6dai0w81qu5dlj/inv.rar

    I have added titles to the images for anyone who doesn't know what a particular item is (Not that I can think of anyone who shouldn't know of what it is)
    In doing so I noticed that the "title" has a line before it and the code is madness when looked at from a browser. So I have edited it so to fix these problems : https://www.dropbox.com/s/wvhrv4od94gtyzu/inve.rar

    Also I was trying to make the inventory items blue background transparent but it seems impossible.
    I hope I saved you some time on the design ;)

    EDIT: I have just noticed but there are 3 coins slots showing however there are actually 4 slots in-game
     
  20. Mr.Pineapple

    Mr.Pineapple Level 2

    Joined:
    Jan 8, 2013
    Messages:
    28

    Tried that code and here's result:
    [​IMG]