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
Marcos
Beginner


Joined: 30 Jan 2003
Posts: 14
Location: USA

PostPosted: Tue Apr 29, 2003 4:53 pm   

Data Tables in 6.4
 
Here's what I'd like to do. I want to create a table wherein I put the spell name, offensive/utility, targetted/nontargetted, and quickcast name of the spells I know.

Also, how would I access, add-to, delete from this table?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Apr 29, 2003 9:13 pm   
 
This is all covered in the helpfiles, in the Introduction to the Database section. You reach it from the Contents page.

LightBulb
Advanced Member
Reply with quote
Marcos
Beginner


Joined: 30 Jan 2003
Posts: 14
Location: USA

PostPosted: Wed Apr 30, 2003 4:52 am   
 
okay...but how do I access it from the mud (ie Return a value based on mud input)

basically something like:

DarkMagic says, "spell detect invis"

that would sort my db and come up with the closest match to %2 and cast it on %1 where the pattern would be:
(%w) says, "spell (*)"
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Apr 30, 2003 6:49 am   
 
Oh, you want something for OTHER people to look at. You don't need a database for that. Just put it in your description or other personal descriptive file, using whatever editing tools your MUD provides.

As for the action itself, just use a trigger.
#TR {(%w) says, "spell (*)"} {cast '%2' %1}

I won't do a full bot-script for you. Someone else might though, if you provide enough information.

LightBulb
Advanced Member
Reply with quote
Marcos
Beginner


Joined: 30 Jan 2003
Posts: 14
Location: USA

PostPosted: Thu May 01, 2003 2:33 am   
 
Well, there are some spells I don't want cast upon others, such as offensive spells...which might get me killed :::)

I had a trigger setup where I had one trigger for each spell, but I don't want to do that...I want a single trigger to compare against some var/db find the closest match and cast (like Sorcerer Globe, one could say 'spell s g' and I'd still cast sorcerer globe on them since there is no other spell with the initials of 's g'
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu May 01, 2003 5:28 pm   
 
IMHO the one trigger/one spell setup is the best for this, since it gives you complete control over which spells you will cast and which ones you won't. Otherwise, you'll have to check every spell request against a list of permitted/forbidden spells to decide whether to cast it.

What you want is a lot of work. I won't do it for you.

LightBulb
Advanced Member
Reply with quote
Marcos
Beginner


Joined: 30 Jan 2003
Posts: 14
Location: USA

PostPosted: Fri May 02, 2003 4:28 am   
 
all I want to know is how to access a db from a trigger/alias/macro
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Fri May 02, 2003 5:18 am   
 
quote:

This is all covered in the helpfiles, in the Introduction to the Database section. You reach it from the Contents page.

LightBulb
Advanced Member



Database Variables
..
#VAR VarName ""
#ADDKEY VarName Name1 Value1
#ADDKEY VarName Name2 Value2
etc

So I'd do something like
#VAR SpellList ""
#ADDKEY SpellList Offensive {fireball|lightning|unpaid bills}
#ADDKEY SpellList Utility {tie shoelaces|sanctuary|detect bugs}
#ADDKEY SpellList Targetted {detect bugs|unpaid bills|tie shoelaces}

Get your programming intro book or Google(tm) for a search routine that yields a search match you like or add keys for the lazy people.

Checking a key of a database variable can be done like:
%ismember("fireball",@SpellList.Offensive)

Changing the variable of a database variable can be done like:
#ADDITEM SpellList.Offensive {noxious cloud}


Ton Diening
Reply with quote
Marcos
Beginner


Joined: 30 Jan 2003
Posts: 14
Location: USA

PostPosted: Fri May 02, 2003 11:41 pm   
 
Woot! Thats what I was looking for...somehow I couldn't find it in the helpfiles, thanks tom!
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