10
« on: August 24, 2015, 11:06:02 PM »
Thanks Chrome, Looking back my post was a bit vague. I try to make backups of everything I do, and even do subs 100% in their own script until I have them down, before merging them. I run sysmessages, and display error lines, to let me know what is blowing up and how. The issues I seem to be having lately have been caused by things I would not think EUO would have issues with. For instance:
wait %Delay
if %CurrentZone = A
{
GoSub TM_TravelFromRunebook RE %BritainRune1 %BritainRune2 %rbook
}
if %CurrentZone = B
{
GoSub TM_TravelFromRunebook RE %TrinsicRune1 %TrinsicRune2 %rbook
}
if %CurrentZone = C
{
GoSub TM_TravelFromRunebook RE %MoonglowRune1 %MoonglowRune2 %rbook
}
if %CurrentZone = V
{
GoSub TM_TravelFromRunebook RE %VesperRune1 %VesperRune2 %rbook
}
if %CurrentZone = P
{
GoSub TM_TravelFromRunebook RE %PapuaRune1 %PapuaRune2 %rbook
}
The above example threw an error when called, anytime the %CurrentZone was P. Can you see where I messed up? (This was the code that when called from in another sub was throwing the display error in (sub) (P) )
The issue was I left a space before the GoSub in the If body for %CurrentZone = P.
I was under the impression that spacing had no effect on the code, but until I noticed it and fixed it, it would not run the GoSub.
In the original post, like I said the event sysmessage TM_TravelFromObject I use to know when a sub is being called, somehow messed up the sub it was in. By commenting it out it worked again. I had to comment these out on both TM's TravelFrom Subs I am currently using. I am unsure how a sysmessage is messing up the subs, but like I said it ran once, went until the above error was thrown and then stopped working for the initial casts. I know I sound like a loon, but I didnt change any code, and it went from initially recalling to get the quest the not recalling at all after the error.
so ill go through it real quick,
1) You changed something in your code and forgot, this changed the test scenario
Start > run until error. > decide to fix error at a later time knowing exactly where it threw it (going to papua fish monger). Click Start. No editing.
2) The Envirement (Ingame) changed so your scenario cannot be 100% repeated
I did not leave the initial subserver (was not using nav at that point) All of TM's subs stopped working, ie startup did not recall to boat, then proceeded into going to monger, did not recall to monger.
3) Your code was not designed to be safe for unit testing and it was either Step 1 or Step 2 now happening or it was pure luck it worked.
100% This. It was safe for unit testing as it proceeded until error, but it had to be pure luck the fact it worked the first time. As again commenting out a line I use for tracking progress which should have 0 impact on the sub fixed it.
TLDR: Weird issues with spacing and sysmessages have been messing up my script and I don't know why. But I am unit testing properly and have been able to track all of these down in a short time.