Author Topic: Casting wait timer  (Read 2564 times)

0 Members and 1 Guest are viewing this topic.

Offline Scotch_Tape

  • Jr. Member
  • **
  • Posts: 55
  • Activity:
    0%
  • Reputation Power: 1
  • Scotch_Tape has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
Casting wait timer
« on: November 17, 2008, 06:54:50 AM »
0
I have an EV script I have written that I am constantly trying to make better.  I replaced all the target [seconds] with this while/scan journal stuff...


 
Code: [Select]
ReCastInvis:
   set %jindex #Jindex + 2    ;sets spot to start the Jornal Scanning
   event macro 15 43          ;cast Invis
    while #targcurs = 0        ;While (Until) the spell is being cast does the brackets
    {
     scanjournal              ;Reads the jornal
     if thy_spell in #journal ;If "Thy Spell" is in jornal recast spell and start over
     goto ReCastInvis         ;Goes back up to cast the spell again
     if Spell_Fizzles in #journal ;checks if you fizzle spell
     goto ReCastInvis         ;Goes back up to cast the spell again
     wait 5
    }[/b]
  event macro 23              ;target self
  wait 1s                     ;waits 2 second
  }
 Return

It's getting the job done, but I wanted to see if anyone had any suggestions.  The timers worked good, but I noticed if I was trying to cast a spell and got fizzled it had to wait for the target timer to time out until it tried again. 

This is my first time using scan journal.  It seems a bit unstable and not very efficient in the way I'm using it.

Thanks for any help. 





 

Offline OMGBurgers

  • Hero Member
  • *
  • Posts: 800
  • Activity:
    0%
  • Reputation Power: 7
  • OMGBurgers has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: Casting wait timer
« Reply #1 on: November 17, 2008, 12:02:33 PM »
0
Hmm.  Well for starters I can see that you set %jindex as the #jindex, but I don't see you actually using that variable or the #jindex anywhere.

I'd try something like this:

Code: [Select]
ReCastInvis:
   set %LASTSCAN #JINDEX    ;sets spot to start the Jornal Scanning
   event macro 15 43          ;cast Invis
   while #targcurs = 0        ;While (Until) the spell is being cast does the brackets
      {
      wait 5
      if #JINDEX > %LASTSCAN
         {
         set %temp #JINDEX
         for %a %LASTSCAN #JINDEX
            {
            scanjournal %a
            if thy_spell in #journal || Spell_Fizzles in #journal
               goto ReCastInvis
            }
         set %LASTSCAN %TEMP
         }
      }
   while #TARGCURS = 1
      {
      event macro 23              ;target self
      wait 2
      }
   wait 1s                     ;waits 2 second
  }
 Return
« Last Edit: November 17, 2008, 12:07:54 PM by OMGBurgers »

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Casting wait timer
« Reply #2 on: November 17, 2008, 12:16:35 PM »
0
That's a good bit of code there, OMG.

This also works:

OMG, that's a good bit of code there.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline OMGBurgers

  • Hero Member
  • *
  • Posts: 800
  • Activity:
    0%
  • Reputation Power: 7
  • OMGBurgers has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: Casting wait timer
« Reply #3 on: November 17, 2008, 12:37:10 PM »
0
I'm sure there's better ways to do it since I just learn what I figure out and from others lol.  I'm sure that while loop at the bottom isn't needed but for me sometimes it misses the target from lag or something so I have a sub to make sure it actually targets.

Tags: