ScriptUO

Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: dxrom on January 09, 2011, 08:58:08 PM

Title: Primary Ability
Post by: dxrom on January 09, 2011, 08:58:08 PM
I'm adding onto a script of mine, which is a sampire assist script. I want to add a sub to use primary abilities though (IE: Armor ignore) However I don't want it to simply spam the ability. How can I insert a check for it?

I thought I might be able to do it the same way I do lightning strike.
Code: [Select]
Journal Scanner:
if You_prepare_to_strike_quickly in #journal ;LS prepped
        set !lstrikeOn #true
if You_attack_with_lightning_precision in #journal ;hit with LS
        set !lstrikeOn #false

if #mana > 24
        set !usePrimary #true
        wait 1
        set !useLstrike #false
     else
         set !usePrimary #false
         wait 1
         set !useLstrike #true
Code: [Select]
Main Script:
if ( %useLS = #true ) && ( !useLstrike = #true ) && ( !lstrikeOn = #false )
     gosub LStrike

sub LStrike
    if !lstrikeOn = #false
       event macro 15 149
       wait 5
    else
        return
return

Although I quickly learned that I could not do it the same way. Because Primaries don't work the same way as LS.

How can I make a script use a primary ability, without spamming it?
Title: Re: Primary Ability
Post by: MeWonUo on January 09, 2011, 09:13:27 PM
Hi there,

Actually, you 'can' use a primary ability the same as lightening strike as long as you have a very large mana pool to keep it up. With the double mana cost that comes into play if you cast AI two times within 3 seconds it can be tough to keep up with.

Most sampire setups don't have that sort of mana pool, so they either alternate LS and AI, or they will do AI every three swings.

As for having the know how to help you with a check in your script, I'm afraid I can't be of much assistance there.  Just thought maybe setting it up to do one ability, then another and repeat might help a little in your venture. 

Also, definitely not in any way, shape, or form, would I ever try to sway you from working on your own tool.  Just wanted to mention that you should check out Twinkle McNugget's combat tool here if you haven't had a chance to.  It is purely insane, and has just about every skill you can think of included.  Who knows, you might be able to get some ideas as to how to get yours to do what you want by taking a peek at it?

Best of luck!
Title: Re: Primary Ability
Post by: dxrom on January 09, 2011, 09:46:36 PM
Armor ignore wont work the way I have my lightning strike setup. My lightning strike setup is a little obscure, but it works well. I start off by setting the !lstrikeOn #false outside of the main module, that way one of the main triggers is active for the if conditional, !lstrikeOn is the controlled by my journal scanner, it is set #true when it reads "You prepare to strike quickly" then once it hits, and reads "You attack with lightning precision" it is set to #false, this way even if I miss an attack it doesn't overlap itself and cancel the LS. %useLS is activated through a menu. !useLstrike is set to true when I am under 24 mana.

The issue with primary abilities is that there is no message like there is for LS, which is "You prepare to strike quickly" therefor I cannot run my script like that. What I need it to do, is activate the ability, then recognize that it is active, skipping that sub until it is no longer active (IE: my AI struck) thus preventing it from just spamming
Code: [Select]
event macro 35 0 which would just turn my primary ability off and on over and over.

With my sampire, I have been able to AI up to 17 times in a row, and I can generally AI atleast 6 times in a row before needing to utilize LS/Momentum Strike/Whirlwind to regain mana. However she only has a small mana pool of 72 mana. Her weapons have 55-62% mana leach, and at 140-153 damage AI's. That is alot of mana back.
Title: Re: Primary Ability
Post by: Kalaka on January 09, 2011, 09:53:02 PM
Ok I know in some scripts they input a script position check where you mouse over the Primary Ability Icon and it doesn't use it if it's already targeted. Maybe it uses hue, idk, there's some check with it with that.
Title: Re: Primary Ability
Post by: dxrom on January 09, 2011, 10:25:49 PM
Aye, that was something that I have been looking into. I am not a fan of having to move your mouse over in order to initialize it, but I have been thinking that maybe I could just have the ability spell pulled out in a hardcoded spot on the screen that never changes.
Title: Re: Primary Ability
Post by: Cerveza on January 10, 2011, 03:21:30 AM
To see if an icon'd ability has been used you really need to pixel scan it, or rely on the journal, provided you get a message with that particular ability.

I normally use pixel scanning where I set a pixel in the Lightning Strike icon and another in the Primary and/or Secondary weapon ability icons. The default is to toggle Lightning Strike to ON if the script ever detects that it is off... unless the script sees that Primary or Secondary is toggled on (manually by me), in which case it bypasses the LS toggle.

Using pixels you can ensure the status of the icon and make use of that in your scripts. The draw back is that you need to keep the pixel "in focus" on windows at all times. I believe Win7 can be used and not require a fully focused client.
Title: Re: Primary Ability
Post by: _C2_ on January 10, 2011, 04:29:10 AM
I second Cerveza's idea.  That is how I do it too.
Title: Re: Primary Ability
Post by: Scrripty on January 10, 2011, 07:03:02 AM
Then you wont have to use all those ifs to check, just check the pixel and do whatever conditions you want in that check.  if #pixcol = whatever && #mana > whatever && %usePrimary = #true.  You get my meaning.  Using your mana pool as a check is a good idea too.  What I do is set a "mana deadpoint" where I want the mana intensive things to stop so I can catch up with my mana consumption, and also so I always have enough mana to cast my healing spells and spells that keep me alive.  Like enemy of one, and confidence/counter attack.  I only have 40 mana on my suit, and I never run out.
Title: Re: Primary Ability
Post by: dxrom on January 10, 2011, 11:44:01 AM
Ah hah! Thank you all for the help. I took your advice and went with pixel checks and it works EXCELLENTLY! Thank you all :)
Title: Re: Primary Ability
Post by: Scrripty on January 10, 2011, 12:41:34 PM
Ah hah! Thank you all for the help. I took your advice and went with pixel checks and it works EXCELLENTLY! Thank you all :)

I dont know if anyone said use a timer too.  Timers are great. 
Title: Re: Primary Ability
Post by: dxrom on January 10, 2011, 01:04:39 PM
How would a timer be implemented for special abilities? Just for working around the double mana usage with back to back abilities?
Title: Re: Primary Ability
Post by: Scrripty on January 10, 2011, 01:14:29 PM
How would a timer be implemented for special abilities? Just for working around the double mana usage with back to back abilities?

I have a lite version of my pvm dexer you can go download and look at.  It's OLD OLD code, and a new version is about to be released that's so good it's scary.  Really if you want to learn how to do it correctly, you should wait for that and look at it to see.  I have timings so tight it's nearly unbelievable. :)  I was killing higher level monsters with a 3.75 swing speed axe and no swing speed increase with no problem.  All it had was mana leech.  I test with the worst weapons, and when I can live with those, I know it's working correctly. :)
Title: Re: Primary Ability
Post by: Kalaka on January 10, 2011, 03:00:08 PM
I have a lite version of my pvm dexer you can go download and look at.  It's OLD OLD code, and a new version is about to be released that's so good it's scary.  Really if you want to learn how to do it correctly, you should wait for that and look at it to see.  I have timings so tight it's nearly unbelievable. :)  I was killing higher level monsters with a 3.75 swing speed axe and no swing speed increase with no problem.  All it had was mana leech.  I test with the worst weapons, and when I can live with those, I know it's working correctly. :)


Sounds siiiiiick. Gonna be elite only though, or for all?
Title: Re: Primary Ability
Post by: Scrripty on January 10, 2011, 05:06:26 PM
I'll have 2 versions for sure.  Haven't decided on features for them yet tho.
Title: Re: Primary Ability
Post by: dxrom on January 10, 2011, 09:59:15 PM
Oh wow! Nice! I'll definitely be looking forward to digging through it! Just out of curiosity, what does it take to become an elite member?
Title: Re: Primary Ability
Post by: MeWonUo on January 10, 2011, 10:04:34 PM
Oh wow! Nice! I'll definitely be looking forward to digging through it! Just out of curiosity, what does it take to become an elite member?

http://www.scriptuo.com/index.php?topic=1801.0
 :)
Title: Re: Primary Ability
Post by: dxrom on January 11, 2011, 03:39:14 PM
Thank you :)
Title: Re: Primary Ability
Post by: MeWonUo on January 11, 2011, 04:26:41 PM
Certainly.