IP informer to OPs - Page 2
 

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

IP informer to OPs

Started by catwo, 26 May, 2005, 22:02:52

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jiten

QuoteOriginally posted by chettedeboeuf
The reason doesn't appear :
?????????????????????????????????????????
   IPs surveill?es :
?????????????????????????????????????????
    * 127.0.0.1
    * 82.141.122.196
    * 85.217.1.75

Anybody have this problem ??
Try copying the script all over again and see if that happens.

Cheers

chettedeboeuf

I have tried this jiten, but nothing :
??????????????????????????????????????????
         Monitored IPs:
??????????????????????????????????????????
    * 82.141.122.196
    * 127.0.0.1
    * 85.217.1.75
    * 80.181.189.211

It's the wonder of catwo of having reason
But nothing in my hub

Sorry for my poor english and thank you for your help

jiten

QuoteOriginally posted by chettedeboeuf
I have tried this jiten, but nothing :
Sorry, my bad. I had copied the first script and it didn't include those changes. Guess it's ok now. :D
You may try it now.

Cheers

chettedeboeuf

Than you (Again !!!) jiten

catwo

--/------------------------------------------------------------

-- IP Monitoring v1.0 by jiten (5/27/2005)

-- Small personal edits by catwo (6/01/2005
--/------------------------------------------------------------



sBot = frmHub:GetHubBotName()

wIP = {} IPFile = "IP.tbl"



Main = function()

   if loadfile(IPFile) then dofile(IPFile) end

end



ChatArrival = function(sUser,sData)

   local sData = string.sub(sData, 1, -2)

   local s,e,cmd = string.find(sData,"%b<>%s+[%!%?%+%#](%S+)")

   if cmd then

      local tCmds = {

      ["online"] =   function(sUser,sData)

               local s,e,IP,reason = string.find(sData,"%b<>%s+%S+%s+(%S+)%s+(.*)")

               if (IP == nil or reason == nil) then

                  sUser:SendData(sBot, "*** Syntax Error: Type !online ")

               else

                  local _,_,a,b,c,d = string.find(IP,"(%d*).(%d*).(%d*).(%d*)")

                  if not (a == "" or b == "" or c == "" or d == "") then

                     if wIP[IP] == nil then

                        wIP[IP] = {} wIP[IP] = reason

                        sUser:SendData(sBot,IP.." is being sucessfuly monitored.") SaveToFile(IPFile,wIP,"wIP")

                     elseif wIP[IP] ~= nil then

                        sUser:SendData(sBot, "*** Error: "..IP.." is already being monitored.")

                     end

                  else

                     sUser:SendData(sBot, "*** Syntax Error: Type !online ")

                  end

               end

            end,

      ["ronline"] =   function(sUser,sData)

               local s,e,IP = string.find(sData,"%b<>%s+%S+%s+(%S+)")

               local _,_,a,b,c,d = string.find(IP,"(%d*).(%d*).(%d*).(%d*)")

               if (IP == nil) or (a == "" or b == "" or c == "" or d == "") then

                  sUser:SendData(sBot, "*** Syntax Error: Type !ronline ")

               elseif wIP[IP] ~= nil then

                  wIP[IP] = nil

                  sUser:SendData(sBot,IP.." is no longer being monitored.") SaveToFile(IPFile,wIP,"wIP")

               elseif wIP[IP] == nil then

                  sUser:SendData(sBot,"*** Error: "..IP.." isn't being monitored.")

               end

            end,

      ["sonline"] =   function(sUser,sData)

               if next(wIP) then

                  local msg = "\r\n\r\n".."\????????????????????????????????????????????????????????????????????????????????????".."\r\n"
                  msg = msg.."\Monitored IP:\t\tReason:\r\n"
                  msg = msg.."\????????????????????????????????????????????????????????????????????????????????????".."\r\n"
                  local i,v for i, v in wIP do msg = msg.."*   "..i.."\t\t"..v.."\r\n" end
                  
                  sUser:SendData(sBot,msg)

               else

                  sUser:SendData(sBot,"*** Error: The IP monitoring list is empty.")

               end

            end,

      }

      if tCmds[cmd] and sUser.bOperator then return tCmds[cmd](sUser,sData),1 end

   end

end



NewUserConnected = function(sUser,sData)

   for i,v in wIP do

      if i == sUser.sIP then SendPmToOps(frmHub:GetOpChatName(),os.date().." - "..sUser.sName.." ("..i..") is being monitored because: "..v)end

   end

   if sUser.bOperator then

      sUser:SendData("$UserCommand 1 3 Online\\Monitor IP$<%[mynick]> !online %[line:UsersIP] %[line:UsersNick/Reason/Date/OPsName]||")

      sUser:SendData("$UserCommand 1 3 Online\\Remove IP$<%[mynick]> !ronline %[line:IP]||")

      sUser:SendData("$UserCommand 1 3 Online\\Show IPs$<%[mynick]> !sonline||")
   end
end



OpConnected = NewUserConnected



Serialize = function(tTable,sTableName,hFile,sTab)

   sTab = sTab or "";

   hFile:write(sTab..sTableName.." = {\n");

   for key,value in tTable do

      if (type(value) ~= "function") then

         local sKey = (type(key) == "string") and string.format("[%q]",key) or string.format("[%d]",key);

         if(type(value) == "table") then

            Serialize(value,sKey,hFile,sTab.."\t");

         else

            local sValue = (type(value) == "string") and string.format("%q",value) or tostring(value);

            hFile:write(sTab.."\t"..sKey.." = "..sValue);

         end

         hFile:write(",\n");

      end

   end

   hFile:write(sTab.."}");

end



SaveToFile = function(file,table,tablename)

   local hFile = io.open(file,"w+") Serialize(table,tablename,hFile); hFile:close()

end

This is what i have and it works perfect ALL CREDIT to jiten.  My edit is just names on input boxes for OPs to all input the reason the same and left screen alignment.

chettedeboeuf

With catwo's modif :
[08:45] Syntax D:\Program Files\Hub PtokaX\HUB 0.3.3.0 17.08\scripts\IP Monitoring.lua:98: unexpected symbol near `&'

jiten

QuoteOriginally posted by chettedeboeuf
With catwo's modif :
[08:45] Syntax D:\Program Files\Hub PtokaX\HUB 0.3.3.0 17.08\scripts\IP Monitoring.lua:98: unexpected symbol near `&'
Replace & quot;\ with " in lines 98 and 100 and the error should be gone.

Cheers

catwo

Hmmm how come i don't get that error then? Strange things these PCs! :D

SMF spam blocked by CleanTalk