taultunleashed logoHunter Script, Range Pulling : DAOC Discussion
newtopic  postreply
 [ 28 posts ]  1, 2  Next
blue large dot

Hunter Script, Range Pulling : DAOC Discussion

Posted: March 5th, 2004, 5:46 pm
 
maximusdm
maximusdm's Reps:
User avatar
Ok, I don't like myself so i'm playing a ranger. (leveling a ranger is not fun or eazy, so playing one is like beating yourself up)

Any ideas on how I can make a scrip find/pull a target with my bow? (other than F8)

Thanks...


Reply with quote
Posted: March 5th, 2004, 6:16 pm
 
carlicj842
carlicj842's Reps:
User avatar
I already created an Auto Farmer...but i decided against letting it work for Magic/Ranged ..only melee..

Because theres no way too
1) Know if your close enough to fire after you find the target
2) you cant /follow them then attack to get in range..because they could be moving and cause you to move with them so you interrupt yourself.


Reply with quote
Posted: March 5th, 2004, 6:40 pm
 
maximusdm
maximusdm's Reps:
User avatar
I might try a melee ranger and respec at 40 but that only gets me to 40... damn, maby a buff bot will make solo better


Reply with quote
Posted: March 5th, 2004, 8:29 pm
 
maximusdm
maximusdm's Reps:
User avatar
1) Know if your close enough to fire after you find the target

We can check this, just for fun I set the second range cicrle to match the range of my bow with the arrrows i'm using, helps alot when picking a target.


Reply with quote
Posted: March 6th, 2004, 1:58 pm
 
Devestator
Devestator's Reps:
User avatar
You can tell how far you are from your target either by simple math or using the FindDistance Function in the DAOCService.

As far as targeting with other than F8, currently as I understand it, is not possible without substantial risk of being detected running the program.

I mean in a script you could simulate pressing f8 .. other than that though only think you could do is spin around in circle clicking randomly on the screen and checking to see if you have a target after each click.


Reply with quote
Posted: March 6th, 2004, 5:07 pm
 
carlicj842
carlicj842's Reps:
User avatar
Sorry i thought we were talking FFXI here..ignore me..i must not have seen what forum this was in :/


Reply with quote
Posted: March 9th, 2004, 8:35 am
 
SideReal
SideReal's Reps:
User avatar
1) Use FindMobByName to get the list of Mobs close to you. Search through the list till you find a juicy one that is fairly close. Get the MOB ID of this critter. This is your target.

2) Use GetDistance to find out how far you are.

3) Use FindHeading to get the direction.

4) Find the OPPOSITE direction by using 360 - (HeadingToMOB)

5) If you are TOO CLOSE to the target, use the angle found in step 4 in a SetHeading call and move AWAY from the target until you are NEAR maximum range.

5a) If you are TOO FAR from the target, use the angle found in step 3 in a SetHeading call and move TOWARDS the target until you are NEAR maximum range.

6) Hit <F8>. Check to see if the MOB ID returned from PlayerTarget matches the MOB ID of the target you wanted to fight.

6a) Keep hitting <F8> until ID's match.

7) Do <Bow> <Bow> <Bow> <Wait 1> <Bow> <Bow> <wait .5> <Melee> <F6> </STICK> <Wait .5> <Attack Special> <Wait 2.5> <Attack Special>


Anyway - that should give you the base idea (in pseudo code) how to write a Bow-hunter.

Change this code slightly and it could also be a NUKE hunter as well.


Reply with quote
Posted: March 9th, 2004, 10:03 am
 
maximusdm
maximusdm's Reps:
User avatar
Cool,thanks. <hunts for the new chat log and triger code>


Reply with quote
Posted: March 9th, 2004, 11:09 am
 
SideReal
SideReal's Reps:
User avatar
Maximus -

Yeah. Sorry about that. I have had problems getting C# and / or VB publishing out the DLL's correctly. This all started after I put both the 1.0 and 1.1 Framework on my development box. (And now I have the 1.2 Whidby stuff out there, which makes it worse).

So.... I have found I *don't* have a problem when I develop the DLL in Managed C++ so I am shifting all my plugins over to Managed C++. It takes me a while to shift back into ATL/STL and using smart pointers, etc. C# has me soooo spoiled!


Reply with quote
Posted: March 9th, 2004, 11:11 am
 
WyvernX
WyvernX's Reps:
User avatar
I still think the admins might be able to correct that if we can pinpoint what is causing it. I would like to move all my plugins straight to vb.net.


Reply with quote
Posted: March 9th, 2004, 3:31 pm
 
SideReal
SideReal's Reps:
User avatar
WyvernX -

I actually have an idea about that. I was working on my plugin in C++ when I realized that C++ EXPLICITLY calls and loads the framework it wants.

VB and C# does not do this - they expect the framework to determine the correct version based on the AssemblyInfo block. I've tried the Microsoft trick of setting the OnlyAllow 1.1 flag in the AssemblyInfo but it does not seem to help.

I'll play around with that some more and see if we can get a VB.NET shell that everyone can use. I much prefer VB.NET (Especially the Whidby version - man it has some good stuff!)


Reply with quote
Posted: March 14th, 2004, 9:47 am
 
JimmyOOOOO
JimmyOOOOO's Reps:
User avatar
-> DAOC autofighter for ranger in deve...



--------------------------------------------------------------------------------
Pages: <Back 1 2 Next>
From Message
BuildingABetterDAoC

04-08-02 04:20 PM
Reply
DAOC autofighter for ranger in developement still

--------------------------------------------------------------------------------
Pause (3000);
// be sure to click OUTSIDE the window before 3 seconds is up


// Auto-Fighter scripting,
// written by notme, with help from all the posters on another 3rd party app Forum.
//---------------------------------------------------------------------------

// OK i have gotten 12 levels in 48 hours with this, although it was only level 9 through 21.
// If someone wants to try it out, or just tell me where I can make some improvements
// Please post here and check it over.
//---------------------------------------------------------------------------
Const MustHaveTargetSTR = 'You must have a target for your';
Const RessurectedSTR = 'You have been resurrected by';
const NoArrowsSTR = 'You must select a quiver slot to draw from!';
const PrepareShot = 'You prepare your shot';
const NoCritshotSTR = 're too tired to perform a critical shot!';
const YouMissSTR = 'You miss!';
const StopAimSTR = 're too tired to hold your shot any longer!';
const FatiguedSTR = 're too tired to use your';
const TiredSTR = 'You are too fatigued to perform';
const YouHitSTR = 'with your bow and hit for';
const CannotSeeSTR = 'see your target!';
const ParrySTR = 'attacks you and you parry the blow!';
const Style1STR = 'attacks you and you block the blow!';
const Style2STR = 'You perform your black widow perfectly';
const HitsYouSTR = 'hits your';
const MissesYouSTR = 'attacks you and misses!';
const YouFumbleSTR= 'You fumble the attack and take time to recover!';
const MonsDiesSTR = 'You are no longer auto-following your target.';
const YouDiedSTR = 'You have died. Type /release to return to you last bind point.';
const NoMonsterSTR = 'No monster target in range.';
const ToFarFaceSTR = 'is too far away to auto-face!';
const ToFarStickSTR = 'is too far away to auto-stick!';
const ShotInterruptedSTR = 'is attacking you and your shot is interrupted!';
const TrantulaSTR = 'You perform your Tarantula perfectly.';
const SidewinderSTR = 'You perform your Sidewinder perfectly.';
const DiamondbackSTR = 'You perform your Diamondback perfectly.';


//---------------------------------------------------------------------------

const PlayerPixels = 89; //
const TargetPixels = 89; //
const SafetyPixelsINT = 20; // out of 89
const HealNowPixelsINT = 9; // out of 89
const MonsterPixelsINT = 10; // out of 89
const PlayerWinX=1472; // can be found in INI of your character
const PlayerWinY=1104; // can be found in INI of your character

//---------------------------------------------------------------------------

const _ALL=0;
const _HEALTH=1;
const _STAMINA=2;
const _MANA=3;
const _TARGET=4;
const _MONSTERCON=5;

//---------------------------------------------------------------------------


//---------------------------------------------------------------------------

var LogText1 : string;
var LogText2 : string;
var LogText3 : string;
var LogText4 : string;
var OrigMarker : integer;
var LogMarker1 : integer;
var LogMarker2 : integer;
var LogMarker3 : integer;
var LogMarker4 : integer;
//---------------------------------------------------------------------------

var CannotSee:boolean;
var YouHit:boolean;
var YouFumble:boolean;
var ShotInterrupted:boolean;
var Fatigued:boolean;
var YouMiss:boolean;
var StopAim:boolean;
var NoArrows:boolean;
var MonsDies:Boolean;
var YouDied:Boolean;
var HitsYou:Boolean;
var Parry:Boolean;
var Style1B:Boolean;
var Style2B:Boolean;
var MustHaveTarget:Boolean;

//---------------------------------------------------------------------------

// var InvBag : integer;
// var InvSlot : integer;
// var ClothingSlot: integer

//---------------------------------------------------------------------------

Procedure Sit ();
begin //Procedure Sit
sendkeys ('/sit<CR>');Pause (150);
end; //Procedure Sit

//---------------------------------------------------------------------------

Procedure Stand ();
begin //Procedure Stand
SendKeys ('/stand<CR>');Pause (150);
end; //Procedure Stand ()

//---------------------------------------------------------------------------

// This procedure logs the char out to desktop
Procedure LogOut ();
begin //Procedure LogOut
SendKeys ('/release<CR>');Pause (1000);
SendKeys ('/quit<CR>');Pause (1000);
end; //Procedure LogOut

//---------------------------------------------------------------------------

// WatchStatus procedure speeds up the reading from the correct area of the screen
// Give the status you will be looking for and a boolean to turn it on or off

procedure WatchStatus (Status:integer; Activate:boolean);
begin
if (Activate) then begin
if ((Status=_HEALTH) or (Status=_ALL)) then AddScreenWatch(PlayerWinX+31,PlayerWinY+24,PlayerPixels,1);
if ((Status=_STAMINA) or (Status=_ALL)) then AddScreenWatch(PlayerWinX+31,PlayerWinY+34,PlayerPixels,1);
if ((Status=_MANA) or (Status=_ALL)) then AddScreenWatch(PlayerWinX+31,PlayerWinY+45,PlayerPixels,1);
if ((Status=_TARGET) or (Status=_ALL)) then AddScreenWatch(PlayerWinX+31,PlayerWinY+90,TargetPixels,1);
end else begin
if ((Status=_HEALTH) or (Status=_ALL)) then DeleteScreenWatch(PlayerWinX+31,PlayerWinY+24,PlayerPixels,1);
if ((Status=_STAMINA) or (Status=_ALL)) then DeleteScreenWatch(PlayerWinX+31,PlayerWinY+34,PlayerPixels,1);
if ((Status=_MANA) or (Status=_ALL)) then DeleteScreenWatch(PlayerWinX+31,PlayerWinY+45,PlayerPixels,1);
if ((Status=_TARGET) or (Status=_ALL)) then DeleteScreenWatch(PlayerWinX+31,PlayerWinY+90,TargetPixels,1);
end;
end;

//---------------------------------------------------------------------------
// GetStatusPixel function is used by GetStatus.
// It returns true if the X-th pixel of that status is filled.
// Examples:
// FullMana:=GetStatusPixel(_MANA,PlayerPixels-1);
// TargetAtHalf:=GetStatusPixel(_TARGET,TargetPixels/2);
// OutOfStamina:=GetStatusPixel(_STAMINA,0);

function GetStatusPixel(Status:integer; Pos:integer):boolean;
var
Red:integer;
Blue:integer;
Green:integer;
begin
if (Status=_HEALTH) then begin
GetPixelColor(PlayerWinX+31+Pos,PlayerWinY+24,Red,Green,Blue);
if ((Red/2)>Green) and ((Red/3)>Blue) and (Red > 100) then Result:=true else Result:=false;
end;
if (Status=_STAMINA) then begin
GetPixelColor(PlayerWinX+31+Pos,PlayerWinY+34,Red,Green,Blue);
if ((Green*2)>(Red*5)) and ((Green*3)>(Blue*5)) then Result:=true else Result:=false;
end;
if (Status=_MANA) then begin
GetPixelColor(PlayerWinX+31+Pos,PlayerWinY+45,Red,Green,Blue);
if ((Red*2)>(Blue*5)) and ((Green*2)>(Blue*5)) then Result:=true else Result:=false;
end;
if (Status=_TARGET) then begin
GetPixelColor(PlayerWinX+31+Pos,PlayerWinY+90,Red,Green,Blue);
if ((Red/2)>Green) and ((Red/3)>Blue) and (Red > 100) then Result:=true else Result:=false;
end;
end;

// function GetStatus returns the status you chose as a float between 0 and 1

function GetStatus(Status:integer):integer;
var
Border:array [1..3] of integer;
Bordertype:array [1..3] of boolean;
Bool:boolean;
CurHP:integer;
Step:integer;
Dir:integer;
begin
Border[1]:=0;
if (Status=_TARGET) then Border[3]:=TargetPixels else Border[3]:=PlayerPixels;
Bordertype[1]:=true;Bordertype[3]:=false;
CurHP:=Border[3]-1; Dir:=-1;
repeat
Step:=Trunc( ((Border[Dir+2]-CurHP)/2)+(Dir*0.55) );
CurHP:=CurHP+Step;
Bool:=GetStatusPixel(Status, CurHP);
if (Bool=true) then Border[1]:=CurHP else Border[3]:=CurHP;
if (Bool=Bordertype[Dir+2]) then Dir:=Dir*-1;
until (Border[1]=Border[3]-1);
if (Status=_TARGET) then begin
Result:=Border[1];
end else begin
Result:=Border[1];
end;
end;

//---------------------------------------------------------------------------

// this Function gets the monsters con
Function GetCon():boolean;
var
Red,Green,Blue:integer;
GrayB,GreenB,BlueB,YellowB,OrangeB,RedB,PurpleB:boolean;
PosX:integer;
PosY:integer;

Begin
PosX:=0;
PosY:=0;
repeat // set one
AddScreenWatch(PlayerWinX+7,PlayerWinY+73,5,5); // target name bar
repeat // set two
GetPixelColor(PlayerWinX+7+PosX,PlayerWinY+73+PosY,Red,Green,Blue);
if (red=168) and (green=168) and (blue=168) then GrayB:=true else GrayB:= False; // gray con, should never be set to true
if (red=152) and (green=240) and (blue=128) then GreenB:=true else GreenB:= False; // green con, set to true for low xp
if (red=104) and (green=100) and (blue=255) then BlueB:=true else BlueB:= False; // blue con, the most likely setting to true
if (red>200) and (green>200) and (blue<50) then YellowB:=true else YellowB:= False; // yellow con,hard for a bot to kill, but maybe
if (red>200) and (green>100) and (green<200) and (blue<100) then OrangeB:=true else OrangeB:= False; // orange con, should never set to true,
if (red=248) and (green=0) and (blue=0) then RedB:=true else RedB:= False; // red con, should never set to true
if (red=176) and (green=80) and (blue=255) then PurpleB:=true else PurpleB:= False; // purple con, should never be set to true
If (GreenB=true) or (BlueB=True) or (Yellowb=True) or (Orangeb=true) then Result:=True else Result:=False;
PosX:=PosX+1;
until (PosX=6) or (Result=true); // set two
PosY:=PosY+1;
PosX:=0;
until (PosY=3) or (Result=true); // set one
DeleteScreenWatch(PlayerWinX+7,PlayerWinY+73,5,5); // target name bar
End; // proceedure GetCon

//---------------------------------------------------------------------------

// This procedure targets a monster
Procedure TargetMonster ();

var Bool:boolean;

begin //Procedure TargetMonster
Bool:=false;

Stand;
Repeat
Pause (60000);
SendKeys ('<F8>');pause (500);
Bool:= GetCon;
until (Bool = true);
SendKeys ('/face<CR>');pause (500);
end; //Procedure TargetMonster

//---------------------------------------------------------------------------

// this procedure will accept a ressurection
Procedure Ressurection();
var RessurectionTries:integer;

Begin

RessurectionTries:=0;
LogMarker1:= SetLogMarker;
Repeat
SendKeys ('l');Pause (250);
SendKeys ('l');Pause (750);// resets the log
MouseMove(762, 543);
WaitForMouse; // lets the mouse catch up to the move
MouseDown(0); // left click
MouseMove(762, 543);
WaitForMouse; // lets the mouse catch up to the move
MouseUp(0); // left click
LogText1:=GetNewLogText(LogMarker1);
if (HasToken(LogText1, RessurectedSTR)) then YouDied:=False else YouDied:=true;
RessurectionTries:=RessurectionTries+1;
Until (YouDied=false) or (RessurectionTries=300);
if (RessurectionTries=300) then LogOut;
Pause (30000); // waits five minutes for the ressurection effects to wear off
end; // proceedure Ressurection

//---------------------------------------------------------------------------

// This procedure fires characters bow
Procedure FireBow ();

var Bool1,Bool2:boolean;
Shots:integer;

begin //Procedure FireBow

Shots:=0;


SendKeys ('l');Pause (250);
SendKeys ('l');Pause (75);// resets the log

Bool1:=false;
Bool2:=false;
CannotSee:=false;
YouHit:=false;
YouFumble:=false;
ShotInterrupted:=false;
Fatigued:=false;
YouMiss:=false;
StopAim:=false;
NoArrows:=false;
YouDied:=false;
MonsDies:=false;

SendKeys ('3');pause (75); // selects melee weapon to ensure proper firing sequence
SendKeys ('1');pause (75); // selects the bow
SendKeys ('2'); // takes aim with the bow replace with a 2 for critshot
// this should keep firing the bow
Repeat
if (Bool1 = true) then SendKeys ('l');Pause (250);
if (Bool1 = true) then SendKeys ('l');Pause (250);//resets the log
SendKeys ('1');pause (250); // fires when ready
SendKeys ('1'); pause (250); // sets the bow to auto reload
LogMarker1:= SetLogMarker;
// this should keep checking the log to see whats happening
Repeat
LogText1:=GetNewLogText(LogMarker1);
if (HasToken(LogText1, CannotSeeSTR)) then CannotSee:=true else CannotSee:=false;
if (HasToken(LogText1, YouHitSTR)) then YouHit:=true else YouHit:=false;
if (HasToken(LogText1, YouFumbleSTR)) then YouFumble:=true else YouFumble:=false;
if (HasToken(LogText1, ShotInterruptedSTR)) then ShotInterrupted:=true else ShotInterrupted:=false;
if (HasToken(LogText1, FatiguedSTR))then Fatigued:=true else Fatigued:=false;
if (HasToken(LogText1, YouMissSTR)) then YouMiss:=true else YouMiss:=false;
if (HasToken(LogText1, StopAimSTR)) then StopAim:=true else StopAim:=false;
if (HasToken(LogText1, NoArrowsSTR)) then NoArrows:=true else NoArrows:=false;
if (CannotSee=true) or (YouHit=true) or (YouFumble=true) or (ShotInterrupted=true) or (Fatigued=true) or
(YouMiss=true) or (StopAim=true) or (YouDied=true) or (MonsDies=true) or
(CannotSee=true) then Bool1:=true else Bool1:=False;
if (NoArrows=True) then LogOut;
Until (Bool1=true);
Shots:=Shots+1;
if (CannotSee=true) then TargetMonster;
if (YouDied=true) then Ressurection;
if (YouDied=true) or (MonsDies=true) or (ShotInterrupted=true) or
(Fatigued=true) or (Shots=2) then Bool2:=true else Bool2:=false;
until (Bool2=true);
end; //Procedure FireBow

//---------------------------------------------------------------------------

// This procedure begins melee
Procedure BeginMelee ();
begin //Procedure BeginMelee
SendKeys ('/face<CR>');Pause (150); // double checks that you are facing opponent
SendKeys ('3');Pause (150); // selects melee weapon right hand
SendKeys ('4');Pause (150); // selects the melee item weapon or shield left hand
SendKeys ('a');Pause (150); // is keyboard default attack key
end; //Procedure beginmelee

//---------------------------------------------------------------------------

// This procedure executes style one
Procedure Style1 ();
begin //Procedure style1
SendKeys ('5'); // uses gem
end; //Procedure Style1

//---------------------------------------------------------------------------

// This procedure executes style two
Procedure Style2 ();
begin //Procedure style2
SendKeys ('6'); // uses gem
end; //Procedure Style2
//---------------------------------------------------------------------------

Procedure HealMeNow();
Begin
SendKeys ('8'); // make sure to have a macro that sends a tell "heal me" to your partner
end;

//---------------------------------------------------------------------------

Function CheckForAdd():boolean;
Begin
LogMarker2 := SetLogMarker;
SendKeys ('l');Pause (250);
SendKeys ('l');Pause (150);// resets the log
Pause (5000);
LogText2 := GetNewLogText(LogMarker2);
if (HasToken(LogText2, MissesYouSTR)) or
(HasToken(LogText2, HitsYouSTR)) or
(HasToken(LogText2, Style2STR)) or
(HasToken(LogText2, Style1STR)) then Result:=True;
end;

//---------------------------------------------------------------------------

procedure DoMelee();

var Health,Target:integer;

Begin

YouHit:=false;YouFumble:=false;Fatigued:=false;YouMiss:=false;
Parry:=false;Style1B:=false;Style2B:=true;
YouDied:=false;MonsDies:=false;MustHaveTarget:=false;

LogMarker2:=SetLogMarker; // this log marker does not reset for entire fight.
LogMarker3:= SetLogMarker; // this log marker should reset for each run through until.
repeat
if (Style2b=true) then SendKeys ('l');Pause (250);
if (Style2b=true) then SendKeys ('l');Pause (925); // resets the log
LogText3 := GetNewLogText(LogMarker3);
if (HasToken(LogText3, YouHitSTR)) then YouHit:=true else YouHit:=false;
if (HasToken(LogText3, YouFumbleSTR)) then YouFumble:=true else YouFumble:=false;
if (HasToken(LogText3, HitsYouSTR))then HitsYou:=true else HitsYou:=false;
if (HasToken(LogText3, YouMissSTR)) then YouMiss:=true else YouMiss:=false;
if (HasToken(LogText3, ParrySTR )) then Parry:=true else Parry:=false;
if (HasToken(LogText3, Style1STR)) then Style1B:=true else Style1B:=false;
if (HasToken(LogText3, Style2STR)) then Style2B:=true else Style2B:=false;
if (HasToken(LogText3, MustHaveTargetSTR)) then MustHaveTarget:=true else MustHaveTarget:=false;
if (Style2B=true) then Style2 else Style1; // will append later
Health:=GetStatus(_HEALTH);
Target:=GetStatus(_TARGET);
if (Health < SafetyPixelsINT) and (Target > MonsterPixelsINT) then HealMeNow;
if (Health < HealNowPixelsINT) then HealMeNow;
LogText2:=GetNewLogText(LogMarker2);
if (HasToken(LogText2, YouDiedSTR)) then YouDied:=true else YouDied:=false;
LogMarker3:=SetLogMarker;
until (HasToken(LogText2, MustHaveTargetSTR)) or (HasToken(LogText2, YouDiedSTR)) or
(HasToken(LogText2, MonsDiesSTR));
End;

//---------------------------------------------------------------------------

Procedure Recover();

var FullStamina,FullHealth:boolean;

Begin
Sit;
repeat
If (YouDied=true) then Ressurection;
FullStamina:=GetStatusPixel(_STAMINA,PlayerPixels-1);
FullHealth:=GetStatusPixel(_HEALTH,PlayerPixels-1);
if (FullHealth=false) then HealMeNow;
if (FullStamina=False) or (FullHealth=false) then Pause (5000);
Until (FullStamina = true) and (FullHealth = true) and (YouDied=false);
Stand;
end;



//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------


While True do begin

Stand;
TargetMonster;
FireBow;
Repeat;
BeginMelee;
DoMelee;
CheckForAdd;
Until (CheckForAdd=false);
Recover;
// Loot; // not implemented yet

End;


//


Reply with quote
Posted: March 14th, 2004, 10:09 am
 
maximusdm
maximusdm's Reps:
User avatar
Cool, Thanks!

Will be playing with this today.

Hurm, need to get a loot function in there...


Reply with quote
Posted: March 14th, 2004, 3:44 pm
 
maximusdm
maximusdm's Reps:
User avatar
Ok, this is the first stage of my rewrite, just fixed some of the small easy stuff for now, will be doing some more reading befor I go on. If you know whats what, feel free point out stuff that needs to be changed (just make sure you inclued how/what to change)

Option Explicit
' be sure to click OUTSIDE the window before 3 seconds is up
' Auto-Fighter scripting,
' written by notme, With help from all the posters on another 3rd party app Forum.
' Re-written by MaximusDM, With help from all the posters at xunleashed
'---------------------------------------------------------------------------

Pause (3000)

Const RessurectedSTR = "You have been resurrected by"
Const NoArrowsSTR = "You must Select a quiver slot to draw from!"
Const PrepareShot = "You prepare your shot"
Const NoCritshotSTR = "re too tired to perform a critical shot!"
Const YouMissSTR = "You miss!"
Const StopAimSTR = "re too tired to hold your shot any longer!"
Const FatiguedSTR = "re too tired to use your"
Const TiredSTR = "You are too fatigued to perform"
Const YouHitSTR = "with your bow and hit For"
Const CannotSeeSTR = "see your target!"
Const ParrySTR = "attacks you and you parry the blow!"
Const Style1STR = "attacks you and you block the blow!"
Const Style2STR = "You perform your black widow perfectly"
Const HitsYouSTR = "hits your"
Const MissesYouSTR = "attacks you and misses!"
Const YouFumbleSTR = "You fumble the attack and take time to recover!"
Const MonsDiesSTR = "You are no longer auto-following your target."
Const YouDiedSTR = "You have died. Type /release to return to you last bind point."
Const NoMonsterSTR = "No monster target in range."
Const ToFarFaceSTR = "is too far away to auto-face!"
Const ToFarStickSTR = "is too far away to auto-stick!"
Const ShotInterruptedSTR = "is attacking you and your shot is interrupted!"
Const TrantulaSTR = "You perform your Tarantula perfectly."
Const SidewinderSTR = "You perform your Sidewinder perfectly."
Const DiamondbackSTR = "You perform your Diamondback perfectly."
'---------------------------------------------------------------------------
Const PlayerPixels = 89
Const TargetPixels = 89
Const SafetyPixelsINT = 20 ' out of 89
Const HealNowPixelsINT = 9 ' out of 89
Const MonsterPixelsINT = 10 ' out of 89
Const PlayerWinX = 1472 ' can be found in INI of your character
Const PlayerWinY = 1104 ' can be found in INI of your character
'---------------------------------------------------------------------------
Const _ALL = 0
Const _Health = 1
Const _STAMINA = 2
Const _MANA = 3
Const _TARGET = 4
Const _MONSTERCON = 5
'---------------------------------------------------------------------------
Dim LogText1, LogText2, LogText3, LogText4
Dim OrigMarker
Dim LogMarker1, LogMarker2, LogMarker3, LogMarker4
'---------------------------------------------------------------------------
Dim CannotSee, YouHit, YouFumble, ShotInterrupted, Fatigued, YouMiss, StopAim, NoArrows
Dim MonsDies, YouDied, HitsYou, Parry, Style1B, Style2B, MustHaveTarget
'---------------------------------------------------------------------------

Private Sub Sit() 'Procedure Sit
begin
sendkeys ("/sit<CR>")
Pause (150)
End Sub

Private Sub Stand() 'Procedure Stand
begin
SendKeys ("/stand<CR>")
Pause (150)
End Sub

Private Sub LogOut() 'Procedure LogOut
begin
SendKeys ("/release<CR>")
Pause (1000)
SendKeys ("/quit<CR>")
Pause (1000)
End Sub

'---------------------------------------------------------------------------
' WatchStatus procedure speeds up the reading from the correct area of the screen
' Give the status you will be looking For and a boolean to turn it on or off

Private Function WatchStatus(Status, Activate)
begin
If (Activate) Then begin
If ((Status = _Health) or (Status = _ALL)) Then AddScreenWatch(PlayerWinX+31,PlayerWinY+24,PlayerPixels,1)
If ((Status = _STAMINA) or (Status = _ALL)) Then AddScreenWatch(PlayerWinX+31,PlayerWinY+34,PlayerPixels,1)
If ((Status = _MANA) or (Status = _ALL)) Then AddScreenWatch(PlayerWinX+31,PlayerWinY+45,PlayerPixels,1)
If ((Status = _Target) or (Status = _ALL)) Then AddScreenWatch(PlayerWinX+31,PlayerWinY+90,TargetPixels,1)
End Else begin
If ((Status = _Health) or (Status = _ALL)) Then DeleteScreenWatch(PlayerWinX+31,PlayerWinY+24,PlayerPixels,1)
If ((Status = _STAMINA) or (Status = _ALL)) Then DeleteScreenWatch(PlayerWinX+31,PlayerWinY+34,PlayerPixels,1)
If ((Status = _MANA) or (Status = _ALL)) Then DeleteScreenWatch(PlayerWinX+31,PlayerWinY+45,PlayerPixels,1)
If ((Status = _Target) or (Status = _ALL)) Then DeleteScreenWatch(PlayerWinX+31,PlayerWinY+90,TargetPixels,1)
End
End Function

'---------------------------------------------------------------------------
' GetStatusPixel Function is used by GetStatus.
' It returns True If the X-th pixel of that status is filled.
' Examples:
' FullMana:=GetStatusPixel(_MANA,PlayerPixels-1)
' TargetAtHalf:=GetStatusPixel(_TARGET,TargetPixels/2)
' OutOfStamina:=GetStatusPixel(_STAMINA,0)

Private Function GetStatusPixel(Status, Pos)
Dim Red, Blue, Green
begin
If (Status = _Health) Then begin
GetPixelColor(PlayerWinX+31+Pos,PlayerWinY+24,Red,Green,Blue)
If ((Red/2)>Green) and ((Red/3)>Blue) and (Red > 100) Then Result = True Else Result = False
End
If (Status = _STAMINA) Then begin
GetPixelColor(PlayerWinX+31+Pos,PlayerWinY+34,Red,Green,Blue)
If ((Green*2)>(Red*5)) and ((Green*3)>(Blue*5)) Then Result = True Else Result = False
End
If (Status = _MANA) Then begin
GetPixelColor(PlayerWinX+31+Pos,PlayerWinY+45,Red,Green,Blue)
If ((Red*2)>(Blue*5)) and ((Green*2)>(Blue*5)) Then Result = True Else Result = False
End
If (Status = _Target) Then begin
GetPixelColor(PlayerWinX+31+Pos,PlayerWinY+90,Red,Green,Blue)
If ((Red/2)>Green) and ((Red/3)>Blue) and (Red > 100) Then Result = True Else Result = False
End
End Function

Private Function GetStatus(Status) ' Function GetStatus returns the Status you chose as a float between 0 and 1
Dim Border(1, 3)
Dim Bordertype(1, 3)
Dim Bool, CurHP, Step, Dir
begin
Border(1) = 0
If (Status = _Target) Then Border(3) = TargetPixels Else Border(3]) = PlayerPixels
Bordertype(1) = True
Bordertype(3) = False
CurHP = Border(3) -1
Dir = -1
repeat
Step = Trunc( ((Border(Dir + 2) - CurHP) / 2) + (Dir * 0.55) )
CurHP = (CurHP + Step)
Bool = GetStatusPixel(Status, CurHP)
If (Bool = True) Then Border(1) = CurHP Else Border(3) = CurHP
If (Bool = Bordertype(Dir + 2)) Then Dir = (Dir * -1)
Until (Border(1) = Border(3) -1)
If (Status = _Target) Then begin
Result = Border(1)
End Else begin
Result = Border(1)
End
End

'---------------------------------------------------------------------------

Private Function GetCon() ' This Function gets the monsters con
Dim Red, Green, Blue, GrayB, GreenB, BlueB, YellowB, OrangeB, RedB, PurpleB, PosX, PosY
Begin
PosX = 0
PosY = 0
repeat ' Set one
AddScreenWatch(PlayerWinX+7,PlayerWinY+73,5,5) ' Target name bar
repeat ' Set two
GetPixelColor(PlayerWinX+7+PosX,PlayerWinY+73+PosY,Red,Green,Blue)
If (Red = 168) and (Green = 168) and (Blue = 168) Then GrayB = True Else GrayB = False ' gray con, should never be Set to True
If (Red = 152) and (Green = 240) and (Blue = 128) Then GreenB = True Else GreenB = False ' Green con, Set to True For low xp
If (Red = 104) and (Green = 100) and (Blue = 255) Then BlueB = True Else BlueB = False ' Blue con, the most likely setting to True
If (Red > 200) and (Green > 200) and (Blue < 50) Then YellowB = True Else YellowB = False ' yellow con,hard For a bot to kill, but maybe
If (Red > 200) and (Green > 100) and (Green < 200) and (Blue<100) Then OrangeB = True Else OrangeB = False ' orange con, should never Set to True,
If (Red = 248) and (Green = 0) and (Blue = 0) Then RedB = True Else RedB = False ' Red con, should never Set to True
If (Red = 176) and (Green = 80) and (Blue = 255) Then PurpleB = True Else PurpleB = False ' purple con, should never be Set to True
If (GreenB = True) or (BlueB = True) or (YellowB = True) or (OrangeB = True) Then Result = True Else Result = False
PosX:=PosX+1
Until (PosX=6) or (Result=True) ' Set two
PosY = (PosY + 1)
PosX = 0
Until (PosY = 3) or (Result = True) ' Set one
DeleteScreenWatch(PlayerWinX+7,PlayerWinY+73,5,5) ' target name bar
End Function ' Proceedure GetCon
'---------------------------------------------------------------------------
Private Sub TargetMonster() ' This procedure targets a monster
Dim Bool
begin 'Procedure TargetMonster
Bool = False
Stand
Repeat
Pause (60000)
SendKeys ("<F8>")
pause (500)
Bool = GetCon
Until (Bool = True)
SendKeys ("/face<CR>")
pause (500)
End Sub 'Procedure TargetMonster
'---------------------------------------------------------------------------
Private Sub Ressurection() ' This procedure will accept a Ressurection
Dim RessurectionTries
Begin
RessurectionTries = 0
LogMarker1 = SetLogMarker
Repeat
SendKeys ("l")
Pause (250)
SendKeys ("l")
Pause (750) ' Resets the log
MouseMove(762, 543)
WaitForMouse ' Lets the mouse catch up to the move
MouseDown(0) ' Left click
MouseMove(762, 543)
WaitForMouse ' Lets the mouse catch up to the move
MouseUp(0) ' Left click
LogText1 = GetNewLogText(LogMarker1)
If (HasToken(LogText1, RessurectedSTR)) Then YouDied = False Else YouDied = True
RessurectionTries = RessurectionTries + 1
Until (YouDied = False) or (RessurectionTries = 300)
If (RessurectionTries = 300) Then LogOut
Pause (30000) ' Waits five minutes For the Ressurection effects to wear off
End Sub ' Proceedure Ressurection
'---------------------------------------------------------------------------
Private Sub FireBow() ' This procedure fires characters bow
Dim Bool1, Bool2, Shots
begin 'Procedure FireBow
Shots = 0
SendKeys ("l")
Pause (250)
SendKeys ("l")
Pause (75) ' Resets the log
Bool1 = False
Bool2 = False
CannotSee = False
YouHit = False
YouFumble = False
ShotInterrupted = False
Fatigued = False
YouMiss = False
StopAim = False
NoArrows = False
YouDied = False
MonsDies = False
SendKeys ("3")
pause (75) ' Selects melee weapon to ensure proper firing sequence
SendKeys ("1")
pause (75) ' Selects the bow
SendKeys ("2") ' Takes aim With the bow replace With a 2 For critshot
' this should keep firing the bow
Repeat
If (Bool1 = True) Then SendKeys ("l")
Pause (250)
If (Bool1 = True) Then SendKeys ("l")
Pause (250) ' Resets the log
SendKeys ("1")
pause (250) ' Fires when ready
SendKeys ("1")
pause (250) ' Sets the bow to auto reload
LogMarker1 = SetLogMarker
' This should keep checking the log to see whats happening
Repeat
LogText1 = GetNewLogText(LogMarker1)
If (HasToken(LogText1, CannotSeeSTR)) Then CannotSee = True Else CannotSee = False
If (HasToken(LogText1, YouHitSTR)) Then YouHit = True Else YouHit alse
If (HasToken(LogText1, YouFumbleSTR)) Then YouFumble = True Else YouFumble = False
If (HasToken(LogText1, ShotInterruptedSTR)) Then ShotInterrupted = True Else ShotInterrupted = False
If (HasToken(LogText1, FatiguedSTR))Then Fatigued = True Else Fatigued = False
If (HasToken(LogText1, YouMissSTR)) Then YouMiss = True Else YouMiss = False
If (HasToken(LogText1, StopAimSTR)) Then StopAim = True Else StopAim = False;
If (HasToken(LogText1, NoArrowsSTR)) Then NoArrows = True Else NoArrows = False
If (CannotSee = True) or (YouHit = True) or (YouFumble = True) or (ShotInterrupted = True) or (Fatigued = True) or
(YouMiss = True) or (StopAim = True) or (YouDied = True) or (MonsDies = True) or
(CannotSee = True) Then Bool1 = True Else Bool1 = False
If (NoArrows = True) Then LogOut
Until (Bool1 = True)
Shots = Shots + 1
If (CannotSee = True) Then TargetMonster
If (YouDied = True) Then Ressurection
If (YouDied = True) or (MonsDies = True) or (ShotInterrupted = True) or
(Fatigued = True) or (Shots = 2) Then Bool2 = True Else Bool2 = False
Until (Bool2 = True)
End Sub 'Procedure FireBow
'---------------------------------------------------------------------------
Private Sub BeginMelee () ' This procedure begins melee
begin ' Procedure BeginMelee
SendKeys ("/face<CR>")
Pause (150) ' Double checks that you are facing opponent
SendKeys ("3")
Pause (150) ' Selects melee weapon right hand
SendKeys ("4")
Pause (150) ' Selects the melee item weapon or shield left hand
SendKeys ("a")
Pause (150) ' Is keyboard default attack key
End Sub ' Procedure beginmelee
'---------------------------------------------------------------------------
Private Sub Style1() ' This procedure executes style one
begin Procedure style1
SendKeys ("5") ' Uses gem
End Sub ' Procedure Style1
'---------------------------------------------------------------------------
Private Sub Style2() ' This procedure executes style two
begin ' Procedure style2
SendKeys ("6") ' Uses gem
End Sub ' Procedure Style2
'---------------------------------------------------------------------------
Private Sub HealMeNow()
Begin
SendKeys ("8") ' Make sure to have a macro that sends a tell "heal me" to your partner
End Sub
'---------------------------------------------------------------------------

Private Function CheckForAdd()
Begin
LogMarker2 = SetLogMarker
SendKeys ("l")
Pause (250)
SendKeys ("l")
Pause (150) ' resets the log
Pause (5000)
LogText2 = GetNewLogText(LogMarker2)
If (HasToken(LogText2, MissesYouSTR)) or
(HasToken(LogText2, HitsYouSTR)) or
(HasToken(LogText2, Style2STR)) or
(HasToken(LogText2, Style1STR)) Then Result = True
End Function

'---------------------------------------------------------------------------

Private Sub DoMelee()
Dim Health, Target
Begin
YouHit = False
YouFumble = False
Fatigued = False
YouMiss = False
Parry = False
Style1B = False
Style2B = True
YouDied = False
MonsDies = False
MustHaveTarget = False
LogMarker2 = SetLogMarker ' This log marker does Not reset For entire fight.
LogMarker3 = SetLogMarker ' This log marker should reset For Each run through Until.
repeat
If (Style2B = True) Then SendKeys ("l")
Pause (250)
If (Style2B = True) Then SendKeys ("l")
Pause (925) ' resets the log
LogText3 = GetNewLogText(LogMarker3)
If (HasToken(LogText3, YouHitSTR)) Then YouHit = True Else YouHit = False
If (HasToken(LogText3, YouFumbleSTR)) Then YouFumble = True Else YouFumble = False
If (HasToken(LogText3, HitsYouSTR))Then HitsYou = True Else HitsYou = False
If (HasToken(LogText3, YouMissSTR)) Then YouMiss = True Else YouMiss = False;
If (HasToken(LogText3, ParrySTR )) Then Parry = True Else Parry = False
If (HasToken(LogText3, Style1STR)) Then Style1B = True Else Style1B = False
If (HasToken(LogText3, Style2STR)) Then Style2B = True Else Style2B = False
If (HasToken(LogText3, MustHaveTargetSTR)) Then MustHaveTarget = True Else MustHaveTarget = False
If (Style2B=True) Then Style2 Else Style1 ' will append later
Health = GetStatus(_Health)
Target = GetStatus(_Target)
If (Health < SafetyPixelsINT) and (Target > MonsterPixelsINT) Then HealMeNow
If (Health < HealNowPixelsINT) Then HealMeNow
LogText2 = GetNewLogText(LogMarker2)
If (HasToken(LogText2, YouDiedSTR)) Then YouDied = True Else YouDied = False
LogMarker3 = SetLogMarker
Until (HasToken(LogText2, MustHaveTargetSTR)) or (HasToken(LogText2, YouDiedSTR)) or
(HasToken(LogText2, MonsDiesSTR))
End Sub

'---------------------------------------------------------------------------

Private Sub Recover()
Dim FullStamina, FullHealth
Begin
Sit
repeat
If (YouDied = True) Then Ressurection
FullStamina = GetStatusPixel(_STAMINA,PlayerPixels-1)
FullHealth = GetStatusPixel(_Health,PlayerPixels-1)
If (FullHealth = False) Then HealMeNow
If (FullStamina = False) or (FullHealth = False) Then Pause (5000)
Until (FullStamina = True) and (FullHealth = True) and (YouDied=False)
Stand
End Sub

'---------------------------------------------------------------------------

While True Do begin

Stand
TargetMonster
FireBow
Repeat
BeginMelee
DoMelee
CheckForAdd
Until (CheckForAdd = False)
Recover
' Loot ' Not implemented yet

End


I'll update this post when i do major updates.


Reply with quote
Posted: March 14th, 2004, 6:26 pm
 
WyvernX
WyvernX's Reps:
User avatar
Wow, that is very good start.


Reply with quote
Want Advertisements After The Last Post Removed? Create A Free Account!

blue large dot Who is online
Users browsing this forum: No registered users and 25 guests

Popular Sections
SWTOR Cheats
Guild Wars 2 Cheats
Guild Wars 2 Hacks
Guild Wars 2 Bots
Diablo 3 Cheats
Guild Wars 2 Mods

Popular Sections
WoW Cataclysm Cheats & Exploits
WoW Cataclysm Hacks & Bots
Star Wars The Old Republic Cheats
SWTOR Mods
Torchlight 2 Cheats
SWTOR Space Mission Bots
Site Nav and RSS
RSS Feed of DAOC Discussion RSS Feed 
Sitemap of DAOC Discussion Sitemap 
SitemapIndex SitemapIndex
RSS Feed RSS Feed
Channel list Channel list
left bottom corner Site and Contents Copyright 2001-2012 All Rights Reserved TaultUnleashed.com bottom corner
top left
top right
createaccount
Username:   Password:   Remember Me?