Jump to content

[TOOL] Add items to database easily/Generate Client Side Files


yepp

Recommended Posts


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  26
  • Reputation:   2
  • Joined:  05/29/16
  • Last Seen:  

ADD ITEMS EASILY

 

Requirements:

- PHP version 5.4 and up is required to run this script.
- JSON File of your item (examples at the end)

Instructions:

- Open up a terminal
- Type in "php item_script.php" (without the quotes)

Creating JSON File:

The format should be like this (The ordering: https://rathena.org/....28Database.29)

[26007,"Pink_Fluffy_Valkyrie_Helm","Pink Fluffy Valkyrie Helm",4,1,null,0,null,0,null,1,"0xFFFFFFFF",3,2,256,null,0,1,907,null,null,null]

NOTES:
- If the value is NULL, type it in small letters
- Use quotes on string values.
- Do not add comma on each line.

 

Download:

https://rathena.org/board/files/file/3453-tool-item-db-automation/

 

Any questions regarding my script are welcome. I'll try to add more features soon including editing and deleting if I'll have the time.

Hope you like my tool! As this make it easier for me.

 

Changelog

Version 1

- First release.

 

Version 1.1

- Added prompt in case you changed your mind.

- Improved checking of empty line in JSON file.

 

Version 2

- Added function to generate client-side resource files from the same JSON file (idnum2itemdisplaynametable, idnum2itemresnametable, etc.)

- It will either create a new file or append your current file if present.

Note: accname.lub and accessoryid.lub is not yet added.

Edited by yepp
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3122
  • Reputation:   1614
  • Joined:  03/26/12
  • Last Seen:  

 

NOTES:

- If the value is NULL, type it in small letters

- Use quotes on string values.

 

 

You could parse the values where NULL could be expected through strtolower(); (if ($string === "NULL"){$string = strtolower($string);} ) and use string check functions (or regex if you like) to ensure strings are encased in quotes.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  26
  • Reputation:   2
  • Joined:  05/29/16
  • Last Seen:  

 

 

NOTES:

- If the value is NULL, type it in small letters

- Use quotes on string values.

 

 

You could parse the values where NULL could be expected through strtolower(); (if ($string === "NULL"){$string = strtolower($string);} ) and use string check functions (or regex if you like) to ensure strings are encased in quotes.

 

 

I may try that one time. Cool. Thanks for the suggestion! Currently not in the mood for some mod xD

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  26
  • Reputation:   2
  • Joined:  05/29/16
  • Last Seen:  

Still waiting to get approved :D

Share your experience or problems with my tool :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  26
  • Reputation:   2
  • Joined:  05/29/16
  • Last Seen:  

New version uploaded! It can now generate client-side files (accname.lub and accessoryid.lub are not included tho). Enjoy!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  68
  • Reputation:   1
  • Joined:  06/21/14
  • Last Seen:  

New version uploaded! It can now generate client-side files (accname.lub and accessoryid.lub are not included tho). Enjoy!

why i cant download the file? any other link?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  26
  • Reputation:   2
  • Joined:  05/29/16
  • Last Seen:  

 

New version uploaded! It can now generate client-side files (accname.lub and accessoryid.lub are not included tho). Enjoy!

why i cant download the file? any other link?

 

 

What error did you got? It must be something with rathena's server. If you still can't download from here I will just upload a mirror from somewhere. Try downloading from here again first.

Link to comment
Share on other sites


  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3122
  • Reputation:   1614
  • Joined:  03/26/12
  • Last Seen:  

He can't download it because your latest version hasn't been approved yet.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

cool thanks for this!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  26
  • Reputation:   2
  • Joined:  05/29/16
  • Last Seen:  

cool thanks for this!

 

No problem :) Just tell me what can make this better if you have something in your mind.

Link to comment
Share on other sites


  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3122
  • Reputation:   1614
  • Joined:  03/26/12
  • Last Seen:  

You could parse the values where NULL could be expected through strtolower(); (if ($string === "NULL"){$string = strtolower($string);} ) and use string check functions (or regex if you like) to ensure strings are encased in quotes.

Also, when you upload a new version, remove the previous one otherwise you get presented with all previous versions to download. Previous are already stored on the forums by default, so you can remove the others in the list when uploading a new file.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  206
  • Reputation:   11
  • Joined:  12/06/11
  • Last Seen:  

Can you just provide attachment for it with the latest update?

Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  26
  • Reputation:   2
  • Joined:  05/29/16
  • Last Seen:  

index.php?app=downloads&module=display&section=screenshot&id=3453

File Name: [TOOL] Item DB Automation

File Submitter: yepp

File Submitted: 07 Jun 2016

File Category: Server Managers/Editors

Content Author: yepp

Requirements:

- PHP version 5.4 and up is required to run this script.

- JSON File of your item (examples at the end)

Instructions:

- Open up a terminal

- Type in "php item_script.php" (without the quotes)

Creating JSON File:

The format should be like this (The ordering: https://rathena.org/wiki/Custom_Items#Structure_.28Database.29)

[26007,"Pink_Fluffy_Valkyrie_Helm","Pink Fluffy Valkyrie Helm",4,1,null,0,null,0,null,1,"0xFFFFFFFF",3,2,256,null,0,1,907,null,null,null]

NOTES:

- If the value is NULL, type it in small letters.

- Use quotes on string values.

- Do not add commas on each line.

Questions? Ask here: https://rathena.org/board/topic/106186-tool-add-items-to-database-easily/

Click here to download this file

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...