okay i´ve got it. here is my Code
this is the advanced killingfunction
add this to the pawn.lua like this
Code: Select all
CPawn = class(function (self, ptr)
self.Address = ptr;
self.Name = "<UNKNOWN>";
self.Id = 0;
self.Type = PT_NONE;
self.Guild = "<UNKNOWN>";
self.Level = 1;
self.Level2 = 1;
self.HP = 1000;
self.MaxHP = 1000;
self.MP = 1000;
self.MaxMP = 1000;
self.MP2 = 1000;
self.MaxMP2 = 1000;
self.X = 0.0;
self.Y = 0.0;
self.Z = 0.0;
self.TargetPtr = 0;
self.Direction = 0.0;
self.Attackable = false;
self.Alive = true;
-- Directed more at player, but may be changed later.
self.Battling = false; -- The actual "in combat" flag.
self.Fighting = false; -- Internal use, does not depend on the client's battle flag
self.Casting = false;
self.Mana = 0;
self.MaxMana = 0;
self.Rage = 0;
self.MaxRage = 0;
self.Energy = 0;
self.MaxEnergy = 0;
self.Concentration = 0;
self.MaxConcentration = 0;
self.PotionLastUseTime = 0;
self.Returning = false; -- Whether following the return path, or regular waypoints
self.BotStartTime = os.time(); -- Records when the bot was started.
self.BotStartTime_nr = 0; -- Records when the bot was started, will not return at pause
self.Unstick_counter = 0; -- counts unstick tries, resets if waypoint reached
self.Success_waypoints = 0; -- count consecutively successfull reached waypoints
self.Cast_to_target = 0; -- count casts to our enemy target
self.LastAggroTimout = 0; -- remeber last time we wait in vain for an aggro mob
self.Sleeping = false; -- sleep mode with fight back if attacked
self.Sleeping_time = 0; -- counts the sleeping time
self.Fights = 0; -- counts the fights
self.Death_counter = 0; -- counts deaths / automatic reanimation
self.MP_counter = 0; -- counts use of mana potions
self.HP_counter = 0; -- counts use of HP potions
self.Current_waypoint_type = WPT_NORMAL; -- remember current waypoint type global
self.Last_ignore_target_ptr = 0; -- last target to ignore
self.Last_ignore_target_time = 0; -- last target to ignore
self.lastHitTime = 0; -- last time the HP of the target changed
self.ranged_pull = false; -- ranged pull phase active
self.free_field1 = nil; -- free field for user use
self.free_field2 = nil; -- free field for user use
self.free_field3 = nil; -- free field for user use
self.free_counter1 = 0; -- free counter for user use
self.free_counter2 = 0; -- free counter for user use
self.free_counter3 = 0; -- free counter for user use
self.free_flag1 = false; -- free flag for user use
self.free_flag2 = false; -- free flag for user use
self.free_flag3 = false; -- free flag for user use
------------------ New attach for specific Mobkilling --------------------------
--------------------------------------------------------------------------------
self.mobs = {};
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
if( self.Address ~= 0 and self.Address ~= nil ) then self:update(); end
end
);
and then add this to the end of the fightfunction of player.lua
Code: Select all
------------------ New attach for specific Mobkilling --------------------------
--------------------------------------------------------------------------------
local mobid = string.format("%s",target.Name);
if(self.mobs[mobid] == nil) then
self.mobs[mobid] = 0
end
self.mobs[mobid] = self.mobs[mobid] + 1
cprintf(cli.lightblue, "%s kills : %s\n",mobid,self.mobs[mobid]);
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
self.Fighting = false;
self:clearTarget();
and comment the clearTarget line under Self:loot();
add this to the end of the Player.lua
Code: Select all
function CPlayer:ScanForItem(itemid)
local item;
local anzahl;
local slot;
local gesamt = 0;
for i=0, 29 do
slot = i + 1
item = memoryReadInt(getProc(), Inv[i]);
if(item == itemid) then
anzahl = memoryReadInt(getProc(), Anzahl[i]);
gesamt = anzahl + gesamt
cprintf(cli.yellow,"Slot %s: %sx %s\n",slot,anzahl,item);
end
end
if(gesamt >=1) then
cprintf(cli.yellow,"Gesamt %s: %sx\n",itemid,gesamt);
return gesamt
else
return 0
end
end
add this to the adresses.lua
Code: Select all
Inv = {
[0] = 0x008EEB78,
[1] = 0x008EEB38,
[2] = 0x008EED58,
[3] = 0x008EEAB0,
[4] = 0x008EE7C0,
[5] = 0x008EEAF0,
[6] = 0x008EE5E4,
[7] = 0x008EE9E0,
[8] = 0x008EE5A0,
[9] = 0x008EE804,
[10] = 0x008EE848,
[11] = 0x008EE890,
[12] = 0x008EE8D0,
[13] = 0x008EE918,
[14] = 0x008EE958,
[15] = 0x008EE9A0,
[16] = 0x008EE628,
[17] = 0x008EEA28,
[18] = 0x008EEA68,
[19] = 0x008EE670,
[20] = 0x008EE6B0,
[21] = 0x008EE6F8,
[22] = 0x008EE738,
[23] = 0x008EEBC0,
[24] = 0x008EEC00,
[25] = 0x008EEC48,
[26] = 0x008EEC88,
[27] = 0x008EECD0,
[28] = 0x008EED10,
[29] = 0x008EE780,
};
Anzahl = {
[0] = 0x008EEB88,
[1] = 0x008EEB44,
[2] = 0x008EED64,
[3] = 0x008EEABC,
[4] = 0x008EE5F4,
[5] = 0x008EEB00,
[6] = 0x008EE5F4,
[7] = 0x008EE9F0,
[8] = 0x008EE5B0,
[9] = 0x008EE814,
[10] = 0x008EE858,
[11] = 0x008EE89C,
[12] = 0x008EE8E0,
[13] = 0x008EE924,
[14] = 0x008EE968,
[15] = 0x008EE9AC,
[16] = 0x008EE638,
[17] = 0x008EEA34,
[18] = 0x008EEA78,
[19] = 0x008EE67C,
[20] = 0x008EE6C0,
[21] = 0x008EE704,
[22] = 0x008EE748,
[23] = 0x008EEBCC,
[24] = 0x008EEC10,
[25] = 0x008EEC54,
[26] = 0x008EEC98,
[27] = 0x008EECDC,
[28] = 0x008EED20,
[29] = 0x008EE78C,
};
you will not die if you thank me for that.