masteuszx
OtsList.eu
- Joined
- Aug 3, 2008
- Messages
- 784
- Reaction score
- 45
It's FORBIDDEN and ILLEGAL to copy this anywhere!
Hello all!
This script won't be useful for me anymore, so I give that you.
What this script does?
Very good question . This detects anti-idle anywhere and ban automatically. Let's say, that this is little part of Cipsoft detection.
This script requires TheForgottenServer in version 0.3.4+!
How to install
====================================
Open file creatureevents.cpp
====================================
Find
Code:
case CREATURE_EVENT_KILL:
return "onKill";
After it paste:
Code:
case CREATURE_EVENT_DIR:
return "onDir";
Find
Code:
else if(tmpStr == "kill")
m_type = CREATURE_EVENT_KILL;
After it paste
Code:
else if(tmpStr == "dir")
m_type = CREATURE_EVENT_DIR;
Find
Code:
case CREATURE_EVENT_KILL:
return "cid, target";
After it paste
Code:
case CREATURE_EVENT_DIR:
return "cid, dir";
At the end of file paste
Code:
uint32_t CreatureEvent::executeOnDir(Creature* creature, const Direction& dir)
{
//onDir(cid, dir)
if(m_scriptInterface->reserveScriptEnv())
{
ScriptEnviroment* env = m_scriptInterface->getScriptEnv();
if(m_scripted == EVENT_SCRIPT_BUFFER)
{
env->setRealPos(creature->getPosition());
std::stringstream scriptstream;
scriptstream << "cid = " << env->addThing(creature) << std::endl;
scriptstream << m_scriptData;
int32_t result = LUA_NO_ERROR;
if(m_scriptInterface->loadBuffer(scriptstream.str()) != -1)
{
lua_State* L = m_scriptInterface->getLuaState();
result = m_scriptInterface->getField(L, "_result");
}
m_scriptInterface->releaseScriptEnv();
return (result == LUA_TRUE);
}
else
{
#ifdef __DEBUG_LUASCRIPTS__
std::stringstream desc;
desc << creature->getName();
env->setEventDesc(desc.str());
#endif
env->setScriptId(m_scriptId, m_scriptInterface);
env->setRealPos(creature->getPosition());
lua_State* L = m_scriptInterface->getLuaState();
m_scriptInterface->pushFunction(m_scriptId);
lua_pushnumber(L, env->addThing(creature));
lua_pushnumber(L, dir);
int32_t result = m_scriptInterface->callFunction(2);
m_scriptInterface->releaseScriptEnv();
return (result == LUA_TRUE);
}
}
else
{
std::cout << "[Error - CreatureEvent::executeOnLook] Call stack overflow." << std::endl;
return 0;
}
}
Open file creatureevent.h
==========================
Find
Code:
CREATURE_EVENT_KILL,
After it paste
Code:
CREATURE_EVENT_DIR,
Find
Code:
uint32_t executeKill(Creature* creature, Creature* target);
After it paste
Code:
uint32_t executeOnDir(Creature* creature, const Direction& dir);
==========================
Open file game.cpp
==========================
Find
Code:
//event method
for(it = list.begin(); it != list.end(); ++it)
(*it)->onCreatureTurn(creature, stackpos);
After it paste
Code:
bool deny = false;
CreatureEventList dirEvents = creature->getCreatureEvents(CREATURE_EVENT_DIR);
for(CreatureEventList::iterator it = dirEvents.begin(); it != dirEvents.end(); ++it)
{
if(!(*it)->executeOnDir(creature, dir))
deny = true;
}
if(deny)
return false;
Then you can close all and compile.
Lua Files
The lua part is only one file of creatureevents.
Open file creaturescripts/creaturescrtips.xml and paste:
<event type="dir" name="AntyBot" event="script" value="anti-bot.lua"/>
Create file creaturescripts/scripts/anti-bot.lua and paste:
-----------------------------------------------------------------------------------------------------------------
---------------------- ANTI-IDLE AUTO DETECT TOOL ---------------------------------------------------------------
----------------------------------- BY INFINITY (OTIBIA.NET) ----------------------------------------------------
-----------------------------------------------------------------------------------------------------------------
--------------------------- DO NOT REMOVE THIS! -----------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------
local time_b = 7 * 24 * 60 * 60
function onDir(cid, dir)
if isPlayer(cid) then
local gracz = getCreatureName(cid)
local last = getPlayerStorageValue(cid,400240)
local count = getPlayerStorageValue(cid,400250)
local last_change = getPlayerStorageValue(cid,400260)
local now = os.time()
if last < 1 then
setPlayerStorageValue(cid,400240,now)
else
local roznica = now - last
if roznica > 180 then
setPlayerStorageValue(cid,400240,now)
setPlayerStorageValue(cid,400260,roznica)
if (roznica == last_change) or (roznica+1 == last_change) or (roznica == last_change+1) then
if count == 3 then
setPlayerStorageValue(cid,400250,0)
local playeracc = getAccountIdByName(gracz)
doAddBanishment(playeracc, time_b, 12, 2, 'Banished by Anti-Idle Automatic Detection Tool by Infinity', 0)
doRemoveCreature(cid)
else
setPlayerStorageValue(cid,400250,count+1)
end
else
setPlayerStorageValue(cid,400250,0)
end
end
end
end
return TRUE
end
Add to login.lua:
registerCreatureEvent(cid, "AntyBot")
To TFS Developers: if you can, add this function to your own source codes. Thanks.
Last edited: