I ran into the issue where I wanted to quickly go through and kill all the Tesla Coils while ignoring everything else. But it was fairly annoying to have to manually target. So I added to the auto aim code to do it for me.
It had to do with the placement of the code that was suggested that was incorrect. Even if you had placed the code in the correct location, it will cause the flash player to crash since it was not fully complete for this situation. In addition, the "jump to SHOOT if it was equal" meant it will just shoot at where your mouse was at since it never determine at what degree it should be firing at. So the code from Nisuxen was a very good hint for those who are trying to figure it out themselves.
Tesla Coil is not a "Character" class object, which was already implied in the your post. That is why you changed it so it was considered a "Character" in bin.
If you took a look at the autoaim's logic, it basically
retrieves the object1, checks to see
if the type of the object is a "Character"2. Then
determines if it is an enemy.3
Afterward it does a bunch of other checks. Finally it picks the best target based on the object's max health within your range. The one with the most max health will be targeted first. It works great for bosses. Not so great when you want rush through mad lab while targeting the Tesla Coils.
Overall, this means that with the current set of code that I have received from 17.4 mod selection, there are two issues that you need to deal with.
1) Making Tesla Coil a valid enemy.
2) Making Tesla Coil a priority.
If you understood the above, then it is pretty simple to get the auto aim code working.
To solve #1, something like this:
Code:
getproperty QName(PackageNamespace(""), "props_")
getproperty QName(PackageNamespace(""), "id_")
pushstring "Tesla Coil"
ifeq SKIP_CHECK
needs to be placed in the proper location. Once placed in the proper location, you will target the Tesla Coils.
Hint: I added superscripts to 3 key points in my explanation above. You need to place the above code somewhere before/after/between those key points.
For #2, if you are lazy, you can simply add to the ignore list so that you focus only on the coils and ignore everything else. Or you can add some simple (to me at least) logic to make Tesla Coils that are in range a priority over other objects.
One question, what are mobs called in this game? Monsters? or enemies? I am still new to ROTMG.