ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: Man7dowN on July 06, 2015, 06:18:10 AM

Title: help please with small script
Post by: Man7dowN on July 06, 2015, 06:18:10 AM
Like to get some of you vet scripts help with a small mage attack/heal routine
I'm not the best scripter, usually I just piece allot of code together to get it to do what I want,  now I'm looking for something that will suit my needs better.
Looking to make a single target attack script for boss fights that take awhile,

Actions: set corpse skin on boss, then set a timer to recast corpse skin on boss when it runs out, then proceed to attack loop: explosion/flames strike combo and have a heal/cure check before each cast

Kinda feel bad for asking for help with this, but I'm sure I'll learn something along the way,
Thank you in advance if anyone chooses to help



Title: Re: help please with small script
Post by: 12TimesOver on July 06, 2015, 06:27:09 AM
I think you might be able to find something like this already created however I'm a big fan of DIY!

Do you have something to post up that you've started already or any specific issues you're running into? That will give people a better chance to help you out.

X
Title: Re: help please with small script
Post by: Man7dowN on July 06, 2015, 07:02:55 AM
I do have some chopped up stuff that works at the house, I'll post it tonight, I'm not sure how to do a corpse skin timer loop tho
Title: Re: help please with small script
Post by: Ketchup on July 06, 2015, 07:47:27 AM
I was interested in helping you out except in my head, the idea of working out how the boss was corpse skinned and setting up a timer for just that in the main script is way past my noobie scripting ability!
Title: Re: help please with small script
Post by: The Ghost on July 06, 2015, 08:33:59 AM
If you are going to be a mage,  this build from TM have some nice option. 
http://www.scriptuo.com/index.php?topic=20.msg20#msg20

 Now you only need to get attack part done.

Title: Re: help please with small script
Post by: Man7dowN on July 06, 2015, 05:13:29 PM
im currently using this for attacking, works well i left the authors for respect and because i didnt write it...  i would like to add a timed corspe skin loop, where once target is found, it casts corpse skin, the does an explosion / flamestrike combo


;=========================================
    ; Script Name: Raziel's Attack Script
    ; Author: Raziel, Tecmo
    ; Version: 1.20a
    ; Client Tested with: 5.0.1a
    ; EUO version tested with: 1.50.0060
    ; Shard OSI / FS: OSI and FS (Alexandria Tested Only)
    ; Revision Date: 2005-Nov-22
    ; Public Release: 2003-Aug-19
    ; Global Variables Used: None
    ; Purpose: Makes your warrior's hunting life all that much easier
    ; by Auto attacking preset creature when nearby.
    ;=========================================

    ;USER VARIABLES
    ;Set !_creature to the type of creatures you wish to auto attack

    SET !_creature OE;_XF_IE_LD_VE_BI_UB_HE_OE_CI_NG
    SET !_AutoMoveToTarget #false ;#TRUE or #FALSE
    SET !_lowHits 55
    SET !_maxRange 10
    ; =====================================
    IGNOREITEM reset

    enemyloop:
    FOR !_range 1 !_maxrange
    {
       FINDITEM !_creature G_ , !_range
       IF #FINDKIND <> -1
       {
         SET #LTARGETID #FINDID
         SET !_enemy #FINDID
         GOSUB attack
       }
       WAIT 10
    }
    SET !_range 0
    goto enemyLoop

    ; ================
    SUB attack
    attack_loop:

    finditem !_enemy G_
 if #findcnt > 0
  {
   event macro 15 50
   set #ltargetkind 1
   set #ltargetid #findid
   target 3s
   event macro 22 0
   wait 5
  }
    FINDITEM !_enemy G_
    IF #FINDKIND = 1
    {
       IF #HITS > !_lowHits && !_AutoMoveToTarget = #TRUE && #FINDDIST > 1
          MOVE #FINDX #FINDY a
       WAIT 20
             GOTO attack_loop
    }
    RETURN
    ; ================
Title: Re: help please with small script
Post by: The Ghost on July 06, 2015, 05:32:11 PM
Here some little stuff that might help you.   Have u think of those thing

find how long Corpse skin last

set %spellTimer #scnt2 + ( insert delay)

if ( %spellTimer < #scnt2 )
gosub CS
Title: Re: help please with small script
Post by: Man7dowN on July 06, 2015, 06:24:27 PM
Here some little stuff that might help you.   Have u think of those thing

find how long Corpse skin last

set %spellTimer #scnt2 + ( insert delay)

if ( %spellTimer < #scnt2 )
gosub CS


excellent info, ty sir i will work on that

Post Merge: July 06, 2015, 06:28:46 PM
im not understanding this formula tho

(caster's Spirit Speak - target's Resisting Spells) / 2.5 + 40 in seconds

is it SS minus total targets resists?  divided by 2.5 + 40
or

SS and targets total resists?
Title: Re: help please with small script
Post by: 12TimesOver on July 07, 2015, 03:00:56 AM
For example - If you have 120 Spirit Speak and your target has 100 Resisting Spells:

(120 - 100)/2.5+40 = 48 seconds

If your target has 0 Resist it would be 88 seconds.

etc
Title: Re: help please with small script
Post by: Man7dowN on July 07, 2015, 05:17:02 AM
For example - If you have 120 Spirit Speak and your target has 100 Resisting Spells:

(120 - 100)/2.5+40 = 48 seconds

If your target has 0 Resist it would be 88 seconds.

etc


Ty for clearing that up, I was mixing up his actual resists with skill resists
Title: Re: help please with small script
Post by: Man7dowN on July 07, 2015, 04:40:35 PM
this is what i have,,, but i think im missing somthing here


SET !_creature OE;_XF_IE_LD_VE_BI_UB_HE_OE_CI_NG
    SET !_AutoMoveToTarget #false ;#TRUE or #FALSE
    SET !_lowHits 55
    SET !_maxRange 10
    ; =====================================
    IGNOREITEM reset

    enemyloop:
    FOR !_range 1 !_maxrange
    {
       FINDITEM !_creature G_ , !_range
       IF #FINDKIND <> -1
       {
         SET #LTARGETID #FINDID
         SET !_enemy #FINDID
         GOSUB attack
       }
       WAIT 10
    }
    SET !_range 0
    goto enemyLoop
    ;================
    set %spellTimer #scnt2 + (48s)
    if ( %spellTimer < #scnt2 )
    gosub CS
    ; ================
    SUB attack
    attack_loop:

    finditem !_enemy G_
 if #findcnt > 0
  {
   event macro 15 50
   set #ltargetkind 1
   set #ltargetid #findid
   target 3s
   event macro 22 0
   wait 5
  }
    FINDITEM !_enemy G_
    IF #FINDKIND = 1
    {
       IF #HITS > !_lowHits && !_AutoMoveToTarget = #TRUE && #FINDDIST > 1
          MOVE #FINDX #FINDY a
       WAIT 20
             GOTO attack_loop
    }
    RETURN
    ; ================
SUB CS
finditem !_enemy G_
 if #findcnt > 0
  {
   event macro 15 103
   set #ltargetkind 1
   set #ltargetid #findid
   target 3s
   event macro 22 0
   wait 5
   }
   RETURN
Title: Re: help please with small script
Post by: Man7dowN on July 07, 2015, 06:03:30 PM
i tried to implement the spell timer,, it was a fail,,,
i think im missing somthing to activate it
Title: Re: help please with small script
Post by: The Ghost on July 07, 2015, 06:29:34 PM
This is how it should look

Code: [Select]
;                                Set up part
; ------------------------------------------------------------------------------
SET !_creature OE;_XF_IE_LD_VE_BI_UB_HE_OE_CI_NG
    SET !_AutoMoveToTarget #false ;#TRUE or #FALSE
    SET !_lowHits 55
    SET !_maxRange 10
    set %spellTimer #scnt2 + 48000
    ; =====================================
    IGNOREITEM reset
; ------------------------------------------------------------------------------------------
 

;                  Main loop     <--  insert what you want to do here.
; ------------------------------------------------------------------------
   enemyloop:
    FOR !_range 1 !_maxrange
    {
       FINDITEM !_creature G_ , !_range
       IF #FINDKIND <> -1
       {
         SET #LTARGETID #FINDID
         SET !_enemy #FINDID
         GOSUB attack
       }
       WAIT 10
    }
    SET !_range 0
  if ( %spellTimer < #scnt2 )   
          {
          gosub CS
           }
    goto enemyLoop
 ; -----------------------------------------------------------------------------

   ;================

 
    ; ================
    SUB attack
    attack_loop:

    finditem !_enemy G_
 if #findcnt > 0
  {
   event macro 15 50
   set #ltargetkind 1
   set #ltargetid #findid
   target 3s
   event macro 22 0
   wait 5
  }
    FINDITEM !_enemy G_
    IF #FINDKIND = 1
    {
       IF #HITS > !_lowHits && !_AutoMoveToTarget = #TRUE && #FINDDIST > 1
          MOVE #FINDX #FINDY a
       WAIT 20
             GOTO attack_loop
    }
    RETURN
    ; ================
SUB CS
finditem !_enemy G_
 if #findcnt > 0
  {
   event macro 15 103
   set #ltargetkind 1
   set #ltargetid #findid
   target 3s
   event macro 22 0
   wait 5
   }
   RETURN
Title: Re: help please with small script
Post by: Man7dowN on July 08, 2015, 02:35:43 AM
Thank you ghost, I'll work on it tonight, last night I worked on spell combo rotation, wich works awesome,  looks like I missed the set spell timer at the top, thank you again hopefully it works tonight
Title: Re: help please with small script
Post by: Man7dowN on July 12, 2015, 02:48:38 AM
This is how it should look

Code: [Select]
;                                Set up part
; ------------------------------------------------------------------------------
SET !_creature OE;_XF_IE_LD_VE_BI_UB_HE_OE_CI_NG
    SET !_AutoMoveToTarget #false ;#TRUE or #FALSE
    SET !_lowHits 55
    SET !_maxRange 10
    set %spellTimer #scnt2 + 48000
    ; =====================================
    IGNOREITEM reset
; ------------------------------------------------------------------------------------------
 

;                  Main loop     <--  insert what you want to do here.
; ------------------------------------------------------------------------
   enemyloop:
    FOR !_range 1 !_maxrange
    {
       FINDITEM !_creature G_ , !_range
       IF #FINDKIND <> -1
       {
         SET #LTARGETID #FINDID
         SET !_enemy #FINDID
         GOSUB attack
       }
       WAIT 10
    }
    SET !_range 0
  if ( %spellTimer < #scnt2 )   
          {
          gosub CS
           }
    goto enemyLoop
 ; -----------------------------------------------------------------------------

   ;================

 
    ; ================
    SUB attack
    attack_loop:

    finditem !_enemy G_
 if #findcnt > 0
  {
   event macro 15 50
   set #ltargetkind 1
   set #ltargetid #findid
   target 3s
   event macro 22 0
   wait 5
  }
    FINDITEM !_enemy G_
    IF #FINDKIND = 1
    {
       IF #HITS > !_lowHits && !_AutoMoveToTarget = #TRUE && #FINDDIST > 1
          MOVE #FINDX #FINDY a
       WAIT 20
             GOTO attack_loop
    }
    RETURN
    ; ================
SUB CS
finditem !_enemy G_
 if #findcnt > 0
  {
   event macro 15 103
   set #ltargetkind 1
   set #ltargetid #findid
   target 3s
   event macro 22 0
   wait 5
   }
   RETURN



I tried this, couldn't get it to work, am I missing somthing?
I don't under stand why this is being so difficult

Find target
Cast corpse skin
Set 48s timer on corpse skin before next cast
Begin attack loop
Cast flam strike
If mana is below 40
Cast fireball
Return

That's all I'm trying to achieve any help appreciated
Title: Re: help please with small script
Post by: Man7dowN on July 12, 2015, 04:49:26 AM
Would this work with the mana check and 2 spells?
Code: [Select]
SUB attack
    attack_loop:

    finditem !_enemy G_
 if #findcnt > 0
  {
   If #MANA > 40
   event macro 15 50
   set #ltargetkind 1
   set #ltargetid #findid
   target 3s
   event macro 22 0
   wait 5
  }
   If #MANA < 40
  event macro 15 17
   set #ltargetkind 1
   set #ltargetid #findid
   target 3s
   event macro 22 0
   wait 5
    FINDITEM !_enemy G_
    IF #FINDKIND = 1
    {
             GOTO attack_loop
    }
    RETURN
Title: Re: help please with small script
Post by: Man7dowN on July 12, 2015, 07:07:32 PM
i have the mana check on spells worked out

Code: [Select]
SET %target OE_XF_IE_LD_VE_BI_UB_HE_OE_CI_NG
    SET !_lowHits 55
    SET !_maxRange 10
    ; =====================================
    IGNOREITEM reset
    Ignoreitem #Charid


    enemyloop:
    FOR !_range 1 !_maxrange
    {
       FINDITEM %target G_ , !_range
       IF #FINDKIND <> -1
       {
         SET #LTARGETID #FINDID
         SET !_enemy #FINDID
         if #findCnt > 0 && #mana > 41
         GOSUB FS
         if #findCnt > 0 && #mana < 40
         GOSUB FB
       }
       WAIT 10
    }
    SET !_range 0
    goto enemyLoop
    ;================

    ; ================

   SUB FS
   finditem !_enemy G_
   if #findcnt > 0
   {
   event macro 15 50
   set #ltargetkind 1
   set #ltargetid #findid
   target 3s
   event macro 22 0
   wait 5
  }
    FINDITEM !_enemy G_
    IF #FINDKIND = 1
    {
    RETURN
    ;==================
   
    SUB FB
   finditem !_enemy G_
   if #findcnt > 0
   {
   event macro 15 17
   set #ltargetkind 1
   set #ltargetid #findid
   target 3s
   event macro 22 0
   wait 5
  }
    FINDITEM !_enemy G_
    IF #FINDKIND = 1
    {
    RETURN



 back to messing round with corpse skin timer, thank you everyone for your input so far it has helped the nooblet scripter lol
Title: Re: help please with small script
Post by: Man7dowN on July 14, 2015, 10:14:31 AM
Here some little stuff that might help you.   Have u think of those thing

find how long Corpse skin last

set %spellTimer #scnt2 + ( insert delay)

if ( %spellTimer < #scnt2 )
gosub CS


Anyone know how I can implement this to my script, i can't get it to work, not sure why,  the post before this is the full script code I'm using
Title: Re: help please with small script
Post by: Tidus on July 14, 2015, 11:39:47 AM
Here some little stuff that might help you.   Have u think of those thing

find how long Corpse skin last

set %spellTimer #scnt2 + ( insert delay)

if ( %spellTimer < #scnt2 )
gosub CS


Anyone know how I can implement this to my script, i can't get it to work, not sure why,  the post before this is the full script code I'm using

Because of the nature of Corpse Skin you will never be able to fully  know how long it lasts because you have 1 unknown variable.  The resist spells of the enemy.  So you will have to go with the longest a corpse skin would last and just put that into your script as the delay rather than using a calculation to get it. 
Title: Re: help please with small script
Post by: Man7dowN on July 16, 2015, 07:31:23 AM
Any suggestions I can try tonight?
Title: Re: help please with small script
Post by: The Ghost on July 17, 2015, 06:01:11 PM
here an idea for you

set %spellTimerCS #scnt


Code: [Select]
if  %spellTimerCS <= #scnt
     gosub CorpseSkin

sub CorpseSkin
    set #ltargetkind 1
    set #ltargetid %victim
    event macro 15 103 ; Corpse Skin
    target 3s
    event macro 22 0
    wait 20
    set  %spellTimerCS #scnt + 20
return

Title: Re: help please with small script
Post by: Man7dowN on July 19, 2015, 03:00:37 AM
here an idea for you




Works awesome ghost, just what I was looking for, I changed it around a little bit, but all the key parts are there, thanks ghost
Title: Re: help please with small script
Post by: The Ghost on July 19, 2015, 04:28:03 AM
Glad it work for you, It is a nice little build to learn.   did you see what you were missing. 
Title: Re: help please with small script
Post by: Man7dowN on July 19, 2015, 05:06:46 AM
Glad it work for you, It is a nice little build to learn.   did you see what you were missing. 

I had the set timer wrong, then changed the sub a little on finding target, works great... 2 steps left, adding a mage cure and  greater than 2 wither sub
Title: Re: help please with small script
Post by: The Ghost on July 19, 2015, 06:42:35 AM
Will be nice to see the final product of this build.   Seen like a little help for mage. 
Title: Re: help please with small script
Post by: Man7dowN on July 19, 2015, 07:00:18 AM
Will be nice to see the final product of this build.   Seen like a little help for mage. 

Ya it's for champ, helps with all the casting on long fights,  little more relax time
Title: Re: help please with small script
Post by: The Ghost on July 19, 2015, 01:21:45 PM
It just to kill the Boss. I see now.  Was wondering if that was during regular hunting.
Title: Re: help please with small script
Post by: Man7dowN on July 20, 2015, 02:35:25 AM
It just to kill the Boss. I see now.  Was wondering if that was during regular hunting.

No, but it can be set up for regular hunting pretty easy