|
Crymson4 Novice
Joined: 20 Nov 2001 Posts: 35 Location: USA
|
Posted: Thu Nov 22, 2001 8:55 pm
Logical AND/OR and bitwise AND/OR |
This is probably a really simple question, but I have trouble none-the-less.
I'm trying to get one IF statement to differentiate between cases.
Basically, on 2d6, if the number rolled is a 2, 3, 4, 9, 10, 11, 12, I want it to one thing.
If it's a 5, 6, 7, 8 I want it do something else.
Now logically, in my mind, I'd just do something like this:
#IF (@DTotal=2 | 3 | 4 | 9 | 10 | 11 | 12) {Do true} {Do false, in this case, 5, 6, 7, 8}
then go on my merry way.
But it seems to think that it's true reguardless of the number rolled.
If I substitute & in there, it always thinks it's false, so I restructured the if to look like this.
#IF (@DTotal = 2 | 3 | 4 & 5 & 6 & 7 & 8 | 9 | 10 | 11 | 12) {Do this}
But again, that didn't work.
I don't really want to make an if for all 11 numbers, so could anybody shed some light on this? Maybe I just dunno the difference between logical and bitwise functions... one of the many things I was never taught in public school. hehe.
Anyways, thanks guys.
-Crymson |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Nov 23, 2001 6:24 am |
Umm, try this:
#if (@DTotal >= 5 AND @DTotal <= 8) {#Noop here's where the 5 through 8 code goes} {#noop here is where the other code goes}
li'l shmoe of Dragon's Gate MUD |
|
|
|
Crymson4 Novice
Joined: 20 Nov 2001 Posts: 35 Location: USA
|
Posted: Fri Nov 23, 2001 6:53 am |
That worked. Sometimes, the answer is so freakin simple.
Thanks
-=Crymson
Reality is the effect of alcohol deficiency |
|
|
|
|
|
|
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
|
|