Author Topic: TM Casting Sub...  (Read 3287 times)

0 Members and 1 Guest are viewing this topic.

Scrripty

  • Guest
TM Casting Sub...
« on: July 21, 2009, 08:53:58 AM »
0
I was trying to test your casting sub...  It's just recasting Consecrate Weapon over and over.  I'm ONLY using it for CW, and the script still casts everything else fine based on their timings, but CW just goes off the whole time... no timing.  Casts it every few seconds...  It works using my sub but doesn't work for yours... wierdness. :)  Can you see any reason why this wouldn't work?

Code: [Select]
set !ConWepCastTime ( ( ( #skill * 5 ) / 34 ) * 100 ) - 2000 ; This is pretty accurate.  Leave it unless you need to change it.
;Sets the casting time for Consecrate Weapon in Seconds.

; %mana_required_1 is just the mana cost of the spell with LMC figured in.

  ;======================================================================
  ; Casts Consecrate Weapon every 11 seconds, works very good.
  ;
  ; no parameters
  ;
  ; returns #true when complete
  ;======================================================================
  sub ConsecrateWeapon ; 10 mana
    menu get 2 ; Consecrate Weapon 10 mana
    if #menures = #true
    {
      chooseSkill chiv
      if #sysTime < !CWTimer || #mana < %mana_required_1 || #skill < 150 || !CastRecovery > #sysTime
      {
        if #mana < %mana_required_1 && !WarningDelay < #sCnt
        {
          set !WarningDelay #sCnt + 5
          event exMsg #charId 3 55 Warning, Low Mana
        }
        RETURN #false
      }
      if #hits > ( #maxhits * !EmergencyHealthPercent ) / 10
      {
        menu get 25 ;Curse Wep
        if #menures = #true && !CWTimer < 6000 || #sysTime > !CRWTimer || #enemyId = N/A
          RETURN
        menu delete status
        menu font color red
        menu font bgcolor gray
        menu text status 225 177 Casting Consecrate Weapon!
        gosub TM_NewCastSpell 203 NONE 2 20 20
        if #result
          set !CWTimer #sysTime + !ConWepCastTime
        RETURN #result
      }
    }
  RETURN

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +321
  • Referrals: 2
    • View Profile
Re: TM Casting Sub...
« Reply #1 on: July 21, 2009, 09:08:36 AM »
0
Are you saying that it doesn't cast at all or is it that it just keeps casting over and over?

X
« Last Edit: July 21, 2009, 09:10:07 AM by 12TimesOver »
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Scrripty

  • Guest
Re: TM Casting Sub...
« Reply #2 on: July 21, 2009, 09:19:32 AM »
0
It just casts over and over.  I need it to return #true when cast successfully, not sure if it's doing that and updating the timier...  It looks as if it SHOULD be doing that, that's how it works in my code.  I just did a quick hack to get it in there and try it out.

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +321
  • Referrals: 2
    • View Profile
Re: TM Casting Sub...
« Reply #3 on: July 21, 2009, 10:00:19 AM »
0
If I remember correctly, TM's subs return #TRUE on error and #FALSE on success.

X
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Scrripty

  • Guest
Re: TM Casting Sub...
« Reply #4 on: July 21, 2009, 10:11:52 AM »
0
My test script isn't working at all either.  Wierd.  It should be simple.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13303
  • Activity:
    0.4%
  • 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: TM Casting Sub...
« Reply #5 on: July 21, 2009, 10:26:25 AM »
0
So you have your status bar open?

One thing to note about this sub is that I was never really optimized to be a generic all purpose casting sub.  It had to be able to handle magery and chiv just because of recall/gate/sacred journey.  Although I ended up using it generically; it's what powers the fishing scripts.  In the FaF, it casts EOO and Consecrate Weapon when using archery.  I don't think I've ever even tried to use it for spellweaving.  It might work, but I dunno.

Also it won't handle spells that popup gumps (summon familiar, polymorph, etc)
« Last Edit: July 21, 2009, 11:54:12 AM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Scrripty

  • Guest
Re: TM Casting Sub...
« Reply #6 on: July 21, 2009, 09:46:28 PM »
0
So you have your status bar open?

I know, it's usually the simple things, but yes, I added your status bar and backpack sub to my script. :)  So it's always open.  Also added your TMaddunderscore sub.  Didn't know if it needed it, but something in there calls it!  I haven't had a lot of time to play with it,  because I've been working around with my sub to see if I can get it working like I'd like... You should test my script out, I'm not sure I'll be posting it publicly but it's gonna be a dexer toybox for sure.  Palonius seems to like it a lot.  I think he's taking out Para Cu's with it pretty easily..?  For some reason when I use your sub tho, not matter what I do, I cant even get it to cast one spell using my timings...  I was told that your sub returns #false if casting is successfull, so I tried that also, still just casts over and over.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13303
  • Activity:
    0.4%
  • 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: TM Casting Sub...
« Reply #7 on: July 21, 2009, 09:52:05 PM »
0
Well there's no return value.  It just assumes the script achieved the designated goal.  Also you don't need the underscore sub; it's built into the advanced journal scanner now.  The runebook subs have a return value however, that's what they were probably thinking of.

I just haven't had a chance to look at your code; been just so busy with my sos farmer project.  At 140Kbytes, it's quite a monster and it's not nearly complete yet.

Keep your snippet up to date so if I find some spare time, I'll look at it for ya.
Please read the ScriptUO site RULES
Come play RIFT with me!

Scrripty

  • Guest
Re: TM Casting Sub...
« Reply #8 on: July 22, 2009, 01:45:15 AM »
0
Now that I know it's not returning a value at all, that makes a lot of sense. :)  My script wants a return value to update the timers on the spell casting subs. :)  I'll just set it to only cast each spell once, but cast until successfull then update the timers.  Should be straight forward.  Does your casting sub EVER fail to cast or "spam out?" under stress?  I'm gonna knock it around with spell after spell.  If it has any issues you can think of, it'd be nice to know.  Also, is there a good way to check fc/fcr and put it into your casting sub?  I noticed you had variables FOR it, but I've never done it myself...  Don't know anything about fc/fcr timings.  I'll do it if someone can point me to the info... or a sub to calc it?  Thanks for the help guys.

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +321
  • Referrals: 2
    • View Profile
Re: TM Casting Sub...
« Reply #9 on: July 22, 2009, 02:08:33 AM »
0
Ah that's right, the spellcast doesn't return a value; I was thinking it did. Instead it simply goto's to the end of the sub and returns.

I guess I would have noticed that had I looked at the sub again. Man, I was having a very off day yesterday!  >:(

XII
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Tags: