ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: OMGBurgers on January 11, 2012, 01:46:29 PM

Title: Multiple scripts running high LPC...
Post by: OMGBurgers on January 11, 2012, 01:46:29 PM
I've noticed some of my scripts running kinda slow lately and I think it's because I have too much going on at once.  For example I typically run a looter, pvm script, and pvp script.  The looter is running just 100lpc, but the pvm/pvp ones are running often around 1000lpc, but switch back and forth from low to high, journal scanning, pixel scanning etc.

Before on OSI shard I did run a looter, but never a pvp script, and things ran fine.  Typically scan times were low from 25-100ms complete cycles on everything.  Since I wrote the pvp one I noticed the cycle times have been getting extremely high, around 500-1000ms which isn't acceptable haha.

I rethought some of the coding for some pixel scanning, and came up with some options to simplify things, which will hopefully speed things up.  But I'm wondering if i'll be still encountering problems because of all the journal scanning.

Also each script does have hotkeys associated with them, which make toggling them a pain when things kinda run slow!

I'm wondering if I should remove a lot of the journal/pixel scanning out of the individual scripts, and incorporate them into like a master control type script?  One that handles all the journal crap, pixel stuff, and hotkey things and kinda queues them up for the other scripts to use?  I just already have enough tabs open and don't want more, especially if it wont solve anything!

Another thing is I'd like to run 5 clients at once, and I'm having problems with the two... lol...  Any ideas?
Title: Re: Multiple scripts running high LPC...
Post by: OMGBurgers on January 12, 2012, 02:48:18 PM
okay well i did quite a bit of changes in one of the scripts and it really helped.  scan times are down to average of 25ms which is great to compared to what it used to be.

now i wonder if trying to improve the other scripts will make the scan times even faster?  or are they all kinda seperate from eachother?  wondering if anyone knows how easyuo executes scripts when you have multiple ones running, like which has priority, or are they all ran seperatley somehow?
Title: Re: Multiple scripts running high LPC...
Post by: Endless Night on January 13, 2012, 11:22:04 AM
they are all run in their own separate threads.  Each accesses the client independently of the others... so if you have 5 scripts all looking at the same client it is the same load as if you had 5 scripts looking at 5 different clients.

But being as they all share the same time slice.. making one script more efficient should make them all run smoother.
Title: Re: Multiple scripts running high LPC...
Post by: TrailMyx on January 13, 2012, 11:58:33 AM
What I have done from time to time is to set a priority for a given script tab.  So if one tab needs to take over from the rest of the tabs, I'll send a signal to the other tabs to scale back their #LPC until the time-critical event is over.  I do that in the heart wood quester to give more speed priority to the looter when evaluating.
Title: Re: Multiple scripts running high LPC...
Post by: manwinc on January 14, 2012, 12:30:02 PM
What is your CPU usage at the time
Title: Re: Multiple scripts running high LPC...
Post by: Newsman on January 14, 2012, 01:35:38 PM
pvp scripts?
Title: Re: Multiple scripts running high LPC...
Post by: OMGBurgers on January 14, 2012, 01:48:03 PM
pvp scripts?

free shard w/ no skill cap 4/6 casting.  i never used scripts for the scrubs on osi lol, well the exception of one to handle the 20 ninja belts
Title: Re: Multiple scripts running high LPC...
Post by: OMGBurgers on January 14, 2012, 01:53:31 PM
What is your CPU usage at the time

I've got 3 fishers going, and 2 pvm bots at the moment.  CPU usage is 11% w/ media player, browser, icq, running.  The fishing scripts are all low lpc, at about 100 if that.  The pvm bots use two scripts a piece, so about 7 scripts going.  I checked if i ran 2 easyuos that it did help.  Maybe I just need to fix my script computer.  Just since I played freeshards and using razor now it don't matter if anything crashes because I don't need to shut them all down just to get my uosassist back.
Title: Re: Multiple scripts running high LPC...
Post by: manwinc on January 14, 2012, 05:12:06 PM
Hmm.... That's Definitely A Strange Occurrence then.

Typically when Running Multiple Scripts and Clients its with the Army, and The Only Time I Notice Fluctuations in my Average Time Cycles is if My CPU Usage Exceeds 80%. On My Present POS Laptop, I can Barely Handle 2 Clients and 3 Scripts at 9999 LPC At Once.

Best thing to watch out for is that Certain Commands Have Built In Wait Timers. Event macros Timers can even exceed 40 ms. Finditem Command Takes a while If there are lots of Things in the List, OR if you have too many items in the Ignoreitem List.

Test out the Time Required On Certain Commands and then Limit Them to only do them so many Cycles Etc. For Instance, I limit Buff Bar Scanning to once ever 250 MS, Finding Monsters to Every 500 MS, and even then Limit the Finditems to Tiers of distance 1, 3, 6, 9. So it Limits how many items the Finditem Builds, and even then I will LImit the script to Only Compare Ranks and Distances on the First 4 Monsters.

Lots of things you can do.

But my shitty computer still sucks.