ScriptUO

Official ScriptUO EasyUO Scripts => Script Snippets => Topic started by: manwinc on August 02, 2012, 07:40:09 PM

Title: Event Sleep Command
Post by: manwinc on August 02, 2012, 07:40:09 PM
I think Event Sleep is probably one of the Most Underused Commands available to us.

Event Sleep will reduce the CPU usage of your Client to 0%. Anyone who has ran multiple scripts and had them lose connection knows just how much CPU this game can eat up when its left at a con loss screen or at the Login Screen. I personally Now use this Command after Con Loss to Prevent my computer from overheating. Here is the Sub I use For Instigating Sleep

 

Code: [Select]
Sub MWinc_Sleep
; Gosub Mwinc_Sleep (Minutes)
Namespace Push
Namespace Local I_love_Da_Boobies
set !Minutes %1
set !Sleep_Timer 60000 * !Minutes
set !Wait_Timer ( ( !Minutes * 60 * 20 ) + 40 )
Event Sleep !Sleep_Timer
Wait !Wait_Timer
Namespace Pop
Return
Title: Re: Event Sleep Command
Post by: Endless Night on August 02, 2012, 08:02:55 PM
nice .. very nice...
Title: Re: Event Sleep Command
Post by: manwinc on August 02, 2012, 08:21:40 PM
Si, On a second note its also very important to stagger all logging in/ logging out..... If you don't and attempt to logout/in multiple clients simultaneously..... uhhh..... Yeah, bad idea.
Title: Re: Event Sleep Command
Post by: NObama on August 05, 2012, 06:51:40 AM
Well hot damn.  This is awesome.  Thanks, and +rep!
Title: Re: Event Sleep Command
Post by: manwinc on July 01, 2013, 12:17:44 AM
Whatever You do, Do not Run a Client Swapping Saluter While you attempt to sleep a client. If you Perform an In game macro on a client that's sleeping, it will actually crash.
Title: Re: Event Sleep Command
Post by: Crome969 on July 01, 2013, 03:19:54 AM
Whatever You do, Do not Run a Client Swapping Saluter While you attempt to sleep a client. If you Perform an In game macro on a client that's sleeping, it will actually crash.
I think Sleep sets the Clientthread to sleep.. So never wakue up sleeping dogs :P
Title: Re: Event Sleep Command
Post by: manwinc on July 01, 2013, 04:02:50 AM
Exactly what Crome said.

Otherwise its still an Excellent Tool for Keeping your CPU down on Logged out Clients.

I kept having crashes on some miners and Couldn't figure it out for the life of me. It was because of the Universal Saluter I was running to keep some other Scripts Logged in.
Title: Re: Event Sleep Command
Post by: Crome969 on July 01, 2013, 07:27:36 AM
Exactly what Crome said.

Otherwise its still an Excellent Tool for Keeping your CPU down on Logged out Clients.

I kept having crashes on some miners and Couldn't figure it out for the life of me. It was because of the Universal Saluter I was running to keep some other Scripts Logged in.

In Stealth you just could start second Application for Saluting with own thread handling ;-)
If EUO would have Stacks and Events, i would say add commands to Stack , Push new Line execute when Thread not sleeping.
Title: Re: Event Sleep Command
Post by: The Ghost on July 01, 2013, 08:41:50 AM
I have this little snippet running on my older machine to reduce CPU lot.  Thx.  Now  where should I try your Sub. :)

if #CONTNAME = MainMenu_gump
{
event sleep 100
}