Author Topic: Attack script issues.  (Read 8032 times)

0 Members and 1 Guest are viewing this topic.

Offline dxromTopic starter

  • Master of the milestones!
  • Elite
  • *
  • *
  • Posts: 1080
  • Activity:
    0%
  • Reputation Power: 15
  • dxrom is working their way up.dxrom is working their way up.dxrom is working their way up.
  • KEYBOARD COWBOY, GREAT SAMURAI OF THE INTERNET.
  • Respect: +100
  • Referrals: 1
    • View Profile
Attack script issues.
« on: February 02, 2012, 11:27:24 PM »
0
So as I am beginning to adapt LAME to support Shame and Wrong, I have begun to notice an issue that effects performance. When the attack sub scans for the predefined IDs (monsters) it is counting the CORPSES of monsters as monsters, despite the fact that they have completely different IDs. I was wondering if anyone knows why this happens?

I have checked the IDs of both a monster, then a monster's corpse, and they are completely different. I've been trying to create a fix for this for about a week now, mainly by attempt to filter out anything that has "corpse" in the #properties. However I have had little success.

Any ideas?



 ​_██​_
(ಠ​_ృ)
I do say, ol' Chap! Come play EVE Online! Why here is a 21 Day Free Trial!

Offline camotbik

  • Sr. Member
  • *
  • Posts: 349
  • Activity:
    0%
  • Reputation Power: 3
  • camotbik has no influence.
  • Gender: Male
  • Hello! I'm a UO addict.
  • Respect: +38
  • Referrals: 0
    • View Profile
Re: Attack script issues.
« Reply #1 on: February 03, 2012, 02:54:29 AM »
0
well if you don't paste the code in the thread it's really hard to see where your problem is.
What you witness -- is whatver..
uogamers hybrid.

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: Attack script issues.
« Reply #2 on: February 03, 2012, 02:56:58 AM »
0
It finds an actual ID when the monster falls. Just put in a delay when the findCnt of the target goes to 0.

Check HERE version 25 should have it coded in.
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline dxromTopic starter

  • Master of the milestones!
  • Elite
  • *
  • *
  • Posts: 1080
  • Activity:
    0%
  • Reputation Power: 15
  • dxrom is working their way up.dxrom is working their way up.dxrom is working their way up.
  • KEYBOARD COWBOY, GREAT SAMURAI OF THE INTERNET.
  • Respect: +100
  • Referrals: 1
    • View Profile
Re: Attack script issues.
« Reply #3 on: February 03, 2012, 08:53:46 AM »
0
Code: [Select]
sub attackMob
set %target (targets go here)

finditem %target G_1
if #findCnt > 0
{
if #findCnt > 1 && ( %useLS = #true ) && ( #mana < 25 ) && ( #mana > 6 ) && ( %spellTimer < #scnt2 )
   gosub execMS
if #findCnt < 2 && ( %useLS = #true ) && ( #mana < 25 ) && ( #mana > 6 ) && ( %spellTimer < #scnt2 )
   gosub execLS
if ( %usePrimary = #true ) &&  ( #mana > 25 ) && ( %spellTimer < #scnt2 )
   gosub execPrim
if ( %useSecondary = #true ) && ( #mana > 25 ) && ( %spellTimer < #scnt2 )
   gosub execSec
Call ScanBuffBar
set %ConWep _ConsecrateWeapon_ in %BuffBarIconNames
if ( %castConWep = #true ) && ( %ConWep = #false ) &&  ( #mana > 10 ) && ( %spellTimer < #scnt2 )
   gosub castCon
set %EOO _EnemyOfOne_ in %BuffBarIconNames
if ( %castEOO = #true ) && ( %EOO = #false ) &&  ( #mana > 10 ) && ( %spellTimer < #scnt2 )
   gosub enemyOfOne
}
if #FINDKIND = -1 4
finditem %target
set %attack #findid
set #LTARGETID %attack
event macro 27

if #findid <> %attack
(
set %attack #findid
set #LTARGETID %attack
event macro 27
}
return

Sorry was so tired, forgot to add code.

I added the timer, no effect. I have a couple theories though that I am testing.



 ​_██​_
(ಠ​_ృ)
I do say, ol' Chap! Come play EVE Online! Why here is a 21 Day Free Trial!

Offline dxromTopic starter

  • Master of the milestones!
  • Elite
  • *
  • *
  • Posts: 1080
  • Activity:
    0%
  • Reputation Power: 15
  • dxrom is working their way up.dxrom is working their way up.dxrom is working their way up.
  • KEYBOARD COWBOY, GREAT SAMURAI OF THE INTERNET.
  • Respect: +100
  • Referrals: 1
    • View Profile
Re: Attack script issues.
« Reply #4 on: February 03, 2012, 09:01:14 AM »
0
...I'm such an idiot...

Code: [Select]
if #findid <> %attack
(
set %attack #findid
set #LTARGETID %attack
event macro 27
}


the ( instead of {


Seems to have fixed it

Nevermind.
« Last Edit: February 03, 2012, 09:02:57 AM by dxrom »



 ​_██​_
(ಠ​_ృ)
I do say, ol' Chap! Come play EVE Online! Why here is a 21 Day Free Trial!

Offline dxromTopic starter

  • Master of the milestones!
  • Elite
  • *
  • *
  • Posts: 1080
  • Activity:
    0%
  • Reputation Power: 15
  • dxrom is working their way up.dxrom is working their way up.dxrom is working their way up.
  • KEYBOARD COWBOY, GREAT SAMURAI OF THE INTERNET.
  • Respect: +100
  • Referrals: 1
    • View Profile
Re: Attack script issues.
« Reply #5 on: February 03, 2012, 09:20:30 AM »
0
It finds an actual ID when the monster falls. Just put in a delay when the findCnt of the target goes to 0.

Check HERE version 25 should have it coded in.

I tried this. It still counts the corpse as a %target...
I think it's just time to rewrite the entire attackMob sub altogether.



 ​_██​_
(ಠ​_ృ)
I do say, ol' Chap! Come play EVE Online! Why here is a 21 Day Free Trial!

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: Attack script issues.
« Reply #6 on: February 03, 2012, 10:29:18 AM »
0
The delay has always worked for me.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline dxromTopic starter

  • Master of the milestones!
  • Elite
  • *
  • *
  • Posts: 1080
  • Activity:
    0%
  • Reputation Power: 15
  • dxrom is working their way up.dxrom is working their way up.dxrom is working their way up.
  • KEYBOARD COWBOY, GREAT SAMURAI OF THE INTERNET.
  • Respect: +100
  • Referrals: 1
    • View Profile
Re: Attack script issues.
« Reply #7 on: February 03, 2012, 10:46:11 AM »
0
The delay has always worked for me.

I've rooted the issue down to the script performing the special abilities and casting while a corpse is near, the attacking didn't seem to be the issue, I illogically lumped them together when describing the issue.

So the real issue is to prevent the script from reading corpses as %target, which would prevent the script from trying to, say Cast Consc Wep when it's standing over a corpse with nothing around it, or trying to momentum strike for mana when there is a single monster and a corpse nearby.

I have attempted creating a sub for
Code: [Select]
if #findCnt > 1 && ( %useLS = #true ) && ( #mana < 25 ) && ( #mana > 6 ) && ( %spellTimer < #scnt2 )
   gosub execMS
if #findCnt < 2 && ( %useLS = #true ) && ( #mana < 25 ) && ( #mana > 6 ) && ( %spellTimer < #scnt2 )
   gosub execLS
if ( %usePrimary = #true ) &&  ( #mana > 25 ) && ( %spellTimer < #scnt2 )
   gosub execPrim
if ( %useSecondary = #true ) && ( #mana > 25 ) && ( %spellTimer < #scnt2 )
   gosub execSec
Call ScanBuffBar
set %ConWep _ConsecrateWeapon_ in %BuffBarIconNames
if ( %castConWep = #true ) && ( %ConWep = #false ) &&  ( #mana > 10 ) && ( %spellTimer < #scnt2 )
   gosub castCon
set %EOO _EnemyOfOne_ in %BuffBarIconNames
if ( %castEOO = #true ) && ( %EOO = #false ) &&  ( #mana > 10 ) && ( %spellTimer < #scnt2 )
   gosub enemyOfOne

and having it call at the end of the attackMob script
In particularly after:
Code: [Select]
if #FINDKIND = -1 4
finditem %target
set %attack #findid
set #LTARGETID %attack
event macro 27 0

if #findid <> %attack
{
set %attack #findid
set #LTARGETID %attack
event macro 27 0
}
However that seemed to have failed...

Basically what I figured would be best, would be (in this order)

1. Script Scans Mobs
2. Script utilizes #FINDKIND to set the %attack
3. Script compares #FINDID (from finditem) to %attack and engages %attack
4. Script Calls sub doStuff (the Logic for special abilities and spells) and uses #findCnt of %attack instead of %target
5. Script then repeats




 ​_██​_
(ಠ​_ృ)
I do say, ol' Chap! Come play EVE Online! Why here is a 21 Day Free Trial!

Offline dxromTopic starter

  • Master of the milestones!
  • Elite
  • *
  • *
  • Posts: 1080
  • Activity:
    0%
  • Reputation Power: 15
  • dxrom is working their way up.dxrom is working their way up.dxrom is working their way up.
  • KEYBOARD COWBOY, GREAT SAMURAI OF THE INTERNET.
  • Respect: +100
  • Referrals: 1
    • View Profile
Re: Attack script issues.
« Reply #8 on: February 03, 2012, 11:35:17 AM »
0
Alright! I believe that I have found a fix!

Code: [Select]
sub attackMob

set %target ;targets here

finditem %target G_1
 if #findCnt > 0
  {
  set #ltargetID #findID
  set %attack #ltargetID
  set #ltargetKind 1
  event macro 27 0
  gosub doStuff
  }
 wait 5
return

sub doStuff
finditem %attack G_1
 if #findCnt > 0
  {
  if #findCnt > 1 && ( %useLS = #true ) && ( #mana < 25 ) && ( #mana > 6 ) && ( %spellTimer < #scnt2 )
   gosub execMS
  if #findCnt < 2 && ( %useLS = #true ) && ( #mana < 25 ) && ( #mana > 6 ) && ( %spellTimer < #scnt2 )
   gosub execLS
  if ( %usePrimary = #true ) &&  ( #mana > 25 ) && ( %spellTimer < #scnt2 )
   gosub execPrim
  if ( %useSecondary = #true ) && ( #mana > 25 ) && ( %spellTimer < #scnt2 )
   gosub execSec
  Call ScanBuffBar
  set %ConWep _ConsecrateWeapon_ in %BuffBarIconNames
  if ( %castConWep = #true ) && ( %ConWep = #false ) &&  ( #mana > 10 ) && ( %spellTimer < #scnt2 )
   gosub castCon
  set %EOO _EnemyOfOne_ in %BuffBarIconNames
  if ( %castEOO = #true ) && ( %EOO = #false ) &&  ( #mana > 10 ) && ( %spellTimer < #scnt2 )
   gosub enemyOfOne
  }
return

This seems to work perfectly :>

I am gonna test it more though.



 ​_██​_
(ಠ​_ృ)
I do say, ol' Chap! Come play EVE Online! Why here is a 21 Day Free Trial!

Offline dxromTopic starter

  • Master of the milestones!
  • Elite
  • *
  • *
  • Posts: 1080
  • Activity:
    0%
  • Reputation Power: 15
  • dxrom is working their way up.dxrom is working their way up.dxrom is working their way up.
  • KEYBOARD COWBOY, GREAT SAMURAI OF THE INTERNET.
  • Respect: +100
  • Referrals: 1
    • View Profile
Re: Attack script issues.
« Reply #9 on: February 03, 2012, 11:55:45 AM »
0
Works fine for single targets, I just learned that it wont use Momentum Strike because of finditem %attack
which pulls the ID for #findCnt from the singular last target that it is on, thus ignoring everything around it until they are targeted...

...starting to think this is an impossible task -.-



 ​_██​_
(ಠ​_ృ)
I do say, ol' Chap! Come play EVE Online! Why here is a 21 Day Free Trial!

Offline UoLugnutz

  • Full Member
  • ***
  • Posts: 123
  • Activity:
    0%
  • Reputation Power: 2
  • UoLugnutz has no influence.
  • Respect: +25
  • Referrals: 0
    • View Profile
Re: Attack script issues.
« Reply #10 on: February 03, 2012, 12:00:55 PM »
0
Works fine for single targets, I just learned that it wont use Momentum Strike because of finditem %attack
which pulls the ID for #findCnt from the singular last target that it is on, thus ignoring everything around it until they are targeted...

...starting to think this is an impossible task -.-
Nothing is impossible :)

Code: [Select]
if #findCnt > 1 && ( %useLS = #true ) && ( #mana < 25 ) && ( #mana > 6 ) && ( %spellTimer < #scnt2 )
   gosub execMS
  if #findCnt < 2 && ( %useLS = #true ) && ( #mana < 25 ) && ( #mana > 6 ) && ( %spellTimer < #scnt2 )
   gosub execLS

Both lines check if %useLS is true? Should the first line check for MS maybe




Offline dxromTopic starter

  • Master of the milestones!
  • Elite
  • *
  • *
  • Posts: 1080
  • Activity:
    0%
  • Reputation Power: 15
  • dxrom is working their way up.dxrom is working their way up.dxrom is working their way up.
  • KEYBOARD COWBOY, GREAT SAMURAI OF THE INTERNET.
  • Respect: +100
  • Referrals: 1
    • View Profile
Re: Attack script issues.
« Reply #11 on: February 03, 2012, 12:07:57 PM »
0
Works fine for single targets, I just learned that it wont use Momentum Strike because of finditem %attack
which pulls the ID for #findCnt from the singular last target that it is on, thus ignoring everything around it until they are targeted...

...starting to think this is an impossible task -.-
Nothing is impossible :)

Code: [Select]
if #findCnt > 1 && ( %useLS = #true ) && ( #mana < 25 ) && ( #mana > 6 ) && ( %spellTimer < #scnt2 )
   gosub execMS
  if #findCnt < 2 && ( %useLS = #true ) && ( #mana < 25 ) && ( #mana > 6 ) && ( %spellTimer < #scnt2 )
   gosub execLS

Both lines check if %useLS is true? Should the first line check for MS maybe





Actually I have it setup so that if LS is checked but there are more then one monster (IE: %target) around you, then it will use MS instead for better mana return... However you just gave me an idea...



 ​_██​_
(ಠ​_ృ)
I do say, ol' Chap! Come play EVE Online! Why here is a 21 Day Free Trial!

Offline dxromTopic starter

  • Master of the milestones!
  • Elite
  • *
  • *
  • Posts: 1080
  • Activity:
    0%
  • Reputation Power: 15
  • dxrom is working their way up.dxrom is working their way up.dxrom is working their way up.
  • KEYBOARD COWBOY, GREAT SAMURAI OF THE INTERNET.
  • Respect: +100
  • Referrals: 1
    • View Profile
Re: Attack script issues.
« Reply #12 on: February 03, 2012, 12:38:10 PM »
0
Well the idea was to change
sub execMS to:
Code: [Select]
sub execMS
finditem %target G_1
 if #findCnt > 1 && corpse notin #property
  {
  cmppix 5 f
   {
   event macro 15 150
   wait 5
   }
  }
return

and to change the check to
Code: [Select]
if ( %useMS = #true ) && ( #mana < 25 ) && ( #mana > 6 ) && ( %spellTimer < #scnt2 )
However the same issue came up, It looks for %target... And counts the Corpse... It's really kind of stupid how the corpse is counted the "same" as the monster itself. Even though the IDs are completely different, and the script only looks for the MONSTERS ID. -.-



 ​_██​_
(ಠ​_ృ)
I do say, ol' Chap! Come play EVE Online! Why here is a 21 Day Free Trial!

Offline dxromTopic starter

  • Master of the milestones!
  • Elite
  • *
  • *
  • Posts: 1080
  • Activity:
    0%
  • Reputation Power: 15
  • dxrom is working their way up.dxrom is working their way up.dxrom is working their way up.
  • KEYBOARD COWBOY, GREAT SAMURAI OF THE INTERNET.
  • Respect: +100
  • Referrals: 1
    • View Profile
Re: Attack script issues.
« Reply #13 on: February 03, 2012, 01:44:50 PM »
0
TM: How do looters detect corpses on the ground? Would I be able to utilize the same methodology to ignore a corpse?



 ​_██​_
(ಠ​_ృ)
I do say, ol' Chap! Come play EVE Online! Why here is a 21 Day Free Trial!

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: Attack script issues.
« Reply #14 on: February 03, 2012, 01:59:36 PM »
0
The easiest thing would be to look at the CLAw and see how I do it in there.  I'm at work now so I can't really be more verbose, but I'll try and make another post later with more details.
Please read the ScriptUO site RULES
Come play RIFT with me!

Tags: