Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: complie errors

  1. #1

    Default complie errors

    I keep getting errors in odd places. My simple scripts run fine, but when I put the same commands into large scripts, the syntax is off. I can't figure out what it is that is incorrect about this one:

    >;herb all
    --- Lich: herb active.
    --- SyntaxError: compile error
    herb:19: syntax error, unexpected $end, expecting kEND
    herb:19:in `create_block'
    --- Lich: cannot execute herb, aborting.
    --- Lich: herb has exited.

    and this is the script: line 19 is the blank line after the matchwait. If I delete the blank line, it generates the same error at line 18.

    def herbcount (name, noun)
    match 'zero', 'referring'
    match 'one', 'There is only one part'
    match 'two', 'There are two parts'
    match 'three', 'There are three parts'
    match 'four', 'There are four parts'
    match 'five', 'There are five parts'
    match 'six', 'There are six parts'
    match 'seven', 'There are seven parts'
    match 'eight', 'There are eight parts'
    match 'nine', 'There are nine parts'
    match 'ten', 'There are ten parts'
    match 'eleven', 'There are eleven parts'
    match 'twelve', 'There are twelve parts'
    match 'thirteen', 'There are thirteen parts'
    match 'fourteen', 'There are fourteen parts'
    put "count my #{name} #{noun}"
    matchwait

    zero:
    herb = 0
    goto 'count0'

  2. #2

    Default

    You need to end definitions...

    def example
    stuff
    end

  3. #3

    Default

    the end is way down at line 67, I just didn't bother to post the whole thing because it's stopping so much earlier.

  4. #4

    Default

    You'd need to post more of the script then.

  5. #5

    Default

    I uploaded it to here: http://elanthipedia.org/w/index.php/...t_%28script%29

    if I replace the method definition at the begining with:
    def herbcount (name, noun)
    return 5
    end

    the rest of it runs fine, so it's just that part that's not working.

  6. #6

    Default

    Sorry to hate but I'm just baffled by the mixed use of labels and definitions. Seems like one of those scripts that would be just a handfull of lines if you write it without that stuff. Just iterate over that array, use the lich match functions with some regex and make a couple if/then statements. You could probably learn to use those functions and re-write the script faster than you could ever debug this one.

    Also, you may want to post your scripts that you need help with on pastebin since you can get line numbers and syntax highlighting.

  7. Default

    Labels aren't actually part of the Ruby language. Lich just makes them work so it's easier to switch from Wizard scripting. The way it works, you can't have a label inside a definiton.
    Get Lich - Vote for Gemstone (topmudsites.com)

  8. #8

    Default

    Labels make baby jesus cry.
    It must be hard to type with ghostcrawlers penis lodged in your ass. - g++

  9. #9

    Default

    Quote Originally Posted by SpiffyJr View Post
    Labels make baby jesus cry.
    What's wrong with labels?

    I guess I'm just lazy and haven't learned enough about ruby/lich scripting, it's the only way I know how to write a script.

  10. #10

    Default

    Quote Originally Posted by Tgo01 View Post
    What's wrong with labels?

    I guess I'm just lazy and haven't learned enough about ruby/lich scripting, it's the only way I know how to write a script.
    I think that labels as a concept were pretty well abandoned by the 80s. When I started up playing GS, the last time I saw a label was BASIC on the Apple ][e.

    They just cause a bizarre workflow where you're jumping all over the place. There's no concept of a procedure. You need to explicitly interrupt control flow or else portions of your code will run into one another.

Similar Threads

  1. 502 Errors
    By subzero in forum Bug Reports
    Replies: 8
    Last Post: 12-09-2015, 02:23 PM
  2. Lich Errors
    By Middian in forum The Lich Project
    Replies: 2
    Last Post: 10-16-2013, 12:04 AM
  3. Scripting Errors
    By KillashandreaDR in forum The Lich Project
    Replies: 7
    Last Post: 07-31-2011, 12:48 AM
  4. Errors
    By Mr. Bill in forum The Lich Project
    Replies: 7
    Last Post: 12-17-2009, 07:48 PM
  5. Keep Getting Errors
    By Methais in forum Bug Reports
    Replies: 27
    Last Post: 07-05-2009, 02:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •