![]() ![]() |
Nov 8 2003, 05:32 PM
Post
#1
|
|
![]() Lord of the Forums ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 1,801 Joined: 15-April 03 From: London, Ontario, Canada Member No.: 14 |
Attached is a copy of an attended-combat-macro that I wrote for my 3-school archer. It self-buffs, fletches, fights, loots, heals, navigates, and salvages. It is probably about as responsive as it is possible for an ACTool macro to be.
Configuration is done by setting the values of Constants and customizing several datasets prior to runtime. Let me know your thoughts! Version specific details below: BowHunter 2.1.0 Significant update: - Resolution independant! - Does not use IsObject for open-corpse detection (Thx DaMob!) - Allows configuration of "prebuffs" BowHunter 2.1.1 Minor update: - Uses AddUstItem command for salvaging, is MUCH faster than the old MousePos...DragTo method. - Some minor tweaks, optimisations and fixes BowHunter 2.2.0 Significant Update: This should be considered a beta release of 2.2.0. The changes to the way the bot monitors its environment haven't been thoroughly hashed out (which is why I'm posting it). Hopefully when the kinks have been worked out, this will be significantly more efficient in it's operation. Also: - It is more of a state-based solution now - Changed the way the bot looks at it's environment and when. - Users can add or remove "phases" more easily (for ppl not wanting buffs for example) - Implemented the use of SetCombatState but this can be tricky, it seems to have a vulnerability to lag. - Some other minor tweaks, optimisations and fixes BowHunter 2.2.1 Significant Update: - Have spent many hours testing the 2.2.0 updates and they seem to be working well. - Added the ability to add SIKs to SI keyrings (if the bot has them). The major caveat of this feature is that it only works with keyrings that haven't had any keys removed from them. This feature can be sketchy at times and is still in development. - Changed the way the bot loots corpses. It no-longer uses mouse-clicking on every item to parse the data. Looting is significantly faster now. - Changed the way existing buff detection works. Becareful, it appears to have issues with setting Bane timers. For this release, it may be necessary to issue /ACTCMD reset when you start the bot if your banes aren't fresh. - Many many minor bug-fixes and optimizations, this is a significant code-update from 2.2.0 BowHunter 2.2.2 Minor Update: (119 downloads) -Fixed the problem with Bane's not being timed correctly. -Implemented buff-extensions, whereby buffs that expire while the bot is buffing itself get dynamically added to the current buffset. This eliminates the problem of the bot doing some buffs, leaving spell mode, equipping a bow, then unequipping it, getting it's casting item back out, and then casting some more spells. BowHunter 2.2.8 Major Update: (34 downloads) - Changed the way healing devices are cataloged and processed, the macro can now use a wide variety of items and it prioritizes their use by the calibre of the item, and uses up the items with the fewest remaining uses first. If this is a successful addition, it will be extended to stamina-recovery methods as well. - Added support for using the bot from another account. BowHunter can be configured to accept commands via TELLs and to relay TELLs it receives to another toon. - The bot can now be sent to a location from the command line. The command is "/actcmd go ns ew" where "ns" and "ew" are incNav style coordinates. - Partial implementation of the ability to get coordinates of landmarks (using the ACExplorer database). <-- (NOTE: this ended up being removed prior to distribution of 2.2.8) This ability will be used to facilitate enhanced functionality in the navigation routine(s). - Fletching has been greatly optimised. The bot can now recognize when it has arrows in stock (but not in hand) and act accordingly. - Improved the fletching process itself including a dramatic increase in the speed of the fletching/equipping process. - The macro now auto-identifies the armour and clothes that it is wearing when the macro is started. No need to statically (manually) define your kit. - The macro also auto-identifies the bow that it is weilding when the macro is initiated and defines it as its primary combat weapon. No need to manually define the GUID of the weapon. - Greater configurability in the header of the macro: buffing, fletching, looting and salvaging can all be de/activated by simple variable assignments. - Broadened the application of the salvage list. Material-types can be set to be ALWAYS collected/salvaged, NEVER collected/salvages, or a third, "conditional" status, whereby they will only be collected/salvaged if a partial bag of that material is in inventory (to finish that bag), but will not be collected/salvaged if there are no bags, or only full-bags. - Modified the combat system to prioritize closer enemies over distant ones. BowHunter 2.2.9 Minor Update: (31 downloads) - Incorporated the same item management system for Stamina as was implemented for healing in 2.2.8 - Implemented whereis functionality for the macro. You can now enter "/actcmd whereis [someplace]" and the macro will return the name and coordinates of the first ten places (out of the places database) that have "[someplace]" in their name. - The "places" database (a dataset-saved XML file) is downloaded by the macro from my website. No need to include it in the distribution this way! - More optimizations of the buff, healing, fletching and hunting routines. - Full implementation of the adaptive salvaging routines. The macro now properly processes "conditional" materials. When materials are configured as "conditional", the macro only loots and salvages them if it has a part-bag already going (to finish the bag). When that bag is filled, the macro will stop collecting that material. Conversely, if you start a bag of a conditional material, while the macro is running, it will start collecting and salvaging that material until that bag is finished. Materials can be defined via modes. Initial modes are 1 (always salvage), 3 (conditional salvage) and 5 (never pickup or salvage). - Buff "phases" are delineated by spell type now (used to be "prebuff" or "main"). This allows you to reset item spell timers manually, without affecting creature, or life spells. The new command "/actcmd resetitems" will do this. - Minor changes to the buff-initialization code. The macro detects the status of Creature Enchantment Mastery Self 7 (Adja's Blessing). If it is running, the macro WON'T prebuff on startup (in all previous versions supporting prebuffs, the macro always prebuffed when it was run, regardless of the condition of it's existing buffs). It also sets all initial item spell timers to be the same value as the last non-item spell. For this reason, it is important that whatever spell IS this last spell, it is the same level as the lowest level item buffs. If that is unfeasible, you should manually re-initialize item spell timers in a timely fashion when you start the macro. BowHunter 2.2.10 Minor Update:(84 downloads) - Added a lot of code to the hunting routine. The macro now deals with arrows striking the environment (by switching to the last attacker), and with running out of ammo while hunting (fletches and equips 30 arrows) - You can now reset your defined weapon without stopping/restarting the macro. Changing your equipped weapon, then issuing the command "/actcmd newweapon" will cause the macro to identify the new item, and reset weapon buffs to target it, and it pre-expires those buffs so they'll be cast by the macro at the first opportunity. - Instead of always using 100% of the "accuracy" bar, you can now set the macro to use a percentage of it when attacking. This is defined by a CONSTANT at the top of the macro. - The macro will check my webserver for version information, and notify you when new versions are posted. If the $AutoUpdate value specified at the top of the macro is set to 'Yes', the macro will auto-download new versions to your computer when they become available. (It does NOT run them, it simply puts the new version onto your computer for you to check out). This feature can be disabled simply by setting the $AutoUpdate variable to anything other than 'Yes'. - fixed a bug that was causing the macro to be very non-responsive to creatures attacking it while it was engaged in other activities (fletching, buffing, looting etc). - fixed a bug where the macro would skip to a new target after breaking to heal or recover stamina while hunting. Note: The optimizations to the hunting logic make this update an important download. Even though there are not a lot of new features, this code makes it a signficant upgrade IMO. BowHunter 2.2.12 Minor Update: - Users of 2.2.10 with the autoupdate enabled should already have a copy of this file on their hard drives. - Added a third method for recovering mana for 2-school archers (no life magic): If ManaMethod is set to 3, the macro will look for and use mana potions to recover mana. - Other minor updates, changes and modifications. Please post here if issues crop up as I have not had a lot of time to playtest some of these updates. -Triane This post has been edited by Triane: May 2 2004, 06:59 PM
Attached File(s)
-------------------- SQL>SELECT * FROM users WHERE clue > 0;
0 rows returned SQL>_ |
|
|
|
Nov 8 2003, 11:41 PM
Post
#2
|
|
![]() Lord of the Forums ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 1,801 Joined: 15-April 03 From: London, Ontario, Canada Member No.: 14 |
Lol -- 8 downloads and not a single comment or reply... I hope that's a good thing
-Triane -------------------- SQL>SELECT * FROM users WHERE clue > 0;
0 rows returned SQL>_ |
|
|
|
Nov 9 2003, 05:40 PM
Post
#3
|
|||
|
Rookie ![]() ![]() ![]() Group: Members Posts: 96 Joined: 1-May 03 Member No.: 496 |
I have to ask: What's this stuff for?
|
||
|
|
|||
Nov 9 2003, 05:55 PM
Post
#4
|
|
![]() Lord of the Forums ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Moderator Posts: 3,366 Joined: 12-April 03 From: Vancouver, Canada Member No.: 5 |
Matches a pattern of pixels in the non-3D area of the game screen. Given the object name ("Dead_Corpse"), I expect it's matching a set of pixels that lets you know a corpse has been opened and the game UI is showing the monster's loot slots. See the IsObject command in the help file for more info.
-------------------- Please read the Forum Posting Guidelines AND the FAQ Forum before posting.
Don't waste your time posting a bug report until you've read FAQ: How do I report a bug ? |
|
|
|
Nov 9 2003, 07:42 PM
Post
#5
|
|
|
Rookie ![]() ![]() ![]() Group: Members Posts: 96 Joined: 1-May 03 Member No.: 496 |
Aha!
Thank you. |
|
|
|
Nov 9 2003, 08:18 PM
Post
#6
|
|
![]() Lord of the Forums ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 1,801 Joined: 15-April 03 From: London, Ontario, Canada Member No.: 14 |
Ipa was, of course, 100% correct. That's also the part of the program that causes the vertical-resolution dependance. I've tried a few times to make the corpse-detection resolution INdependant, even with Ipa's help on the calculations, but for whatever reason, I could NEVER get the IsObject to succeed except in the one case as it's hard-coded into BH at present. I have never liked using object-mapping, and so I've not spent much effort to find out why it won't work at any other scale. If Ipa wants to weigh in on this, I'd more than appreciate it!
-Triane -------------------- SQL>SELECT * FROM users WHERE clue > 0;
0 rows returned SQL>_ |
|
|
|
Nov 9 2003, 09:08 PM
Post
#7
|
|
|
Rookie ![]() ![]() ![]() Group: Members Posts: 96 Joined: 1-May 03 Member No.: 496 |
Certainly there is an easier way to determine if a corpse is open or not.
|
|
|
|
Nov 9 2003, 10:32 PM
Post
#8
|
|
|
Rookie ![]() ![]() ![]() Group: Members Posts: 80 Joined: 7-November 03 Member No.: 1,690 |
Triane, couldnt you add the guid of the dead corpse to a list, and do a list check of the guid you've selected before you loot(using _selectedguid). If its on the list, dont loot it, cuzz its been looted already, if not, loot it, and add it to the list...And clear the list every 5 or 6 minutes? that way you wont have to worry about the isobjects.
I'll do anything to stay away from object checks hehe, ANYTHING. I always hated em. |
|
|
|
Nov 9 2003, 10:42 PM
Post
#9
|
|
![]() Lord of the Forums ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 1,801 Joined: 15-April 03 From: London, Ontario, Canada Member No.: 14 |
For looting the corpse, the macro selects it, and confirms that it got the corpse by GUID. At that point, it hits 'r' for Use Item, which will cause the toon to walk over to the corpse and open it. However things can go awry and the corpse doesn't open, or you're not very near it, and it takes longer than other times.
If I don't detect that the corpse is actually opened, with it's contents visible (via IsObject), the macro has to just assume there's an open corpse after some arbitrary delay. If this isn't true, and the window didn't get opened, then the corpse will be marked as looted even though the macro never saw what was in it. Contrarily, having an arbitrary time-out means that there will be times the macro doesn't make it to the corpse before the time runs out, or that it will spend too much extra time waiting around for a timer to run out with the corpse already open. If I knew ANY better way to accomplish the same end, I'd do it in a heartbeat, I hate IsObject as much as anyone! -Triane PS: The idea regarding lists IS the way this macro ensures it's not re-looting corpses (although I think I used a dataset instead), but as I described above, the object-detection isn't related to that function. PPS: As I recall it, the "Object" being detected is the "Skull" icon in the upper left corner of an opened-corpse window which is why your chatbar has to be minimised and alternate vertical resolutions mess it up... -------------------- SQL>SELECT * FROM users WHERE clue > 0;
0 rows returned SQL>_ |
|
|
|
Nov 9 2003, 11:35 PM
Post
#10
|
|
|
Rookie ![]() ![]() ![]() Group: Members Posts: 80 Joined: 7-November 03 Member No.: 1,690 |
Sounds like the only thing making you use isobjects is corpse distance. You could add a distance check on the corpse when you select it, If its over say 25 meters, check heading, run that way for say 20 meters, then use it. Instead of having it check for the skull, what about moving the mouse to the first slot in the corpse, if _selected <> 0 then you got something, and the corpse is open.
Shrug if i know if that would work or not, just trying to help a fellow actooler outta using objects. |
|
|
|
Nov 9 2003, 11:43 PM
Post
#11
|
|||||
![]() Lord of the Forums ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 1,801 Joined: 15-April 03 From: London, Ontario, Canada Member No.: 14 |
If the corpse's window doesn't open (b/c you're stuck on a wall or, you don't have permission or whatever)... the mouse moves to the location and clicks... without an open window, that space is in the 3D area. It could click on a critter, a corpse, furniture, anything at all that could be in your 3D display, could get clicked, and generate a non-zero _selected value yet not be an indication that the corpse window is actually open...
How would you "check heading"? Using Select or SelectGUID doesn't turn your toon to face the selected object, and AFAIK ACTools doesn't give you a direct method for it either. You could use coordinates, algebra and geometry to try to work it out, but if a land-block boundary lies between you and it, you're still SOL. I'm not being critical of your ideas, I welcome any attempts to remove the IsObject, but the point of it is to optimise the process of opening a corpse and knowing when it's open. Guessing isn't a good solution IMO, certainly not for optimal performance. -Triane -------------------- SQL>SELECT * FROM users WHERE clue > 0;
0 rows returned SQL>_ |
||||
|
|
|||||
Nov 10 2003, 01:16 AM
Post
#12
|
|
|
Rookie ![]() ![]() ![]() Group: Members Posts: 80 Joined: 7-November 03 Member No.: 1,690 |
Check heading thing, i was thinking about when you ID something you turn towards it. Forgot they changed it.
|
|
|
|
Nov 10 2003, 07:12 AM
Post
#13
|
|
![]() Lord of the Forums ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 3,409 Joined: 12-April 03 Member No.: 6 |
I hope this helps but I just tried this and it worked as I thought it would.
I killed a Tumerok Champion Keys E WaitForcursor SendText 13, _idLockOpen Result: 0 I then opened his corpse and reran the above and the result became a 1 Closed the corpse and reran it and _idLockOpen returned to 0. |
|
|
|
Nov 10 2003, 08:53 AM
Post
#14
|
|
![]() Lord of the Forums ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 1,801 Joined: 15-April 03 From: London, Ontario, Canada Member No.: 14 |
Ahh, cool! -- hehe -- I guess the _idlockopen variable is misleadingly named! -- I'll put that in tonight if I get a chance, if it works as you've indicated it'll be a really big improvement!
Did I mention I HATE IsObject? -Triane -------------------- SQL>SELECT * FROM users WHERE clue > 0;
0 rows returned SQL>_ |
|
|
|
Nov 10 2003, 01:22 PM
Post
#15
|
|
|
Insane Poster ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 487 Joined: 26-April 03 Member No.: 191 |
I've messed with the _idlockopen at one time and found I got inconsistant results. The variable requires examining the selected item after a delay. Now the waitforcursor delay works, most of the time. However, if you get lag it can throw the whole thing off. Also the act of examining an item used to be a little buggy. I think they fixed that but I've still seen goofy things happening when trying to examine many item quickly. That being said, maybe there is some new functionality available due to the decal sanfu. I'm just thinking out loud since I havn't been following the situation that closely.
|
|
|
|
![]() ![]() |
| Lo-Fi Version | Time is now: 3rd September 2010 - 07:27 AM |