Non-threaded

Forums » Bugs & Problems » Read Thread

Post reports about problems or bugs in here.
This bug was closed 8/20/2006: Fixed.

EOF, END, IF, BEGIN Bug

19 years ago

Here's my script.

%DEFENSE := %BASEDEF + %HELMET + %GLOVES + %BODY + %SHOES

%MONATK1 := %BASEATK1 - %DEFENSE -1 * 1D3 * %RANDOM + (1D2 - 1)
%MONATK2 := %BASEATK2 - %DEFENSE -1 * 1D3 * %RANDOM + (1D2 - 1)
%MONATK3 := %BASEATK3 - %DEFENSE -1 * 1D3 * %RANDOM + (1D2 - 1)
%ATTACK := %WEAPON + %BASEATK - %MONDEF1 -1 * 1D3 * %RANDOM + (1D2 - 1)
%ATTACK := %WEAPON + %BASEATK - %MONDEF2 -1 * 1D3 * %RANDOM + (1D2 - 1)
%ATTACK := %WEAPON + %BASEATK - %MONDEF3 -1 * 1D3 * %RANDOM + (1D2 - 1)

IF %EXPERIENCE > 0 THEN
BEGIN
IF %LEVEL = 1 THEN
BEGIN
%LEVEL := %LEVEL + 1
%ATTACK := %BASEATTACK + 2
%DEFENSE := %BASEDEF + 1
%MAGIC := %MAGIC + 1
%MAGICDEF := %MAGIC + 1
%EXPERIENCE := %EXPERIENCE - 39 - 1D21
END

IF %LEVEL = 2 THEN
BEGIN
%LEVEL := %LEVEL + 1
%ATTACK := %BASEATTACK + 2
%BASEDEF := %BASEDEF + 2
%MAGIC := %MAGIC + 1
%MAGICDEF := %MAGICDEF + 1
%EXPERIENCE := %EXPERIENCE - 174 + 1D51
END

END

-----------------Valadate--------------------------

Error With 'IF' Line=10
Error with 'BEGIN' Line=11
Error With 'IF' Line=12
Error With 'BEGIN' Line=13
Error With 'END' Line=20
Error With 'IF' Line=22
Error With 'BEGIN' Line=23
Error With 'END' Line=30
Error With 'END' Line=32
After those are fixed, I get a few more and eventually a thing saying it can't understand EOF.

This is obviously a huge bug in the system and I cannot edit my script w/o deleting it.

---Also, I'm currently (as a freshman) in Basics to Computer Programming.  I'll have a few more ideas on how scripting can work.  I've also understood why you have the page scripts.

EOF, END, IF, BEGIN Bug

19 years ago

get rid of the "BEGIN" and "END" words, there is no point in using them because i want you to edit it to say this:

----THIS IS YOUR CURRENT CODE (for my reference while i type, so i dont need to keep scrolling)----

IF %EXPERIENCE > 0 THEN
BEGIN
IF %LEVEL = 1 THEN
BEGIN
%LEVEL := %LEVEL + 1
%ATTACK := %BASEATTACK + 2
%DEFENSE := %BASEDEF + 1
%MAGIC := %MAGIC + 1
%MAGICDEF := %MAGIC + 1
%EXPERIENCE := %EXPERIENCE - 39 - 1D21

END

IF %LEVEL = 2 THEN
BEGIN
%LEVEL := %LEVEL + 1
%ATTACK := %BASEATTACK + 2
%BASEDEF := %BASEDEF + 2
%MAGIC := %MAGIC + 1
%MAGICDEF := %MAGICDEF + 1
%EXPERIENCE := %EXPERIENCE - 174 + 1D51

END

END

-----DO THIS -----

IF %EXPERIENCE > 0 AND %LEVEL = 1 THEN
--ADD IN STUFF IN GREEN--

IF %EXPERIENCE > 0 AND %LEVEL = 2 THEN
--ADD IN STUFF IN YELLOW--

The BEGIN and END stuff, is basically for YOU, so that you are organized, but you do not need them and those errors COULD mean that they have not been programmed into the compiler yet...

EOF, END, IF, BEGIN Bug

19 years ago

or if you want to keep it under one IF statement (though this will be a nested IF statement, sort of an ELSE IF statement)

--- put the following after the ADD STUFF IN GREEN --

ELSE IF %EXPERIENCE > 0 AND %LEVEL = 2 THEN
--ADD IN STUFF IN YELLOW--

so basically change that line to say ELSE...

EOF, END, IF, BEGIN Bug

19 years ago
im sorry, there are still errors with the IF statements, this must be a bug as you said, nevertheless, the above code is a much better variation because it is more organized, not "spagghetti code"... just my suggestion of course...

EOF, END, IF, BEGIN Bug

19 years ago

Wow! you're really gettig into this. Aweome!

I ran your script through the Grammar Validator and it passes OK, so it's definitely a bug on my end. I will run the parser on my end and see what's going on. Good find though.

EOF, END, IF, BEGIN Bug

19 years ago
o btw, BASEATTACK and BASEATK (i think thats waht you wrote, or was it BASEATCK, anyways...) are too different variables, keep this in mind havac!

EOF, END, IF, BEGIN Bug

19 years ago

It looks like the BEGIN/END block is completely broken. This script should pass:

BEGIN
 %SCORE := 1
END

This makes it easier for me to fix I suppose :-).

EOF, END, IF, BEGIN Bug

19 years ago
lol, hmmm, maybe you should try passing all of havacs code :P, anyways, hope its an easy fix!