ScriptUO

Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: zaan on August 07, 2019, 07:41:10 AM

Title: Need help with optimization, LPC, spell timers, and FC/FCR/LMC calcs of dual bot
Post by: zaan on August 07, 2019, 07:41:10 AM
Hello! this is my first script! =] So fun! I just took a bunch of awesome scripts and smashed them all together.
Can you help my with the more complex stuff, and optimizing it?
I think I need to dynamically change LPC depending upon the sub being run. What are some good LPC values for different subs? Also, I think I need a couple different spell/action timers to be dynamically set depending on the character, and type of spell/action. Finally, I'd like support implementing some subs for calculating FC/FCR/LMC for these timers.

Also, I notice most scripts don't have many comments. Do ;comments slow the script down?   
Maybe someone already has a script like this? (Twinkle McNugget?, Cervesa?)  ;D Thank you in advance!!

; Thank you scriptuo.com, easyuo.com, and uoguide.com!
; Merely a bunch of amazing work smashed together!
; Thank you so much! to these smart generous people:                                 ;
; Twinkle McNugget - Scanbar sub, inspiration, and blog posts
; --> http://www.easyuo.com/forum/viewtopic.php?p=392597
; Cerveza - Cerv's UOXL Swap Bot script, outline, and idea for script
; --> http://www.scriptuo.com/index.php?topic=4543.0
; dxrom - LAME 3.0 sampire script, idea, and menu
; --> http://www.scriptuo.com/index.php?topic=7538.180
; Einstein - Duo Sampire Healer bot idea
; --> http://www.scriptuo.com/index.php?topic=10509.0
; Felix - Warriors assistant
;--> http://www.easyuo.com/forum/viewtopic.php?t=40116&sid=5d1bf9d51f55afa026d7c21dcb51a078
; Endless Night - uoXL setup and swap, and scanbuffbar
; --> http://www.easyuo.com/forum/viewtopic.php?p=247583&sid=21e86aba8d10afa672a1b7eda6e006b7
; Trailmyx (TM) - Journal subs and blog posts.
;--> http://www.scriptuo.com/index.php?topic=33.0
; Tecmo - Tecmo's Creature ID (c)
; -->http://www.easyuo.com/forum/viewtopic.php?t=235&sid=8b60691e1a85040466803d81096298fb
; CEO - CEO Medic
; --> http://www.easyuo.com/forum/viewtopic.php?p=13869
Title: Re: Need help with optimization, LPC, spell timers, and FC/FCR/LMC calcs of dual bot
Post by: The Ghost on August 07, 2019, 08:46:08 PM
I disn't run the script I just  give it a read real quick.

First off,
Also, I notice most scripts don't have many comments. Do ;comments slow the script down?   
   They do not slow down script.     If small comment add you understand the flow, you can add so.

Second.
I read you main loop and you are missing alot of you end statement.
Let take this for example. 
 if %autotrapbox
     gosub trapbox

It is not going to do anything because you have set up anything.

You need to said this instead
if %autotrapbox = #true
     gosub trapbox

The #true is set when you put the check in the box.  that #true statement come from line 181 and line 1374  (menu get autotrapboxbox)

Have a look at the  rest of the main loop and if statement.

Good job


Title: Re: Need help with optimization, LPC, spell timers, and FC/FCR/LMC calcs of dual bot
Post by: freddy on August 08, 2019, 01:17:49 AM
I've only ever really needed to adjust the default LPC when processing strings/data; adjusting the LPC isn't going to make your script faster, and in some cases, it can cause errors. If you're just doing timers you shouldn't need to adjust LPC. combat events can benefit from faster processing, but you need to know what to speed up. i'd say work on getting your script stable before you worry about speeding it up
Title: Re: Need help with optimization, LPC, spell timers, and FC/FCR/LMC calcs of dual bot
Post by: zaan on August 08, 2019, 07:37:26 AM
Thank you The Ghost and freddy!! I really appreciate the replies!! =]

The Ghost: Good news about comments! I love comments! =]
Also, I thought like you that I needed "if %variable = #true" and "if %variable = #false", but then I noticed that easyuo can interpret booleans as just %variable or ! %variable respectively! =] So, I took out all = #true and = #false. Seems to work well without them. =]

freddy: OK! So, should I leave everything at the default LPC of 10? Except for the processing subs like the scanbuffbar? Or, should I leave the default LPC at 60 like LAME 3.0 uses? What about the wait 10 that is peppered about? after using spells/abilities? Should I make those dynamic to change with the LPC? Also, obviously i need 2 spell timers since i have 2 characters, but should i use a different timer for spells vs abilities and whatnot?

ALSO! I like to make my menu dynamic so it just iterates through my boolean variables, and creates the menu itself.  Was a pain to manually order and change my menu items as it grew. Was looking for some kind of loop like
Code: [Select]
for %i in "list of strings or variables"
{
     blah %i
}
Is there anything like that I can use?
Title: Re: Need help with optimization, LPC, spell timers, and FC/FCR/LMC calcs of dual bot
Post by: The Ghost on August 08, 2019, 02:00:06 PM
To help you with your menu   you can go to https://www.easyuo.com/downloads.php#euo15 
look for this,  that will help you build menu. 
Code: [Select]
Old EasyUO 1.42
This is the older version of EasyUO. It is no longer supported. Do NOT ask questions about it. It is available here for those that desire to use the older version and/or need it in order to use Scriptfellow's Menu Designer.

EasyUO V1.42 Menu Designer (UO 2D Client )
EasyUO V1.42 [Build 00B4] (UO 2D Client 5.0.0b or lower)


I will have to test that booleans value in some other build ;)
Title: Re: Need help with optimization, LPC, spell timers, and FC/FCR/LMC calcs of dual bot
Post by: zaan on August 08, 2019, 09:02:41 PM
Oooooooo thank you! I'll try it out. =]
Title: Re: Need help with optimization, LPC, spell timers, and FC/FCR/LMC calcs of dual bot
Post by: zaan on August 12, 2019, 07:53:04 AM
I tried the menu creator. Is great! But, not what I am looking for. I couldn't find a dynamic menu builder sub, so I kludged a checkbox menu together.
Here it is! Automatically builds a list of check boxes that turn on/off features.
Title: Re: Need help with optimization, LPC, spell timers, and FC/FCR/LMC calcs of dual bot
Post by: The Ghost on August 12, 2019, 03:01:11 PM
Will have to look at this snippet.

Here another way to check for the check box. It a little more cleaner.
Code: [Select]
sub Update
  gosub checkBoxes
    menu get conwepbox
        set %castConWep #menures
    menu get attackbox
        set %keepatk #menures
    menu get divinebox
         set %castFury #menures
    menu get eoobox
       set %castEOO #menures
    menu get lstrikebox
       set %useLS #menures
    menu get mstrikebox
       set %useMS #menures
    menu get confidencebox
       set %useConfidence #menures
    menu get primarybox
       set %usePrimary #menures
    menu get secondarybox
       set %useSecondary #menures
    menu get RemoveCurse
       set %removecurse #menures
   return
Title: Re: Need help with optimization, LPC, spell timers, and FC/FCR/LMC calcs of dual bot
Post by: zaan on August 12, 2019, 07:59:27 PM
Oh! TY! Much cleaner.
Title: Re: Need help with optimization, LPC, spell timers, and FC/FCR/LMC calcs of dual bot
Post by: The Ghost on August 12, 2019, 08:15:47 PM
This is nice what you did with the menu.   Thx for sharing.
Title: Re: Need help with optimization, LPC, spell timers, and FC/FCR/LMC calcs of dual bot
Post by: zaan on August 14, 2019, 08:31:59 AM
Ty! hehehe
I update the original script, and my dynamic menu example.

I also found these great menu Subs that Twinkle McNugget posted:
http://www.easyuo.com/forum/viewtopic.php?t=53162&p=431253

So cool you can add tooltips. =]
Title: Re: Need help with optimization, LPC, spell timers, and FC/FCR/LMC calcs of dual bot
Post by: The Ghost on August 14, 2019, 04:06:56 PM
With the Menu builder you can perform the same.   Once you save the template you can add to it, move items where you want to.

You can look here menu's and menu designer.   http://www.scriptuo.com/index.php?topic=1535.0
Here some  set #lpc What does it do?         http://www.scriptuo.com/index.php?topic=11375.0

Menu can be anything you want it to be.
Title: Re: Need help with optimization, LPC, spell timers, and FC/FCR/LMC calcs of dual bot
Post by: zaan on August 15, 2019, 06:39:09 PM
Seems like some good calcs for Spell timers here:
http://www.easyuo.com/forum/viewtopic.php?f=2&t=25215&start=15
Title: Re: Need help with optimization, LPC, spell timers, and FC/FCR/LMC calcs of dual bot
Post by: freddy on August 15, 2019, 11:36:15 PM
Seems like some good calcs for Spell timers here:
http://www.easyuo.com/forum/viewtopic.php?f=2&t=25215&start=15

what a blast from the past. I was banned from EUO and ended up starting my own site, which worked out really well becau7se i made a bunch of friends that were sick of EUO too.
Title: Re: Need help with optimization, LPC, spell timers, and FC/FCR/LMC calcs of dual bot
Post by: zaan on August 18, 2019, 05:13:18 PM
awwwwww.... lol
Which site did you start? heheh glad you made friends.  8)
Title: Re: Need help with optimization, LPC, spell timers, and FC/FCR/LMC calcs of dual bot
Post by: TrailMyx on August 19, 2019, 07:02:58 AM
freddy is why we're all here in this business.  He ran WinUO.com and I was brought on by his GMOD at the time, Cerveza.  So even though he's a young pup, he's the Godfather.  lol
Title: Re: Need help with optimization, LPC, spell timers, and FC/FCR/LMC calcs of dual bot
Post by: Endless Night on August 19, 2019, 09:23:08 AM
freddy is why we're all here in this business.  He ran WinUO.com and I was brought on by his GMOD at the time, Cerveza.  So even though he's a young pup, he's the Godfather.  lol

winuo.com   ...  now i feel old....  time sure flys
Title: Re: Need help with optimization, LPC, spell timers, and FC/FCR/LMC calcs of dual bot
Post by: TrailMyx on August 19, 2019, 12:52:28 PM
freddy is why we're all here in this business.  He ran WinUO.com and I was brought on by his GMOD at the time, Cerveza.  So even though he's a young pup, he's the Godfather.  lol

winuo.com   ...  now i feel old....  time sure flys

Shush!  It's almost time for the early-bird special and I'll be late for shufflepuck if I miss it!  :P
Title: Re: Need help with optimization, LPC, spell timers, and FC/FCR/LMC calcs of dual bot
Post by: zaan on August 23, 2019, 07:32:26 AM
Hehehehehe .... We'll I'm sure glad you folks started all this. So much knowledge! I'm having a blast learning.

What do you think of this chat bridge? https://github.com/jphein/duo

Title: Re: Need help with optimization, LPC, spell timers, and FC/FCR/LMC calcs of dual bot
Post by: freddy on August 26, 2019, 01:02:26 AM
I was 16/17 when winuo was a thing, then coders, then winuo, and finally scriptuo. i'm 30 now. time really does fly lol

edit: I can't believe how old UO is, also, the scripting community beyond EUO is what kept me in the game. Lots of smart people made a lot of awesome scripts that weren't allowed on easyuo and having a site devoted to that really brought some amazing scripts together. Trailmyx and cerveza's heartwood quester was a game changer. It really seemed like the wild west of scripting back when winuo/uocoders/scriptuo first started out. It was a lot of fun, and the best part was besides the beef between myself and the owner of coders, everyone got a long and just wanted to help out and create cool scripts with friends.
Title: Re: Need help with optimization, LPC, spell timers, and FC/FCR/LMC calcs of dual bot
Post by: freddy on August 26, 2019, 02:04:34 AM
So here's a little scripting history lesson.

WinUO never would have existed without a scripter named sorrowmaster who wrote the original mace and shield script. She quit UO and asked me to maintain the script, EUO banned the donation scripts, and I was banned soon after due to other reasons (I didn't get along with CEO) - i made a small site that hosted hers & my scripts, eventually made the message board and it attracted a lot of great scripters. sorrowmaster's script brought a ton of ppl to the site. I was a pretty bad admin, and i relied on donations and selling GTC to keep the site running - life hit me and winuo shut down, but Trailmyx has always been there to keep everything afloat. While I appreciate Trailmyx calling me the godfather, he's the real reason why this community exists today - i was a stepping stone - he is the mountain haha