arbinger's Refuge

-[Bad Company]-

Portal Scripts: A Stack Implementation

This trigger implements a basic corpse trigger

  1. Bring up the Variable Maintanence dialog (@ on the toolbar)
  2. To start you will need to create 2 variables, one for the stack and one for the "pop'd" value. Create your variables, and set the initialzation to Clear on Login for this example I will use @stack1example and @stack1pop.
  3. Create 3 new aliases.
    STACK.PUSH
    STACK.POP
    STACK.INIT
  4. Lets start with the easist first STACK.INIT this will initialize the stack.
    set(@stack1example=)
  5. Next we do STACK.PUSH this will place the $1 argument on the stack.
    set(@stack1example=$1;@stack1example)
    Note: I am using the ; character as my delimeter
  6. And Finally STACK.POP. The only way I can handle this at the moment is to pop the value into a variable
    set(@stack1pop=copy(@stack1example,1,pos(;,@stack1example))) set(@stack1pop=delete(@stack1pop,pos(;,@stack1example),1)) set(@stack1example=delete(@stack1example,1,pos(;,@stack1example)))

Now you have a basic functioning stack for use in other events or aliases.

Contact Me : [email protected]










1
Hosted by www.Geocities.ws