PDA

View Full Version : Request: X log when..



04-25-2016, 12:16 PM
Hello,

I just started botting 2 weeks ago and have recently started getting killed by people who just trap my character in a small area and waste my supplies. Then when im out of supplies they drop a few fire bombs behind them and wait for their White skull to dissapear. After it's gone they let my character out and I eventually die by fire (I know I could turn off Walking on fields but then I can't bot spawns with monsters that shoot/drop different types of fields.

So my request is:

1. X log when low on supplies

2. X log when you take fire, poison or energy damage(cuz they usually fire, energy and poison bomb me at the start according to the screenshots. Preferably with the option to turn off a specific elemental dmg if you hunt where the monsters do that type of dmg.

Example:
X log if you take fire dmg (true/false)
X log if you take energy dmg (true/false)
X log if you take poison dmg (true/false)

I would also like to request a third .lua script and that is to make sure I don't get red skulled by noob chars while botting.

3. X log when the text "The murder of blabla bla was not justified" appears

Thanks!

04-25-2016, 12:27 PM
Also open for other tips that might avoid this scenario from happening.

Thanks :)

eldera
04-26-2016, 03:59 PM
I was kinda bored. This script will close client if you frag someone, logout when you lose pz with low supplies (when someone wastes you and then let you die from fire bombs etc). Let me ok if it works because I haven't really tested it.

local xLogOnFrag = true;
local supplies = {
{id = 268, min = 10},
{name = "Ultimate health potion", min = 10}
};

--[[ DO NOT EDIT ANYTHING BELOW THIS LINE ]]--
for i, item in pairs(supplies) do
if (item.name ~= nil) then
item.name = item.name:lower()
end
end

local suppliesNameList = {};

for i, item in pairs(supplies) do
local arg = item.name or item.id
local itemName = Item.GetItemNameFromDualInput(arg)
if (itemName == "<invalid>") then
return error("Couldn't resolve " .. item.name .. "id.");
else
table.insert(suppliesNameList, itemName)
end
end

local cachedItems = {};
local everOpenedContainers = false;
Self.GetItemCount = function(item)
local itemId = Item.GetItemIDFromDualInput(item);
local cachedItemCount = cachedItems[itemId];
if (cachedItemCount) then
return cachedItemCount;
end

if (not everOpenedContainers and #Container.GetAll() == 0) then
return -1;
end

return Self.ItemCount(itemId);
end

function setTimeout(...)
local done = false;
Module.New("aa", function(mod)
if (done) then
arg[1]();
mod:Stop();
else
done = true;
mod:Delay(arg[2]);
end
end)
end

local containerProxy = ContainerOpenProxy.New();

local timedout = false;
containerProxy:OnReceive(function (proxy, index, title, id)
setTimeout(function()
everOpenedContainers = true;
end, 10000);
local cont = Container.New(index);
for i, item in Container:iItems() do
cachedItems[item.id] = Self.ItemCount(item.id);
end
end)

function isSuperLowOnSupplies()
for i, item in pairs(supplies) do
if (item.min == nil) then
return error("Use:\n {name = 'Mana Potion', min = '10'},\n {id = '266', min = '10'}\nformat in supplies.")
end
local arg = item.name or item.id;
local itemCount = Self.GetItemCount(arg);
if (itemCount == -1) then
print("Never opened bp's and never used any potion - assuming character got supplies.");
return false;
elseif (itemCount < item.min) then
return true;
end
end
return false;
end

Module.New("logout", function(mod)
if (Walker.IsStuck() and not Self.isInFight()) then
print("EXITING!");
Self.Logout();
elseif (isSuperLowOnSupplies()) then
print("EXITING!")
Self.Logout();
end
end)

if (xLogOnFrag) then
GenericTextMessageProxy.OnReceive("", function(proxy, text)
if (string.find(text, "The murder of ")) then
print("ANTY RS - EXITING!");
os.exit();
end
end)
end

GenericTextMessageProxy.OnReceive("", function(proxy, text)
for i, itemName in pairs(suppliesNameList) do
if (string.find(text, itemName)) then
local id = Item.GetItemIDFromDualInput(itemName);
local count = string.match(text, '%d+');
cachedItems[id] = tonumber(count);
end
end
end)

timmy1210
05-17-2020, 09:53 AM
this does not seem to work, any ideas?

19:47 XenoScript Error:
Script: xlogfrag.lua
Line #: 5637
Chunk: C:\PROGRA~2\XenoBot\Versions\..?Data?XB0025?1.LUA
Error: table index is nil
This is an error with user-input and should not be reported as a bug with XenoBot.