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
DeathofOne
Beginner


Joined: 03 Jun 2003
Posts: 25

PostPosted: Tue Jun 03, 2003 12:54 pm   

Looking for 2 things detection and so case in if
 
Ok so first need some detection that can look for all of these
(999)
(9)
(99)
(9,999)
(99,999)
Then can put it into a variable.
Thinking something like this

trigger{&{%d|%d,%d}Var

#if (@Var = yy,xxx or @Var = y,xxx) {#math y or yy * 1000 + xxx}

also is there a way to do a #case inside of a #if or for that matter a #math inside of a #if. Looking for this as in something like

#if (@Var = 10) {#case (%random (1,2), "tell %w go away", "tell %w Do not have the time
Reply with quote
DeathofOne
Beginner


Joined: 03 Jun 2003
Posts: 25

PostPosted: Tue Jun 03, 2003 1:00 pm   
 
In the math part @Var = #math ????????
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Tue Jun 03, 2003 1:05 pm   
 
Just using %n should cover all of these cases and it gives you the number without the commas:
#TRIGGER {~((%n)~)} {#VAR number %1}

Yes, you can use a #CASE or a #MATH inside an #IF. You are, however, using the #CASE command incorrectly. Have a look at its help entry for the correct syntax. Or perhaps what you want to use is the %case function, so you may want to have a look at that too.

Kjata
Reply with quote
DeathofOne
Beginner


Joined: 03 Jun 2003
Posts: 25

PostPosted: Tue Jun 03, 2003 1:24 pm   
 
Say thanks for the %n and yeah the %case is what I wanted. hehe that is why, but I was thinking that since I was starting the line with #case that it would work in the #if's.
Reply with quote
DeathofOne
Beginner


Joined: 03 Jun 2003
Posts: 25

PostPosted: Tue Jun 03, 2003 2:30 pm   
 
Can you put a #if in a %case
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Jun 03, 2003 6:16 pm   
 
No.

Well, you can put it there. It just won't do anything.

LightBulb
Advanced Member
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