• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

GlobalEvent Automagically clean unused houses, multi-world support!

ok ok ty but is normal to have houses that ar enot in map and they dont have town id??
 
It sure isn't normal, it could cause a lot more trouble so I'd either remove or fix them.
 
i cant i tried....i cant find those houses they dont have town id and neither are in map :(

look


Fixed :) ty for all rep ++
 
Last edited by a moderator:
wich one do you prefer.. the mod one.. or the one with globalevent?
 
Updated MOD to 1.03, I dropped support for non-mod so if you're using it you will have to update it yourself.

With this update there's new configurable, which allows you to choose whether to clean houses of all players, or only those who don't have any PACC days left.

The issue with missing house names has also been addressed.
 
i got this thing when i used it..:
Code:
[16:44:53.419] [Error - GlobalEvent Interface]
[16:44:53.435] domodlib('cleanhouses_conf')
[16:44:53.435]         local house = db.getResult(ns_query)
[16:44:53.435]         local logs = " :: Houses cleaned:\n\n"
[16:44:53.435]         if house:getID() ~= -1 then
[16:44:53.435]             repeat
[16:44:53.450]                 logs = logs .. getHouseInfo(house:getDataInt('id'
)).name ..", owned by " .. house:getDataString('name') .. "\n"
[16:44:53.450]                 setHouseOwner(house:getDataInt('id'), 0)
[16:44:53.450]             until not house:next()
[16:44:53.450]             house:free()
[16:44:53.450]         else
[16:44:53.466]             logs = logs .. "There were no houses to clean."
[16:44:53.466]         end
[16:44:53.466]         if config.log then
[16:44:53.466]             doWriteLogFile(config.file, logs)
[16:44:53.466]         end
[16:44:53.481]         addEvent(doSaveServer, 1000)
[16:44:53.481]
[16:44:53.481] Description:
[16:44:53.481] (luaGetHouseInfo) House not found

[16:44:53.497] [Error - GlobalEvent Interface]
[16:44:53.497] domodlib('cleanhouses_conf')
[16:44:53.497]         local house = db.getResult(ns_query)
[16:44:53.513]         local logs = " :: Houses cleaned:\n\n"
[16:44:53.513]         if house:getID() ~= -1 then
[16:44:53.513]             repeat
[16:44:53.513]                 logs = logs .. getHouseInfo(house:getDataInt('id'
)).name ..", owned by " .. house:getDataString('name') .. "\n"
[16:44:53.528]                 setHouseOwner(house:getDataInt('id'), 0)
[16:44:53.528]             until not house:next()
[16:44:53.528]             house:free()
[16:44:53.528]         else
[16:44:53.544]             logs = logs .. "There were no houses to clean."
[16:44:53.544]         end
[16:44:53.544]         if config.log then
[16:44:53.544]             doWriteLogFile(config.file, logs)
[16:44:53.544]         end
[16:44:53.560]         addEvent(doSaveServer, 1000)
[16:44:53.560]
[16:44:53.560] Description:
[16:44:53.560] [string "LuaInterface::loadBuffer"]:6: attempt to index a boolean
 value
 
Yea i was using the 1.2 version then:p then i test the 1.3
error on the new one!
Code:
[17:16:05.450] [Error - GlobalEvent Interface]
[17:16:05.450]
[17:16:05.450]
[17:16:05.450]         local config = {
[17:16:05.450]             days = 30,
[17:16:05.450]             log = true,
[17:16:05.450]             file = getDataDir() .. "/logs/cleanhouses.txt",
[17:16:05.450]                  onlyNonPremium = true
[17:16:05.450]         }
[17:16:05.450]
[17:16:05.450]
[17:16:05.450]
[17:16:05.450]         local ns_query =[[ SELECT houses.owner, houses.id, houses
.name as house_name ,players.name FROM houses
[17:16:05.450]             LEFT JOIN players ON players.id=houses.owner
[17:16:05.450]             LEFT JOIN accounts ON players.account_id=accounts.id
[17:16:05.466]             WHERE players.lastlogin < (UNIX_TIMESTAMP() - ]] ..co
nfig.days.. [[*24*60*60)
[17:16:05.466]             ]] ..(config.onlyNonPremium and ' AND accounts.premda
ys=0 ' or '')..[[
[17:16:05.466]             AND  players.world_id =]] .. getConfigValue("worldId"
)
[17:16:05.466]
[17:16:05.466]         local house = db.getResult(ns_query)
[17:16:05.466]         local logs = " :: Houses cleaned:\n\n"
[17:16:05.466]         if house:getID() ~= -1 then
[17:16:05.466]             repeat
[17:16:05.466]                 logs = logs .. house:getDataString('house_name')
..", owned by " .. house:getDataString('name') .. "\n"
[17:16:05.466]                 setHouseOwner(house:getDataInt('id'), 0)
[17:16:05.466]             until not house:next()
[17:16:05.466]             house:free()
[17:16:05.466]         else
[17:16:05.466]             logs = logs .. "There were no houses to clean."
[17:16:05.466]         end
[17:16:05.466]         if config.log then
[17:16:05.466]             doWriteLogFile(config.file, logs)
[17:16:05.481]         end
[17:16:05.481]         addEvent(doSaveServer, 1000)
[17:16:05.481]
[17:16:05.481]
[17:16:05.481] Description:
[17:16:05.481] (luaSetHouseOwner) House not found
 
Last edited:
Are you using 0.4?

I suppose this could be the script confusing player and house id, so I have edited my first post. Try copying the mod again and run it - if it doesn't help then I'm out of ideas :(
 
Dint work... same shit again!
what version did you test it for on 0.4?
 
Well different revisions, last one I'm using is 3670 but I doubt it matters. I'm really puzzled now, cause for me and some people it works as exected ;/
 
Can you post the errors? Otherwise I won't know what's wrong this time
 
Back
Top