Author Topic: #LPC  (Read 5974 times)

0 Members and 1 Guest are viewing this topic.

Offline 12TimesOverTopic starter

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +321
  • Referrals: 2
    • View Profile
#LPC
« on: August 07, 2011, 04:51:05 AM »
0
Looking for a little feedback on the use of #LPC in a script or sub. I understand what #LPC is and have read what is actually not a bad Advanced Tutorial that Cheffe did a long time ago on EasyUO. The piece that I would like to understand is when people decide to change it in their scripts. What kind of actions, etc are you upping #LPC for?

For example, TM, you change the #LPC to 100 in your casting subs. Why?

TIA for any feedback.

X
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: #LPC
« Reply #1 on: August 07, 2011, 07:03:53 AM »
0
There's a utility that calculates LPC for your PC on easyuo.
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline gimlet

  • Very Super Secret
  • Global Moderator
  • *
  • *
  • Posts: 6206
  • Activity:
    3.2%
  • Reputation Power: 71
  • gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!
  • Gender: Male
  • Respect: +274
  • Referrals: 3
    • View Profile
Re: #LPC
« Reply #2 on: August 07, 2011, 07:26:48 AM »
0
OK What is LPC?

Offline JustAnotherFace

  • Hero Member
  • *
  • Posts: 530
  • Activity:
    0%
  • Reputation Power: 8
  • JustAnotherFace has no influence.
  • Gender: Male
  • My new toy....
  • Respect: +24
  • Referrals: 4
    • View Profile
Re: #LPC
« Reply #3 on: August 07, 2011, 07:56:06 AM »
0
Lines Per Cycle.... basically it tells the script how fast to execute the lines in the script following that LPC# command, and continues executing the script at that speed until you reset it to something else.  It has been a long time since I have played with it, but if I remember correctly LPC# 100 is the standard speed at which all script lines execute without using the LPC# command. 
All that tyranny needs to gain a foothold is for people of good conscience to remain silent.
Thomas Jefferson

Offline JustAnotherFace

  • Hero Member
  • *
  • Posts: 530
  • Activity:
    0%
  • Reputation Power: 8
  • JustAnotherFace has no influence.
  • Gender: Male
  • My new toy....
  • Respect: +24
  • Referrals: 4
    • View Profile
Re: #LPC
« Reply #4 on: August 07, 2011, 07:59:50 AM »
0
Correction... the default is 10 LPC.  As seen in the EUO command reference page:

Quote
The LinesPerCycle command sets the number of lines that the EasyUO parser runs through for every cycle. The default value is 10 and is reset when you stop the script.
 
Cheffe's description of lines per cycle, and cycles per second:

"EUO has 20 cycles per second and in each cycle it executes 10 lines (default). Some commands have built in waits so that the script speed slows down considerably.
 
You can't say that one command is faster than the other. EUO gives away most of the available processing time so that the UO client can have it.
 
EUO doesn't know the difference between a processing intensive task such as "finditem *" at WBB or a simple "set %x 3". While 10 lines per cycle is already too fast if you have 10 finditems in a row you could execute hundreds of set instructions in the same time without stressing the CPU."
 

Read here: http://www.easyuo.com/forum/viewtopic.php?p=21269


Quote from Cheffe:

Quote
Hmmm, maybe I should explain this a bit better:

EUO has 20 cycles per second and in each cycle it executes 10 lines (default). Some commands have built in waits so that the script speed slows down considerably.

You can't say that one command is faster than the other. EUO gives away most of the available processing time so that the UO client can have it.

EUO doesn't know the difference between a processing intensive task such as "finditem *" at WBB or a simple "set %x 3". While 10 liens per cycle is already too fast if you have 10 finditems in a row you could execute hundreds of set instructions in the same time without stressing the CPU.

I'm working on a concept that'll estimate the needed processing time for each command and speed up execution for commands that need virtually no time at all (so that you can execute more of those per cycle).

You can already do that now using linespercycle. If you use this command wisely you can speed up execution speed in parts of the script where a lot of time is wasted and slow down execution in parts that are more difficult for the CPU.

I hope that clears it up.

Also, an advanced tutorial on LPC posted by Cheffe can be found here:

http://www.easyuo.com/forum/viewtopic.php?t=17091

JaF
« Last Edit: August 07, 2011, 08:04:15 AM by JustAnotherFace »
All that tyranny needs to gain a foothold is for people of good conscience to remain silent.
Thomas Jefferson

Offline 12TimesOverTopic starter

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +321
  • Referrals: 2
    • View Profile
Re: #LPC
« Reply #5 on: August 07, 2011, 08:20:53 AM »
0
Thanks JaF, already read all that. What I'm wondering is how some of our talent actually utilizes it. Why? Where?
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Offline JustAnotherFace

  • Hero Member
  • *
  • Posts: 530
  • Activity:
    0%
  • Reputation Power: 8
  • JustAnotherFace has no influence.
  • Gender: Male
  • My new toy....
  • Respect: +24
  • Referrals: 4
    • View Profile
Re: #LPC
« Reply #6 on: August 07, 2011, 12:17:04 PM »
0
Thanks JaF, already read all that. What I'm wondering is how some of our talent actually utilizes it. Why? Where?

Sorry 12, that was directed mainly at Gimlet who asked what LPC was.  I unfortunately can not add much more useful information to this.

JaF
All that tyranny needs to gain a foothold is for people of good conscience to remain silent.
Thomas Jefferson

Offline Alpha

  • Hero Member
  • *
  • Posts: 583
  • Activity:
    0%
  • Reputation Power: 10
  • Alpha barely matters.Alpha barely matters.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: #LPC
« Reply #7 on: August 07, 2011, 12:51:12 PM »
0
@ 12x

As far as I know the common things that people adjust LPC for are the ones that don't have set delays built into them. (ex... finditem)

Journal Scanning
Pixel Scanning

Are the 2 I use it most for.

Offline 12TimesOverTopic starter

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +321
  • Referrals: 2
    • View Profile
Re: #LPC
« Reply #8 on: August 07, 2011, 01:08:22 PM »
0
Ah k, gotcha JaF ;)

Journal Scanning
Pixel Scanning

Are the 2 I use it most for.
Thx Alpha.

I guess I'll have to do some testing with some of my subs to see what the difference seems to be. It doesn't seem to do much good to me to cycle 100 lines when I need to throw a wait in ther eanyhow for example.

X
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Offline NObama

  • Everything I need to know, I learned from Miffy's Item Finder.
  • Elite
  • *
  • *
  • Posts: 3454
  • Activity:
    0%
  • Reputation Power: 43
  • NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.NObama is a force to reckon with.
  • Respect: +161
  • Referrals: 2
    • View Profile
Re: #LPC
« Reply #9 on: August 07, 2011, 03:28:06 PM »
0
I think manwinc is a good person to ask.  As I recall, he's written some scripts that make judicious use of #LPC.

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: #LPC
« Reply #10 on: August 07, 2011, 03:53:23 PM »
0
I think it was said before in this thread.  Especially when journal scanning I kick up the #LPC to iterate quickly through the unscanned journal entries.  At #LPC of 10, and there are 20 cycles per second, that means you can do 200 lines per second.  Suppose you have an iterative function that has maybe 20 lines in it, that means you may only be able to loop through it 10 times a second to look for 1 entry.  Suppose you haven't updated your journal pointer for a while and have a depth of 50 entries in your journal.  That means it would take 5 seconds to run that one call to the journal scan function.  If you kick up to 100 LPC, it would take 0.5 seconds.
Please read the ScriptUO site RULES
Come play RIFT with me!

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: #LPC
« Reply #11 on: August 07, 2011, 11:22:05 PM »
0
I just codet in past my Scripts and checked how many lines i have in end, and kept sure he can scan the whole lines in 1 cycle.But i noticed my Ressource using of euo getting up when #lpc is tooo high, so its nothing for old Computers:).
I used lpc a lot when it comes in a way of OCR, complicated handling of Routines or something about Journalscanning as MTx said.

Kind Regards

Crome

Offline 12TimesOverTopic starter

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +321
  • Referrals: 2
    • View Profile
Re: #LPC
« Reply #12 on: August 08, 2011, 03:10:47 AM »
0
Good stuff guys, thanks!!

X
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Offline Neo

  • Prime Program
  • Elite
  • *
  • *
  • Posts: 821
  • Activity:
    0%
  • Reputation Power: 13
  • Neo barely matters.Neo barely matters.
  • Respect: +155
  • Referrals: 3
    • View Profile
Re: #LPC
« Reply #13 on: August 12, 2011, 04:03:04 PM »
0
I'm new at using this, but this is what I found in my crafter's check sub:

This is part of it
Code: [Select]
repeat
finditem %weapon C_ , %trashbag
set %currentweapon #findid
wait 10
if #findkind = -1
   {
   return
   }
event property #findid
wait 5
for %cproprange %custompropmin 150
    {
    if ( %customprop , #spc , %cproprange in #property && %custompropchk = #true )
       {
       set %custompropcnt %custompropcnt + 1
       set %totalcnt %totalcnt + 1
       menu Text EUOLabel38 216 280 %custompropcnt
       menu Text EUOLabel19 456 296 %totalcnt
       gosub keep %currentweapon
       ignoreitem #findid
       return
       }
    }
So, I have several checks like this one in this sub... I use event property once, then I do all the checking for the weapon properties... In this first one (for %cproprange %custompropmin 150) the 'range' its going to check for is minimum amount of intensity the user wants, up until 150... So, if the user wants to save any weapon with Luck above 30, it will check for 30, 31, 32, ..., 150. Same thing to check for other properties. I have no full understanding how easyuo would work exactly doing this, but I did notice that it took a while to finish checking the weapon when I first wrote this sub like this...

Then I changed #LPC to 1000 for this specific sub, and apparently this "wait time" to check the weapon's properties was gone. It feels almost instant now...

So, while in this sub, I set #LPC to 1000, and before exiting the sub, I set it back to what it was previously (10 I guess).
« Last Edit: August 12, 2011, 04:04:44 PM by frneo »
Never refuse an invitation.
Never resist the unfamiliar.
Never fail to be polite.
And never outstay your welcome.

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: #LPC
« Reply #14 on: August 16, 2011, 05:22:22 PM »
0
I use LPC in alot of functions... but i normally save the old LPC and restore it at the end of said function.

I use it to:
- Load large vairable lists (like in my overseer script)
- Large amounts of number crunching/calculations
- Intensive Tile scanning to make it seem like my miner/lumberjacker is not scripted as he instantly mines)
- any time intensive repetative action...

My buffbar scanner... uses a LPC of 9999... this allows it to function at acceptable speeds otherwise the scanner would be uselessly slow.
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: