|
stark62 Wanderer
Joined: 04 Apr 2003 Posts: 94 Location: United Kingdom
|
Posted: Mon Feb 01, 2010 2:55 am
Extracting a string into another variable with maybe a bit of random thrown in |
is there a way for me to load and active variable with a set stringlist varibale
eg I have lets say 3 variables
@attack1 @attack2 and maybe @attack3 (each stringlist has attacks that suit different types of fight)
ok each has a stringlist of various herbs poisons etc
now i have an alias which uses the contents of another variable called @attack00
ok so can i take the stringlist from @attack2 into @attack00
eg i want to be able to leave my @attack00 in my alias and load the other lists into it when i need them depending on which attack set i want to use
thanks |
|
|
|
stark62 Wanderer
Joined: 04 Apr 2003 Posts: 94 Location: United Kingdom
|
Posted: Mon Feb 01, 2010 3:09 am |
ok read it back to myself and think it needs to be clearer
@attack1 = (one|two|three|four)
@attack2 = (five|six|seven|eight)
@attack3 = (nine|ten|eleven|twelve)
ok my attack alias will cycle through a list that is @attack00
so i want an alias eg attt1 that will load the list from @attack2 into it
I tried the obvious attack00=attack2 but as you will all know that just makes the value of @attack00 atack2 - not (five|six|seven|eight)
so my 3 alias might be
att1 = make the list @attack00 the same list as @attack1 (one|two|three|four)
att2 = " " @attack00 " " @attack2 (five|six|seven|eight)
att3 --- yes you guessed it as above |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Mon Feb 01, 2010 3:45 am |
You very nearly have it.
Try.
Code: |
attack1 = {kick|punch|trip|throw}
attack2 = {stab|slice|jab|slash}
attack3 = {poke|bash|pummel|club}
att=@attack1
target=ape
#show @att
#alias attfists {att=@attack1;#show {%item(@att,%random(1,4)) @target}}
#alias attsword {att=@attack2;#show {%item(@att,%random(1,4)) @target}}
#alias attstaff {att=@attack3;#show {%item(@att,%random(1,4)) @target}} |
Of course when using it for fighting use send in place of show. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
stark62 Wanderer
Joined: 04 Apr 2003 Posts: 94 Location: United Kingdom
|
Posted: Mon Feb 01, 2010 4:40 am |
thanks
|
|
|
|
|
|