Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #16  
Old 12-10-2009, 03:34 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
A query generator would be cool too.

I.e: Select a few columns from a few tables, and so on.. click Generate Query.

PHP Code:
// Generated Query
function getQuery() {
  return 
"
    SELECT column
    FROM table
    WHERE condition = query
  "
;

__________________
Quote:
Reply With Quote
  #17  
Old 12-10-2009, 06:10 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
NPCserver update: the next uploaded npcserver will include a new script command bool sqlitedefragment(host) for defragmenting and reducing the file size (host=="" for default database). May be there could a file panel or so where you see the database size and a button for optimizing it.
Reply With Quote
  #18  
Old 12-10-2009, 07:02 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Just seeing the database size would be very useful. Nice addition to hear of, though, Stefan
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #19  
Old 12-10-2009, 08:43 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Sorry for the double post. There seem to be SQL errors every now and then, such as this:
Quote:
SQL Explorer Error: near ",": syntax error
Query: CREATE TABLE 'testitems' ('foo' TEXT DEFAULT '', 'bar' REAL DEFAULT , 'baz' INTEGER DEFAULT )
Also, it seems you can't insert rows through the GUI without there already being existing rows.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #20  
Old 12-11-2009, 12:02 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
All good ideas, I'll try to update it over the weekend. Stefan: is there any advantage to the scripted functions as opposed to just calling "VACUUM"?

Quote:
Originally Posted by coreys View Post
Sorry for the double post. There seem to be SQL errors every now and then, such as this:
There shouldn't be single quotes around the column names... it's adding those by itself? Strange.... I'll fix that.

Quote:
Also, it seems you can't insert rows through the GUI without there already being existing rows.
This is true, I'll fix this as well.
__________________
Reply With Quote
  #21  
Old 12-12-2009, 11:59 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
I've added quite a few things to the new version, mostly bug fixes, but also some other stuff. I went to add the database information, but ran into a wall: ".db" isn't one of the extensions the NPC-server can manipulate, which means I can't read the file size. I mentioned this to Stefan a few weeks or so again, so he may have fixed it in the new NPC-server, but I'm not sure. Until then, I'll leave it out (psst Stefan, would be great if you could fix it and let me know).
__________________
Reply With Quote
  #22  
Old 12-13-2009, 01:33 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Quote:
Originally Posted by cbk1994 View Post
I've added quite a few things to the new version, mostly bug fixes, but also some other stuff. I went to add the database information, but ran into a wall: ".db" isn't one of the extensions the NPC-server can manipulate, which means I can't read the file size. I mentioned this to Stefan a few weeks or so again, so he may have fixed it in the new NPC-server, but I'm not sure. Until then, I'll leave it out (psst Stefan, would be great if you could fix it and let me know).
This was updated to the original post, I assume?
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #23  
Old 12-13-2009, 01:45 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by coreys View Post
This was updated to the original post, I assume?
No, sorry... didn't mean to make it sound like I'd already released it. I'm still adding the filtering, will probably release it later tonight or tomorrow.
__________________
Reply With Quote
  #24  
Old 12-18-2009, 04:26 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Sorry for the delay, updated to version 2.0; see first post (thanks again Tig)

Changelog:
  • New Features and Enhancements
    • The "n" key now toggles instead of opening
      • Addition of the "TOGGLE_KEY" constant to change what key toggles the window (default "n"); see the clientside portion
    • Right-click a tab for a menu to refresh the table or to close the tab
    • You can now right-click the column headings to insert rows, letting you insert columns into empty tables.
    • You can now sort columns by double clicking. Double click once to sort ascending, double click again to sort descending.
    • You can now filter tables with various modes such as "contains", "=", and "LIKE", right from the table view.
  • Fixes
    • Updated inaccurate title of "Tables" tab - used to be called "Databases" (oops)
    • Fixed the auto increment feature in table creation
    • Fixed a problem with table creation when leaving "Default" blank and selecting REAL or INT (now sets it to '0' if not specified)
    • Removed single quotes around columns when creating tables with the GUI and when adding columns with ALTER TABLE.

I'll release an updated version with database statistics when the new NPC-server is released.

Filter:


Sort:
__________________
Reply With Quote
  #25  
Old 12-18-2009, 05:21 AM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Nice, you implemented my suggestions.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #26  
Old 12-18-2009, 05:58 AM
TSAdmin TSAdmin is offline
Forum Moderator
TSAdmin's Avatar
Join Date: Aug 2006
Location: Australia
Posts: 1,980
TSAdmin is a splendid one to beholdTSAdmin is a splendid one to beholdTSAdmin is a splendid one to beholdTSAdmin is a splendid one to beholdTSAdmin is a splendid one to behold
This is great. Well done, Chris. Rep++
__________________
TSAdmin (Forum Moderator)
Welcome to the Official GraalOnline Forums! Where sharing an opinion may be seen as a declaration of war!
------------------------
· User Agreement · Code of Conduct · Forum Rules ·
· Graal Support · Administrative Contacts ·
Reply With Quote
  #27  
Old 02-27-2010, 06:44 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Updated to version 2.1, thanks Supernanny. Here are some of the changes:
  • Support for multiple databases for browsing, manipulating, and SQL execution. For information on adding databases see this thread. See the note below about adding databases to the list.
  • Added a "toggle external window" button to toggle between internal and external windows. It remembers your preference for how to display the windows for next time. This only works with v6 clients.
  • Changed the tables tab to instead show the structure of the configured SQL databases on the server; it works the same way, though.
  • Fixed the max loop limit problem with the execute SQL tab.
  • Closing tabs now works with v6 clients by right clicking tab.

Mostly minor improvements besides the change for multiple databases.

Right now there's no way to dynamically get a list of configured databases, so you will have to maintain the list yourself. There's a list with the default configuration near the top of the script. Add any additional databases there and you'll be good to go. The file of the database isn't used yet but will be in the future (probably).
Attached Thumbnails
Click image for larger version

Name:	Picture 001.png
Views:	325
Size:	54.9 KB
ID:	50477   Click image for larger version

Name:	Picture 002.png
Views:	321
Size:	34.3 KB
ID:	50478  
__________________
Reply With Quote
  #28  
Old 02-27-2010, 06:46 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Fantastic job, nice seeing things updated.
Reply With Quote
  #29  
Old 02-27-2010, 06:50 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
This is an excellent tool.
__________________
Reply With Quote
  #30  
Old 03-28-2010, 10:31 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Hmm, I seem to be having some problems deleting a row from a table, I used the exact same code as you have posted but it seems to not find the table correctly... any suggestions?
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:07 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.