I thought I would share the compilation of user functions that I'm building. Most of these are to make coding faster and easier, and some are quite helpful for code readability. Put this file into /userfunctions/ folder.
New/modified functions in bold.
v1.1 changes:
Rewrite function sort_daily_log(folder) to sort_log(folder,_breakafterlines)
Just to let you know, you shouldn't call GetIdName outside of a function because it runs at load time. This causes an error if the addresses need updating because the userfunctions are loaded before the addresses check happens.
function kill_stupid_newbie_pet()
local function evalfunc(address)
local obj = CPawn.new(address)
obj:updateIsPet()
return obj.IsPet == player.Address
end
if player:findNearestNameOrId(113199,nil,evalfunc ) then -- search vicinity for your Newbie Pet
local newbEgg = inventory:findItem(207051); -- Newbie Pet Egg
if newbEgg then
newbEgg:use()
newbEgg:delete()
end
end
end
It checks if the newbie pet is your pet before recalling and tidys up the code that uses and deletes the egg.
Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
sorry that did not seem to work either. it will get rid of pet 1 on 1 char but any relogs it does not seem to it only deletes the egg after first.
---------------------------------
Rock I tried your newbie pet code and it would not get rid of the pet if char started moving and interrupt it.
-- function kill_stupid_newbie_pet()
local function evalfunc(address)
local obj = CPawn.new(address)
obj:updateIsPet()
return obj.IsPet == player.Address
end
if player:findNearestNameOrId(113199,nil,evalfunc ) then -- search vicinity for your Newbie Pet
local newbEgg = inventory:findItem(207051); -- Newbie Pet Egg
if newbEgg then
newbEgg:use()
yrest(500); -- I added this to prevent interrupting pet recall
newbEgg:delete()
end
end
beanybabe wrote:sorry that did not seem to work either. it will get rid of pet 1 on 1 char but any relogs it does not seem to it only deletes the egg after first.
I always put these lines at the top of all my wp's onload section.
And then followed by gm detect if the area is risky. Haven't botted in years so I vaguely remember the commands, it's probably loadprofile() will small letter p.
I know some functions already do the updates for you but I think it's still best to update at the very start of the script. So try that if you haven't already. Good luck.
It's possible the problem is with how long it takes for the pet to appear. If it hasn't appeared yet when that code runes then it won't see the pet but will still drop the egg. Maybe a yrest would help.
Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
function kill_stupid_newbie_pet()
yrest(4500) -- wait for pet to appear
local function evalfunc(address)
local obj = CPawn.new(address)
obj:updateIsPet()
return obj.IsPet == player.Address
end
if player:findNearestNameOrId(113199,nil,evalfunc ) then -- search vicinity for your Newbie Pet
local newbEgg = inventory:findItem(207051); -- Newbie Pet Egg
if newbEgg then
newbEgg:use()
newbEgg:delete()
end
end
end