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

I need an anti-bot system script :*

7i7a

New Member
Joined
Feb 23, 2011
Messages
43
Reaction score
1
Hi.... Plz i need a script for my rl-map to send the botter automaticly to a (position i will choose myself like jail or room) for duration 30 minutes and after the 30 minutes he return back to the temple..
With broadcast msgs, and magic effects , i think this script is a creaturescript OR Mod i don't know plz don't forgot me!!

thnx
 
U mean like a command that will send a person to jail for a certain amount of minutes and then it will automatically kick him somewhere?

Or u want some kind of automatic tool?
If you want a command then there u go:

your_ots_folder > data > talkaction > script > jailsystem.lua
Code:
-- Default jail time in seconds -- 
default_jail = 180 
-- The permission you need to jail someone -- 
grouprequired = 4 
-- StorageValue that the player gets -- 
jailedstoragevalue_time = 1338 
jailedstoragevalue_bool = 1339 
-- Set the position of the jail: -- 
jailpos = { x = 32389, y = 31777, z =7 } 
-- Set the position once unjailed: -- 
unjailpos = { x = 32360, y = 31782, z =7 } 
-- auto kicker, dont edit 
jail_list = {} 
jail_list_work = 0 

function checkJailList(param) 
    addEvent(checkJailList, 1000, {}) 
    for targetID,player in ipairs(jail_list) do 
        if isPlayer(player) == TRUE then 
            if getPlayerStorageValue(player, jailedstoragevalue_time) < os.time() then 
                doTeleportThing(player, unjailpos, TRUE) 
                setPlayerStorageValue(player, jailedstoragevalue_time, 0) 
                setPlayerStorageValue(player, jailedstoragevalue_bool, 0) 
                table.remove(jail_list,targetID) 
                doPlayerSendTextMessage(player,MESSAGE_STATUS_CONSOLE_BLUE,'You were kicked from jail. Have fun and behave good.')
            end 
        else 
            table.remove(jail_list,targetID) 
        end 
    end 
end 

function onSay(cid, words, param) 
    if jail_list_work == 0 then 
        jail_list_work = addEvent(checkJailList, 1000, {}) 
    end 
    if param == '' and (words == '!unjail' or words == '/unjail') then 
        if getPlayerStorageValue(cid, jailedstoragevalue_time) > os.time() then 
            doPlayerSendTextMessage ( cid, MESSAGE_STATUS_SMALL, 'You are jailed until ' .. os.date("%H:%M:%S", getPlayerStorageValue(cid, jailedstoragevalue_time)) .. ' (now is: ' .. os.date("%H:%M:%S", os.time()) .. ').')  
        else 
            if getPlayerStorageValue(cid, jailedstoragevalue_bool) == 1 then 
                table.insert(jail_list,cid) 
                doPlayerSendTextMessage ( cid, MESSAGE_INFO_DESCR, 'You will be kicked from jail now.') 
            else 
                doPlayerSendTextMessage ( cid, MESSAGE_STATUS_SMALL, 'You are not jailed.') 
            end 
        end 
        return TRUE 
    end 
    local jail_time = -1 
    for word in string.gmatch(tostring(param), "(%w+)") do 
        if tostring(tonumber(word)) == word then 
            jail_time = tonumber(word) 
        end 
    end 
    local isplayer = getPlayerByName(param) 
    if isPlayer(isplayer) ~= TRUE then 
        isplayer = getPlayerByName(string.sub(param, string.len(jail_time)+1)) 
        if isPlayer(isplayer) ~= TRUE then 
            isplayer = getPlayerByName(string.sub(param, string.len(jail_time)+2)) 
            if isPlayer(isplayer) ~= TRUE then 
                isplayer = getPlayerByName(string.sub(param, string.len(jail_time)+3)) 
            end 
        end 
    end 
    if jail_time ~= -1 then 
        jail_time = jail_time * 60 
    else 
        jail_time = default_jail 
    end 
    if words == '!jail' or words == '/jail' then 
        if getPlayerGroupId ( cid ) >= grouprequired then 
            if isPlayer(isplayer) == TRUE then 
                doTeleportThing(isplayer, jailpos, TRUE) 
                setPlayerStorageValue(isplayer, jailedstoragevalue_time, os.time()+jail_time) 
                setPlayerStorageValue(isplayer, jailedstoragevalue_bool, 1) 
                table.insert(jail_list,isplayer) 
                doPlayerSendTextMessage ( cid, MESSAGE_STATUS_DEFAULT, 'You jailed '.. getCreatureName(isplayer) ..' until ' .. os.date("%H:%M:%S", getPlayerStorageValue(isplayer, jailedstoragevalue_time)) .. ' (now is: ' .. os.date("%H:%M:%S", os.time()) .. ').')  
                doPlayerSendTextMessage ( isplayer, MESSAGE_INFO_DESCR, 'You have been jailed by '.. getCreatureName(cid) ..' until ' .. os.date("%H:%M:%S", getPlayerStorageValue(isplayer, jailedstoragevalue_time)) .. ' (now is: ' .. os.date("%H:%M:%S", os.time()) .. ').')  
                return TRUE 
            else 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Player with this name doesn\'t exist or is offline.") 
                return FALSE 
            end 
        else 
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "You can't execute this command.") 
            return FALSE 
        end 
    elseif words == '!unjail' or words == '/unjail' then 
        if getPlayerGroupId ( cid ) >= grouprequired then 
            if isPlayer(isplayer) == TRUE then 
                doTeleportThing(isplayer, unjailpos, TRUE) 
                setPlayerStorageValue(isplayer, jailedstoragevalue_time, 0) 
                setPlayerStorageValue(isplayer, jailedstoragevalue_bool, 0) 
                table.remove(jail_list,targetID) 
                doPlayerSendTextMessage(isplayer,MESSAGE_STATUS_DEFAULT,getCreatureName(cid) .. ' let you go earlier from jail. Remember to behave good.') 
                doPlayerSendTextMessage ( cid, MESSAGE_STATUS_DEFAULT, 'You unjailed '.. getCreatureName(isplayer) ..'.') 
            else 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "Player with this name doesn't exist or is offline.") 
                return FALSE 
            end 
        else 
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "You can't execute this command.") 
            return FALSE 
        end 
    end 
    return FALSE 
end

talkactions.xml
Code:
	<talkaction words="!jail" access="3" script="jailsystem.lua"/> 
    <talkaction words="!unjail" access="3" script="jailsystem.lua"/> 
    <talkaction words="/jail" access="3" script="jailsystem.lua"/> 
    <talkaction words="/unjail" access="3" script="jailsystem.lua"/>

Can you add reputation if I helped me? :) Thanks. If i didnt help u then sorry.
 
Hahahahahahahahaha
i said i need " anti bot system ". Not jailsystem
i need a script to send the booter to a posion (if he is botter) .... Hope to understand me!
 
Back
Top