View Full Version : Scripts start moving super slow after about 10-15 minutes
whiteflash
09-08-2011, 07:49 PM
So after a few minutes some of my lich scripts stop working at a smooth pace, including go2.
I have several minor personalize scripts to do things like clear prepped spells and cast something else for example. Or piercing gaze all the boxes in the room.
After about 10-20 minutes logged in they stop working fast, they still run, but it will be like.
prep 416, a 15 second pause, cast at xx box, rinse repeat.
Go2 works, but there are long pauses between movements.
Any ideas as to what might be causing this would be awesome. Thanks.
Also seems to effect only one of the chars I may have logged in at any given time, my main, sadly.
boardergeek
09-08-2011, 08:21 PM
Operating System? Front End (Wizard or SF)? Any other programs running? How does the game react if you type in the front end? Is it snappy or just a laggish?
If running windows, what does your task manager show, specifically how much CPU is Ruby using when the slowness occurs.
If running Mac OSX I think the same can be determined with Process Monitor.
If running Linux, use top to determine the same.
I doubt you will get any answers with the amount of detail provided in your initial post.
If you have a script that loops without any pause/sleep/wait in it, this could happen, though it would most likely happen as soon as the loop started, not 15 minutes later.
whiteflash
09-08-2011, 08:36 PM
Sure, more info.
Windows 7, 16g RAM, stormfront. ;loot, and my aliases all seem snappy. So voodoo is working just fine.
This seems to only happen to one of my chars, Draithe, doesn't matter if hunting or not. waggle, go2, and other multi-command scripts just start running super super slow. If I exit out and re-enter the game, the scripts start running smoothly again. Dunno if a file has gone wrong or what
Other chars I have logged in at the same time do not experience this (obviously I MA), and seem to run all scripts at a normal pace. Spell up, singing, whatever.
Appreciate the responses greatly, getting sick of logging in and out, heh.
Tillmen
09-08-2011, 08:41 PM
It's still probably caused by a runaway loop. For example:
loop {
if mana > 20
sleep 1
end
}
In theory, you have something besides "sleep 1" when the if statement is true, but the idea is there's some case where the loop is doing nothing except checking a conditional a billion times per second, and that case doesn't have to show up right away.
boardergeek
09-08-2011, 09:00 PM
bow to Tillman and Brute, those are the obvious answers and have had the same experience. Though I side with Brute in that my scripts ended up in the no pause loop immediately not later. I can imagine a lot of scenarios there your loop wouldn't come up until a point later than immediately starting it though.
Anyone in the habit of putting a sleep 0.1 at the end of all loops to prevent this? Or is the answer just be a better scripter?
whiteflash
09-08-2011, 09:24 PM
It's still probably caused by a runaway loop. For example:
loop {
if mana > 20
sleep 1
end
}
In theory, you have something besides "sleep 1" when the if statement is true, but the idea is there's some case where the loop is doing nothing except checking a conditional a billion times per second, and that case doesn't have to show up right away.
Thanks a bunch again for the help. I'm a molecular biologist so this is all basically me looking at code and apeing stuff, I have zero idea what I'm actually doing. Could this code be the culprit? It might explain why only the char that uses this script is having hang ups.
target = script.vars[1]
if checkprep != 'None'
fput "release"
end
if checkmana >= 40
if target == nil
fput "incant 140"
else
fput "prepare 140"
fput "cast #{target}"
end
else
echo "*** NOT ENOUGH MANA FOR WALL ***"
end
boardergeek
09-08-2011, 09:55 PM
Is this in a loop? Or is the script being called repeatedly? How is the script ran? The way that script is written it will just go through once and be done and will not loop at all. The problem exist when you get stuck in a loop and there is no pause in the loop. Ruby will just loop as fast as it can so you have to introduce some way for the loop to slow down to allow ruby to run all the scripts without one loop dominating the processing. A sleep command anywhere within the loop (that is certain to execute) will cause the loop to slow down.
Thanks a bunch again for the help. I'm a molecular biologist so this is all basically me looking at code and apeing stuff, I have zero idea what I'm actually doing. Could this code be the culprit? It might explain why only the char that uses this script is having hang ups.
target = script.vars[1]
if checkprep != 'None'
fput "release"
end
if checkmana >= 40
if target == nil
fput "incant 140"
else
fput "prepare 140"
fput "cast #{target}"
end
else
echo "*** NOT ENOUGH MANA FOR WALL ***"
end
whiteflash
09-08-2011, 10:04 PM
Is this in a loop? Or is the script being called repeatedly? How is the script ran? The way that script is written it will just go through once and be done and will not loop at all. The problem exist when you get stuck in a loop and there is no pause in the loop. Ruby will just loop as fast as it can so you have to introduce some way for the loop to slow down to allow ruby to run all the scripts without one loop dominating the processing. A sleep command anywhere within the loop (that is certain to execute) will cause the loop to slow down.
This script exits after every use, I stopped using it the last few hunts and have not run into the problems I was having before. See if that pattern holds. This script got written because I kept blasting my brother with dark catalyst during fights when I want to wall him so destroyers don't fuck him up.
That wasn't it, still doing it. Seems to mainly hold up in go2 when moving to do actions such as go ledge, or moving the tines going into the rift. Regular movement is somewhat slower, but not super slow. Again, logging out and back in fixes it. Hmmmm....
boardergeek
09-08-2011, 11:13 PM
Copy and paste the output of ;list all when it is slowing down.
This script exits after every use, I stopped using it the last few hunts and have not run into the problems I was having before. See if that pattern holds. This script got written because I kept blasting my brother with dark catalyst during fights when I want to wall him so destroyers don't fuck him up.
That wasn't it, still doing it. Seems to mainly hold up in go2 when moving to do actions such as go ledge, or moving the tines going into the rift. Regular movement is somewhat slower, but not super slow. Again, logging out and back in fixes it. Hmmmm....
So, this just happened to me on my brothers character, go2 moving extremely slow, certain aliases not moving quickly.
Figure that determines that it is not his computer, but something specific to his character or character settings within lich.
I was running this at log in
--- Lich: loot, rnum, voodoo, infomon, lnet, uberbar, sorter, exec1.
When I noticed the problems occuring it showed this
--- Lich: rnum, voodoo, sorter, exec1.
boardergeek
09-09-2011, 04:47 PM
And you confirmed that it wasn't in game lag? I don't know, maybe try an ;update update forcemap. I noticed some off things happening with a bad map database. If it is happening on two completely different computers then I would say either game lag (connectivity has been spotty lately) or a change to go2 that didn't work as intended. I know there was a change to ;go2 targets that slowed down that specific function significantly it could be that change has to do with updates to the map database file that is having some unintended consequences.
To be honest, I am out of my skillset hear since I have not studied the map database file or how go2 interacts with those.
It doesn't only affect go2 though, voodoo becomes somewhat inoperable as well. So along with moving slow, you don't cast either.
Which files can you delete\clear without losing aliases, possibly something got corrupted and it is ceasing to work when it hits that portion.
whiteflash
09-23-2011, 06:39 PM
So figured out a little more about this problem and I'm a bit scared to start randomly deleting things.
Basically after logging in for a bit and hunting everything slows down, this happens on both my computer and my brothers ONLY when logging into Draithe (my main). This mainly manifests in go2 and other lich scripts going massively slow, but also general commands slow down. If I re-login this goes away for a while. Seems to be worse hunting in scatter??
Also of note sounds do not seem to attach to highlights to ONLY Draithe's stormfront. All other chars on both computers do not have this issue. Any help would be awesome, or even knowing what is ok to delete/redo in regards to Draithe specific files on my computer which won't destroy my ability to log in and play.
Here's the lich scripts I run on startup:
--- Lich v4.3.1 is active. Type ;help for usage info.
Please wait for connection to game server.
Welcome to GemStone IV (R) v5.10
Copyright 2011 Simutronics Corp.
All Rights Reserved
--- Lich: voodoo active.
--- Lich: uberbar active.
--- Lich: psisorter active.
--- Lich: updater active.
--- Lich: rnum active.
--- Lich: infomon active.
--- Lich: loot active.
Tillmen
09-23-2011, 06:52 PM
I would say, play until it happens again. When it happens, open up your task manager (start > run > taskmgr > ok) and switch to the performance tab. What we're all expecting to see is that your CPU Usage is stuck at or near 100%. If it's not, there's an entirely different sort of problem. With the task manager still open, go back to the game and do a ";list all". Start killing one script at a time, maybe five or ten seconds between scripts, and keep an eye on the task manager to see if the CPU Usage drops after killing one of the scripts.
Tillmen
09-23-2011, 06:53 PM
Also.. the CPU Usage may be at 50% for a duel core processor with the same problem.
whiteflash
09-23-2011, 07:56 PM
Also.. the CPU Usage may be at 50% for a duel core processor with the same problem.
Thanks, I really appreciate the help, will do that as soon as I have some game time. I figure it is getting stuck in a loop or something but it is specific to that char, and I use the same scripts on all of them. I run an i7 with 16g ram, if something is spiking my CPU it is pulling down a ton of computing!
whiteflash
09-24-2011, 12:41 PM
So, tried killing scripts one at a time. Here is an example of what happens.
This script simply casts 416 at all the boxes on the ground, typically it does so quite rapidly. When this catch happens it goes so slow the spell departs before it moves on to casting at the target box.
s>;gaze
--- Lich: gaze active.
[gaze]>prepare 416
You gesture and invoke the powers of the elements for the Piercing Gaze spell...
Your spell is ready.
s>
You feel the magic of your spell depart.
s>
You feel less drained.
You feel fully energetic again.
s>
[gaze]>cast #54229025
You don't have a spell prepared!
So I went through script by script killing them until I had no running, still caught in this super slow execution problem. CPU was 0-1% usage and Physical memory was at 17% the whole time. Still a problem when nothing is running.
s>;list all
--- Lich: no active scripts.
Another char I was running at the time had no problem running scripts at full speed. At this point I'm fairly sure it is the wizard client on this char and something is screwed up there. What can I delete and not screw with my ability to log into gemstone and lnet?
Tillmen
09-24-2011, 01:05 PM
If it's not a runaway loop, that makes this a lot harder to figure out.
I don't think deleting things is going to be as helpful as you think. You can delete pretty much everything except lich.rbw and scripts\lnet.lic if all you want to do is log in and use lnet. Of course, you should make a copy of your lich folder before you start deleting things.
Next time it happens type this:
;e loop { echo 'test'; sleep 1 }
If it doesn't echo every second, the problem is probably XML related. I'm not sure why an XML problem would be character specific unless it's caused by a spell knowledge enhancive item.
m444w
09-25-2011, 05:29 PM
Do you find you use a particular artifact before having problems? Like dhairn's horn?
Some times gms code stuff that out puts malformed xml... Not sure if you can think of a scenario where that might happen? Ive seen someone with feature alters that caused lich to freak out.
whiteflash
09-25-2011, 05:40 PM
Do you find you use a particular artifact before having problems? Like dhairn's horn?
Some times gms code stuff that out puts malformed xml... Not sure if you can think of a scenario where that might happen? Ive seen someone with feature alters that caused lich to freak out.
Dhairn is the only one who uses the horn. And we rarely use it hunting up in the rift, only to get down.
It is certainly something specific to Draithe on both of our computers. Even further if we do not hunt in the rift, this does not happen. I'm slowly getting used to just relogging after our rift hunts.
Gonna try removing some of the newer enhancives and other scripty items I have to see if that helps. Thanks for your input, I'm way out of my league here.
whiteflash
09-27-2011, 09:52 AM
Well, it has been narrowed down to breaking when entering the rift, perhaps even specific to entering the scatter. Tried removing some of his newer enhancives, didn't seem to make a difference.
I don't use scripts while hunting but for voodoo and a few aliases, but they seem to work fine for the 10-20 minutes a typical hunt lasts. Just relogging after hunts seems to be the status quo for now! Thanks for your various thoughts on the problem.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.