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
Elcyion
Newbie


Joined: 28 May 2002
Posts: 1
Location: Australia

PostPosted: Tue May 28, 2002 2:29 am   

Tryin To Develop This Code
 
Hiya, this is my first time post so forgive any flaws in my conventions.
Im trying to develop a window that keeps constant track of a characters inventory, after this is done i might link the inventory to a database for each item.

This some of the suedocode i've developed so far for the different scripts required

Parts Involoved:
101 Variable
-> 50 Items, @InvA Where A is a number from 1 to 50
-> 50 Contents, @InvCA Where A is a number from 1 to 50
-> 2 Temps, @Temp1 and @Temp2

1 Screen: Inven

Inventory Updator Scripts:

Get (From Ground) Script


On trigger {You Get %1 %2.} {
@Temp1 = %1
@Temp2 = %2
If @Temp1 = Integer Then
For A = 1 to 50
If @Inv(A) = "" Then
@Inv(A) = @Temp2
@InvC(A) = 1
Else
If @Inv(A) = @Temp2 Then
@InvC(A) = @InvC(A) + @Temp1
End
Else
End If
End If
Next A
Else
For A = 1 to 50
If @Inv(A) = "" Then
@Inv(A) = @Temp2
@InvC = 1
End
Else
If @Inv(A) = @Temp2 Then
@Inv(A) = Inv(A) + 1
End
Else
End If
End If
Next A
End If


Well Thats The First Of My Four SeudoCodes Developed So Far.
If anyone would know a way of altering them to fit Zmuds Script language please send me an email.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Tue May 28, 2002 11:51 am   
 
If you were given the complete script that would make this happen, you would never be able to maintain such code later on. I will then point you in the direction of help topics that should give you what you need to do this in zMUD.

First, you need to read the Introduction to Triggers topics. This is a must. Also, read about expression and wildcard characters, which is linked from this topic. Another required reading is Introduction to Variables. Introduction to Multiplaying will give you what you need for displaying that stuff in another window.

Now, you may wish to do this using the 102 variables you mentioned, but this may be easier by using stringlists which are a kind of array. If you wish to go through this route, try looking for stuff on stringlists in the help file.

Finally, look at the help entries for the following commands: #LOOP, #IF, and #ADD. Also look at the functions: %integer and %null.

Kjata
Reply with quote
GiriFox
Wanderer


Joined: 25 Sep 2001
Posts: 59
Location: Australia

PostPosted: Tue May 28, 2002 11:58 am   
 
I couldn't find the 'introduction to multiplaying' support file you mentioned. Where is it located?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue May 28, 2002 1:54 pm   
 
From the Help Contents, it's under Getting Started. From the Index, it's under multiplaying.

LightBulb
Vague questions get vague answers
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