PtokaX forum

Lua 5.3/5.2/5.1 Scripts (for PtokaX 0.4.0.0 and newer) => Request for scripts => Topic started by: Hamachi on 13 July, 2011, 18:59:13

Title: WebBan 1.0 LUA 5.1x [Strict] [API 2] Support iblocklist lists
Post by: Hamachi on 13 July, 2011, 18:59:13
Support for http://www.iblocklist.com/lists.php list

2 Lists Were Processed, 0 I.P.'s And 0 Ranges Were Banned In: 7.72 seconds.

no ips is add atm :(
Title: Re: WebBan 1.0 LUA 5.1x [Strict] [API 2] Support iblocklist lists + bug
Post by: Hamachi on 14 July, 2011, 13:09:13
Okay :(

I have found a small bug, if there is ( : ) in reason it will not work :( like:
something 22:22:11 something :xxx.xxx.xxx-xxx.xxx.xxx

for reason,ips in list:gmatch("([^:]+):([^%\r\n]+)[\r\n]*") do
local _,_,sr,er = ips:find("^([%d%.]+)%-([%d%.]+)$")



when adding code please use code tags
Title: Re: WebBan 1.0 LUA 5.1x [Strict] [API 2] Support iblocklist lists
Post by: Hamachi on 15 July, 2011, 08:34:32
This have nofing whit the gzipped

if there is ( : ) in reason, it will not work :(
like:
somfing 22:22:11 somfing  :xxx.xxx.xxx-xxx.xxx.xxx

it will use ( : )
from
somfing  22:22:11
and not
somfing  :xxx.xxx.xxx-xxx.xxx.xxx

the code i send is from your script where the bug is.

hope you understand, hope you can help me :) and thanks you use you time on it.
Title: Re: WebBan 1.0 LUA 5.1x [Strict] [API 2] Support iblocklist lists
Post by: Hamachi on 17 July, 2011, 16:38:23
Mutor can you help me ?
Title: Re: WebBan 1.0 LUA 5.1x [Strict] [API 2] Support iblocklist lists
Post by: bastya_elvtars on 17 July, 2011, 19:23:51
I guess the colon is a delimiter in the database (reason:IP or something like that) and the pattern is confused when there is a colon in the reason (^%:+), so I also think this is a bug, if I am correct.

Also, Hamachi, it is correctly spelled SOMETHING. As "som" is a fruit in Hungarian, and "fing" means fart, you will slowly kill me if you insist on using this spelling because I'll laugh myself to death soon. :D
Title: Re: WebBan 1.0 LUA 5.1x [Strict] [API 2] Support iblocklist lists
Post by: bastya_elvtars on 17 July, 2011, 19:47:43
There is a GNU gzip port for windows so the download (with wget) and the inflation can be automated without any libs (and it can also be made really platform-independent this way, even though wget is part of the base system in GNU/Linux only) but that would cause some commandline popup windows all the time on Win.
I am however against adding such functionality into the hub server. How about using a method that works independently from the p2p app one is using, like PeerBlock (http://www.peerblock.com/)?
Title: Re: WebBan 1.0 LUA 5.1x [Strict] [API 2] Support iblocklist lists
Post by: Hamachi on 17 July, 2011, 21:03:23
Sorry my bad english, i start a new Topic for the bug...
Title: Bug / request for support lot of ( : ) in WebBan
Post by: Hamachi on 17 July, 2011, 21:09:44
I have found a small bug, if there is ( : ) in reason it will not work :( like:
something 22:22:11 something :xxx.xxx.xxx-xxx.xxx.xxx

it take the first ( : ) in line not the last ( : ) one

it mean it take ( : ) from reason too, it make a bug and dont take the reason  and ips correct

Hope some like to look on it :)
Title: Re: WebBan 1.0 LUA 5.1x [Strict] [API 2] Support iblocklist lists
Post by: Hamachi on 18 July, 2011, 07:44:22
WebBan 1.0 LUA 5.1x [Strict] [API 2] Support iblocklist lists - gz bug

is not the same as

Bug / request for support lot of ( : ) in WebBan - characters  bug
Title: Re: WebBan 1.0 LUA 5.1x [Strict] [API 2] Support iblocklist lists
Post by: Hamachi on 19 July, 2011, 00:32:18
It is make as req too

yes it support:
Verizon Internet Services Inc:4.5.248.0-4.5.251.255

but the script have a bug if  the list look like:
ISP:Telia Internet Services:4.5.248.0-4.5.251.255

this script is make like peerblock etc, it support:
ISP:Telia Internet Services:4.5.248.0-4.5.251.255

it only need to take the last : not the first, it will take you 1 min to edit...

hope some like to look on it
Title: Re: WebBan 1.0 LUA 5.1x [Strict] [API 2] Support iblocklist lists
Post by: Hamachi on 19 July, 2011, 10:51:35
Yes you have say 3 time it not support .gz, i don't talk about it anymore.

I have write i 6 time, what i mean after, I have understand that whit gz.

I not write anything about it anymore, so i start a new topic, so you understand it:
Bug / request for support lot of ( : ) in WebBan ( anything about .gz)

But you move it, i can not find any original scripts thread.

Sorry my bad English, because you are Global Moderator can still talk normal to the users...

Who are thick ?
Title: Re: WebBan 1.0 LUA 5.1x [Strict] [API 2] Support iblocklist lists
Post by: Hamachi on 19 July, 2011, 22:30:00
what i do:
Add a p2p text format list where the reasons have lot of ( : ) in it

ISP:Verizon Internet Services Inc:4.3.0.0-4.3.255.255
ISP:Google Incorporated:4.3.2.0-4.3.2.255
ISP:Verizon Internet Services Inc:4.5.248.0-4.5.251.255

:)
Title: Re: WebBan 1.0 LUA 5.1x [Strict] [API 2] Support iblocklist lists
Post by: sphinx_spb on 20 July, 2011, 08:54:57
Try to remove ^ symbol from 2nd line

change
local _,_,sr,er = ips:find("^([%d%.]+)%-([%d%.]+)$")
to
local _,_,sr,er = ips:find("([%d%.]+)%-([%d%.]+)$")
Title: Re: WebBan 1.0 LUA 5.1x [Strict] [API 2] Support iblocklist lists
Post by: Hamachi on 21 July, 2011, 01:12:04
LOL :D

Total thanks sphinx_spb :D
Title: Re: WebBan 1.0 LUA 5.1x [Strict] [API 2] Support iblocklist lists
Post by: Hamachi on 21 July, 2011, 11:45:25
IPs works now :)

the reason fuck up :(
Title: Re: WebBan 1.0 LUA 5.1x [Strict] [API 2] Support iblocklist lists
Post by: sphinx_spb on 21 July, 2011, 15:29:03
Quote from: Hamachi on 21 July, 2011, 11:45:25
the reason fuck up :(
Then fuck the reasons  ;D