Download Gag
 

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

Download Gag

Started by Devastator, 10 January, 2004, 20:31:46

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Devastator

Hey,

i was wonderin if sum1 could make a stand alone download gag script so that misbehaving users can get punished.

i would like this script because for users it would be a dire punishment instead of being kicked.

if someone can make that it would be excellent

thank u

Devastator
(? ?.??.->PLOP DEFINATELY 4 MOD!!!<-.??.???)


Intel

This Should Work
Try it ...

[code]
BotName =  "-Download-Blocker-"

--Txts--
Gags = "gags.txt"

--Txts--
   
function Main()
frmHub:RegBot(BotName)
frmHub:EnableFullData(1)
end
function GetArgsPm(sdata)
   local _,_, arg1 = strfind(sdata,"$To:%s+%S+%s+From:%s+%S+%s+$%S+%s+%S+%s+(%d+.%d+.%d+.%d+)")
return arg1
end
function GetArgsMain(sdata)
   local _,_, arg2 = strfind(sdata,"%s+%S+%s+(%d+.%d+.%d+.%d+)")
return arg2
end      
function DataArrival(curUser,sdata)
if strsub(sdata,1,12) == "$ConnectToMe" then
         local _,_, From,ToIp = strfind(sdata,"$ConnectToMe%s+(%S+)%s+(%d+.%d+.%d+.%d+):.*")         
               readfrom(Gags)               
   while 1 do
      local line = read()
      
      if line then         
         ip = strsub(line, strfind(line, "|") + 1)
         if ip == ToIp then
         return 1         
         end
         

      else      
         break
      end
   end
end

   readfrom()             
if (strsub(sdata,1,4) == "$To:") or strfind(sdata,"<")  then
   sdata = strsub(sdata,1,-2)
   local _,_,   check,command = strfind(sdata,"$To:+%s+(%S+)%s+From:+%s+%S+%s+$+%S+%s+(%S+)")
   local _,_,   command = strfind(sdata,"%b<>%s+(%S+)")      
   if (check == BotName) or (strsub(sdata,1,1) ~= "$")  then      
   
--commandes--

if curUser.bOperator then
if (command=="!addgag") then
SendAddGag(curUser,sdata)
return 1
elseif (command=="!delgag") then
SendDelGag(curUser,sdata)
return 1
elseif (command=="!getgag") then
SendGetGag(curUser,sdata)
return 1
end
end
end
end
end

--commandes--

   function SendAddGag(curUser,sdata)
      if strsub(sdata,1,4) == "$To:" then
      arg1=GetArgsPm(sdata)
      else
      arg1=GetArgsMain(sdata)      
      end
      if arg1~=nil then
       appendto(Gags)
         write("-|"..arg1.."\r\n")
         writeto()
         SendToOps(BotName,"Ipt "..arg1.." canr connect too any one")
         else
         curUser:SendData(BotName,"Command is !addgag ..")
         end
      
end
      function  SendDelGag(curUser,sdata)   
         writeto(Gags)      
         write("-|Gags ips.\r\n")
         writeto()
         curUser:SendPM(BotName,"Download gag list is delited!")

         end         
         function SendGetGag(curUser)
            readfrom(Gags)
            local message = ""
            while 1 do
            local line = read()
            if (line == nil) then  break  else   
            message = message.."\r\nIps gagged "..gsub(line,"-|"," @ ")..""
            end
            end
            curUser:SendPM(BotName,message)
         end   


[\CODE]
Punnakku

c h i l l a

#2
not bad intel,
Only thing is one also needs to block the RevConnectToMe.

plus reading out a file one each ConnectToMe is quite disk intense, okey, depending on the filesize.. well anyways, a nonassocciative table where you have added the curUser.sName  is a bit better in the performance. If you wanted to block ceratain IP's then, I would also only check the curUser.sIP if it matches a IP in the table. Dunno just keep trying.

Keep goin' intel

Intel

Hi Chilla, Could then make the Modified part and repost it... it would be very nice
Punnakku

Spyro

The PtokaX has the !gag command. Why don?t you just use that one ?
-------------------------
[Iceland]Spyro

icelandic hubowners forum
-----------------------------

c h i l l a

Spyro its a chat gag command.

Intel, I don't think it will help, I think plop is right it won't help, if I code it for you, but if you look at phattie's How To's you will find all info you need, and most of it is already in your script, so happy coding.

Tuben

It is not Intel that have done that script ;))
It is meeeee ;)))))
Hehe.
Dosnt mather .
-Dark-Mind-[ DOWNLOAD ]

Intel

Its Not me who Coded It, Its Tuben I think, But I understand the Script now, soon I will repost the modified part :) Unless Tuben is faster than me :P
Punnakku

plop

QuoteOriginally posted by Intel
Its Not me who Coded It, Its Tuben I think, But I understand the Script now, soon I will repost the modified part :) Unless Tuben is faster than me :P
still post it no mather tuben is faster or not.
you can only learn from it and thats a good thing.
and i always like 2 see multiple scripts doing the same thing, it can show diferent ways of doing things.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

Tuben

I dont code scripts any more..;))
-Dark-Mind-[ DOWNLOAD ]

SMF spam blocked by CleanTalk