Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Ekaterin
Newbie


Joined: 17 Aug 2006
Posts: 9

PostPosted: Thu Aug 17, 2006 9:52 pm   

Scripting Item details to MS Access
 
I'm sure someone has already done this. I want to capture information on items in Materia Magica and store it (I'm happy to shove it all into a text file for later processing, however if someone has already written it to grab it all and shove it in an Access DB all the better)

Format is something like:

Item 'a friar's lantern' is type light, alignment 0, made of unknown-alloy,
has keywords 'friar lantern'.
This item weighs 0 stones and 20 pebbles, and is valued at 500 gp.
This level 5 item has the attributes: identified
A friar's lantern is in excellent condition.
This light source will last for another 50 minutes.
*This item may be repaired 7 more times.

Format changes for each item.

Any assistance welcomed.
Reply with quote
edb6377
Magician


Joined: 29 Nov 2005
Posts: 482

PostPosted: Thu Aug 17, 2006 11:41 pm   
 
THis has been done and you are better off using the zmud database already included with the software or writing it to text file although you can export it to and ODBC source.

There are ways to export it into a database i already do this automatically with my rooting scripts and 95% of my other scripts for administrative functions for the clan system.

This is an example of the ship location tracking system i use in the game to track everyones ships. It merely requires you to setup an ODBC connection to your mysql server or access file etc. basically anything. Mines for mysql. This is just to give you an idea.

You will need to research and develop your own system. A few of us in game have item loggers and use them for our websites to track the auction channel and autoadd anything new. However each format is a bit different as you said because the format changes for each item. This locator will give you a basic example of taking data from MM and adding it to a mysql database.

*** NOTE REALIZE THAT IF YOUR DB OR ACCESS FILE DIES IT WILL ERROR OUT ALL OVER THE PLACE AND YOU WONT BE ABLE TO PLAY UNTIL YOU RECREATE IT OR DISABLE IT SO I RECOMMEND MAKING AN ON OFF SWITCH FOR THE CLASS***

FOR MYSQL ODBC you will need a connector

http://dev.mysql.com/get/Downloads/MyODBC3/mysql-connector-odbc-3.51.12-win32.msi/from/http://www.stathy.com/mysql/

Root counter and adjustments - http://mminfo.homeip.net/misc.php?action=roots (I cant show you the administrative view because its well admin protected but this will give you an idea what we do here)

i.e. ship locator - Example output ( http://mminfo.homeip.net/maploc.php ) green - moving red-anchored and grey - inactive within last 10 minutes or so.

Code:

#CLASS {ShipLocator} {disable}
#ALIAS myInit {#VARIABLE myConn "";#VARIABLE myConn %comcreate( "ADODB.Connection");#VARIABLE myConn.ConnectionString @myConnStr;#CALL @myConn.Open("mminfo");#VARIABLE rs @myconn.execute(@mysql)}
#ALIAS myClose {#CALL myConn.Close;#VARIABLE myConn ""}
#ALIAS myinitpk {#VARIABLE myConn "";#VARIABLE myConn %comcreate( "ADODB.Connection");#VARIABLE myConn.ConnectionString @myConnStr;#CALL @myConn.Open("mminfo");#VARIABLE rs @myconn.execute(@mysqlpk)}
#VAR mySQL {UPDATE shiploc SET xpos = @xpos, ypos = @ypos, state = '@state', lastupdate='@lastupdate', wind='@wind' WHERE captain = '@name'}
#VAR myConn {<OLE object: ADODB.Connection>}
#VAR xpos {} {}
#VAR ypos {} {}
#VAR state {Anchor} {Anchor}
#VAR lastupdate {} {}
#VAR wind {} {}
#VAR xpospk {1280}
#VAR ypospk {911}
#VAR mySQLpk {INSERT INTO xmb_shiplocpk (xpospk,ypospk,locid) VALUES(@xpospk,@ypospk,@xpospk@ypospk) ON DUPLICATE KEY UPDATE xpospk=@xpospk}
#TRIGGER {^~(*hull%s*dir%s(*)%s(*)wind%s(%d),(%d)~)%s$} {#VARIABLE state %1;#IF (%2 = '--') {#VARIABLE wind no} {#VARIABLE wind %2};#VARIABLE xpos %3;#VARIABLE ypos %4;#VARIABLE lastupdate %time( aaa mmm dd hh:mm:ss yyyy);myinit;myclose}
#TRIGGER {^~[SPK~]~(*hull%s*dir%s(*)%s(*)wind%s(%d),(%d)~)%s$} {#VARIABLE state %1;#IF (%2 = '--') {#VARIABLE wind no} {#VARIABLE wind %2};#VARIABLE xpos %3;#VARIABLE ypos %4;#VARIABLE lastupdate %time( aaa mmm dd hh:mm:ss yyyy);#VARIABLE xpospk %3;#VARIABLE ypospk %4;myinit;myinitpk;myclose}
#TRIGGER {^~[MAIL~]~(*hull%s*dir%s(*)%s(*)wind%s(%d),(%d)~)%s$} {#VARIABLE state %1;#IF (%2 = '--') {#VARIABLE wind no} {#VARIABLE wind %2};#VARIABLE xpos %3;#VARIABLE ypos %4;#VARIABLE lastupdate %time( aaa mmm dd hh:mm:ss yyyy);myinit;myclose}
#CLASS 0


ebaptist a.k.a. Tamlin
_________________
Confucious say "Bugs in Programs need Hammer"
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net