Clarity
2015-04-05 21:57:31
ClarityDominionTower
A "learning" release. Endurance mode only.
Read everything below before using.
A "learning" release. Endurance mode only.
Read everything below before using.
This script works, but not super well. It utilizes motion detection, posted by @bonsai a few months ago. A lot of it is hardcoded, simply because that was the easiest and quickest way to go for my personal account needs. I finished using this script awhile ago. I used it to achieve the "Ruler of the Tower" title, getting to the 250th floor per script run. It worked flawlessly up until the Dominion Tower update a few months ago, which added and modified bosses and interfaces. I have somewhat edited the script to account for the update - it should run correctly, but treat unknown bosses (lack of stored BMP) as regular bosses. Since I was done using it entirely, I have not maintained it seriously. If I have free time I might take a second look, but until then, I'm releasing it for those who may want to modify it for themselves as a learning activity, for their own account specifications, or finish Dominion Tower tasks. It will likely not work flawlessly for you if you don't make any edits. This minigame, after the update, also provides very good combat XP, and other rewards.
I will be happy to answer questions about making your own edits to the script. Had this been a fully polished and functioning release, it would have been posted in SRL Members+, but I thought this would be a better way of letting people get their hands dirty in some code for the first time having the work done about 80-90% for you.
Expected failures for: Outdated script boss bitmaps, bosses that may have had their combat mechanics buffed, totally new bosses, bosses I couldn't access and as such could not code for, using equipment that wasn't coded for in the script (need to add your own DTMs for your own equipment)
On the whole, this is a babysit style script, but should work correctly almost all the time.
Everlasting and Illusive takes awhile unless manually corrected (need a search function for Illusive).
Setup Example

You will need ability bars for your attack styles, and relevant equipment.
My account was using Supreme Overloads, Super Saradomin Brews, Super Prayers, Drygore longswords, a Noxious staff, and Superior elite void (magic/melee helms). Ice nihil familiars were also extremely helpful for cutting down kill times. Your required gear might change for your own set of bosses, which are based on completed quests.
The script works by endlessly checking for your account "state" and deciding what to do from there. Note that it does NOT operate with the camera facing north. Dominion Tower automatically changes your camera angle frequently, and this script is based on those automatic angles. It can detect any of these states:
procedure getState;
var
x, y: integer;
begin
//Before walking to the entrance gate to enter the next arena
if findDTM(atEntranceDTM, x, y, minimap.getBounds) then
begin
state := 'atentrance';
inc(atentranceCount);
if atentranceCount >= 10 then state := 'fightOver';
exit;
end;
//Currently in a boss fight
if findBitmap(fightHappeningBMP, x, y) then
begin
state := 'fighting';
exit;
end;
//Boss fight just ended, still standing in the arena
if (state = 'fighting') and (not findDTM(lockDTM, x, y, mainscreen.getBounds)) then
begin
state := 'fightOver';
exit;
end;
//Standing directly after the exit gate, right after going through it
if findDTM(atExitDTM, x, y, minimap.getBounds) or findDTM(glitchExitDTM, x, y, minimap.getBounds) then
begin
if findDTM(glitchExitDTM, x, y, minimap.getBounds) then isGlitched := true;
state := 'exited';
inc(atExitCount);
exit;
end;
//Boss selection is being rolled
if findBitmap(selectionScreenBMP, x, y) and (not (getColor(point(327, 503)) = 0)) then
begin
state := 'bossSelect';
exit;
end;
//Boss has been selected
if findBitmap(selectionScreenBMP, x, y) and (getColor(point(327, 503)) = 0) then
begin
state := 'bossSelected';
exit;
end;
end;
From those states, it will choose what to do based on its knowledge of what boss is being fought, provided by the many BMPs stored in the script.
If you encounter a boss that is not in the script, this means I couldn't code for it, or it was an incredibly easy boss with no special mechanics, such as The Kendal. If a boss is easily killed AFK with little/no interaction, a BMP is not necessary.
You can add in special activities to do before, during, or after the fight. For example:
procedure specialBefore;
begin
if (boss = '') then exit;
case boss of
'Pest Queen':
begin
//Instructing the script to change to Drygores and my Melee ability bar
tabBackpack.clickDTM(drygoreMainDTM, MOUSE_LEFT, 'ield', 300, false);
wait(50 + random(250));
tabBackpack.clickDTM(drygoreOffDTM, MOUSE_LEFT, 'ield', 300, false);
wait(50 + random(250));
tabBackpack.clickDTM(voidMeleeHelmDTM, MOUSE_LEFT, 'ear', 300, false);
wait(50 + random(250));
switchToBar('Melee');
end;
'Ice Demon':
begin
//Setting spells
setSpell('Blood Barrage');
end;
'Balance Elemental':
begin
//showBalloonHint('Balance Elemental', 'Attempting Balance Elemental automation, please supervise!', 10000, bfInfo);
tabBackpack.clickDTM(drygoreMainDTM, MOUSE_LEFT, 'ield', 300, false);
wait(50 + random(250));
tabBackpack.clickDTM(drygoreOffDTM, MOUSE_LEFT, 'ield', 300, false);
wait(50 + random(250));
tabBackpack.clickDTM(voidMeleeHelmDTM, MOUSE_LEFT, 'ear', 300, false);
wait(50 + random(250));
switchToBar('Melee');
end;
'DT Warriors':
begin
//Equipping Ice gloves
tabBackpack.clickDTM(glovesDTM, MOUSE_LEFT, 'ear', 300, false);
end;
{...}
end;
Some bosses require special items found on the arena floor, such as Count Draynor who needs to be killed with a stake and hammer. For something like this, I added the following code to the SpecialDuringPre; procedure.
procedure specialDuringPre;
begin
{...}
'Count Draynor':
begin
//showBalloonHint('Count Draynor', 'Attempting Count Draynor automation, please supervise!', 10000, bfInfo);
while attempts < 15 do
begin
mouse(point(258 + random(-7, 7), 192 + random(-5, 5)), MOUSE_MOVE, MOUSE_HUMAN);
if isMouseOverText(['ake'], 300) then
begin
fastClick(MOUSE_LEFT);
break;
end;
inc(attempts);
continue;
end;
wait(1500 + random(1500));
attempts := 0;
while attempts < 15 do
begin
mouse(point(288 + random(-6, 6), 208 + random(-4, 4)), MOUSE_RIGHT, MOUSE_HUMAN);
if chooseOption.select(['ake'], 300) then break;
inc(attempts);
continue;
end;
wait(500 + random(500));
end;
{...}
end;
There are also specialDuringPost; and specialAfter; procedures.
While I originally intended to fully polish this for ultra-user-friendly release, I think it will be beneficial for those who truly want to bot Dominion Tower, and contribute some of their own custom code without having to make an entire script from scratch. Perhaps if you are generous enough, you will post your own code for other bosses for more members to use.
Download: [ATTACH]25511[/ATTACH]
Credits:
@bonsai, @bg5, and @slacky, for motion detection contributions that I adapted.
@elfyyy, for the tutorial on real mouse location for interactive SMART functionality, which I used at one point to signal to the script that I had finished legitting a boss. When I updated it with automatic fighting for all harder bosses like Nomad, I commented it out.
Best of luck with your botting endeavors,
~Clarity