• 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 DDoS protection*

Gostei do script Mock ta de parabéns.
Com algumas pequenas mudanças da pra atacar DDOS em outros servers. xD

I liked the script Mock.
With some minor changes to attack other servers. Heheheh I(-.-)I
 
I had this problem, what could be reason? Appeared on console.

Code:
[20/10/2009 22:05:22] Lua Script Error: [GlobalEvent Interface] 
[20/10/2009 22:05:22] data/globalevents/scripts/noDDoS.lua:onThink

[20/10/2009 22:05:22] host not found
[20/10/2009 22:05:22] stack traceback:
[20/10/2009 22:05:22] 	[C]: in function 'request'
[20/10/2009 22:05:22] 	data/globalevents/scripts/noDDoS.lua:22: in function <data/globalevents/scripts/noDDoS.lua:21>
[20/10/2009 22:05:22] [Error - GlobalEvents::think] Couldn't execute event: ddos

My DDoS.lua

Code:
------ DDoS protection
------ By Mock
------ Require O.T.A.L
------ [url=http://otal.awardspace.info/]O.T.A.L - Open Tibia Advanced Lib[/url]
local conf = {
      check_website1 = 'http://www.google.com/', ---- First website
      check_website2 = 'http://pt.wikipedia.org/', ---- Second website
      ifoff = { --- If this 2 websites was offline
            kickall = true, --- Kick all players?
            save = true, --- Save server?
            closeserver = false, --- Exit server?
      }
}
--[[
This script every X seconds will check if google is online,
if google is off it will check wikipedia, if wikipedia is
off too is because your net is verry overloaded (DDoS attack)
or your connection is down. If all this is off this script
will kick all players, save server and close server.
]]
function onThink(interval, lastExecution)
    local info,kind = socket.http.request(conf.check_website1)
    if not info then
       print('::Google is off?\a')
       if conf.check_website2 and conf.check_website2 ~= '' and conf.check_website2:len() > 6 then
          local info,kind = socket.http.request(conf.check_website2)
          if not info then
             print('::We are under attack or you connection is offline!\a\a')
             if conf.ifoff.kickall == true then
                for i,b in pairs(getOnlinePlayers()) do
                    doRemoveCreature(b)
                end
             end
             if conf.ifoff.save == true then
             saveServer()
             end
             if conf.ifoff.closeserver == true then
             os.sleep(2)
             os.exit()
             end
          end
       end  
    end
        return TRUE
end

Using Crying Damson 0.3.5pl1

Thanks.

@EDIT: I have OTAL Installed.
 
Last edited:
@snacky
you got attack or you connection got down!
well i wiil check about this error, in normal cases it dont print error ._.'
 
Well, i guess that my connection went down when this occur, because, currently i dont get im beign attacked, im changing my IP frequently, becuase im working with DNS's and stuff.


But, what could be the problem? it isnt strange? Thank you.
 
ive tried to run the script to test accuracy, and i opened the server, logged in from local computer, and unplugget internet cable.

After like 12 seconds, the script shows

Code:
[22/10/2009 03:26:53] Lua Script Error: [GlobalEvent Interface] 
[22/10/2009 03:26:53] data/globalevents/scripts/noDDoS.lua:onThink

[22/10/2009 03:26:53] host not found
[22/10/2009 03:26:53] stack traceback:
[22/10/2009 03:26:53] 	[C]: in function 'request'
[22/10/2009 03:26:53] 	data/globalevents/scripts/noDDoS.lua:22: in function <data/globalevents/scripts/noDDoS.lua:21>
[22/10/2009 03:26:53] [Error - GlobalEvents::think] Couldn't execute event: ddos

But it didnt even kicked me, or saved the server, also i make sure didnt disabled anything on the noDDoS.lua file


thanks
 
Oh, but that works if i really lost connection? well unplugin the cable its connection lost already..

It works?
 
@snacky
Bug fixed

yes if you unplug internet cable, or go to offline mode or something like
this script will kick all players :D
 
Buddy, it does kick the players, but didnt save the server and close it.

Any ideas?

Thanks you. (i just unplugged the cable)
 
0.3.4 pl 2

[23/10/2009 06:11:48] Lua Script Error: [GlobalEvent Interface]
[23/10/2009 06:11:48] data/globalevents/scripts/noDDoS.lua:eek:nThink

[23/10/2009 06:11:48] luaDoRemoveCreature(). Creature not found

no kick players ^^
 
Last edited:
so, not working? the file its OK

But doesnt save/shutdown server, just kick them..

Any function to do this?
 
@snacky
it save and shutdown yes.
you must need enable it on config.
@haleko
disable kick and enable save and shutdown
you TFS it's sux
 
this for tfs 0.3.6 pl 1

Lua:
------ DDoS protection
------ By Mock
------ Require O.T.A.L
------ [url=http://otal.awardspace.info/]O.T.A.L - Open Tibia Advanced Lib[/url]
local conf = {
      check_website1 = 'http://www.google.com/', ---- First website
      check_website2 = 'http://pt.wikipedia.org/', ---- Second website
      ifoff = { --- If this 2 websites was offline
            kickall = true, --- Kick all players?
            save = true, --- Save server?
            closeserver = true, --- Exit server?
      }
}
--[[
This script every X seconds will check if google is online,
if google is off it will check wikipedia, if wikipedia is
off too is because your net is verry overloaded (DDoS attack)
or your connection is down. If all this is off this script
will kick all players, save server and close server.
]]
function onThink(interval, lastExecution)
    local re,info,kind = pcall(socket.http.request,conf.check_website1)
    if not info or re == false then
       print('::Google is off?\a')
       if conf.check_website2 and conf.check_website2 ~= '' and conf.check_website2:len() > 6 then
          local re,info,kind = pcall(socket.http.request,conf.check_website2)
          if not info or re == false then
             print('::We are under attack or you connection is offline!\a\a')
             if conf.ifoff.kickall == true then
                for i,b in pairs(getPlayersOnline()) do
                    doRemoveCreature(b)
                end
             end
             if conf.ifoff.save == true then
             saveServer()
             end
             if conf.ifoff.closeserver == true then
             os.sleep(2)
             os.exit()
             end
          end
       end
    end
        return TRUE
end

for i,b in pairs(getPlayersOnline()) do

^^

rep ++ for me
 
In console:
beztytuuzyv.jpg
 
Back
Top