local whitelist = {
"FriendName1",
"FriendName2",
"FriendName3",
}
local function isInWhitelist(playerName)
local selfName = getSelfName()
for _, name in ipairs(whitelist) do
if playerName == name then
return true
end
if selfName ~= nil and playerName == selfName then
return true
end
end
return false
end
local function checkForPlayers()
local players = getScreenPlayers()
for _, player in ipairs(players) do
local playerName = getCreatureName(player)
if playerName and not isInWhitelist(playerName) then
playSound("playerOnScreen.wav")
break
end
end
end
autoRun(1000, checkForPlayers)
local function f()
if #getScreenPlayers() > 1 then
xlog()
sleep(1000)
end
end
autoRun(100, f)
local function logoutMultifloor()
local selfName = getSelfName()
if selfName == nil then
return
end
for i, creature in ipairs(getCreaturesMultiFloor()) do
if isPlayer(creature) and getCreatureName(creature) ~= selfName then
xlog()
sleep(500)
return
end
end
end
autoRun(100, logoutMultifloor)
local ITEMS_TO_DROP = {
3264, -- sword
3286, -- mace
}
local function f()
for _, itemId in ipairs(ITEMS_TO_DROP) do
dropItem(itemId, 1)
end
end
autoRun(300, f)
local function f()
if getItemCount(3277) > 1 then
equipItem(RIGHT_HAND_SLOT, 3277, 5)
sleep(math.random(200,300))
end
collectNearbyGroundItem(2854, 3277)
sleep(math.random(300, 500))
end
autoRun(100, f)
local AMMO_ID = 7368
local function f()
equipItem(AMMO_SLOT, AMMO_ID , 100)
sleep(math.random(100000, 200000))
end
autoRun(1, f)
local E_RING_ID = 3051
local EQUIPED_E_RING_ID = 3088
local UNEQUIP_HPPC = 80
local EQUIP_HPPC = 40
local function f()
local equippedRingId = getInventoryItemId(RING_SLOT)
local hppc = getPlayerHppc()
if equippedRingId == EQUIPED_E_RING_ID and hppc >= UNEQUIP_HPPC then
equipItem(RING_SLOT, RING_ID_TO_EQUIP_WHEN_E_RING_NOT_NEEDED , 1)
return
end
if hppc <= EQUIP_HPPC and equipedRingId ~= EQUIPED_E_RING_ID then
equipItem(RING_SLOT, E_RING_ID, 1)
end
end
autoRun(100, f)
local followedPlayer = "Pan Tadeusz"
local function f()
local followed = getCreatureByName(followedPlayer)
mapClickChase(followed)
end
autoRun(20, f)
local LOOT_BACKPACK_ID = 2853
local LOOT_BAG_CAPACITY = 8
local ITEMS_TO_PUSH = {
3264, -- sword
3286, -- mace
}
local function collectFromGround()
for i, v in ipairs(ITEMS_TO_PUSH) do
collectNearbyGroundItem(LOOT_BACKPACK_ID, v)
sleep(300)
end
end
local function openNextBackpack()
for index, container in ipairs(getOpenContainers()) do
if getId(getContainerItem(container)) == LOOT_BACKPACK_ID then
local items = getItems(container)
if #items >= LOOT_BAG_CAPACITY then
for index, item in ipairs(items) do
if getId(item) == LOOT_BACKPACK_ID then
open(item, container)
sleep(500)
return
end
end
end
end
end
end
autoRun(500, openNextBackpack)
autoRun(500, collectFromGround)