Convert IP BOT
 

News:

11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Convert IP BOT

Started by ?[-?Genius?-]?, 08 March, 2007, 20:16:07

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

?[-?Genius?-]?

Hi ppl

I need this IpBot script converted too Lua 5.1 If is Possible.

Tankx

--=[ DvdRip.sytes.net ]=--
	--=[ Script Ip-Bot Por Genius ]=--
	--=[ Adaptado e actualizado para DvdRip em Junho 2006 ]=--

	--=[ Nome do Bot ]=--

sBot = "![ PT??w?s ]"
OpChatName = "![ PT??w?s ]"

	--=[ Exep??es / Deixar entrar um internacional atrav?z do nick ]=--

excepcoes = {
	[" xxxx"] = 1,
	["  xxxx"] = 2,
	["   xxxx"] = 3,
}


	--=[ Ranges permitidas no Hub ]=--

arrIP = { 
   ["xxxxxxx"] = "xxxxxx", -- xxxxx
} 

	--=[ Codigo do script ]=-

function Main() 
   frmHub:RegBot(sBot) 
end 

	--=[ Mensagem ao user n?o constante na Range ]=-

function NewUserConnected(user) 
   if (excepcoes[user.sName] == nil) and (isGoodIP(user.sIP) == nil) then 
	user:SendData(sBot, "	--=[ Este Servidor apenas permite Ips Nacionais. Se ?s de Portugal contacta-nos: RicardoFVTavaresHotmail.com [EMAIL]ou abre pvt com [PT]?Genius??, a tua ajuda ? preciosa. ]=--	") 
      user:SendData("$ForceMove PtDowns.sytes.net:8888")
	user:Disconnect() 
   end 
end 

OpConnected = NewUserConnected 

function isGoodIP(sIP) 
   sIP = ipToNumber(sIP) 
   local iFirst,iLast 
   for iFirst, iLast in arrIP do 
      if (sIP >= ipToNumber(iFirst) and sIP <= ipToNumber(iLast)) then 
         return 1 
      end 
   end 
   return nil 
end 

function ipToNumber(sIP) 
   iAux = "" 
   string.gsub(sIP,"(%d+)", function(w) 
      w = tonumber(w) 
      if (w < 10) then 
         iAux = iAux.."00"..w 
      elseif (w < 100) then 
         iAux = iAux.."0"..w 
      else 
         iAux = iAux..w 
      end 
   end) 
   return tonumber(iAux) 
end

Cêñoßy†ê

Try this
Code: lua
--=[ DvdRip.sytes.net ]=--
	--=[ Script Ip-Bot Por Genius ]=--
	--=[ Adaptado e actualizado para DvdRip em Junho 2006 ]=--

	--=[ Nome do Bot ]=--

sBot = "![ PT??w?s ]"
OpChatName = "![ PT??w?s ]"

	--=[ Exep??es / Deixar entrar um internacional atrav?z do nick ]=--

excepcoes = {
	[" xxxx"] = 1,
	["  xxxx"] = 2,
	["   xxxx"] = 3,
}


	--=[ Ranges permitidas no Hub ]=--

arrIP = { 
   ["xxxxxxx"] = "xxxxxx", -- xxxxx
} 

	--=[ Codigo do script ]=-

function Main() 
   frmHub:RegBot(sBot) 
end 

	--=[ Mensagem ao user n?o constante na Range ]=-

function NewUserConnected(user) 
   if (excepcoes[user.sName] == nil) and (isGoodIP(user.sIP) == nil) then 
	user:SendData(sBot, "	--=[ Este Servidor apenas permite Ips Nacionais. Se ?s de Portugal contacta-nos: RicardoFVTavaresHotmail.com [EMAIL]ou abre pvt com [PT]?Genius??, a tua ajuda ? preciosa. ]=--	") 
      user:SendData("$ForceMove PtDowns.sytes.net:8888")
	user:Disconnect() 
   end 
end 

OpConnected = NewUserConnected 

function isGoodIP(sIP) 
   sIP = ipToNumber(sIP) 
   local iFirst,iLast 
   for iFirst, iLast in pairs(arrIP) do 
      if (sIP >= ipToNumber(iFirst) and sIP <= ipToNumber(iLast)) then 
         return 1 
      end 
   end 
   return nil 
end 

function ipToNumber(sIP) 
   iAux = "" 
   string.gsub(sIP,"(%d+)", function(w) 
      w = tonumber(w) 
      if (w < 10) then 
         iAux = iAux.."00"..w 
      elseif (w < 100) then 
         iAux = iAux.."0"..w 
      else 
         iAux = iAux..w 
      end 
   end) 
   return tonumber(iAux) 
end
Powered By Leviathan™ 2nd Generation v. 1.6

?[-?Genius?-]?


SMF spam blocked by CleanTalk