Author Topic: Multiple scripts running high LPC...  (Read 3544 times)

0 Members and 1 Guest are viewing this topic.

Offline OMGBurgersTopic starter

  • Hero Member
  • *
  • Posts: 800
  • Activity:
    0%
  • Reputation Power: 7
  • OMGBurgers has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Multiple scripts running high LPC...
« on: January 11, 2012, 01:46:29 PM »
0
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?

Offline OMGBurgersTopic starter

  • Hero Member
  • *
  • Posts: 800
  • Activity:
    0%
  • Reputation Power: 7
  • OMGBurgers has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: Multiple scripts running high LPC...
« Reply #1 on: January 12, 2012, 02:48:18 PM »
0
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?

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: Multiple scripts running high LPC...
« Reply #2 on: January 13, 2012, 11:22:04 AM »
0
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.
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 TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Multiple scripts running high LPC...
« Reply #3 on: January 13, 2012, 11:58:33 AM »
0
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.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +123
  • Referrals: 1
    • View Profile
Re: Multiple scripts running high LPC...
« Reply #4 on: January 14, 2012, 12:30:02 PM »
0
What is your CPU usage at the time
Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Offline Newsman

  • Hero Member
  • *
  • Posts: 627
  • Activity:
    0%
  • Reputation Power: 8
  • Newsman has no influence.
  • Respect: +38
  • Referrals: 2
    • View Profile
Re: Multiple scripts running high LPC...
« Reply #5 on: January 14, 2012, 01:35:38 PM »
0
pvp scripts?

Offline OMGBurgersTopic starter

  • Hero Member
  • *
  • Posts: 800
  • Activity:
    0%
  • Reputation Power: 7
  • OMGBurgers has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: Multiple scripts running high LPC...
« Reply #6 on: January 14, 2012, 01:48:03 PM »
0
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

Offline OMGBurgersTopic starter

  • Hero Member
  • *
  • Posts: 800
  • Activity:
    0%
  • Reputation Power: 7
  • OMGBurgers has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: Multiple scripts running high LPC...
« Reply #7 on: January 14, 2012, 01:53:31 PM »
0
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.

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +123
  • Referrals: 1
    • View Profile
Re: Multiple scripts running high LPC...
« Reply #8 on: January 14, 2012, 05:12:06 PM »
0
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. 
Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Tags: