Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Lowe
Newbie


Joined: 13 Jan 2006
Posts: 3
Location: Corona Ca

PostPosted: Sat Sep 13, 2008 6:31 am   

Trying to figure out #IF command
 
This is what i have so far

#T- track@CurrentTrack
#ADD CurrentTrack 1
#IF (@CurrentTrack =~ 11) {@CurrentTrack =~ 1}
#T+ track@CurrentTrack

I have an alarm that runs currenttrack so that it can change the folder with my triggers in it from one to another i think the problem lies in the #if command. The two samples helped some but i can't get it to work right. I know i'm doing something wrong.

#IF (@gold < 100000) {emote is poor} {emote is RICH!}

#IF (@line =~ "You receive (%d) coins") {split %pat(1)}
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Sat Sep 13, 2008 8:40 am   
 
Code:
#IF (@CurrentTrack == 11) {CurrentTrack = 1}

Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Sep 15, 2008 1:16 pm   
 
Actually, it's just
Code:
#IF (@CurrentTrack = 11) {CurrentTrack = 1}
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Sep 15, 2008 5:12 pm   
 
Either = or == will both work for testing equality. The =~ operator is for testing a pattern match as shown in the help file example.

Anyway, either Oldguy2 or Rehab solutions should work for you. Both are correct.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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