ScriptUO
Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: dxrom on February 02, 2012, 11:27:24 PM
-
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?
-
well if you don't paste the code in the thread it's really hard to see where your problem is.
-
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 (http://www.scriptuo.com/index.php?topic=587.0) version 25 should have it coded in.
-
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'm such an idiot...
if #findid <> %attack
(
set %attack #findid
set #LTARGETID %attack
event macro 27
}
the ( instead of {
Seems to have fixed it
Nevermind.
-
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 (http://www.scriptuo.com/index.php?topic=587.0) 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.
-
The delay has always worked for me.
-
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
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:
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
-
Alright! I believe that I have found a fix!
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.
-
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 -.-
-
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 :)
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
-
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 :)
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...
-
Well the idea was to change
sub execMS to:
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
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. -.-
-
TM: How do looters detect corpses on the ground? Would I be able to utilize the same methodology to ignore a corpse?
-
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.
-
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.
Yep yep... I've been digging through it and any other loot script I come across trying to code up a method for it.
-
Hmm?? This is definitely a strange occurrence. (Not to mention my cat liking to sleep on my arm while I am typing)
I seem to remember a similar instance happening when I wrote a bull tamer, character would spam trying to tame its dead body like a silly necromancer.
I'll try and get one of my old attack scripts up and running and let you know if I notice the issue happening. I didn't see any countermeasures in my Code like I would of Expected.
Maybe try checking to see if the TYPE is still the Same for the Monster? Maybe it saves the ID, but changes to a different type as its falling.
Another Method, Probably a better one, is to not care what the ID for the Monster is except when just performing the attack macro. In other words, stay away from Loops that require the #Findcnt for the target to go to 0.
while #true
{
Check for Monsters in the Area through Type
if Monsters in Area
{
Locate Nearest
Move to Target
Attack Target
Perform specials/Casting
}
if Monsters Notin Area and Corspes In Area
Loot
if Monsters notin Area and Corpses Notin Area
Run Rail
}
That loop "Setup" right there should make it so you move to the closest target, and since you are on top of it, you will continue to destroy it until its no more. or until it invises, and you run away like a little girl, only to return later for round 2.
-
Working with the types is something I've been beating my head against the table trying to do, but haven't found anything within the EUO documentation that sufficiently allows me to do it.
-
Hmm.... Maybe I'm Misunderstanding. I thought the Script was something that you set up the types for what you want to attack.
Set %Bad_Guys XX_XX_XX_XX_XX_XX_XX
And then as you run around the script auto attacks/moves/Performs the Tasks necessary to kill the target.
-
You are correct, it is that kind of script.
The the issue I am having is that when monsters start to die, the script still thinks they are there, and attempts to regard them as such. Even though they are corpses.
-
From Lame 3.0 in the sub AttackMOb
sub attackMob
set %target FZ_DN_II_WI_TI_YD_WD_NI_EB_VI_NI_R_XF_VE_IE_OE_HE_LD_BI_RB_UB_GB_LB_FB_CI_QE_AE_DE_FE_AB_QF_XE_YE_X_DF_CD_DI_W_BE_UC_UD_YH_N_FD_HI_UE_SD_K_J_U_HD_PD_EJ_UI_QO_EAB_TO_PO_XI_UZ_KH_KAB_SZ_FD_MB_AC_IZ_XU_DF_DD_NE_VE_MO_TZ_LD_CI_OE_WH_XI_SH_SC_EF_NB_RC_PB_UGB_KHB_T_CHB_BHB_NE_FD_YO_QO_EAB_TO_PO_XI_UZ_KH
;; Oaks:: WH_XI_SH_SC_EF_NB_RC_PB :: Pixies, Shadow Wisps, Kirins, Unicorns
;; Mephitis:: UE_SD_K_J_U_HD_PD_EJ_UI :: Scorpions, Giant Spiders, Terathan Warriors, Terathan Drones, Dread spiders, Matriarch, Avengers, PEs
;; Niera:: II_WI_TI_YD_WD_NI_EB_VI_NI_R :: Mummies, Skeletal Knights, Wraiths, Spectres
;; Semidar:: W_BE_UC_UD_YH_N_FD_HI :: Imps, Mongbats, gargoyles, harpies, burning gargs, stone gargs
;; Rikktor:: QE_AE_DE_FE_AB_QF_XE_YE_X_DF_CD_DI :: Lizardmen, Snakes, Lava lizards, ophidian warriors, Dragons, Ophidian Avengers
;; Baracoon:: XF_VE_IE_OE_HE_LD_BI_RB_UB_GB_LB_FB_CI ::
;; Pet Balls:: PHB :: Solen Queens
;; Evil Mages:: LC_OC :: Evil Mages
;; Lich Lords:: R_EB :: Lich Lords
;; Hythloth Spawn UGB_KHB_T_CHB_BHB_NE_FD_YO
;; New Deceit _QO_EAB_TO_PO_XI_UZ_KH
finditem %target G_1
if #findCnt > 0
{
if #findCnt > 1 && ( %useLS = #true ) && ( #mana < 25 ) && ( %spellTimer < #scnt2 )
gosub execMS
if #findCnt < 2 && ( %useLS = #true ) && ( #mana < 25 ) && ( %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 0
if #findid <> %attack
{
set %attack #findid
set #LTARGETID %attack
event macro 27 0
}
return
First Problem. #Findkind is for Checking if an object is in a container or not. Don't use it when looking at objects on the Ground already.
if #FINDKIND = -1 4
finditem %target
set %attack #findid
set #LTARGETID %attack
event macro 27 0
Change that to This, And then DROP the Part where you check for if #Findid <> %Attack, and add in a small Wait timer in between attacking.
if #Findcnt > 0
{
set #ltargetid #Findid
Event macro 27 0
Wait 5
}
That should solve all your problems.
-
The problem isn't it trying to attack though, it's that it's improperly using the spells/abilities on top of the corpse of a monster.
For example, I have an AI weapon in my hand, There are two monsters, As the script kills one with AIs, it uses Momentum strike (instead of lightning strike) because there are TWO (or more) monsters there. Once the first one is dead, it then switches to the next monster and proceeds to kill it with AIs, however instead of using Lightning Strike, it attempts to Momentum strike because the corpse of the previous one is right next to me, and it is ready that corpse.
Also when all things are dead, and I am looting, it counts the corpses as there still, and casts spells like Consc wep, EOO, etc.
-
Alright... Time for another go at this.. Now that I've got some rum in my system.
I'll post progress :>
-
Tee Hee, I think I know what your problem is, and its probably much more Simple than you Think.
Try putting this at the Top of your Script
Ignoreitem #Charid
I think its locating you as one of the Monsters
XU is a type for a Male Elf. And is in the types you wish to attack :P
Hoping its that Simple....
-
Tee Hee, I think I know what your problem is, and its probably much more Simple than you Think.
Try putting this at the Top of your Script
Ignoreitem #Charid
I think its locating you as one of the Monsters
XU is a type for a Male Elf. And is in the types you wish to attack :P
Hoping its that Simple....
Negative, I've tried this already unfortunately... Also tried making sure my swampy wasn't the issue...
But I can literally, kill something, Move away from it's corpse and the script wont cast anything (which it should do, since nothing is around) and then run on top of the corpse, and it will act as if the corpse is a mob and do it's thing. >.<
I had something working fairly well, and couldn't get it to attack though, but I didn't save and my laptop died :X
Which made me need to take a breather, rofl.
-
Ouch...
I mean, from the looks of it, what you run is very Similar to the Attack portion of the Army, And I've never noticed an issue with Corpses like that though.... They always Perform the Right Special Based on Number of targets.
-
I'll give it a whirl here in a few and see if I can "Step" into the Script to see just whats going on.
-
Yeah... I really like that EUO has those options... but I really dislike the quality of it... Breakpoints would be awesome :>
-
Alright, so I found out the culprit ID of these issues.
The id was XC (Which is the ID for the new ogres in Wrong)
for some reason, some corpses would pickup that SAME ID and the script was tripping over it.
Gonna do some more testing to see if there are more issues like this.