• 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!

Anti Idle Bug. Advices Appreciated

Danny_

Evora Project Dev
Joined
Mar 19, 2008
Messages
283
Reaction score
4
Location
Bermuda Triangle
Hello. I'm having issues with the AFK training bug at my server. The bug itself doesn't really involve the training part but the training part is being exploited by the Anti-Idle system.

Even though my config.lua have these both:
idleWarningTime = 10 * 60 * 60
idleKickTime = 15 * 60 * 60

Players aren't getting kicked for some reason? They can just logg on and be logged on for as long as they want.

Any solutions to this?
 
hoho
i've got this problem some times ago
the problem is in your playerFlags

you should use this groups.xml

XML:
<?xml version="1.0" encoding="UTF-8"?>
<groups>
	<group id="1" name="Player"/>
	<group id="2" name="Tutor" flags="16809984" customFlags="2" access="1" violationReasons="4" nameViolationFlags="2"/>
	<group id="3" name="Senior Tutor" flags="68736352256" customFlags="14" access="2" violationReasons="10" nameViolationFlags="2" statementViolationFlags="63" maxVips="200"/>
	<group id="4" name="Gamemaster" flags="34448854875999" customFlags="257215" access="3" violationReasons="19" nameViolationFlags="10" statementViolationFlags="69" depotLimit="3000" maxVips="300" outfit="75"/>
	<group id="5" name="Community Manager" flags="34629247434751" customFlags="781823" access="4" violationReasons="23" nameViolationFlags="170" statementViolationFlags="213" depotLimit="4000" maxVips="400" outfit="266"/>
	<group id="6" name="God" flags="57172457136122" customFlags="12582911" access="5" violationReasons="23" nameViolationFlags="170" statementViolationFlags="213" depotLimit="5000" maxVips="500" outfit="302"/>
	</groups>
 
My idle.lua contains:


XML:
local config = {
	idleWarning = getConfigValue('idleWarningTime'),
	idleKick = getConfigValue('idleKickTime')
}

function onThink(cid, interval)
	if(getTileInfo(getCreaturePosition(cid)).nologout or getCreatureNoMove(cid) or
		getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_ALLOWIDLE)) then
		return true
	end

	local idleTime = getPlayerIdleTime(cid) + interval
	doPlayerSetIdleTime(cid, idleTime)
	if(config.idleKick > 0 and idleTime > config.idleKick) then
		doRemoveCreature(cid)
	elseif(config.idleWarning > 0 and idleTime == config.idleWarning) then
		local message = "You have been idle for " .. math.ceil(config.idleWarning / 60000) .. " minutes"
		if(config.idleKick > 0) then
			message = message .. ", you will be disconnected in "
			local diff = math.ceil((config.idleWarning - config.idleKick) / 60000)
			if(diff > 1) then
				message = message .. diff .. " minutes"
			else
				message = message .. "one minute"
			end

			message = message .. " if you are still idle"
		end

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, message .. ".")
	end

	return true
end


-- If it's right, how to activate it?
 
Last edited:
Creaturescripts.xml

XML:
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
	<event type="login" name="PlayerLogin" event="script" value="login.lua"/>

	<event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/>
	<event type="receivemail" name="Mail" event="script" value="mail.lua"/>
	<event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>
	<event type="advance" name="AdvanceSave" event="script" value="advancesave.lua"/>
	<event type="kill" name="KillingInTheNameOf" event="script" value="killinginthenameof.lua"/>
	<event type="kill" name="kill" event="script" value="onkill.lua"/>
	<event type="advance" name="advanced" script="advanced.lua"/>
	<event type="login" name="MountLogin" event="script" value="moistgiraffe_mount_cs.lua"/>
	<event type="combat" name="MountCombat" event="script" value="moistgiraffe_mount_cs.lua"/>
	<event type="areacombat" name="MountAreaCombat" event="script" value="moistgiraffe_mount_cs.lua"/>
	<event type="think" name="PetLogic" event="script" value="moist_pet_logic.lua"/>
	<event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/>
	<event type="login" name="ARLS-LOGIN" event="script" value="deviance_randomlootstats.lua"/>
	<event type="kill" name="ARLS-KILL" event="script" value="deviance_randomlootstats.lua"/>
	<event type="kill" name="Questkiller" event="script" value="npcQuestKill.lua"/>
	<event type="think" name="vip_think" event="script" value="vip.lua"/>
	<event type="login" name="vip_login" event="script" value="vip.lua"/>
	<event type="kill" name="scripty" event="script" value="scripty.lua"/>
	<event type="login" name="_advanced" event="script" value="advanced.lua"/>
	<event type="advance" name="advanced" event="script" value="advanced.lua"/>
	<event type="preparedeath" name="killdeath" event="script" value="killdeath.lua"/>
	<event type="kill" name="arena" event="script" value="killdeath.lua"/>
	<event type="login" name="SlotLogin" script="slot.lua"/>
	<event type="combat" name="nohurt" script="nohurt.lua"/>
	<event type="kill" name="KillingInTheNameOf" event="script" value="killinginthenameof.lua"/>
	<event type="combat" name="pvp" event="script" value="pvp.lua"/>
	<event type="login" name="ExtraStatsLogin" event="script" value="extra_stats.lua"/>
	<event type="statschange" name="ExtraStatsChange" event="script" value="extra_stats.lua"/>
	
	<event type="login" name="TalentsLogin" event="script" value="talents/login.lua"/>
	<event type="advance" name="TalentsAdvance" event="script" value="talents/advance.lua"/>
	<event type="outfit" name="Addons" event="script" value="outfits.lua"/>
	<event type="login" name="AddonsLogin" event="script" value="outfits.lua"/>
	<event type="advance" name="SpellUp" event="script" value="spellup.lua"/>


</creaturescripts>

Login.lua
Lua:
local config = {
	loginMessage = getConfigValue('loginMessage'),
	useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

local items = {
				--// [itemid] = {empty storage} \\--
				[2446] = 199209,
				[2466] = 199219,
				[2160] = 199229
			  }
local storage = 192289    -- empty storage 




function onLogin(cid)
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
	end

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
		local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
		if(lastLogin > 0) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
			str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
		else
			str = str .. " Please choose your outfit."
			doPlayerSendOutfitWindow(cid)
		end

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
	elseif(accountManager == MANAGER_NAMELOCK) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
	elseif(accountManager == MANAGER_ACCOUNT) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
	end
	
	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end
	
	if getPlayerStorageValue(cid,storage) > 0 then
		doPlayerSendTextMessage(cid,25,"Seems you have lost some of your premmy items, type !get to get them back.")
	end
	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "GuildMotd")
	registerCreatureEvent(cid, "KillingInTheNameOf")
        registerCreatureEvent(cid, "nohurtparty")

	registerCreatureEvent(cid, "Idle")
	if(config.useFragHandler) then
		registerCreatureEvent(cid, "SkullCheck")
	end

	registerCreatureEvent(cid, "ReportBug")
	registerCreatureEvent(cid, "AdvanceSave")
	registerCreatureEvent(cid, "Questkiller")
	registerCreatureEvent(cid, "scripty")
	registerCreatureEvent(cid, "killdeath")
	
	registerCreatureEvent(cid, "arena")
	registerCreatureEvent(cid, "nohurt")
	registerCreatureEvent(cid, "nodrop")
	registerCreatureEvent(cid, "KillingInTheNameOf")
	registerCreatureEvent(cid, "pvp")
	registerCreatureEvent(cid, "Death")
	registerCreatureEvent(cid, "Logout")
	registerCreatureEvent(cid, "ExtraStatsLogin")
	registerCreatureEvent(cid, "TalentsLogin")
	registerCreatureEvent(cid,'SpellUp')


       setPlayerHonorRank(cid)
	return true
end
 
21:10 You have been idle for 1 minutes, you will be disconnected in one minute if you are still idle.


Cykotitan I love you... <3 (L) (A) <3 <-- That should be some smiley code xD

< PROBLEM SOLVED >
 
Back
Top