Author Topic: Need help with optimization, LPC, spell timers, and FC/FCR/LMC calcs of dual bot  (Read 17634 times)

0 Members and 1 Guest are viewing this topic.

Offline zaanTopic starter

  • Jr. Member
  • **
  • Posts: 13
  • Activity:
    0%
  • Reputation Power: 1
  • zaan has no influence.
  • Respect: +10
  • Referrals: 0
    • View Profile
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

There are 1 attachment(s) in this post. You must register and post an acceptable introduction to download
sampire-angelbot.txt
« Last Edit: August 14, 2019, 08:32:30 AM by zaan »

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +556
  • Referrals: 0
    • View Profile
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



Offline freddy

  • Sr. Member
  • *
  • Posts: 271
  • Activity:
    0%
  • Reputation Power: 4
  • freddy has no influence.
  • Gender: Male
  • Respect: +110
  • Referrals: 1
    • View Profile
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

Offline zaanTopic starter

  • Jr. Member
  • **
  • Posts: 13
  • Activity:
    0%
  • Reputation Power: 1
  • zaan has no influence.
  • Respect: +10
  • Referrals: 0
    • View Profile
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?

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +556
  • Referrals: 0
    • View Profile
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 ;)

Offline zaanTopic starter

  • Jr. Member
  • **
  • Posts: 13
  • Activity:
    0%
  • Reputation Power: 1
  • zaan has no influence.
  • Respect: +10
  • Referrals: 0
    • View Profile
Oooooooo thank you! I'll try it out. =]
« Last Edit: August 09, 2019, 09:22:59 AM by silvercypher »

Offline zaanTopic starter

  • Jr. Member
  • **
  • Posts: 13
  • Activity:
    0%
  • Reputation Power: 1
  • zaan has no influence.
  • Respect: +10
  • Referrals: 0
    • View Profile
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.

There are 1 attachment(s) in this post. You must register and post an acceptable introduction to download
angelbot.txt
« Last Edit: August 14, 2019, 08:32:59 AM by zaan »

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +556
  • Referrals: 0
    • View Profile
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

Offline zaanTopic starter

  • Jr. Member
  • **
  • Posts: 13
  • Activity:
    0%
  • Reputation Power: 1
  • zaan has no influence.
  • Respect: +10
  • Referrals: 0
    • View Profile
Oh! TY! Much cleaner.

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +556
  • Referrals: 0
    • View Profile
This is nice what you did with the menu.   Thx for sharing.

Offline zaanTopic starter

  • Jr. Member
  • **
  • Posts: 13
  • Activity:
    0%
  • Reputation Power: 1
  • zaan has no influence.
  • Respect: +10
  • Referrals: 0
    • View Profile
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. =]
« Last Edit: August 14, 2019, 01:48:05 PM by zaan »

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +556
  • Referrals: 0
    • View Profile
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.

There are 1 attachment(s) in this post. You must register and post an acceptable introduction to download
G-Bot 5.02 menu.JPG

Offline zaanTopic starter

  • Jr. Member
  • **
  • Posts: 13
  • Activity:
    0%
  • Reputation Power: 1
  • zaan has no influence.
  • Respect: +10
  • Referrals: 0
    • View Profile
Seems like some good calcs for Spell timers here:
http://www.easyuo.com/forum/viewtopic.php?f=2&t=25215&start=15

Offline freddy

  • Sr. Member
  • *
  • Posts: 271
  • Activity:
    0%
  • Reputation Power: 4
  • freddy has no influence.
  • Gender: Male
  • Respect: +110
  • Referrals: 1
    • View Profile
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.

Offline zaanTopic starter

  • Jr. Member
  • **
  • Posts: 13
  • Activity:
    0%
  • Reputation Power: 1
  • zaan has no influence.
  • Respect: +10
  • Referrals: 0
    • View Profile
awwwwww.... lol
Which site did you start? heheh glad you made friends.  8)

Tags: