Author Topic: Execution Issues?  (Read 5445 times)

0 Members and 1 Guest are viewing this topic.

Offline PauloniusTopic starter

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +162
  • Referrals: 1
    • View Profile
Execution Issues?
« on: June 01, 2011, 05:32:59 AM »
0
I have been working on a simple rail miner script and ran into some issues that I don't fully understand in the last day or so.  I have been running it for a few weeks without a hitch and yesterday it started having issues.  I didn't edit any of the code, it just started screwing up spontaneously.  

Things I have noticed:

In a series where it is supposed to be moving items from a Findindex it can't pick some of them up.

While mining, it will give me the message for using a shovel three times and then there is a delay before the messages that indicate the targets were successful.  Normally these would immediately follow a successful target.  

The script seems to be simply missing some commands.  I have it set up to mount my fire beetle when it engages a creature, and then dismount to continue mining.  It doesn't do either consistently anymore.


Everything I am seeing looks like the effects of really bad lag, but I am not lagging when I shut the script down and try doing the same things manually.  I am also running other clients on the same shard, in the same location, and I don't lag scripting or not.  

I slowed the execution speed down and it still acts as though it is lagging, missing commands and such.

Anyone have any ideas what might be causing these issues?
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Execution Issues?
« Reply #1 on: June 01, 2011, 07:01:08 AM »
0
sounds strange paulo.... probably would have to see the code to help diagnose it...  Does it happen when you use others miners ?
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline Masscre

  • Gran Master Jester !!
  • Scripthack
  • *
  • Posts: 4615
  • Activity:
    0%
  • Reputation Power: 55
  • Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!
  • Gender: Male
  • Air Guitar Commander !!
  • Respect: +144
  • Referrals: 1
    • View Profile
Re: Execution Issues?
« Reply #2 on: June 01, 2011, 07:05:53 AM »
0
Just out of curiosity have you tried changing your LPC down some?

Offline The Reaper

  • Jr. Member
  • **
  • Posts: 42
  • Activity:
    0%
  • Reputation Power: 1
  • The Reaper has no influence.
  • Respect: +14
  • Referrals: 1
    • View Profile
Re: Execution Issues?
« Reply #3 on: June 01, 2011, 10:05:46 AM »
0
I too have had one or two similar issues recently.

I've narrowed it down to scripts that have been using out-dated commands. IE event drag, instead of exevent drag etc.

Basically, scripts like this were often written back in EUO 1.4

Also, check the "Repeat" and "While" commands. If they call subs out of the loop, make sure they return to the loop. If they contain "Goto" commands this could be causing your issue.

All in all, it's often easier to re-write the coding from scratch than de-bug someone elses code :S

Offline PauloniusTopic starter

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +162
  • Referrals: 1
    • View Profile
Re: Execution Issues?
« Reply #4 on: June 01, 2011, 02:11:21 PM »
0
Just to help focus the question a bit:

This script is new code that I wrote in the last month. I am not using any retired commands

The script has worked for several weeks (probably 200 hours) without issues. The script has only developed these problems in the last two days.

The issue doesn't go away if I restart script, UO, computer.  It is there right at start up.


@Mass I did try dropping the execution speed and it didn't fix the problem.

@The script is a mess and has some things I don't want public, but I would like to keep the discussion public.  I will start posting the subs on this thread and see if anyone can see where the issues are.


This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

Offline The Reaper

  • Jr. Member
  • **
  • Posts: 42
  • Activity:
    0%
  • Reputation Power: 1
  • The Reaper has no influence.
  • Respect: +14
  • Referrals: 1
    • View Profile
Re: Execution Issues?
« Reply #5 on: June 02, 2011, 09:41:48 AM »
0
In that case the only thing left are corrupt Global (saved) variables. In which case you'd need to write a sub to reset them. Not that I can of much help, my windows update on my PC corrupted this morning, and I'm left with an OS that won't boot. Not much chance of recovering some of my stuff, but a lot will be backed up on my laptop or my portable hard drive.

oooooo, it would appear that the repair function on the win CD is actually trying to do something, first time I've ever had it actually work :S

Offline Masscre

  • Gran Master Jester !!
  • Scripthack
  • *
  • Posts: 4615
  • Activity:
    0%
  • Reputation Power: 55
  • Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!Masscre is leading the good life!
  • Gender: Male
  • Air Guitar Commander !!
  • Respect: +144
  • Referrals: 1
    • View Profile
Re: Execution Issues?
« Reply #6 on: June 02, 2011, 04:30:09 PM »
0
Keep the info coming Paul.   I love a challenge and the more information we have the more we can do. Also if you want you can pm the file and I will look it over paul if that will help you any.

Offline PauloniusTopic starter

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +162
  • Referrals: 1
    • View Profile
Re: Execution Issues?
« Reply #7 on: June 07, 2011, 01:44:07 PM »
0
90% sure I have found my issue.  I am using a For statement to move stuff, in this case to load up tools.  If I need three shovels it looks something like this

Code: [Select]
Finditem %Shovels C_ , %Wherevermyshovelsare
For #Findindex 1 %ShovelsToGet
  {
   exevent drag #FindID
   Wait 10
   exevent dropc #BackpackID
   Wait 10
   }

Instead of using the correct variable for the upper limit on the FOR statement, I had mistakenly substituted a variable that was assigned to the item type for shovel.  I am not sure why, but this caused the script to load one shovel and then act wanky.  After writing this explanation I realize that it was prospectors tools, but you get the idea...
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

Offline PauloniusTopic starter

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +162
  • Referrals: 1
    • View Profile
Re: Execution Issues?
« Reply #8 on: June 07, 2011, 08:46:22 PM »
0
Holy crap, the problem was I was running a stat modification script at the same time that was mucking with my miner.  I can't believe I didn't figure that out earlier. 
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

Offline The Reaper

  • Jr. Member
  • **
  • Posts: 42
  • Activity:
    0%
  • Reputation Power: 1
  • The Reaper has no influence.
  • Respect: +14
  • Referrals: 1
    • View Profile
Re: Execution Issues?
« Reply #9 on: June 08, 2011, 02:54:02 AM »
0
Code: [Select]
Finditem %Shovels C_ , %Wherevermyshovelsare
For #Findindex 1 %ShovelsToGet
  {
   exevent drag #FindID
   Wait 10
   exevent dropc #BackpackID
   Wait 10
   }

This is really risky coding  :o

Try something like this instead:
Code: [Select]
For %xyz 1 %ShovelsToGet
    {
    Finditem %Shovels C_ , %Wherevermyshovelsare
    if #kindkind = -1
       {
       display ok You've run out of shovels
       halt
       }
    exevent drag #FindID #findstack
    wait 10
    exevent dropc #BackpackID
    wait 10
    }

The use of #findindex was probably screwing it up. Much easier to just search for a new shovel in the secure. Note that the variable %xyz isn't called anywhere, it doesn't need to be.

And I know exevent drag defaults to 1, but I prefer to state it, it then becomes a re-useable sub for much more.

Offline PauloniusTopic starter

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +162
  • Referrals: 1
    • View Profile
Re: Execution Issues?
« Reply #10 on: June 08, 2011, 04:04:22 AM »
0
This coding was not the problem I was seeing.  However, I am curious to know why you think its risky.  I use similar coding a lot and it is very consistent -- when I am not thoughtlessly running a second script that interferes with it.
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Execution Issues?
« Reply #11 on: June 08, 2011, 07:10:24 AM »
0
Code: [Select]
Finditem %Shovels C_ , %Wherevermyshovelsare
For #Findindex 1 %ShovelsToGet
  {
   exevent drag #FindID
   Wait 10
   exevent dropc #BackpackID
   Wait 10
   }

This is really risky coding  :o

Try something like this instead:
Code: [Select]
For %xyz 1 %ShovelsToGet
    {
    Finditem %Shovels C_ , %Wherevermyshovelsare
    if #kindkind = -1
       {
       display ok You've run out of shovels
       halt
       }
    exevent drag #FindID #findstack
    wait 10
    exevent dropc #BackpackID
    wait 10
    }

The use of #findindex was probably screwing it up. Much easier to just search for a new shovel in the secure. Note that the variable %xyz isn't called anywhere, it doesn't need to be.

And I know exevent drag defaults to 1, but I prefer to state it, it then becomes a re-useable sub for much more.

Ouch on Both methods

Repear using #findindex is perfectly valid and preferable to multiple search.  Finditem is the slowest command in the game and why do it x times when you get all the results you need by calling it once.

Paulo ... you do for #findindex %ShovelstoGet without first checking that #findcnt is actually greater than the number of shovels to get (in posted code) this could cause invalid drag drops...

This is how i would do it, bascially just adding in a check to make sure dont try and get more shovels than where found.

Code: [Select]
Finditem %Shovels C_ , %Wherevermyshovelsare
set !Get %ShovelsToGet
if !Get > #findcnt
  set !Get #findcnt
if !Get > 0
  {
  For #Findindex 1 !Get
    {
   exevent drag #FindID
   Wait 10
   exevent dropc #BackpackID
   Wait 10
   }
  }
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline PauloniusTopic starter

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +162
  • Referrals: 1
    • View Profile
Re: Execution Issues?
« Reply #12 on: June 08, 2011, 07:59:36 AM »
0
Thanks EN, always appreciate your eye.  I have a check, but I like yours better as usual. 
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

Offline The Reaper

  • Jr. Member
  • **
  • Posts: 42
  • Activity:
    0%
  • Reputation Power: 1
  • The Reaper has no influence.
  • Respect: +14
  • Referrals: 1
    • View Profile
Re: Execution Issues?
« Reply #13 on: June 08, 2011, 08:13:35 AM »
0
Yes, EN's code would be faster than mine although they do the same thing effectively. Sorry I didn't explain myself about needing to check that you actually have shovels to move.

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Execution Issues?
« Reply #14 on: June 08, 2011, 08:37:30 AM »
0
Yes, EN's code would be faster than mine although they do the same thing effectively. Sorry I didn't explain myself about needing to check that you actually have shovels to move.

Yes the code does do same thing effectively... but differently...  I have a bunch of rules i always try and follow, the applicable ones for this snippet are

1) use as little finditems as possible .. their slow and can cause crashes with multi scripts.
2) Only ONE halt command per script.
3) Dont use findkind use findcnt.

But hell thats me theirs more than one way to skin a cat and as long as the job is done.

 
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Tags: