
confirmen plz, die description kommt später
Code:
//Level2 0.3
//alpha beta gaga release
SETActiveWindow Lineage II
delay 6 sec
//code borrowed from tivia is the hp/mp check for your char, thanks mang
//RESOLUTION: 1024x768
//PUT ALL FILES IN YOUR ACTOOL\MACROS FOLDER.
//[OLD] Personal Notes:
//1: If you haven't attacked the mob yet, and you're being aggro'd,
// * you'll have a monster attacking you and their name will have red
// *balls in the target title. You could wait and check that before you
// *attack the passive mob. (assuming you only target passive mobs)
//2: Could use the near target hotkey to see how many mobs are attacking
// *you at once. Cycle through and keep a count by checking discrepancies
// * in their health bars. --run away using the arrow keys?
//3: Load potential targets from a text file?
//4: Find out precisely the amount of HP by scanning down the hp meter till
// * you get to the depleted red color (or blue)
//5: Start using soulshots if monster health is lower than yours but you're starting to hurt
//6: Could determine how fast you are killing him by storing damage/hit over x amount
// *of exchanges...see if you need to use soulshots
//NEW
//Add monsters to the Targets.txt in the Objects Folder
Constructs
*Targets * *= File //targets file construct
*TargetsList = List //list to store the targets in
End
Constants
*//EDITABLE FLAGS 1 = ON; 0 = OFF
*//If $PlaySafe is set to 1, you will rest when you're at or around HalfHP
*PlaySafe * = 0
//EDIT THESE FLAGS
//1 if you want to use them, 0 if you don't (or dont have them)
*//TOOLBAR FLAGS//
*WeaponSkill = 1
*Spoil * *= 1
*Heal * * = 0
*Potion * *= 0
*UseSpiritSoulShot = 0 //default key is F9
*
*
*
*Count * *= 1 //used to traverse the targetList index
*Total * *= 1 //used to find the ListCount
*TempTarget = NoValue //holds the value for target before placing into list
*
*ExecWindStrike * *= {F1}
*ExecAttack * * * = {F2}
*ExecPickup * * * *= {F3}
*ExecTarget * * *= {F4}
*ExecSpoil * * *= {F5}
*ExecSweep * * * = {F6}
*ExecHeal * * * = {F7}
*ExecPotion * * *= {F8}
*ExecSoulSpiritShot = {F9}
*
*///LOCATIONS//
*MobHP * *= 435, 19
*MobHPFull = 562, 19
*
*SafeHP * * = 100, 25 //if red at or above this mark, you're fine
*HalfHP * *= 73, 25 *//half hp if lower than this mark
*LowHP * * = 44, 25 *//low hp if at or lower than this mark
*DeadHP * * = 14, 25 *//you're dead :(
*
*//numbers in between
*//object maps would work better for this detection methinks...
*SafeHalfHP = 87, 25 //between safe and half hp
*
*
*SafeMP * * = 100, 38 //replace hp with mp for the rest of these to understand
*HalfMP * * = 73, 38
*LowMP * * *= 44, 38
*NoMP * * = 14, 38
*ObjVar * * = 5
*
*//COLORS//
*DeadRed * *= 102
*AliveRed * = 207
* *
*//HEALTH FLAGS//
*Health * *= "NoValue"
*
*//COMBAT FLAGS//
*Attacking = 0 //test if you're currently engaged in combat
*StopSpoil = 1 //should we spoil this guy or not
*Spoiled * = 0 //see if target is already spoiled
*Moving * *= 0 //once you start moving, this is set to true
*
*//MISC
*Diff * * * *= 0 // didn't feel like typing out difference
*Difference *= 0 //used to find the variance of red
*StartDelay *= 10 //macro start delay
*MovingTimer = 0 //a timer for...moving?
*SitTimer * = 0 //a timer for...sitting?
*Returned * *= 0
*
End //of constants
Call ReadTargets //bottom of macro
////MAIN LOOP
While 1=1
*Processmessages
*Call FindTarget
End
///END MAIN LOOP
/////////////////////////////////////////////////
/////////////////////////////////////////////////
Procedure FindTarget
*
*Keys {BACK} //make sure it deletes any channel crap crap (+, #, etc)
*keys /stand {RETURN}
*
*Set STOPSPOIL = 0 //reset stop spoil if it somehow didn't get reset already
*
*//Check our HP and see if we need to rest
*Call HealthCheck
*
*While $Attacking = 0
* *Timestamp Debug: Start of FindTarget
* *Call SitDown
* *Keys {BACK} //make sure it deletes any channel crap crap (+, #, etc)
* *Set TempTarget = TargetsList[$Count] //quick hack to get it working with brackets
* *
* *Keys /target [$TempTarget] {RETURN}//target a monster from the list
* *
* *Delay 200
* *//target anything close first
* *Call Aggro
* *//Call the CheckMonsterHP procedure to see if we have a target
* *Call CheckMonsterHP
* *
* *If $Count >= $Total
* * *Set COUNT = 1 //reset count if we've targeted all the monsters
* *Else
* * *Inc $Count //go to the next monster
* *End
* *
* *Timestamp Debug: End of FindTarget...
*End //End $Attacking While
*
*//Call Kill because we're attacking now
*Call MoveToTarget
*
End
/////////////////////////////////////////////////
/////////////////////////////////////////////////
Procedure MoveToTarget
*
*//we've set off to kill a monster
*Set MOVING = 1
*While $Moving = 1
* *Keydown $ExecWindStrike
* *
RightClick //necessary for the about-face for "RunningLikeHell"
* *Inc $MovingTimer
* *
* *//CFB will tell us if we've struck it yet, and will set moving to 0 if we have
* *Call CheckFirstBlow
*
* *//if we've been moving for 10 seconds or more, drop the target,
* *//and then unstick + find a new target
* *if $MovingTimer >= 10 AND $Moving = 1
* * *TimeStamp Debug: Time's up, unsticking...
* * *//Reset moving flags and timer, and then unstick us + find a new target
* * *Set MOVING * * *= 0
* * *Set MOVINGTIMER = 0
* * *Set ATTACKING * = 0
* * *call RandomMove
* * *call FindTarget
* *end
* *
* *//if time's up but we've finally hit it, start attacking
* *if $MovingTimer >= 10 AND $Moving = 0
* * *Call KillFirst
* *end
*End
*Call KillFirst //we've got a target so call kill
End
/////////////////////////////////////////////////
/////////////////////////////////////////////////
Procedure RunLikeHell
* *keydown {TAB} * * //Tab is neccessary to get out of chat window.
* *Keydown {DOWN} 4 sec *//Run like hell.
* *Keydown {TAB} * * //Closes inventory menu again.
*Call KillSecond * *//Finish the npc off.
End
/////////////////////////////////////////////////
/////////////////////////////////////////////////
Procedure KillFirst
*
*(*
*If $Spoil = 1 and $Spoiled = 0 and $StopSpoil = 0
*Keydown $ExecSpoil 500
*Set SPOILED = 1 //monster has been spoiled
*End
**)
*
*While $Attacking = 1
* *Keydown $ExecWindStrike 150
* *Delay *sec
* *Call RunLikeHell
End
End
/////////////////////////////////////////////////
/////////////////////////////////////////////////
Procedure KillSecond
While $Attacking = 1
* *Keydown $ExecWindStrike 150
* *delay 1500
* *Call CheckMonsterHP
* *Timestamp END OF ATTACKING
*End
*//Hooray! Monster is dead, now for the spoils
*
*delay 100
*Call Aggro //check yourself before you loot
*delay 100
*
*If $Attacking = 0
* *Call Loot
* *delay 2 sec
* *Call Loot
* *Call Loot
*Else
* *Call KillSecond
*End
*
*Call HealthCheck // see if you're good to go again
*
End
/////////////////////////////////////////////////
/////////////////////////////////////////////////
Procedure Loot
*Keydown $ExecPickup 10
*delay 20
*Keydown $ExecPickup 10
*delay 20
*Keydown $ExecPickup 10
*delay 20
*Keydown $ExecPickup 10
*delay 20
*Keydown $ExecPickup 10
*delay 20
*Keydown $ExecPickup 100
*
*If $Spoiled = 1
* *Keydown $ExecSweep //sweep the monster
* *Set SPOILED = 0 //reset spoiled flag
* *Set STOPSPOIL = 0 //reset stopspoil flag
*End
End
/////////////////////////////////////////////////
/////////////////////////////////////////////////
/////////////////////////////////////////////////
/////////////////////////////////////////////////
Procedure RandomMove
*TimeStamp RANDOMMOVE()
*keys {ESC}
*compute $returned = Random(X) * 5
*Keydown {RIGHT} $returned sec *
*compute $returned = Random(X) * 5
*keydown {DOWN} $returned sec
END
/////////////////////////////////////////////////
/////////////////////////////////////////////////
/////////////////////////////////////////////////
/////////////////////////////////////////////////
Procedure SitDown
*Call Aggro
*Timestamp Health is $Health
*//if our HP isn't at a safe level and we're not attacking, then rest
*If $Health <> "safe" and $Attacking = 0
* *//see how long we need to sit
* *
* *//if health is at Danger, then we sit for 1 minute
* *if $Health = "danger"
* * *keydown /sit {RETURN}
* * *//while the timer is still ticking and we're not being aggro'd, rest
* * *while $SitTimer < 60
* * * *Call Aggro
* * * *if $Attacking = 1
* * * * *Call KillFirst
* * * * *break
* * * *end
* * * *delay 1 sec
* * * *Inc $SitTimer
* * *end //END DANGER WHILE
* *else
* * *if $Health = "critical"
* * * *KeyDown /sit {RETURN}
* * * *//while timer is still ticking and we're not being aggro'd, rest
* * * *while $SitTimer < 180
* * * * *Call Aggro
* * * * *if $Attacking = 1
* * * * * *Call KillFirst
* * * * * *break
* * * * *end
* * * * *delay 1 sec
* * * * *Inc $SitTimer
* * * *end//END CRITICAL WHILE
* * *End//END CRITICAL IF
* *Else
* * *if $Health = "safe"
* * * *Timestamp Debug: Health is safe, no need to sit.
* * *end
* *Else
* * *Timestamp Debug: Unknown Health status
* *End//END PARENT IF
* *keys /stand {RETURN}
* *Call HealthCheck //see if we're good to go
*End
End
/////////////////////////////////////////////////
/////////////////////////////////////////////////
/////////////////////////////////////////////////
/////////////////////////////////////////////////
Procedure HealthCheck
*
*//returns your health status FIRST, then does work depending on health
*
*//first we load RGB values for SafeHP
*LoadRGB $SafeHP
*
*//then we see if we can set $Health to safe by testing if we have an alive red color
*compute $Difference = Abs ( $AliveRed - {RGBRED} )
*
*//if difference between the two is minimal (less than 40)...then we set $Health to 'safe'
*if $Difference < 40
* *TimeStamp Health is at a safe level
* *Set $HEALTH = "safe"
* *//if we didn't have an alivered at a safe [hp] level, then we load at the $halfhp mark
*else
* *LoadRGB $HalfHP
* *
* *//do math on the color
* *compute $Difference = Abs ( $AliveRed - {RGBRED} )
* *
* *//if we get a positive, then health is at least half hp
* *if $Difference < 40
* * *//now we move to the right a few pixles and see just how safe we are...
* * *LoadRGB $SafeHalfHP
* * *
* * *compute $Difference = Abs ( $AliveRed - {RGBRED} )
* * *//if we get a positive here, then that means we're pretty much ok, and we can keep going
* * *if $Difference < 40
* * * *Set $Health = "safe"
* * *else
* * * *//if not, then we're at half hp (or close enough)
* * * *Set $Health = "danger"
* * *end * * *
* *end
*end
*
*if $Health <> "safe"
* if $Attacking = 0
* *//if we're not attacking, we call the sitdown procedure
* *Call SitDown
* else
* *//else we are attacking and we either need to use a potion or run away
* *if $Heal = 1
* * keys {ESC}
* * delay 10
* * Keydown $ExecHeal
* * delay 10
* * Keydown $ExecTarget * *
* *Else
* * if $Potion = 1
* * *Keydown $ExecPotion
* * end
* *end
* end
*end
End
/////////////////////////////////////////////////
/////////////////////////////////////////////////
/////////////////////////////////////////////////
/////////////////////////////////////////////////
Procedure CheckMonsterHP
*//Load the current RGB values at $MobHP
*LoadRGB $MobHP
*
*//find the difference between desired red and actual red
*Compute $Difference = ABS ( $AliveRed - {RGBRed} )
*
*//if the difference is acceptable, it's still alive
*if $Difference < 40
* *Set Attacking = 1
* *Timestamp Debug: We're still fighting...
* *//else it's dead
*else
* *Set Attacking = 0
* *Timestamp Debug: MOB has been vanquished.
*end
*
End
/////////////////////////////////////////////////
/////////////////////////////////////////////////
/////////////////////////////////////////////////
/////////////////////////////////////////////////
Procedure CheckFirstBlow
*//check to see if we've attacked the monster yet
*LoadRGB $MobHPFull
*
*Compute $Difference = ABS ( $AliveRed - {RGBRed} )
*
*if $Difference < 40
* *TimeStamp Debug: Still moving to target... $MovingTimer
*else
* *Set MOVING = 0
* *Set MOVINGTIMER = 0
*end
*
End
/////////////////////////////////////////////////
/////////////////////////////////////////////////
/////////////////////////////////////////////////
/////////////////////////////////////////////////
Procedure Aggro every 5 sec
*Timestamp ()
*Keydown $ExecTarget 100
*Call CheckMonsterHP
*
*//if we got aggrod, dont waste time by spoiling
*If $Attacking = 1 and $Spoil = 1
* *Set STOPSPOIL = 1
*End
*//hit escape and call nearest target?
End
/////////////////////////////////////////////////
/////////////////////////////////////////////////
/////////////////////////////////////////////////
/////////////////////////////////////////////////
Procedure ReadTargets
*//READ TARGETS INTO THE LIST
*FileOpen Targets, Objects\Targets.txt
*FileReset Targets
*
*While 1=1
* *FileRead Targets, TempTarget
* *If $TempTarget <> " " //make sure we have a value
* * *ListAdd TargetsList, $TempTarget //add the read item into the list
* *End
* *If {EOF} = True
* * *Break
* *End
*End
*
*FileClose Targets //close targets file
*ListCount TargetsList, Total
*//END READING TARGETS
End
/////////////////////////////////////////////////
/////////////////////////////////////////////////
/////////////////////////////////////////////////
//SOUL SHOT USAGE
//Make sure your Soulshot or Spirit shot is
//on the F9 hot key
/////////////////////////////////////////////////
Procedure UseSS
*
*If $UseSpiritSoulShot = 1
* *Keydown $ExecSoulSpiritShot 2
*End
*
End
/////////////////////////////////////////////////
/////////////////////////////////////////////////






