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
aunkkaro
Newbie


Joined: 02 Mar 2008
Posts: 5

PostPosted: Sun Mar 02, 2008 6:13 am   

illegal token error
 
hey, just got cmud and converted my zmud script over to it, but I keep getting an illegal token error on one of my aliases. It's an extremely long one, so I'm only gotta put a few lines in here and hope it's enough for some one to help me figure out what's wrong.

Code:

#IF (@envenom1 = "opium" AND @opium = 0) {EnvenomReplace opium} {
#IF (@envenom1 = "veratrum" AND @veratrum = 1) {
      envenom dirk with veratrum
      envenomreset1 = 1
      envenomholder = 0
      } {
#IF (@envenom1 = "veratrum" AND @veratrum = 0) {EnvenomReplace veratrum} {
#IF (@envenom1 = "actinium" AND @actinium = 1) {
      envenom dirk with actinium
      envenomreset1 = 1    ****
      envenomholder = 0
      } {


the problem is (according to cmud) at the last line with the astericks. It says: "illegal token: = 1" but it doesn't make sense to me since the envenomreset1 = 1 code is working right above it (and atleast 10 more times before this section of code. When I try to comment out this line it then says the next line is wrong with an "illegal token: = 0"

any one happen to know why the equal sign isn't being accepted?
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Sun Mar 02, 2008 6:50 am   
 
With out the entire script it will be hard to tell exactly what's going on, but I would guess that it's your code indentation. Try something like this

Code:
#IF (@envenom1 = "opium" AND @opium = 0) {EnvenomReplace opium} {
  #IF (@envenom1 = "veratrum" AND @veratrum = 1) {
      envenom dirk with veratrum
      envenomreset1 = 1
      envenomholder = 0
    } {
      #IF (@envenom1 = "veratrum" AND @veratrum = 0) {EnvenomReplace veratrum} {
        #IF (@envenom1 = "actinium" AND @actinium = 1) {
            envenom dirk with actinium
            envenomreset1 = 1    ****
            envenomholder = 0
        } {
_________________
Asati di tempari!
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Mar 02, 2008 4:13 pm   
 
Illegal token errors are a catch-all error and often the position of the error is just when CMUD realises there's an error and not where the error actually is. Without your whole script, there's not much we can do.

Also, use #switch for this problem.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
aunkkaro
Newbie


Joined: 02 Mar 2008
Posts: 5

PostPosted: Sun Mar 02, 2008 5:11 pm   
 
I appreciate the the help that I've already been given. I'm going to post the whole code since I've been messing with it for a while now and have no idea what to do. And I'm not real sure how to turn this mass of code into #switches, but I'll worry more about that after I have it working right. So, I apologize but this code is pretty long and I'd appreciate any more help I could get. Thanks in advance

Code:
#IF (@envenom = 3) {#IF (@dstabcombo != "None") {
    #IF (@envenomlistholder >= @dstabcount) {envenomlistholder = 1}
    envenom1 = %item( @envenomlist, @envenomlistholder)
    envenom2 = %item( @envenomlist, (@envenomlistholder + 1))
    envenom = 0
    }} {#IF (@envenom = 0 AND @envenom1 != "done" AND @envenomreset1 = 0) {#IF (@envenom1 = "ether" AND @ether = 1) {
      envenom dirk with ether
      envenomreset1 = 1
      envenomholder = 0
      } {#IF (@envenom1 = "ether" AND @ether = 0) {EnvenomReplace ether} {#IF (@envenom1 = "aspartame" AND @aspartame = 1) {
          envenom dirk with aspartame
          envenomreset1 = 1
          envenomholder = 0
          } {#IF (@envenom1 = "aspartame" AND @atropine = 0) {EnvenomReplace aspartame} {#IF (@envenom1 = "atropine" AND @atropine = 1) {
              envenom dirk with atropine
              envenomreset1 = 1
              envenomholder = 0
              } {#IF (@envenom1 = "atropine" AND @atropine = 0) {EnvenomReplace atropine} {#IF (@envenom1 = "mercury" AND @mercury = 1) {
                  envenom dirk with mercury
                  envenomreset1 = 1
                  envenomholder = 0
                  } {#IF (@envenom1 = "mercury" AND @mercury = 0) {EnvenomReplace mercury} {#IF (@envenom1 = "digitalis" AND @digitalis = 1) {
                      envenom dirk with digitalis
                      envenomreset1 = 1
                      envenomholder = 0
                      } {#IF (@envenom1 = "digitalis" AND @digitalis = 0) {EnvenomReplace digitalis} {#IF (@envenom1 = "xeroderma" AND @xeroderma = 1) {
                          envenom dirk with xeroderma
                          envenomreset1 = 1
                          envenomholder = 0
                          } {#IF (@envenom1 = "xeroderma" AND @xeroderma = 0) {EnvenomReplace xeroderma} {#IF (@envenom1 = "ciguatoxin" AND @ciguatoxin = 1) {
                              envenom dirk with ciguatoxin
                              envenomreset1 = 1
                              envenomholder = 0
                              } {#IF (@envenom1 = "ciguatoxin" AND @ciguatoxin = 0) {EnvenomReplace ciguatoxin} {#IF (@envenom1 = "benzene" AND @benzene = 1) {
                                  envenom dirk with benzene
                                  envenomreset1 = 1
                                  envenomholder = 0
                                  } {#IF (@envenom1 = "benzene" AND @benzene = 0) {EnvenomReplace benzene} {#IF (@envenom1 = "strychnine" AND @strychnine = 1) {
                                      envenom dirk with strychnine
                                      envenomreset1 = 1
                                      envenomholder = 0
                                      } {#IF (@envenom1 = "strychnine" AND @strychnine = 0) {EnvenomReplace strychnine} {#IF (@envenom1 = "vitriol" AND @vitriol = 1) {
                                          envenom dirk with vitriol
                                          envenomreset1 = 1
                                          envenomholder = 0
                                          } {#IF (@envenom1 = "vitriol" AND @vitriol = 0) {EnvenomReplace vitriol} {#IF (@envenom1 = "botulinum" AND @botulinum = 1) {
                                              envenom dirk with botulinum
                                              envenomreset1 = 1
                                              envenomholder = 0
                                              } {#IF (@envenom1 = "botulinum" AND @botulinum = 0) {EnvenomReplace botulinum} {#IF (@envenom1 = "chloroform" AND @chloroform = 1) {
                                                  envenom dirk with chloroform
                                                  envenomreset1 = 1
                                                  envenomholder = 0
                                                  } {#IF (@envenom1 = "chloroform" AND @chloroform = 0) {EnvenomReplace chloroform} {#IF (@envenom1 = "oxalis" AND @oxalis = 1) {
                                                      envenom dirk with oxalis
                                                      envenomreset1 = 1
                                                      envenomholder = 0
                                                      } {#IF (@envenom1 = "oxalis" AND @oxalis = 0) {EnvenomReplace oxalis} {#IF (@envenom1 = "arsenic" AND @arsenic = 1) {
                                                          envenom dirk with arsenic
                                                          envenomreset1 = 1
                                                          envenomholder = 0
                                                          } {#IF (@envenom1 = "arsenic" AND @arsenic = 0) {EnvenomReplace arsenic} {#IF (@envenom1 = "benzedrine" AND @benzedrine = 1) {
                                                              envenom dirk with benzedrine
                                                              envenomreset1 = 1
                                                              envenomholder = 0
                                                              } {#IF (@envenom1 = "benzedrine" AND @benzedrine = 0) {EnvenomReplace benzedrine} {#IF (@envenom1 = "lindane" AND @lindane = 1) {
                                                                  envenom dirk with lindane
                                                                  envenomreset1 = 1
                                                                  envenomholder = 0
                                                                  } {#IF (@envenom1 = "lindane" AND @lindane = 0) {EnvenomReplace lindane} {#IF (@envenom1 = "bromine" AND @bromine = 1) {
                                                                      envenom dirk with bromine
                                                                      envenomreset1 = 1
                                                                      envenomholder = 0
                                                                      } {#IF (@envenom1 = "bromine" AND @bromine = 0) {EnvenomReplace bromine} {#IF (@envenom1 = "cyanide" AND @cyanidetoxin = 1) {
                                                                          envenom dirk with cyanide
                                                                          envenomreset1 = 1
                                                                          envenomholder = 0
                                                                          } {#IF (@envenom1 = "cyanide" AND @cyanidetoxin = 0) {EnvenomReplace cyanide} {#IF (@envenom1 = "opium" AND @opium = 1) {
                                                                              envenom dirk with opium
                                                                              envenomreset1 = 1
                                                                              envenomholder = 0
                                                                              } {#IF (@envenom1 = "opium" AND @opium = 0) {EnvenomReplace opium} {#IF (@envenom1 = "veratrum" AND @veratrum = 1) {
                                                                                  envenom dirk with veratrum
                                                                                  envenomreset1 = 1
                                                                                  envenomholder = 0
                                                                                  } {#IF (@envenom1 = "veratrum" AND @veratrum = 0) {EnvenomReplace veratrum} {
#IF                                                                                    (@envenom1 = "actinium" AND @actinum = 1) {
                                                                                      envenom dirk with actinium
                                                                                      envenomreset1 = 1 ******
                                                                                      envenomholder = 0
                                                                                      } {
#IF (@envenom1 = "actinium" AND @actinium = 0) {EnvenomReplace actinium} {#IF (@envenom1 = "aconite" AND @aconite = 1) {envenom dirk with aconite
                                                                                    envenomreset1 = 1
                                                                                    envenomholder = 0} {
                                                                                    #IF (@envenom1 = "aconite" AND @aconite = 0) {EnvenomReplace aconite} {#IF (@envenom1 = "iodine" AND @iodine = 1) {envenom dirk with iodine
                                                                                    envenomreset1 = 1
                                                                                    envenomholder = 0} {
                                                                                    #IF                                                                                    (@envenom1 = "iodine" AND @iodine = 0) {
                                                                                      EnvenomReplace iodine
                                                                                      } {
                                                                                   
                                                                                    #IF (@envenom1 = "butisol" AND @butisol = 1) {
                                                                                      envenom dirk with butisol
                                                                                      envenomreset1 = 1
                                                                                      envenomholder = 0
                                                                                      } {#IF (@envenom1 = "butisol" AND @butisol = 0) {EnvenomReplace butisol} {#IF (@envenom1 = "oxycodone" AND @oxycodone = 1) {envenom dirk with oxycodone
                                                                                    envenomreset1 = 1
                                                                                    envenomholder = 0
                                                                                   
                                                                                   
                                                                                    } {#IF                                                                                    (@envenom1 = "oxycodone" AND @oxycodone = 0) {EnvenomReplace oxycodone} {#IF (@envenom1 = "metrazol" AND @metrazol = 1) {envenom dirk with metrazol
                                                                                    envenomreset1 = 1
                                                                                    envenomholder = 0} {#IF                                                                                    (@envenom1 = "metrazol" AND @metrazol = 0) {EnvenomReplace metrazol} {#IF (@envenom1 = "mebaral" AND @mebaral = 1) {envenom dirk with mebaral
                                                                                    envenomreset1 = 1
                                                                                    envenomholder = 0} {#IF                                                                                    (@envenom1 = "mebaral" AND @mebaral = 0) {EnvenomReplace mebaral} {#IF (@envenom1 = "noctec" AND @noctec = 1) {envenom dirk with noctec
                                                                                    envenomreset1 = 1
                                                                                    envenomholder = 0} {#IF                                                                                    (@envenom = "noctec" AND @noctec = 0) {EnvenomReplace noctec} {#IF (@envenom1 = "calotropis" AND @calotropis = 1) {envenom dirk with calotropis
                       envenomreset1 = 1
                       envenomholder = 0} {#IF (@envenom = "calotropis" AND @calotropis = 0) {EnvenomReplace calotropis}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
#IF (@envenom = 1 AND @envenom2 != "done" AND @envenomreset2 = 0) {#IF (@envenom2 = "ether" AND @ether = 1) {
    envenom dirk with ether
    envenomreset2 = 1
    envenomholder = 0
    } {#IF (@envenom2 = "ether" AND @ether = 0) {EnvenomReplace ether} {#IF (@envenom2 = "aspartame" AND @aspartame = 1) {
        envenom dirk with aspartame
        envenomreset2 = 1
        envenomholder = 0
        } {#IF (@envenom2 = "aspartame" AND @atropine = 0) {EnvenomReplace aspartame} {#IF (@envenom2 = "atropine" AND @atropine = 1) {
            envenom dirk with atropine
            envenomreset2 = 1
            envenomholder = 0
            } {#IF (@envenom2 = "atropine" AND @atropine = 0) {EnvenomReplace atropine} {#IF (@envenom2 = "mercury" AND @mercury = 1) {
                envenom dirk with mercury
                envenomreset2 = 1
                envenomholder = 0
                } {#IF (@envenom2 = "mercury" AND @mercury = 0) {EnvenomReplace mercury} {#IF (@envenom2 = "digitalis" AND @digitalis = 1) {
                    envenom dirk with digitalis
                    envenomreset2 = 1
                    envenomholder = 0
                    } {#IF (@envenom2 = "digitalis" AND @digitalis = 0) {EnvenomReplace digitalis} {#IF (@envenom2 = "xeroderma" AND @xeroderma = 1) {
                        envenom dirk with xeroderma
                        envenomreset2 = 1
                        envenomholder = 0
                        } {#IF (@envenom2 = "xeroderma" AND @xeroderma = 0) {EnvenomReplace xeroderma} {#IF (@envenom2 = "ciguatoxin" AND @ciguatoxin = 1) {
                            envenom dirk with ciguatoxin
                            envenomreset2 = 1
                            envenomholder = 0
                            } {#IF (@envenom2 = "ciguatoxin" AND @ciguatoxin = 0) {EnvenomReplace ciguatoxin} {#IF (@envenom2 = "benzene" AND @benzene = 1) {
                                envenom dirk with benzene
                                envenomreset2 = 1
                                envenomholder = 0
                                } {#IF (@envenom2 = "benzene" AND @benzene = 0) {EnvenomReplace benzene} {#IF (@envenom2 = "strychnine" AND @strychnine = 1) {
                                    envenom dirk with strychnine
                                    envenomreset2 = 1
                                    envenomholder = 0
                                    } {#IF (@envenom2 = "strychnine" AND @strychnine = 0) {EnvenomReplace strychnine} {#IF (@envenom2 = "vitriol" AND @vitriol = 1) {
                                        envenom dirk with vitriol
                                        envenomreset2 = 1
                                        envenomholder = 0
                                        } {#IF (@envenom2 = "vitriol" AND @vitriol = 0) {EnvenomReplace vitriol} {#IF (@envenom2 = "botulinum" AND @botulinum = 1) {
                                            envenom dirk with botulinum
                                            envenomreset2 = 1
                                            envenomholder = 0
                                            } {#IF (@envenom2 = "botulinum" AND @botulinum = 0) {EnvenomReplace botulinum} {#IF (@envenom2 = "chloroform" AND @chloroform = 1) {
                                                envenom dirk with chloroform
                                                envenomreset2 = 1
                                                envenomholder = 0
                                                } {#IF (@envenom2 = "chloroform" AND @chloroform = 0) {EnvenomReplace chloroform} {#IF (@envenom2 = "oxalis" AND @oxalis = 1) {
                                                    envenom dirk with oxalis
                                                    envenomreset2 = 1
                                                    envenomholder = 0
                                                    } {#IF (@envenom2 = "oxalis" AND @oxalis = 0) {EnvenomReplace oxalis} {#IF (@envenom2 = "arsenic" AND @arsenic = 1) {
                                                        envenom dirk with arsenic
                                                        envenomreset2 = 1
                                                        envenomholder = 0
                                                        } {#IF (@envenom2 = "arsenic" AND @arsenic = 0) {EnvenomReplace arsenic} {#IF (@envenom2 = "benzedrine" AND @benzedrine = 1) {
                                                            envenom dirk with benzedrine
                                                            envenomreset2 = 1
                                                            envenomholder = 0
                                                            } {#IF (@envenom2 = "benzedrine" AND @benzedrine = 0) {EnvenomReplace benzedrine} {#IF (@envenom2 = "lindane" AND @lindane = 1) {
                                                                envenom dirk with lindane
                                                                envenomreset2 = 1
                                                                envenomholder = 0
                                                                } {#IF (@envenom2 = "lindane" AND @lindane = 0) {EnvenomReplace lindane} {#IF (@envenom2 = "bromine" AND @bromine = 1) {
                                                                    envenom dirk with bromine
                                                                    envenomreset2 = 1
                                                                    envenomholder = 0
                                                                    } {#IF (@envenom2 = "bromine" AND @bromine = 0) {EnvenomReplace bromine} {#IF (@envenom2 = "cyanide" AND @cyanidetoxin = 1) {
                                                                        envenom dirk with cyanide
                                                                        envenomreset2 = 1
                                                                        envenomholder = 0
                                                                        } {#IF (@envenom2 = "cyanide" AND @cyanidetoxin = 0) {EnvenomReplace cyanide} {#IF (@envenom2 = "opium" AND @opium = 1) {
                                                                            envenom dirk with opium
                                                                            envenomreset2 = 1
                                                                            envenomholder = 0
                                                                            } {#IF (@envenom2 = "opium" AND @opium = 0) {EnvenomReplace opium} {#IF                                                                              (@envenom2 = "veratrum" AND @veratrum = 1) {
                                                                                envenom dirk with veratrum
                                                                                envenomreset2 = 1
                                                                                envenomholder = 0
                                                                                } {#IF                                                                                (@envenom2 = "veratrum" AND @veratrum = 0) {EnvenomReplace veratrum} {#IF                                                                                  (@envenom2 = "actinium" AND @actinum = 1) {
                                                                                    envenom dirk with actinium
                                                                                    envenomreset2 = 1
                                                                                    envenomholder = 0
                                                                                    } {
#IF                                                                                    (@envenom2 = "actinium" AND @actinium = 0) {EnvenomReplace actinium} {#IF (@envenom2 = "aconite" AND @aconite = 1) {envenom dirk with aconite
                                                                                    envenomreset2 = 1
                                                                                    envenomholder = 0
                                                                                    } {
#IF                                                                                    (@envenom2 = "aconite" AND @aconite = 0) {EnvenomReplace aconite} {#IF (@envenom2 = "iodine" AND @iodine = 1) {envenom dirk with iodine
                                                                                    envenomreset2 = 1
                                                                                    envenomholder = 0
                                                                                    } {
#IF                                                                                    (@envenom2 = "iodine" AND @iodine = 0) {EnvenomReplace iodine} {
                                                                                   
                                                                                    #IF (@envenom2 = "butisol" AND @butisol = 1) {
                                                                                      envenom dirk with butisol
                                                                                      envenomreset2 = 1
                                                                                      envenomholder = 0
                                                                                      } {
#IF (@envenom2 = "butisol" AND @butisol = 0) {EnvenomReplace butisol} {#IF (@envenom2 = "oxycodone" AND @oxycodone = 1) {envenom dirk with oxycodone
                                                                                    envenomreset1 = 1
                                                                                    envenomholder = 0
                                                                                   
                                                                                   
                                                                                    } {
#IF (@envenom2 = "oxycodone" AND @oxycodone = 0) {EnvenomReplace oxycodone} {#IF (@envenom2 = "metrazol" AND @metrazol = 1) {envenom dirk with metrazol
                                                                                    envenomreset2 = 1
                                                                                    envenomholder = 0} {
#IF (@envenom2 = "metrazol" AND @metrazol = 0) {EnvenomReplace metrazol} {#IF (@envenom2 = "mebaral" AND @mebaral = 1) {envenom dirk with mebaral
                                                                                    envenomreset2 = 1
                                                                                    envenomholder = 0} {

                                                                              #IF (@envenom2 = "mebaral" AND @mebaral = 0) {EnvenomReplace mebaral} {
 
 #IF (@envenom2 = "noctec" AND @noctec = 1) {envenom dirk with noctec
                                                                                envenomreset2 = 1
                                                                                    envenomholder = 0
                                                                                   
                                                                                    } {
                                                                                #IF (@envenom2 = "noctec" AND @noctec = 0) {
                                                                                  EnvenomReplace noctec
                                                                                  } {

#IF (@envenom2 = "calotropis" AND @calotropis = 1) {envenom dirk with calotropis
                                                                                    envenomreset2 = 1
                                                                                    envenomholder = 0
                                                                                   
                                                                                    } {#IF (@envenom2 = "calotropis" AND @noctec = 0) {EnvenomReplace calotropis}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
Reply with quote
Anaristos
Sorcerer


Joined: 17 Jul 2007
Posts: 821
Location: California

PostPosted: Sun Mar 02, 2008 5:19 pm   
 
When CMUD tells you there is a error in your script such as the type you mention, click on the EDITOR tab and select Check syntax. This will tell you which line and column number it thinks the error is located. Once we have this information, it will be easier to tell what the problem is. As Tech pointed out, it may be just and indentation error because the Editor sometimes loses track of the newline it uses to represent ";".
_________________
Sic itur ad astra.
Reply with quote
aunkkaro
Newbie


Joined: 02 Mar 2008
Posts: 5

PostPosted: Sun Mar 02, 2008 6:28 pm   
 
aye, I did that and that's where it tells me the error is an illegal toke: = 1, I've tried changing the spacing and even tried to use the reformat script button. I'm still going to keep trying of course, just wanted to let people know what I've done so they know if it works or not
Reply with quote
Anaristos
Sorcerer


Joined: 17 Jul 2007
Posts: 821
Location: California

PostPosted: Sun Mar 02, 2008 8:10 pm   
 
I've copied your script to one of my aliases and I am trying to figure out why you are getting a syntax check. However, and with all due respect, have you thought about making the script table-driven (or at least, stringlist or database-record driven?). It would make it much simpler to update.
_________________
Sic itur ad astra.
Reply with quote
aunkkaro
Newbie


Joined: 02 Mar 2008
Posts: 5

PostPosted: Sun Mar 02, 2008 8:41 pm   
 
honestly, I'm not too sure how I'd go about doing all that I only know the very basic stuff for programming thats why I just a mess of if statements. But I'll look into it if it would make this easier on me
Reply with quote
Anaristos
Sorcerer


Joined: 17 Jul 2007
Posts: 821
Location: California

PostPosted: Sun Mar 02, 2008 8:59 pm   
 
Well, your can take advantage of the fact that @envenom1 contains a string which is, in most cases, the name of the variable that contains the flag. So, for instance, @envenom1 = "opium" and there is a @opium flag. So you could use something like
Code:
#IF (@{@envenom1} = 1) {...}
to check for the flag. By making the flag have the same exact name as the contents of @envenom1 you save a lot of work. You could keep all your poisons in a stringlist and have that list drive your script. For isntance
Code:
poisonlist = "opium|mercury|..."
#FORALL @poisonlist {#IF (@envenom1 = %i AND @{%i}) {...}}
since the flag is either 0 or not 0, you can treat it as a TRUE/FALSE value. There are many ways to go about this, and this is just a suggestion. The point is that your script lends itself to be shortened by ideas like this one. The shorter the script, the easier it is to debug and mantain.
_________________
Sic itur ad astra.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Mon Mar 03, 2008 10:03 am   
 
I carefully indented this code.. and still got the error. It's almost as if CMUD loses track of what's happening. With that said this is poorly written code (no offense). The same can be accomplished with cleaner code.

A couple of questions... When you enter this bit of code
Code:
#IF (@envenom = 0 AND @envenom1 != "done" AND @envenomreset1 = 0)
are you guaranteed to meet one of the conditions? Does the same hold true here with this code?
Code:
#IF (@envenom = 1 AND @envenom2 != "done" AND @envenomreset2 = 0)
_________________
Asati di tempari!
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Mon Mar 03, 2008 11:55 am   
 
Quote:
And I'm not real sure how to turn this mass of code into #switches


Here is your code using #SWITCH and two additional aliases:

Code:
#IF (@envenom = 3) {
  #IF  (@dstabcombo != "None") {
    #IF (@envenomlistholder >= @dstabcount) {envenomlistholder = 1}
    envenom1 = %item( @envenomlist, @envenomlistholder)
    envenom2 = %item( @envenomlist, (@envenomlistholder + 1))
    envenom = 0
    } {
    #IF (@envenom = 0 AND @envenom1 != "done" AND @envenomreset1 = 0) {
      #switch (@envenom1 = "ether" AND @ether = 1) {env1 ether}
        (@envenom1 = "aspartame" AND @aspartame = 1) {env1 aspartame}
        (@envenom1 = "atropine" AND @atropine = 1) {env1 atropine}
        (@envenom1 = "mercury" AND @mercury = 1) {env1 mercury}
        (@envenom1 = "digitalis" AND @digitalis = 1) {env1 digitalis}
        (@envenom1 = "xeroderma" AND @xeroderma = 1) {env1 xeroderma}
        (@envenom1 = "ciguatoxin" AND @ciguatoxin = 1) {env1 ciguatoxin}
        (@envenom1 = "benzene" AND @benzene = 1) {env1 benzene}
        (@envenom1 = "strychnine" AND @strychnine = 1) {env1 strychnine}
        (@envenom1 = "vitriol" AND @vitriol = 1) {env1 vitriol}
        (@envenom1 = "botulinum" AND @botulinum = 1) {env1 botulinum}
        (@envenom1 = "chloroform" AND @chloroform = 1) {env1 chloroform}
        (@envenom1 = "oxalis" AND @oxalis = 1) {env1 oxalis}
        (@envenom1 = "arsenic" AND @arsenic = 1) {env1 arsenic}
        (@envenom1 = "benzedrine" AND @benzedrine = 1) {env1 benzedrine}
        (@envenom1 = "lindane" AND @lindane = 1) {env1 lindane}
        (@envenom1 = "bromine" AND @bromine = 1) {env1 bromine}
        (@envenom1 = "cyanide" AND @cyanidetoxin = 1) {env1 cyanide}
        (@envenom1 = "opium" AND @opium = 1) {env1 opium}
        (@envenom1 = "veratrum" AND @veratrum = 1) {env1 veratrum}
        (@envenom1 = "actinium" AND @actinum = 1) {env1 actinium}
        (@envenom1 = "aconite" AND @aconite = 1) {env1 aconite}
        (@envenom1 = "iodine" AND @iodine = 1) {env1 iodine}
        (@envenom1 = "butisol" AND @butisol = 1) {env1 butisol}
        (@envenom1 = "oxycodone" AND @oxycodone = 1) {env1 oxycodone}
        (@envenom1 = "metrazol" AND @metrazol = 1) {env1 metrazol}
        (@envenom1 = "mebaral" AND @mebaral = 1) {env1 mebaral}
        (@envenom1 = "noctec" AND @noctec = 1) {env1 noctec}
        (@envenom1 = "calotropis" AND @calotropis = 1) {env1 calotropis}
        {EnvenomReplace @envenom1}
      }
    #IF (@envenom = 1 AND @envenom2 != "done" AND @envenomreset2 = 0) {
      #switch (@envenom2 = "ether" AND @ether = 1) {env2 ether}
        (@envenom2 = "aspartame" AND @aspartame = 1) {env2 aspartame}
        (@envenom2 = "atropine" AND @atropine = 1) {env2 atropine}
        (@envenom2 = "mercury" AND @mercury = 1) {env2 mercury}
        (@envenom2 = "digitalis" AND @digitalis = 1) {env2 digitalis}
        (@envenom2 = "xeroderma" AND @xeroderma = 1) {env2 xeroderma}
        (@envenom2 = "ciguatoxin" AND @ciguatoxin = 1) {env2 ciguatoxin}
        (@envenom2 = "benzene" AND @benzene = 1) {env2 benzene}
        (@envenom2 = "strychnine" AND @strychnine = 1) {env2 strychnine}
        (@envenom2 = "vitriol" AND @vitriol = 1) {env2 vitriol}
        (@envenom2 = "botulinum" AND @botulinum = 1) {env2 botulinum}
        (@envenom2 = "chloroform" AND @chloroform = 1) {env2 chloroform}
        (@envenom2 = "oxalis" AND @oxalis = 1) {env2 oxalis}
        (@envenom2 = "arsenic" AND @arsenic = 1) {env2 arsenic}
        (@envenom2 = "benzedrine" AND @benzedrine = 1) {env2 benzedrine}
        (@envenom2 = "lindane" AND @lindane = 1) {env2 lindane}
        (@envenom2 = "bromine" AND @bromine = 1) {env2 bromine}
        (@envenom2 = "cyanide" AND @cyanidetoxin = 1) {env2 cyanide}
        (@envenom2 = "opium" AND @opium = 1) {env2 opium}
        (@envenom2 = "veratrum" AND @veratrum = 1) {env2 veratrum}
        (@envenom2 = "actinium" AND @actinum = 1) {env2 actinium}
        (@envenom2 = "aconite" AND @aconite = 1) {env2 aconite}
        (@envenom2 = "iodine" AND @iodine = 1) {env2 iodine}
        (@envenom2 = "butisol" AND @butisol = 1) {env2 butisol}
        (@envenom2 = "oxycodone" AND @oxycodone = 1) {env2 oxycodone}
        (@envenom2 = "metrazol" AND @metrazol = 1) {env2 metrazol}
        (@envenom2 = "mebaral" AND @mebaral = 1) {env2 mebaral}
        (@envenom2 = "noctec" AND @noctec = 1) {env2 noctec}
        (@envenom2 = "calotropis" AND @calotropis = 1) {env2 calotropis}
        {EnvenomReplace @envenom2}
      }
    }
  }


Alias ENV1:

Code:
#send {envenom dirk with %1}
envenomreset1=1
envenomholder=0


Alias ENV2:

Code:
#send {envenom dirk with %1}
envenomreset2 = 1
envenomholder = 0


I would look at using a database though as someone stated earlier.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Mon Mar 03, 2008 12:30 pm   
 
How are you setting @envenom1 and @envenom2? It would be much easier to do something like the following:

Code:
#local $venom1 $venom2
$venom1=?
$venom2=?
#IF (@envenom = 3) {
  #IF  (@dstabcombo != "None") {
    #IF (@envenomlistholder >= @dstabcount) {envenomlistholder = 1}
    envenom1 = %item( @envenomlist, @envenomlistholder)
    envenom2 = %item( @envenomlist, (@envenomlistholder + 1))
    envenom = 0
    } {
    #IF (@envenom=0 AND (@envenom1 != "done") AND !@envenomreset1 AND @{$venom1}) {env1 $venom1} {EnvenomReplace $venom1}
    #IF (@envenom=1 AND (@envenom2 != "done") AND !@envenomreset2 AND @{$venom2}) {env2 $venom2} {EnvenomReplace $venom2}
    }
  }
Reply with quote
aunkkaro
Newbie


Joined: 02 Mar 2008
Posts: 5

PostPosted: Tue Mar 04, 2008 12:53 am   
 
I greatly appreciate all the help you guys gave me. I just replaced the envenomreset1 = 1 with #VAR envenomreset1 1 to get rid of the token error. However it then said the braces didn't match, so I put it in a switch like Oldguy2 showed me and it seems to have cleared up all the errors. Thank you for all the help
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