• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Feature Anti Anti-paralyze bot (detect & punish)

Gesior.pl

Mega Noob&LOL 2012
Senator
Joined
Sep 18, 2007
Messages
2,968
Solutions
99
Reaction score
3,385
Location
Poland
GitHub
gesior
Tested on TFS 0.3.4pl2

Short script to detect and punish anti-paralyze bots (after X uses of bot it slow player until relog).
In creature.h below:
PHP:
friend class LuaScriptInterface;
Paste:
PHP:
		uint64_t addParalyzeTime;
		uint32_t antiParalsUnderTime;
		void removeParalyze();
In configmanager.h above:
PHP:
LAST_NUMBER_CONFIG
Paste:
PHP:
			PARAL_SLOW,
			PARAL_MIN_TIME,
			PARAL_CHECKS,
In configmanager.cpp above:
PHP:
m_loaded = true;
Paste:
PHP:
	m_confNumber[PARAL_SLOW] = getGlobalNumber("paralyzeSlow", 10);
	m_confNumber[PARAL_MIN_TIME] = getGlobalNumber("paralyzeMinTime", 200);
	m_confNumber[PARAL_CHECKS] = getGlobalNumber("paralyzeChecks", 3);
In creature.cpp:
below:
PHP:
void Creature::removeCondition(ConditionType_t type)
{
paste:
PHP:
	if(type == CONDITION_PARALYZE)
	    removeParalyze();
below:
PHP:
void Creature::removeCondition(Condition* condition)
{
paste:
PHP:
    if(condition->getType() == CONDITION_PARALYZE)
        removeParalyze();
below:
PHP:
void Creature::removeCondition(const Creature* attacker, ConditionType_t type)
{
paste:
PHP:
	if(type == CONDITION_PARALYZE)
		removeParalyze();
at end of file paste:
PHP:
void Creature::removeParalyze()
{
    if(OTSYS_TIME() - addParalyzeTime > g_config.getNumber(ConfigManager::PARAL_MIN_TIME))      
        return;
    addParalyzeTime = 0; 
    ++antiParalsUnderTime;
	if(antiParalsUnderTime > g_config.getNumber(ConfigManager::PARAL_CHECKS) && getBaseSpeed() > g_config.getNumber(ConfigManager::PARAL_SLOW))
	    setBaseSpeed((uint32_t) getBaseSpeed() - (getBaseSpeed() / 100 * g_config.getNumber(ConfigManager::PARAL_SLOW)));
    std::cout << getName() << " bot-antiparalyze " << antiParalsUnderTime << " times, basespeed: " << getBaseSpeed() << std::endl;  
}
below:
PHP:
onIdleStatus();
paste:
PHP:
	addParalyzeTime = 0;
	antiParalsUnderTime = 0;
below:
PHP:
	if(condition->startCondition(this))
	{
		conditions.push_back(condition);
		onAddCondition(condition->getType());
paste:
PHP:
		if(condition->getType() == CONDITION_PARALYZE)
				addParalyzeTime = OTSYS_TIME();
In config.lua paste:
PHP:
paralyzeSlow = 10 -- decrease basespeed percent
paralyzeMinTime = 200 -- if unparalyze time under (miliseconds) count it as too fast
paralyzeChecks = 3 -- after how many too fast unparalyzes punish player (slow)
Maybe it doesnt work with normal paralyze rune.
My paralyze rune isnt spell. It's action.
actions.xml
PHP:
<action itemid="2278" event="script" value="paralize.lua" allowfaruse="1"/>
paralyze.lua script:
PHP:
local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 20000)
setConditionFormula(condition, -0.9, 40, -0.9, 0)

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if (not (isDruid(cid) or isSorcerer(cid))) and (getPlayerGroupId(cid) <= 3) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your vocation cannot use this rune.")
		return FALSE
	end

	if (getPlayerMana(cid) < 700) and (getPlayerGroupId(cid) <= 3) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't have enough mana points.")
		return FALSE
	end

	if (not (isPlayer(itemEx.uid))) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You may use paralyze only on players.")
		return FALSE
	end
	
	if(getTilePzInfo(getCreaturePosition(cid)) == TRUE or getTilePzInfo(getCreaturePosition(itemEx.uid)) == TRUE) and (getPlayerGroupId(cid) <= 3) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't paralyze in protection zone.")
		return FALSE
	end
	doAddCondition(itemEx.uid, condition)
	doPlayerAddMana(cid, -700)
	if(item.type > 1) then
		doTransformItem(item.uid, item.itemid, item.type-1)
	else
		doRemoveItem(item.uid)
	end
	return true
end
 
You can add globalevent (interval 1 minute) with paralyze 1-2% for all players online - fast detect bots even when they dont fight.
 
Small suggestion, dear Gesior (no irony :))- instead adding if condition and "removeParalyze" part in every removeCondition member, paste the removeParalyze content under the if to onEndCondition. Same with part:
Code:
    if(condition->startCondition(this))
    {
        conditions.push_back(condition);
        onAddCondition(condition->getType());
which should be in onAddCondition. Also with 0.3.6 you can use creature storage for storing the values anyway ^^, so no header editing :p
 
Last edited:
all stuffs to fight botters in the game can hurt those who don't bot..

it's actually possible to by "mistake" do something several times that people think that only a bot can do..

as far you fight botters inside the game, none are safe of banishment..

only fight the botters before they login are safer,, etc a client that detect the bot, and banish the account that tried to login under this time.. (pretty simple to fix)..


:p
 
Bumping this post, i've been trying to find such code, because everybody is using it. (The Anti-paralize bot *G/**fbot) etc
 
Code works fine, thanks!
But there's one problem.
From the moment i put this code into my forgottenserver, it's impossible to heal with 'exura', 'exura gran' etc...

//Solved
 
Last edited:
all stuffs to fight botters in the game can hurt those who don't bot..

it's actually possible to by "mistake" do something several times that people think that only a bot can do..

as far you fight botters inside the game, none are safe of banishment..

only fight the botters before they login are safer,, etc a client that detect the bot, and banish the account that tried to login under this time.. (pretty simple to fix)..


:p

BULL SHIT! you don't even know how to do so, and yet you say it is easy when nobody else has managed to do it? Once again BULL SHIT.. I hate fucking noobs.
 
BULL SHIT! you don't even know how to do so, and yet you say it is easy when nobody else has managed to do it? Once again BULL SHIT.. I hate fucking noobs.

then you're just ignorant. I said it's easyfix for WHOEVER is familiar with client codes. I didn't ever said I CAN DO IT EASY.

and yeah, fucking noobs that says something is impossible because you've never seen anything samiliar...

the day you learn how OT systems works, that day you will know what's fully possible and what's not. and now in my eyes a Client detect bots is easy fix with simple functions that's connected between the server and client, some function that sense the process of the client and if something is modifying it...

but yeah, loggout, grow some IQ and come back before you call someones else "fucking noob" next time idiot ;)
 
then you're just ignorant. I said it's easyfix for WHOEVER is familiar with client codes. I didn't ever said I CAN DO IT EASY.

and yeah, fucking noobs that says something is impossible because you've never seen anything samiliar...

the day you learn how OT systems works, that day you will know what's fully possible and what's not. and now in my eyes a Client detect bots is easy fix with simple functions that's connected between the server and client, some function that sense the process of the client and if something is modifying it...

but yeah, loggout, grow some IQ and come back before you call someones else "fucking noob" next time idiot ;)

Scanning running process' on client side is illegal if player don't accept it :p
 
well, good program can send to server packet with "everything is correct" info even if its using all possible cheats
and Chojrak is right: scanning pc/processes without users agreement is illegal
 
well, good program can send to server packet with "everything is correct" info even if its using all possible cheats
and Chojrak is right: scanning pc/processes without users agreement is illegal

Wouldn't be very hard to add it to the agreement, nobody reads them anyway xD:p
 
Back
Top