Friday 24th November 1995 Coding Lecture 8 ---------------- The doors part so you can enter the Auditorium. Carlin Auditorium You are catapulted back into the late 20th century as you step through the double doors and into the dimness of the back of the Auditorium. As your eyes become accustomed to the lacklight, you begin to appreciate the beauty of this unique Terran decor. More than 200 seats, divided by two wide aisles spread over the main floor. An overhanging balcony provides additional seating. Three luxurious private boxes, obviously for visiting dignitaries, are visible on either side of the expansive walls. Thick red and gold carpeting covers the floor. All seating is upholstered in plush red velvet, a common covering for the era that is being depicted here. Two large gold pillars stand like silent sentinels on either side of a stage that spans the full width of the room. The only hint that you are still in your own time are the three familiar flags; Starfleet, Federation, and that of Starfleet Academy that stand proudly on the left side of the stage. Contents: Final Test Section Obvious exits: Out Yale has arrived. Yale enters from the Quad. Siond has arrived. Siond enters from the Quad. Yale says "Sir, is the coding lecture here?" Mark_Farrell nods. Dropped. You say "Alright, I don't know how much coding you know, or what you want me to cover today." Mark_Farrell looks at Yale. Yale snaps to attention. Yale says "SIr?" Mark_Farrell sighs and says explicitly "How much coding do you know, and what do you want me to cover. Siond says "Well the thing I wonder about is how to check list and how to code in good algoritems ." You say "Ground rules are that I run these sessions informally." Siond says "muse code algoritmes , that is" Yale says "One thing I want to know is how to make my object interact with the hu++ humans" Mark_Farrell nods. Yale says "I can't get my object to repond ++(can't erase)responf" Yale says "sorry" You say "Okay, so we have basic $ and ! commands, and some discussion of better ways to do things, and list processing." Yale says "I can't make my object respond to commands that are typed by the user" You say "Okay. Lets cover basic interaction quickly." You say "You understand registers, @commands and functions I presume?" Yale says "The commands?" Mark_Farrell nods. Yale says "Yes" You say "Right." Yale wonders how to get more building quota. You say "Interaction is done in a few ways. There are specific registers that are triggered by events such as the object being dropped, picked up, looked at." You say "Eg, @drop, @adrop, @odrop are all related to what happens when an object is dropped." Yale nods You say "These special registers tend to appear in these sets of 3 - for respectively - the message sent to the person dropping the object, @command you want doing if the object is dropped, and the message sent to objects other than the one that did the dropping" You say "So, let me code an example onto the WiP" Mark_Farrell will use @drop/@adrop and @odrop Siond says "is there a way to pemit to all but the enactor too ?" Mark_Farrell nods. You say "@oemit" You say "Generally the sets of 'doing' functions come in 3 varieties too." Siond whispers "thanks" Yale dropped Patty. You say "So I've set Wip/drop: Hey - careful when you put me down." You say "So I've set Wip/adrop: :shakes and nearly falls apart." You say "So I've set Wip/odrop: throws the WiP onto the floor with excessive violence" Taken. Mark_Farrell picks up the WiP Mark_Farrell drops the WiP Hey - careful when you put me down. WiP shakes and nearly falls apart. Yale says "How did you do that with the @drop?" You say "You should both have seen the 'Hey - careful when you put me down.' and 'MNark_Farrell throws the WiP onto the floor with excessive violence'" Siond says "? Hey - careful when you put" Siond says "shouldn't you seen that ?" You say "Okay - Let me cover the mechanics of this now." You say "yes, Siond - sorry - you should have seen WiP shakes and nearly falls apart." Mark_Farrell copied the wrong line out. Yale Yale throws Patty onto the floor with excessive violence. You say "So the @drop is shown to only me - that is 'Hey - careful when you put me down.'" Siond nods "and shall try to keep her mouth shot" You say "The action - @adrop is done, and the results are dependant on the commands set in there." You say "In this case ':shakes and nearly falls apart.'" You say "So, the WiP posed 'shakes and nearly falls apart.'" You say "And everyone in the location sees the WiP pose." Yale says "And @adrop, everyone in the room can here it?" You say "I could have set the @adrop to be an @oemit, or an @pe, or whatever. The results depend only on the actions the code specifies." You say "Finally, the @odrop is shown to everyone in the location the WiP arrived in, except the object/person who did the dropping." Yale says "Did you use @drop, and @adrop, and @odrop in that case?" Mark_Farrell nods. You say "Do: 'examine wip/drop' 'examine wip/odrop' and 'wip/adrop'" Drop:Hey - careful when you put me down. Adrop::shakes and nearly falls apart. Odrop:throws the WiP onto the floor with excessive violence You say "Those are the commands that I used." Yale says "Did patty wi work earlyer.. earlier?" Mark_Farrell nods. Yale says "Sir?" You say "Okay - so you are happy about how and why those registers do what they do?" Yale says "yes" You say "Siond?" Siond says "yes" Yale says "Okay, like this??:" Yale Yale throws Patty on the floor. Yale says "IS there a @get or something??" Mark_Farrell nods. You say "@succ" You say "And @osucc, and @asucc." You say "To be honest, @succ and @drop mean slightly different things depending on what type of object they are defined on." You say "You can read the 'help @' for more details." You say "Right." You say "The second major way to interact with objects is through ! and $ commands." You say "Basically - @va object=$://" Yale says "Can you make your object say what the object wants the user to type?" Huh? (Type "help" for help.) You say "The // is optional" Yale says "What does that do?" Yale says "The /lock function/" Yale Yale throws Patty on the floor. Yale Yale pushes a button. Yale says "????" You say "It is a way to restrict who can use that command on a per-! or $ command basis - instead of globally with @ulock" Yale says "Can you give me an example?" Mark_Farrell nods. Yale says "Of the coding line." Siond says "what do you put in db numbers or a true /false ?" You say "Take a look at 'examine wip/vs'" You say "That's a basic command without a register lock." You say "The register lock takes either a list of DB# separated by |, or a function returning true or false." Yale says "What does it do?" You say "Just like any other lock." Yale says "here-oops" You say "Vs basically looks to see if you typed 'pwd unlock' or 'pwd open' and gives you one of two messages" You say "Try it and see." Yale says "What does this lock protect?" You say "Nothing. It's a demo function." You say "If you looks at Vs again you should see the only @command is the @pe (short for @pemit)" Yale says "Hw" You say "hw?" Yale says "How can I do this example??::Patty is scared, type calm patty." You say "Well, first off, you need to have some trigger for patty to _be_ scared." Yale says "And when the user types 'calm patty' patty repons++ t+ reponds with a pose" Yale says "@va?" You say "Okay - lets take the second bit first." Yale says "can I have multipul;;CAN'T ERASE TYPOS!!! AHHH!" You say "@va patty=$calm patty:pose is soothed by Mark_Farrell." You say "@va patty=$calm patty:pose is soothed by %N." You say "%N (as demonstrated) is replaced by the name of the enactor." Yale says "How can you make patty say patty is scared, type calm patty?" You say "Okay - as I said, you need to have some event trigger that response." Yale nods You say "It is _not_ a good thing for her to say it over and over and over." You say "Okay - decision time - what event do you want to make her scared?" Yale says "It's like when patty is soothed" Mark_Farrell nods. Rusty has arrived. Rusty enters from the Quad. You say "The most straightforward case is:" Rusty says "Hiya..." *Mark_Farrell* Lieutenant JG Siond is looking at you. Yale says "When someone ...No,...Yes, when patty is g..no..When someone is trying to pick he up" You say "@vb patty=$scare patty:pose cowers away. Type 'calm patty' to sooth her." Yale says "Bu" Yale says "Oh" You say "Okay. Now, to do it when she is being picked up:" You say "Firstly, we need to prevent her being picked up." Yale says "lock her?" Rusty says "What are we talking about???" Mark_Farrell nods at Rusty "Evening." You say "That's right, Yale." Yale says "" You say "Yuo need to @lock her to the people who are allowed to pick her up." Yale says "Patty is a cat, just for the record" Mark_Farrell nods. Yale says "locked" You say "Probably 'hisses and spits' is better than cowers away then :-)" Rusty :) You say "Okay - now the event that is triggered when you fail to pick up an object is imaginatively named @fail" Rusty says "Can you lock to more than one person???" You say "And has associated '@ofail' and '@afail'" Mark_Farrell nods at rusty. Rusty whispers "How?" You say "Simplist case: @lock object=#1|#2|#3|#4...." You say "The | indicates 'OR'" Yale Yale throws Patty on the floor. Yale Yale pushes a button. You say "There is help available on locks under 'help locks'" Yale says "@lock patty = me to lock her?" Siond says "is this lock valid ? *siond|rank:>12" You say "The allows you to pick her up, but nobody else, yes." You say "Siond - yes, I believe so." You say "I have to say that I tend to use functions in locks though." Siond says "how should it be then ?" Rusty says "Is there anyway to let someone else code an object w/o @chowning it???" You say "@lock object=[member(list of db#,v(#))][gt(rank(v(#)),12)]" You say "Rusty - nope." Rusty says "drats" Siond says "ok" Mark_Farrell also notes that for simple locks, using | is better (but most locks I code are excessively ugly and big) Siond says "insteed of db# can I just *" You say "Eg, checking for a players organization, exceptions, etc." Mark_Farrell nods. You say "You should use the db# though, because it is less work for the game to do." Siond smiles "Ok" You say "Basically, everytime you use *Name, the muse has to turn it into #db at run time." *WiP(Mark_Farrell)* > Rusty types holleod. The value returned is 'The of '. You say "If you do that step yourself, there's less for the game to do." Rusty says "What hte???" Rusty says "Less lag..." Yale Yale throws Patty on the floor. You say "Rusty - you just triggered a command on the WiP." Plant has arrived. Plant enters from the Quad. Siond says "ok, thats just that sort of thing I'd like to know." Patty purrs at Yale Locked. Rusty says "I know...what does it do???" Plants Majic Box has arrived. Plant dropped Plants Majic Box. You say "I can mail you lecture 2 (or it may be 3) where that was coded and discussed." Plant Sits on ithis box Yale says "How" Yale says "How do you clear @va?" You say "Evening Plant." Rusty says "How would you make a macro to FORWARD +mail???" You say "Just '@va object'" Rusty says "Using @va" Plant says "Hi Mark_Frrell" You say "You don't - you do it with email :-)" Rusty says "But how..." Siond says "And you shouldn't use macros." You say "Storing lots of text on the game is anti-social." Plant says "Farrell even.. sorry" Plants Majic Box has left. Plant dropped Plant's Confy Chair. Plant Sits on his Chair You say "Okay - if you want to +mail lots of people at once:" Rusty says "NO..." You say "You would use an @dolist" You say "If you want to bounce mail on - you use a decent terminal and cut + paste :-)" Rusty says "I want to take a piece of mail I have and send it to someone else w/o retyping it" You say "Can't do that with a muse command." Rusty says "I can't get a decent terminal to work on my sys" You say "You get to practise typing then, Rusty." Rusty says "I know...I want to make a macro..." You say "You can't - because there isn't a function or command to retrieve the text of a +mail message,." Mark_Farrell wonders if he's said 'no' enough times yet :-) Plant says "hmm" Rusty says "Drats" Plant's Confy Chair has arrived. Rusty dropped Plant's Confy Chair. Rusty says "heheh" Rusty :) Rusty says "Lock it next time" Rusty says "Mark, can you change @quota's??" You say "Okay - so we were covering $ and ! commands." Mark_Farrell grins. "Directors only Rusty, and you need a good reason." Rusty says "Shoot" Rusty can never find a Director when he needs one You say "Everyone happy now with the basics of setting up a $ command to recognize a typed command?" Siond nods Rusty says "Yes" Locked. You say "Okay - the register lock is a straight forward extension of the basic principle." Rusty says "Reg lock?!?" Yale Yale pushes a button. Yale Yale throws Patty on the floor. You say "A simple example: @va object=$test:/0/@emit The command was executed" Patty playsaa *Rusty* don't don't double pose Patty playsaa You say "The register lock : /0/ is always false" Yale Yale pushes a button. Rusty says "Can I lock a $ command to work only with me?" You say "So, even if I type 'test', nothing is going to happen." You say "If we move up the scale slightly, and use /#db1|#db2/ then only the objects whose numbers are db1 and db2 can use the command." Siond says "1" Rusty says "Laura and Gene???" Siond says "0" You say "Basically a register lock functions in exactly the same way as an exit lock, but restricts a command, not a doorway." Siond says "0 is false and 1 is true ?" *Mark_Farrell* TIME:Fri Nov 24 19:18:43 1995. STARDATE: 95896.7 You say "db1 and db2 are just generic labels I use as examples." You say "0, #-1 or a null string is false." Rusty says "Can I lock a $ command to work only with me...???" You say "Anything else is true." Mark_Farrell is coming to that rusty. You say "The specific case of locking to yourself : /#db/" You say "There #db is your own database number." Siond nods You say "For instance: Rustys is #8731" Rusty whispers "How do you know???" Siond says "how do you find that out ?" You say "To find the number of an object in your location, use whisper me=[num(object-name)]" You say "As a general rule, whenever you can, always use a database number to perform actions from." Siond says "so your db# is 16055 ?" You say "Anything else means the muse does more work turning a name into a db# before it can do the command." You say "That's right Siond." You say "So - for instance, I expect some of you know that @pe %#=... is better than @pe %N=...." Mandor has arrived. Mandor enters from the Quad. Mandor nods Yale Yale throws Patty on the floor. Siond says "ok.." Yale says "sorry" You say "The reason is that %# -> a db number directly, while %N goes to a name, and then the muse does the extra step of name->db#" Patty hides from Yale. Type calm patty. Siond understands. You say "Evening Lieutenant." Yale Yale pushes a button. Mandor says "Good Evening" Yale says "Sir, I need help on patty" Mandor says "Having a good time" You say "Okay Yale, what's the problem?" Mark_Farrell smiles at Mandor. "Always" Plant is bleeding from the mouth Mandor says "Good" Mandor says "Ill let you be then" Yale says "It only allows me to do one @va patty = $etc,,.. It only reponds to the newest @va. It ignores the rest" Mandor waves Mandor leaves the Auditorium. Mandor has left. You say "Right." You say "@va is a single register." Yale says "reponds = responds" You say "You need to put other commands into @vb, @vc...." Yale says "???" You say "You have @va->@vz, @wa->@wz and @xa->@xz" You say "So, @va object=$:........" You say "Then @vb object=$:......." Yale says "so first one @va, and @vb...?" You say "And so on." Yale says "Thanks" Norm has arrived. Norm enters from the Quad. Rusty says "doh" Norm quietly takes a seat Rusty says "Use vb and vc" You say "Right. So we have covered a little bit on register locks." Yale says "vd?" Rusty says "Everytime you use va...it overwrites the previous" Rusty says "Up to vz" Yale says "is there vd, ve??" Mark_Farrell nods Rusty says "and wa-wy" Yale says "Thanks!!" Rusty says "and xa-xz" Rusty says "NOT WZ" Mark_Farrell chuckles. "Aye - WZ holds your academy details. Norm says "That's for administrative uses, right?" Rusty says "Yes" Rusty titles it "The Art Of Self-Promotion" Yale Yale throws Patty on the floor. You say "Okay - so were there any questions on register locks?>" Yale says "does it say type Play patty?" Rusty says "Yes" Yale Yale pushes a button. Norm grins Rusty says "yale-no" Yale says "What?" Yale says "Does?" Yale says "It?" Yale says "Say?" Rusty says "What do I type to lock a $ command to me?" You whisper-posed Yale with "Mark_Farrell tries to keep the floor fairly clear - you can experiment later.". Rusty says "yale-That you threw it on the floor" Yale says "and?" You say "A simple example: @va object=$test:/#/@emit The command was executed" Rusty says "yale-that's it" Yale says "" Norm says "so the /'s add locks?" Mark_Farrell nods. Norm says "ok" Norm whispers "Can I ask what we're doing?" Norm whispers "Or is it a free-for-all?" You say "Basically - @va object=$://" Yale leaves the Auditorium. Yale has left. You whisper-posed Norm with "Mark_Farrell is trying to cover $ and ! command - basically ways to trigger object events.". Runabout has arrived. Norm whispers "Ok, thanks." Yale has arrived. Yale enters from the Quad. You say "The // is optional." Yale leaves the Auditorium. Yale has left. Rusty says "plant, type run o" Yale has arrived. Yale enters from the Quad. Norm nods Rusty says "please" Rusty says "Or anybody else" Norm says "??" Huh? (Type "help" for help.) Mark_Farrell recieved a 'huh', rusty. Rusty says "GREAT" Plant is cleaning up his blood Norm says "same here, you coded it?" Rusty says "Thanks...That's my new drive command" Rusty says "Yes" You say "Okay - so, to lock individual commands you can use a register lock." You say "To lock an entire object, you can set the @ulock register." Rusty says "Please explain @ulock" You say "This operates in the same way as a register lock, but is checked before the register lock." Rusty says "Help doesn't explain it" Yale leaves the Auditorium. Yale has left. You say "It is also checked for _every_ command." Rusty says "well" @ulock = Sets the use-lock for an object. Only players or things that pass the lock will be able to use $ or ! commands stored on the object. Useful for making sure that no one abuses your machines. See help on locks for an explanation of how to phrase your key. * See also: @lock, $ commands, ! Commands Norm nods Yale has arrived. Yale enters from the Quad. Yale says "Yeah!!" You say "For instance, the 'wip' has the @ulock set to '#16055' so only I can trigger commands on it." Yale says "My patty is done" Rusty says "How do I @force an object using commas???" You say "It basically effects _all_ commands on the object." Norm says "use {}'s curly brackets" Norm says "I think" You say "What exactly do you mean, rusty." Rusty says "Nope...doesnt work" Norm says "@force's don't care about commas, do they?" Rusty says "Wath...I'll make the runabout say 5 commas" Norm says "try " Norm says "[" Runabout says "start finish" Mark_Farrell waits for Rusty to explain what he means by '@force an object using commas' Norm grins Rusty says "make it say commas" Norm says "Try square brackets" Rand has arrived. Rand enters from the Quad. Norm says "some bracket does it" You say "Well, how about '@emit {,,,,}" Norm says "He wants the @force not to recognize the comma as a command-separator" Runabout says "hi hello" Rusty says "Exactly" You say "The , isn't a command separator." Rusty says "that was "hi, hello" Rusty says "Or was supposed to be" Plants Majic Box has arrived. Plant dropped Plants Majic Box. You say "You are using %0?" Norm says "DOPE!!! that's a colon, or semi-coloon, isn't it?" Plant's Confy Chair has left. Plants Majic Box says "See you later!" You say "A semi-colon, Norm." Rand leaves the Auditorium. Rand has left. Plants Majic Box says "See you later!" Rusty says "Yes" Norm says "ahh" Plants Majic Box says "i can do ,," You say "You need to use [v(0)]" Runabout says "hi, hello" Norm waves, Rusty says "there's a difference???" Norm leaves the Auditorium. Norm has left. Plants Majic Box says "See you later!" You say "Yes." Plant says "WeeWom" Plants Majic Box says "Aye Reteval start" Plants Majic Box Beeps 3 times Plants Majic Box says "Going to Plant" Plants Majic Box goes home. Plants Majic Box has left. Rusty says "I scrolled it off...say it again" Yale says "Bye!!" Mark_Farrell waves to Yale Rusty waves] Yale says "I'll be in room 203 faar..faragut hull if you need me" Yale says "Bye!!" You say "You should use [v(0)] instead of %0, Rusty." Yale goes home. Yale has left. You say "Specifically, %0 strips commas, semi-colons etc, for security reasons." Rusty says "What's bad about {v(0)] then" Rusty knows there has to be something Norm has arrived. Norm enters from the Quad. You say "Imagine: @va object=$bad *:@pe %#=%0, and you type 'bad Test;@destroy me'" Norm quietly takes his seat, again You say "Because %0 is done before the string is parsed, that becomes:" Norm grins You say "@pe #16055=test;@destroy me and both commands are queued." You say "NOT GOOD." Rusty says "computer, talk mode on" Rusty r hi, hello You say "However, because [v(0)] is only parsed after the command is split up - you have" [Phoenix] Mandor: <**> Other than that....Mom want's us for x-mas...:) You say "@pe #16055={Test;@destroy me} queued so you say 'Test;@destroy me' instead of actually doing it." Norm will have to take the logs again, I'll leave +mail. Thanks Norm moves toward the rear of the Auditorium Norm leaves the Auditorium. Norm has left. You sense you have new mail from Norm. Rusty says "computer, talk mode on" Rusty r hi, hello Runabout says "" Rusty says "Now...how do I get it to @va itself with ???" Rusty says "Like I use %%0" Rusty says "err used" Plant says "song 2" You say "@va itself?" Rusty says "NOOOOOOOOOOO" Rusty says "Yes..." Rusty says "song 1" You say "Just what does '@va itself' mean." Rusty says "It sets it's own va" Plant says "song 1" You say "Well, @va me= will do." You say "Eg, @vb me=$Test *:@va me=%0" Mark_Farrell notes that setting the entire contents of a register in this way is _bad_ You say "Security wise = someone types 'test $kill:@destroy me' then @va is $kill:@destroy me, and then typing 'kill' will delete your object." Rusty says "Yes, but I used !Rusty says "computer, talk mode on":@wk me=!Rusty r *:"%%0" Rusty says "How would I get it to use instead of %0???" You say "You would just use: !Rusty says "computer, talk mode on":@wk me=!Rusty r *:"[v(0)]"" Rusty says "{}" Rusty says "vv(0)]" Rusty says "Function (V) only expects 1 arguments" Rusty says "But it sets @wk to !Rusty r *:""" Rusty says "When you type it like that" You say "Okay, use [[v(0)] then." Rusty says "[v(0)]" Rusty says "OK" You say "Anyway - this is all getting very specific." You say "Lets move back towards the more general topics." Rusty says "computer, talk mode on" Rusty r Hi, hello Runabout says "" You say "I've said some things about $, ! commands, register locks and the ulock. Also about the builtin ways of triggering things (events like dropping, picking up etc)." Rusty says "It STILL doesn't work" You whisper "I'll give you a hand after I finish up here." to Rusty. Rusty says "computer, talk mode on" Rusty r hi, hello Runabout says "hi, hello" Rusty says "YEAH!!!!!" Rusty says "I accidently type ; instead of :" You say "Okay. So - any more questions on those topics?" Plant says "i dont know it was cluttered]" Plant smiles Runabout :) Rusty :) You say "I've said some things about $, ! commands, register locks and the ulock. Also about the builtin ways of triggering things (events like dropping, picking up etc)." Runabout says "sicdsnf, dcnf" You say "So, next topic was list handling" Runabout says "hi, test" Siond listen up *Rusty* Rusty says "brb" You say "Okay - Siond - you wanted this covered. Anything specific?" *Rusty* Rusty says "Back..." Siond says "yes, how to check list/rooms/strings and the like for spec thing in a good manner" Rusty has another question after Siond is done You say "Right." Siond whispers "how long will this lecture last ?" You say "there are basically two strategies for lists." You whisper-posed Siond with "Mark_Farrell is going to stop in 20 minutes tops.". You say "The first is to keep the data and the indexing in different registers." You say "So, for instance, if you were remembering how many chips a player has in a game of poker, you could" You say "1. Store a list of players in one register, and a list of numbers in another." You say "An alternative is to store them both in the same list." You say "So: @register object=#db1 chips1 #db2 chips2 . . ." You say "Lets take the first option as a starting point" You say "Basically we have 3 main things we need to be able to do to a list." You say "1. Add/change items" You say "2. Lookup values" You say "3. Delete items." Rusty nods Siond says "ok, if you do the first, how do you find the what number each player has in the list ? Siond farrell Plant Runabout , and I want to find what nunbers plant has ?" You say "Okay. The lookup() function is very useful." Rusty says "?!?" You say "Basically the syntax is : lookup(list 1, list 2,item,offset)" Rusty really doesn't know much MUSE coding... You say "What it does is to lookup item in the list 2, and find the position of the first matching item" You say "Then if it found one, it adds offset to this position." Rusty is already lost You say "Then you extracts the corresponding item out of list 1." Mark_Farrell codes a quick example. Siond says "what does the integer in the end do ? the offset ?" You say "The integer is useful for misaligned items." You say "Examine wip/vj, vk and vl" Siond says "ok." You say "From that you should be able to see that is you type 'list #16055' is will return A, 'list #7' will return B, etc." Siond says "is it case sensative" You say "If I made the '0' a '1' then 'list #16055' would return 'B', 'list #7' 'C' etc." You say "No." Rusty says "@un ulock it" You say "If I made the offset -1, then 'list #16055' would not index a valid entry, and would (I think) return an error message." Rusty says "So we can use it" Unlocked. Siond says "ok..." Mark_Farrell nods. "Unlocked. Vj:$list *:@pe %#=[lookup(v(vk),v(vl),v(0),0)] *WiP(Mark_Farrell)* A Rusty says "doent work..." Mark_Farrell remembers that a number of people have single letter aliases. You say "Let me avoid spoofing problems." You say "Should work now." *WiP(Mark_Farrell)* The result is: B Rusty says "It onlt works when you type list #" Mark_Farrell nods. You say "That's right." Rusty says "not list c" You say "It's a _basic_ example." You say "It matches the list in vl : #16055 #7 #2 #9" You say "Against what you type." Plant waves Plant leaves the Auditorium. Plant has left. Rusty has left. Runabout says "Gotta run(no pun intended)" Runabout leaves the Auditorium. Runabout has left. Siond says "so if the last number was -2 and I typed :list #2 it would give me A" Mark_Farrell modifies the list to index with -2 Siond says "ok.. what if the lists get too long , ie over the max for a register?" You say "Okay - then you have big problems :-)" You say "What you need to do then is:" Siond listens up... You say "[ifelse(lookup(list1A,list1B,item,offset),,lookup(list2A,list2B,item,offset)) etc" You say "So basically you do 1 lookup first, and if that fails, you look at another register pair, and so on" Siond nods "ok" You say "Because you can't easily save the result of the first lookup you do the ifelse() with, you probably need to do one of the lookup's twice." Siond nods .. Ackman has arrived. Ackman enters from the Quad. You say "Okay - do, that's how you reference items." Siond says "So I should have two lookups if I feel there is a dangers things will be to long." You say "Changing items uses the same sort of jiggery pokery -" Ackman has left. Ackman has arrived. Siond shakes her head *Mark_Farrell* Cadet Ackman is looking at you. You say "Well, 2000/7 = about 300 objects in a simple list..." Ackman stands in attention. You say "7 being the length of db# + a space" You say "At ease Cadet." Ackman leaves the Auditorium. Ackman has left. You say "You do a 'member()' on the first list to find the index of the item you need to change, and then use a replace function, or so on." Siond nods You say "Okay - becuase this uses pairs of registers though, there are some performance problems." Siond says "?" You say "You have at least 2 @command to add/remove items." You say "Basically because 2 registers need to change,." Siond says "Oh, why is that a problem ?" You say "Take the caes of a single db # and 6 or 8 registers holding different data." Siond nods Mark_Farrell smiles. "One of the goals of efficiency is to keep the number of @ commands to a minimum. Siond says "aha's" You say "As far as workload is concerned, @commands are _much much_ more work than functions." You say "So, if you have a choice between 2 @ commands, and a single @ command and a few extra functions, you choose the single @ command way." Siond says "ok.. So a @dolist with @pe ## is bad .." You say "You have probably heard of 'queue lag'" Siond smiles and nods You say "Right - the only thing queued are @commands." You say "you can look on functions as 'sub-parts' of @commands. - 1 @command can have many functions, but it is still only 1 entry in the queue." Siond says "ok... does it go over and over in the queue or does it all at once ?" You say "All at once." Siond smiles "Ok good for me , bad for anyone else..." You say "In a nutshell, when the muse looks at a command, the first thing it does is to parse the line for %" You say "Then it breaks the line up into separate commands at the semi-colons, skipping over {}'s and so on." You say "It puts all those bits into the queue" You say "Then then each bit gets to the top of the queue, it has all the other bits parsed." Mark_Farrell is sure he has got the actual times that things are done slightly wrong - (read the 'help parser' tutorial for the right details) but you get the idea. Siond says "So @something {@something;@something} would first have one entery then two ?" You say "No." Siond says "Will do." You say "It gets parsed as: @something1 {@something2;@something3} -> @something1 @something2;@something3 in the queue, and then the @something1 is executed with @something2;@something3 as a parameter." You say "Is is not broken up again." Siond says "Oh ok" You say "This actually causes a little bit of a problem for the advanced stuff to do with @switchless coding, but we'll leave that for later." Siond says "I've been reading something about it .. but ain't following quite yet.. needs more practice.." You say "Okay. Back to the 'unified' list." Mark_Farrell comments back again "Watching an object set dark and puppet is a good way to get a feel for what happens." Siond says "yes , but I feel so spasemd when i do so.." You say "Especially with something like and @switch or an @dolist being executed." You say "Do a simple one, and then follow through what it was going step by step." Siond says "I've heard that I shall not use @swi but swi() .." Mark_Farrell nods. You say "However, for good understanding of the way the parser works, experiment with watching an @switch set dark & puppet." You say "The switch() vs @swi is again to reduce the @command count." Siond says "Ok, I will" Siond says "To cut you of again , is there a good way to make a loop ?" You say "iter()" You say "That is only really useful for loops of functions." You say "If you need loops of @commands, it's normally easiest to use @dolist or @trigger." Siond says "but if it shall go until " You say "Nope." You say "A 'do-until' is against the philosophy of coding muse objects," Siond smiles "ok..." You say "It's possible, but it's friendly to anyone else on the game." Mark_Farrell inserts a 'not' You say "DoUntil(some-condition-that's-never-true,.....) = Mega problems/lag even if there is a built in limiter." Siond says "yea, I thought of a if(not something, @tri) but got away from it again.." Mark_Farrell erks. "You could simulate something like a 'do-until' in a number of ways. As I say, generally you should pick methods of coding that don't require that sort of construct' Siond says "ok." Siond says "I need to go , but can I ask you concrete questions later ?" You say "Time is fleeing quickly past - but you are asking good, useful questions." You say "Sure." You say "I'm generally around 2pm to 6pm muse." Siond says "I'll try .. thanks." You say "No weekend access though" Mark_Farrell sighs. Siond says "ohh too bad. at work or something ?" Plant has arrived. Plant enters from the Quad. Mark_Farrell nods. "I'm in the UK - it's 1.40 am Saturday morning already" Plant says "right, right your bloddy well right" Siond says "I'm in Norway and here it's 2.40.am.." Plant giggles Mark_Farrell is still at work in the office too... Siond waves bye and thanks again . Siond taps her Insignia "Constitution, Lieutenant JG Siond to beam onboard" Plant says "eek still at work" Siond slowly fades away Siond has left. Mark_Farrell nods.