ScriptUO

Ultima Online Fan Board => General UO Chat => Topic started by: NObama on April 16, 2012, 03:34:35 PM

Title: Frustrated! Problem with logical operator failing in EUO
Post by: NObama on April 16, 2012, 03:34:35 PM
Please look at the attached screenshot and tell me...WHY AM I ON THIS LINE?!

If %bottomrow = true, I should never get here!

ARGH!!!!!!!!!
Title: Re: Frustrated! Problem with logical operator failing in EUO
Post by: TrailMyx on April 16, 2012, 03:38:50 PM
Check your braces.  You may have a brace imbalance.  Try running the syntax checker from SUO.
Title: Re: Frustrated! Problem with logical operator failing in EUO
Post by: NObama on April 16, 2012, 03:53:05 PM
Yep, that was it.  It's proving much harder to keep track of all my branch and sequels than I thought, even for a 3x3 puzzle.
Title: Re: Frustrated! Problem with logical operator failing in EUO
Post by: TrailMyx on April 16, 2012, 03:57:35 PM
Don't worry, I've fallen in that particular hole many times.  Part of the reason that inspired me to do the SUO thing.
Title: Re: Frustrated! Problem with logical operator failing in EUO
Post by: 12TimesOver on April 17, 2012, 04:45:48 AM
Don't worry, I've fallen in that particular hole many times.  Part of the reason that inspired me to do the SUO thing.
I would venture to bet that this is probably the number one syntactical stumper for newb's and vet's alike - probably in just about any applicable language really. Thus why a decent parser is so bitchin' ;)

Imagine trying to figure that out by hand with tens of thousands of lines of code? I don't care if you're the inventor of C++, there ain't no way you're dealing with that manually and still raising children and having sex from time to time. Nope, it ain't happening.

X
Title: Re: Frustrated! Problem with logical operator failing in EUO
Post by: NObama on April 17, 2012, 02:05:33 PM
In case anyone cares, I've decided to scrap my current brute force logic approach to this process, and go with a rules-based one instead.  It will take a really long time for me to code it, though, so in the meantime I've been using a version of the army to keep my main character healed.

I can do individual puzzles faster that I can code a solution, but it makes me sad that a prime scripting opportunity is being lost...perhaps if someone else wants to take it on, I can provide my work thus far.
Title: Re: Frustrated! Problem with logical operator failing in EUO
Post by: manwinc on April 17, 2012, 09:26:30 PM
yeah, when you have a bracket imbalance, the if statment just reads the first open bracket.

set %Boobies So_So
if %Boobies = magnificent
{
Display WOOT


Because there is no CLosing bracket, the if statment will only perform the Open Bracket if its true, so obviously it just performs everything else
Title: Re: Frustrated! Problem with logical operator failing in EUO
Post by: TrailMyx on April 18, 2012, 07:29:56 AM
I can relate to your excellent code example.  :)
Title: Re: Frustrated! Problem with logical operator failing in EUO
Post by: NObama on April 18, 2012, 02:43:14 PM
I read "boobies" and immediately went off to find some.

Damn.  Did it again.