Isp check(swe)
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
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

Isp check(swe)

Started by Jokken, 05 September, 2004, 19:08:41

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jokken

I wonder if someone could make me a isp check script so that only swedish users can join the hub. very greatfull if someone could. Don?t have to be advanced.
THX

nErBoS

Hi,

There is already one script for that, try to search in the Finished Scripts area.

Best regards, nErBoS
--## nErBoS Spot ##--

IceCoder

#2
Hi there, you could always use my own script
but you have to find the ip ranges by your self






---------------------------------------------
-- ISP/IP checker
-- Written by IceCoder
--  Make an text file called ipranges.txt
    and put the ips and isp's like this
    213.214.;[BBB]
---------------------------------------------


sBotName = "-Infection-"
sScriptVersion = "1.0"
Owner = "IceCoder"
bIPCheck = 1
bISPCheck = 1

botemail = "admin@swedish-hub.se"
botspeed = "LAN(T3)"
botdescr = "This Script is written by IceCoder v"..sScriptVersion -- DON'T CHANGE IT
botinfostring = "$MyINFO $ALL "..sBotName.." "..botdescr.."$ $"..botspeed.."$"..botemail.."$"

sRejectMessage = "Sorry, This hub is for Swedish users only. If you are using a swedish isp and still can't enter add this ICQ# XXXXXXXX."
sPrefixMessage = "You must use your own prefix like $prefix and it will look like $prefixKarl  //"..Owner
AllowArray = {}

function Main()
   getIpList()
   frmHub:RegBot(sBotName)
        SendToAll(botinfostring)
end

function getIpList()
   readfrom("ipranges.txt")
   while 1 do
      local line = read()
      if line == nil then
         break
      else
         ip,prefix = splittext(line, ";")
         AllowArray[ip]=prefix
      end
   end
   readfrom()
end

function NewUserConnected(User)
SendToAll(botinfostring)
if User.iProfile ~= 2 then
 if (bIPCheck == 1) then
  local sIP, sIPa, sIPb, sIPc, sPrefix
  sIP = User.sIP

  _,_,sIPc = strfind(sIP, "((%d+).(%d+).(%d+))",1)
  _,_,sIPb = strfind(sIP, "((%d+).(%d+))",1)
  _,_,sIPa = strfind(sIP, "(%d+)",1)

    sIPa = sIPa..".*"
    sIPb = sIPb..".*"
    sIPc = sIPc..".*"

  if (AllowArray[sIP] ~= nil) then
   sPrefix = AllowArray[sIP]
  elseif (AllowArray[sIPc] ~= nil) then
   sPrefix = AllowArray[sIPa]
  elseif (AllowArray[sIPb] ~= nil) then
   sPrefix = AllowArray[sIPb]
  elseif (AllowArray[sIPa] ~= nil) then
   sPrefix = AllowArray[sIPc]
  end

   if (sPrefix == nil) then
        User:SendData(sBotName, "Infection Powered by: IceCoder")
   User:SendData(sBotName, sRejectMessage)
   User:SendData("$ForceMove "..frmHub:GetRedirectAddress())
   else
    if (bISPCheck == 1) then
     if (strsub(strlower(User.sName), 1, strlen(sPrefix)) == strlower(sPrefix) or strlower(sPrefix) == "ignore") then
   User:SendData(sBotName, "Welcome to "..frmHub:GetHubName().."..!")
     else
   sPrefixMessage = gsub(sPrefixMessage, "$prefix", sPrefix)
        User:SendData(sBotName, "Infection Powered by: IceCoder")
   User:SendData(sBotName, sPrefixMessage)
   User:Disconnect()
     end
    end
   end


 end
end
end

function OpConnectet(user)
        SendToAll(botinfostring)
end

function splittext(input, splitsyntax)
 if strfind(input, splitsyntax) then
  part1 = strsub(input,1,strfind(input, splitsyntax)-strlen(splitsyntax))
  part2 = strsub(input,strfind(input, splitsyntax)+strlen(splitsyntax), -1)
 end
return part1, part2
end

SMF spam blocked by CleanTalk