Author Topic: It Worked then...  (Read 3837 times)

0 Members and 1 Guest are viewing this topic.

Offline KryzTopic starter

  • Jr. Member
  • **
  • Posts: 33
  • Activity:
    0%
  • Reputation Power: 1
  • Kryz has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
It Worked then...
« on: August 23, 2015, 11:13:00 AM »
0
So I have been doing a TON with my script over the past couple of days. Editing, Testing, Fixing, Editing, Testing, Etc.

I ran it successfully up to turning in the quest. It threw an error, wasn't a big deal. Located the error, didn't change anything as it made sense the way it was. Decided it was worth trying to run again and see if it did the same thing.

Without changing anything now my script has gone all screwy. Its showing the event sysmessages properly I put in each sub i'm using, but it is not actually performing the subs...

Any idea what I may have done? Any simple thing that has caused something similar in the past? Im looking for stray ;'s atm but with it breaking most of my subs hard to imagine that is it. Maybe ill look into open { }'s


OK I fixed it. I am sooo confused as to how it broke. I added a event sysmessage to every sub like I said before. It broke when I added one to TM's Sub TM_TravelFromObject. By commenting out my line
Code: [Select]
;event sysmessage TM_TravelFromObject The script started working as intended again.
« Last Edit: August 23, 2015, 11:30:08 AM by Kryz »

Offline Crome969

  • Elite
  • *
  • *
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: It Worked then...
« Reply #1 on: August 24, 2015, 04:58:07 AM »
0
As Application Developer myself let me give you some hints what could be the possible scenarios :

1) You changed something in your code and forgot, this changed the test scenario
2) The Envirement (Ingame) changed so your scenario cannot be 100% repeated
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.

In order to find issues always try to do following steps :

1) Make Backups and use merging tools to find differences. The more Backups the better.
2) Do line by line code testing, do practical tests on paper what result you would prefer and compare on variables what results you got. If they differ either your "paper" logic is *bleep* or some bug is behind.
3) Ask Questions on a level, a more advanced scripter\developer understand your problem. Also add snippets and explain what purpose and target this subfunction has.


If you have any questions on details about the above described ways, just ask, i can explain some things making your life easyier.

PS : My hints arent euo related, this is similar on openuo, stealth, injection or any scripting\coding project.

Offline KryzTopic starter

  • Jr. Member
  • **
  • Posts: 33
  • Activity:
    0%
  • Reputation Power: 1
  • Kryz has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
Re: It Worked then...
« Reply #2 on: August 24, 2015, 11:06:02 PM »
0
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:

Code: [Select]
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.


Offline Crome969

  • Elite
  • *
  • *
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: It Worked then...
« Reply #3 on: August 25, 2015, 04:11:20 AM »
0

Tags: