if getuseroption("PlayerAlert") then
setsetting("Alerts/PlayerOnScreen/PlaySound", "yes")
end
fixhuntbps()
setlooting("yes")
settargeting("yes")
This is 1 of my persistent scripts named global.
this is the 2nd one named: setup fixer.function fixrefillbps()
local MainBP = getuseroption("MainBP")
setsetting("Looting/OpenNextBP", "no")
while windowcount(MainBP) ~= 1 or windowcount() ~= 1 do
closewindows() waitping()
openitem(MainBP, "back") waitping()
resizewindows(0, MainBP) waitping()
resizewindows()
end
end
function fixhuntbps()
local MainBP = getuseroption("MainBP")
local LootBP = getuseroption("LootBP")
local GoldBP = getuseroption("GoldBP")
setsetting("Looting/OpenNextBP", "no")
while windowcount(MainBP) ~= 1 or windowcount(LootBP) ~= 1 or windowcount(GoldBP) ~= 1
or windowcount() ~= 3 do
closewindows() waitping()
openitem(MainBP, "back") waitping()
resizewindows(0, MainBP) waitping()
openitem(LootBP, MainBP, true) waitping()
resizewindows(0, LootBP) waitping()
openitem(GoldBP, MainBP, true) waitping()
resizewindows(0, GoldBP) waitping()
resizewindows()
end
setsetting("Looting/OpenNextBP", "yes")
end
function logouterror(msg)
messagebox("Character: " .. $name .. "\nScript: EK Minotaurs Yalahar\n" .. msg)
beep()
flashclient()
logout()
setcavebot("no")
end
function sayhi()
if ischannel("NPCs") then
npcsay("hi") waitping()
else
say("hi") wait(2200, 2500)
end
end
function freeslots(c)
tmp = getcontainer(c)
return tmp.maxcount - tmp.itemcount
end
function _opentrade(n, sayhi)
if $tradeopen then
return true
end
if type(n) == 'boolean' then
sayhi = n
n = nil
end
n = n or math.random(3,5)
if sayhi then
if not ischannel('NPCs') then
local nhi = math.random(3,5)
local trieshi = 0
while (not ischannel('NPCs') or sayhi) and trieshi < nhi do
say('hi')
local waittime = $timems+2500
while $timems < waittime and not ischannel('NPCs') do wait(100) end
trieshi = trieshi+1
end
if not ischannel('NPCs') then
return false
end
else
npcsay('hi') waitping(2, 4)
end
end
local tries, tradesentence, npcinfo = 0, 'trade', getcreaturebyname('Rock In A Hard Place')
if ('Rock In A Hard Place' == $lastnpcmsg.sender or (npcinfo.id > 0 and npcinfo.isnpc and tilehasinfo(npcinfo.posx, npcinfo.posy, npcinfo.posz))) then
tradesentence = 'magic'
end
while not $tradeopen and tries < n do
npcsay(tradesentence)
local waittime = $timems+1400
while $timems < waittime do
wait(100)
if $tradeopen then
return true
end
end
tries = tries + 1
end
return false
end
function nosupplies()
return itemcount(getuseroption("ManaName")) <= getuseroption("ManaCheck")
or itemcount(getuseroption("HealthName")) <= getuseroption("HealthCheck")
or $cap <= getuseroption("CapCheck")
or $stamina <= getuseroption("StaminaCheck")
end
before start hunting my bot just close and open all BP's (loot, main, gold) the problem is, he keeps closing and opening all BPs and never start hunt,auto(2000)
setlootingdestination("mainbp", getuseroption("MainBP"))
setlootingdestination("lootbp", getuseroption("LootBP"))
setlootingdestination("goldbp", getuseroption("GoldBP"))
local supplybp = "mainbp"
setsetting("Looting/LootList/health potion/LootingDestination", "lootbp")
setsetting("Looting/LootList/strong health potion/LootingDestination", "lootbp")
setsetting("Looting/LootList/great health potion/LootingDestination", "lootbp")
setsetting("Looting/LootList/ultimate health potion/LootingDestination", "lootbp")
if getuseroption("HealthName") == "Health Potion" then
setsetting("Looting/LootList/health potion/LootingDestination", supplybp)
setsetting("PotionHealer/Rules/health/Spell", "Health Potion")
elseif getuseroption("HealthName") == "Strong Health Potion" then
setsetting("Looting/LootList/strong health potion/LootingDestination", supplybp)
setsetting("PotionHealer/Rules/health/Spell", "Strong Health Potion")
elseif getuseroption("HealthName") == "Great Health Potion" then
setsetting("Looting/LootList/great health potion/LootingDestination", supplybp)
setsetting("PotionHealer/Rules/health/Spell", "Great Health Potion")
else
setsetting("Looting/LootList/ultimate health potion/LootingDestination", supplybp)
setsetting("PotionHealer/Rules/health/Spell", "Ultimate Health Potion")
end
dab04b81a2.png
808b6795fc.jpg