PtokaX forum

Archive => Archived 5.0 boards => Finished Scripts => Topic started by: VidFamne on 08 March, 2005, 21:15:04

Title: GeoIP for Lua5
Post by: VidFamne on 08 March, 2005, 21:15:04
GeoIP for Lua5
>>HERE<< (ftp://vidfamne.myftp.org/dl/GeoIP5.00px.rar)
Title:
Post by: Psycho_Chihuahua on 08 March, 2005, 22:04:24
Cool good Work Vid

one question though...

to allow more then one CC how should i enter them?

CH DE.......

or

CH;DE.......  ?
Title:
Post by: Alexandros on 08 March, 2005, 23:30:33
I get this error :-S
Syntax Files/Func/fFunc.lua:118: attempt to perform arithmetic on field `?' (a nil value)
Title:
Post by: Psycho_Chihuahua on 09 March, 2005, 00:10:01
i had that, but after a hub restart it worked. i think its because at start you dont have a Cnumb.txt in the files/Save Folder.

So just restart and it should work ^^
Title: same as
Post by: Skynet on 09 March, 2005, 17:17:53
i had same problem as well after adding Cnumb.txt in the files/Save Folder it works fine

Skynet
landofkaraoke
Title:
Post by: nEgativE on 09 March, 2005, 17:25:37
Is the link ok ?

Tks VidFamne.
Title:
Post by: bokkepoot on 12 March, 2005, 18:40:22
It seems that the GeoIP link doesn't work.
Can somebody place a good working link ?

Thanks in advance

Bokkepoot
Title: GeoIP for Lua5
Post by: Psycho_Chihuahua on 12 March, 2005, 18:54:34
GeoIP for Lua5
>>HERE<< (http://psycho-chihuahua.net/GeoIP5.00px.rar)
Title:
Post by: bokkepoot on 12 March, 2005, 23:12:25
Thank you very much !!

This is much apreciated by the operators of the queen hub.
They use this function to have some ease back-ground info about logged on users.
(To have a oppertunity if they have succes to talking in english to this new logged in user or not)

anyway thanks for downloading the script.
I go test it now !!

greetings


Bokkepoot
Title:
Post by: Psycho_Chihuahua on 12 March, 2005, 23:26:36
well if they understand German i can post my translated version (haven't done all yet)  :D
Title:
Post by: bokkepoot on 13 March, 2005, 00:21:52
This will be fun !!!!

The operator who is using (and did request this script for LUA 5) is from Germany  :)

It would be nice if I can surpise her with a german version

If you can share it with us, it would be great !!

thank you very much

Bokkepoot
Title: great :0)
Post by: UwV on 13 March, 2005, 00:35:24
thanks :0))
Title:
Post by: Psycho_Chihuahua on 13 March, 2005, 00:46:56
Sure no problem

Here you go GeoIP.German (http://hub.psycho-chihuahua.net/jgs_db.php?action=download&download_id=29&sid=)

But the compiled files i haven't translated so the Country's still appear as english...but commands and right click menu i've done
Title:
Post by: bolamix on 13 March, 2005, 09:02:57
Thanks for the link! I should have a French version ready tonight ;)
Title: little problem here ..
Post by: UwV on 13 March, 2005, 16:14:04
i think i have found a slight problem with the next though ..
so i added these 3 'debug' lines to the script ..
recnick = "UwV"
repnick = "Geo"

Newcon = function(User)
     -- cut 2 make post a little smaller --
local Countn = tCnumb[C]-1
      SendPmToNick(recnick, repnick, "  - IN    -->  "..User.sName.." \t from \t"..C.."\t was just added to table tCnumb by Ge0iP")
      User:SendData
      -- cut 2 make post a little smaller --
end

UserDisc = function(User)
    -- cut 2 make post smaller --
    tCnumb[C] = tCnumb[C] - 1
    SendPmToNick(recnick, repnick, "  - OUT ->  "..User.sName.."\t from\t "..C.." has just been substracted from table tCnumb by Ge0iP

and got this printed to me

[15:06:47]  - IN    -->  Doustna     from    Poland was just added to table tCnumb by Ge0iP
[15:07:39]  - IN    -->  Ms.Nice     from    Local Host  was just added to table tCnumb by Ge0iP
[15:08:01]  - IN    -->  Gert     from    Netherlands  was just added to table tCnumb by Ge0iP
[15:08:18]  - OUT ->  ragdool    from    Sweden has just been substracted from table tCnumb by Ge0iP
[15:09:18]  - IN    -->  psycho.sys    from    Israel was just added to table tCnumb by Ge0iP
[15:09:19]  - IN    -->  Panoramix    from    United Kingdom was just added to table tCnumb by Ge0iP
[15:09:58]  - IN    -->  DiMT    from    Russian Federation was just added to table tCnumb by Ge0iP
[15:10:22]  - IN    -->  ragdool    from    Sweden was just added to table tCnumb by Ge0iP
[15:10:28]  - IN    -->  Gert    from    Netherlands was just added to table tCnumb by Ge0iP
[15:10:29]  - OUT ->  Tranceguy    from    Finland has just been substracted from table tCnumb by Ge0iP
[15:11:06]  - OUT ->  Ms.Nice    from    Local Host has just been substracted from table tCnumb by Ge0iP
[15:11:07]  - IN    -->  Ms.Nice    from    Local Host was just added to table tCnumb by Ge0iP
[15:11:11]  - OUT ->  Ms.Nice    from    Local Host has just been substracted from table tCnumb by Ge0iP
[15:11:11]  - IN    -->  Ms.Nice    from    Local Host was just added to table tCnumb by Ge0iP
[15:11:13]  - OUT ->  Ms.Nice    from    Local Host has just been substracted from table tCnumb by Ge0iP
[15:11:13]  - IN    -->  Tranceguy    from    Finland was just added to table tCnumb by Ge0iP
[15:11:14]  - IN    -->  Ms.Nice    from    Local Host was just added to table tCnumb by Ge0iP
[15:11:41]  - OUT ->  Doustna    from    Poland has just been substracted from table tCnumb by Ge0iP

so i think "Gert" has a bad connection or a bad client, or it is something in the hubsoft ? ..
then i read the PtokaX debug window and i see this ..

[15:10] (xxx.xxx.xxx.251) > $ValidateNick Gert|
[15:10] Gert (xxx.xxx.xxx.251) > $Version 1,0091|
[15:10] Gert (xxx.xxx.xxx.251) > $GetNickList|
[15:10] Gert (xxx.xxx.xxx.251) > $MyINFO $ALL Gert <++ V:0.305,M:P,H:34/0/0,S:15,O:15>$ $Cable$MAil@nowhere.nl$39826034582$|
[15:10] x User removed: Gert (Socket 804)..


" H:34 "  is why he is being disconnected by the hub .. (maxhub is set to 34)
 so not a bad client , not a bad connection, and not something with the hubsoft either ..
 anybody any ideas how to solve this 'nasty' thing..?  
   (exept for adding a second ('nickonline') table, to remember/check if a nick is not considered 'online' by the script.. ..   )
Title:
Post by: UwV on 13 March, 2005, 17:40:24
i mean Newcon = function(User)
     local compIp = f.ComputeIP(User.sIP)
     local C, CC = f.tSearchCountry(compIp)
          if (CountryCode == CC  or CountryCode == "ALL" or User.bOperator) then else
               User:SendData("Sorry but this hub only allow users from "..CountryCode)
               User:Disconnect(); return nil
          end
          if (tOnline[User.sName] ~= 1) then else
               return nil
          end
     tOnline[User.sName] = 1
     tCnumb[C] = tCnumb[C] or 0
     tCnumb[C] = tCnumb[C] + 1
     local Countn = tCnumb[C]-1User:SendData(" Hello "..User.sName.."  from "..C.." Welcome to "..frmHub:GetHubName()..
    ". \r\nOut of "..frmHub:GetUsersCount().." users in this hub,You have "..Countn.." compatriots in this hub.\r\n"..
    "Sending you this hubs normal user-command. Right-click on hub tab or userlist.|$UserCommand 255 7|"..
    "$UserCommand 0 1|$UserCommand 1 1 Get Country Stats.$<%[mynick]> +TopCountry||"..
    "$UserCommand 0 2|$UserCommand 2 2 Get User's Country$<%[mynick]> +Country %[nick]||"..
    "$UserCommand 1 1 Country by IP$<%[mynick]> +Country %[line:IP?]||"..
    "$UserCommand 1 1 My IP$<%[mynick]> +myip||")
        if User.bOperator then
    User:SendData("$UserCommand 1 1 Allow by Country Code$<%[mynick]> +Allow %[line:Country Code? or ALL?]||")
        end
end,
UserDisc = function(User)
    local compIp = f.ComputeIP(User.sIP)
    local C, CC = f.tSearchCountry(compIp)
    tCnumb[C] = tCnumb[C] - 1
    tOnline[User.sName] = 0
end,
actually solves that problem ..  but i dont really like it since i'll need to do the whole file routine if i want it to work on script reboot,.. besides that it might become a pretty large table after a week or two .. and thus eating 'precious' memory away  ..  :0(
Title:
Post by: Zigurds on 13 March, 2005, 18:57:26
I am use script user command  (http://board.univ-angers.fr/thread.php?threadid=3722&boardid=26&styleid=1&sid=0d782bdc9edba822428ffad76d6dd9fc)

use this GeoIP here me is conflict,  invisibility my commands

Sorry my bad English
--------------------------------------------
owner for Latvian hubs Alfa
Title:
Post by: VidFamne on 13 March, 2005, 19:14:09
To Zigurds, delete this;   $UserCommand 255 7|
in the NewCon function.
And to UwV, I could only assume that the NewUserConnected function is trigged only when a user is properly loged in.
PPK could perhaps answer this question.
Title:
Post by: Zigurds on 13 March, 2005, 19:44:31
and any
how much have updates this GeoIP ?
My hub for Latvian users only
Title:
Post by: UwV on 13 March, 2005, 20:26:05
QuoteOriginally posted by VidFamne
And to UwV, I could only assume that the NewUserConnected function is trigged only when a user is properly loged in.
PPK could perhaps answer this question.

problem is with the  UserDisconnected function..
not the NewUserConnected function..

but anyway .. guess your answer is the same ..
so i hope PPK can answer the question ..

Yet what about solving it though ?
 .. if i am the only one experiencing this .. np
 i guess can solve my own problems (with a little help from my friends)..
but it seems like there will be more people getting or having this same problem sooner or later..

best regards,

p.s. the solution above does NOT fix the problem.. just makes it lighter ..  (a user that is counted for, and disconnects without  being noticed by the script still is couted for) as 1 .. but at least i wont wake up in the mornig again and see..
 38 users from poland and 28 from netherlands.. and to top it all off 56 from sweden in the top 10 list ..
 when there is only 43 users online..  ;0)
Title:
Post by: Zigurds on 13 March, 2005, 21:18:20
here is my fragment recension. Visible in but commands and right click menu


    User:SendData(" Hello "..User.sName.."  from "..C.." Welcome to "..frmHub:GetHubName()..
    ". \r\nOut of "..frmHub:GetUsersCount().." users in this hub,You have "..Countn.." compatriots in this hub.\r\n"..
    "Sending you this hubs normal user-command. Right-click on hub tab or userlist."..
    "$UserCommand 1 3|$UserCommand 1 1 Country\\Get Country Stats.$<%[mynick]> +TopCountry||"..
    "$UserCommand 0 2|$UserCommand 2 2 Country\\Get User's Country$<%[mynick]> +Country %[nick]||"..
    "$UserCommand 1 3 Country\\Country by IP$<%[mynick]> +Country %[line:IP?]||"..
    "$UserCommand 1 3 Country\\My IP$<%[mynick]> +myip||")
        if (curUser.iProfile == 0) then
    User:SendData("$UserCommand 1 3 Country\\Allow by Country Code$<%[mynick]> +Allow %[line:Country Code? or ALL?]||")
        end
end,
Title:
Post by: Zigurds on 13 March, 2005, 22:00:24
Sorry, my error

true --- if (User.iProfile == 0) then
Title:
Post by: PPK on 14 March, 2005, 10:18:10
QuoteOriginally posted by UwV
problem is with the  UserDisconnected function..
Bug found, bug fixed  :]
Title:
Post by: UwV on 14 March, 2005, 12:40:02
QuoteOriginally posted by PPK
QuoteOriginally posted by UwV
problem is with the  UserDisconnected function..
Bug found, bug fixed  :]

great :0)

didn't wanna post in bugs section untill i was absoluteley sure ..
 and i was only sure about it this morning
(after trying in solo and with a zzz. in the front of the filename and with a aaa. in front of the filename)

and it still gave me the same problems ..
aslong as i had PPK's "anti no-hash-client script" running..
users would get disconnected by it and not be noticed by geoip script...
 (even after commenting the  return 1 in PPK's and changing it from aaa.lua to zzz.lua rebooting etc. etc.) ..

so glad to hear this was not some ghosthunt  i was on ..
and even more happy to hear it is fixed already even :0)
Title:
Post by: PPK on 14 March, 2005, 13:29:20
QuoteOriginally posted by UwV
and it still gave me the same problems ..
aslong as i had PPK's "anti no-hash-client script" running..
users would get disconnected by it and not be noticed by geoip script...
 (even after commenting the  return 1 in PPK's and changing it from aaa.lua to zzz.lua rebooting etc. etc.) ..

so glad to hear this was not some ghosthunt  i was on ..
and even more happy to hear it is fixed already even :0)
My fix not help with problem if another script disconnect user in NewUserConnected :(
One way is to change manually script order, another way is add all scripts having NewUserConnected to one :rolleyes:
Title:
Post by: PPK on 14 March, 2005, 13:30:15
I try to add script order change to PtokaX, this feature is already in my TODO  ;)
Title:
Post by: UwV on 14 March, 2005, 18:43:28
i tryed manual order didn't change anything .. :rolleyes:
Quote(even after commenting the return 1 in PPK's and changing it from aaa.lua to zzz.lua rebooting etc. etc.)
and hmm i guess the second option aint that bad ..
should be no too hard .. (to fit the anti no hash in the geo) ..

but like when i reload a script it also isn't really in the same dataflow order as in the list.. (only if i reload all) so manually reloading just one of the two after a full reload should then fix it and it doesn't..
also i noticed the dataflow is from z to a when the  list is a to z .. right ?
little confusing .. but has been like this since 15.xx already
.. ;0)
Title:
Post by: nEgativE on 21 March, 2005, 18:37:18
Hi there, i'm having the same problem, i think.. :(
Users disconnected by other scripts, are still being logged as being Online by GeoIP.. what could be the problem ?...
Title:
Post by: Dag on 08 May, 2005, 20:55:04
Hi there, can anyone help me pls?
I need to know if it's possible to write more than one country into Allow by Country Code?
Title:
Post by: ConejoDelMal on 09 May, 2005, 20:12:32
Is it possible that you release the source of the IpTables? cause i would need to update few ranges..
Title:
Post by: VidFamne on 23 May, 2005, 20:33:59
As I haven't been able to solve the issue with the
NewUserConnected function, I've removed some functions in the script.
Added  allowed CountryCode table, so now it's possibel to add several Countrys.
Updated the IP-range table, it now contains 73160 IP-ranges.
About the IP-ranges, they can be obtain by the MaxMind website.
The script;  
Title:
Post by: Psycho_Chihuahua on 23 May, 2005, 21:19:45
Vid i think something went wrong ^^ on your ftp i cant see anything  :(  and if i click on your link here i get a Site not available or something like that ....
Title:
Post by: VidFamne on 23 May, 2005, 21:57:16
Yeah, I know. Have struggled here, to get the ftp server
working behind my router. I see only 3 managed to download. But I am doing my best to fix it.  :))
Title:
Post by: Psycho_Chihuahua on 24 May, 2005, 03:13:07
Oh, well good Luck then  :D  Otherwise i could have put it Online on my webspace as well and post the link here

**Edit
For all those who have trouble getting it from Vid's FTP here's a HTTP Link (didn't work with IE so i used my FTP Client ^^ )

GeoIP5.01px (http://ptokax.psycho-chihuahua.net/Scripts/GeoIP5.01px.rar)
Title:
Post by: VidFamne on 24 May, 2005, 04:56:38
Thanks, Psycho_Chihuahua.  :))
Title:
Post by: Psycho_Chihuahua on 24 May, 2005, 15:27:34
No Problem Vid ^^

I translated it to German as well

German GeoIP (http://ptokax.psycho-chihuahua.net/Scripts/GeoIP5.01pxde.rar)   :D
Title:
Post by: yoonohoo on 24 May, 2005, 17:03:08
When using GeoIP and Guarding together the rigth click from Guarding disappears and GeoIP takes over.

More weird, this happens with all clients I've tried except DCDM 0.45.

If I understood Zigurds he/she has a similar problem.

How can I solve this?

Thanks
Title:
Post by: yoonohoo on 25 May, 2005, 01:35:32
Having problems with commands disappearing when using several scripts?

Before you change the scripts try the following:

Move the scripts around in the ptokax script editor and try having your security script in last (bottom)

It worked for me!

Thanks for nothing
Newbie
Title:
Post by: VidFamne on 25 May, 2005, 12:28:14
Please remove $UserCommand 255 7|
in the NewCon function  in ../Files/Func/fFunc.lua
I've placed this UserCommand there because I dont want multiple duplicates, of commands,
when I reconnects to the hub.
Title: Recoded GeoIP
Post by: Mogli on 25 June, 2005, 10:49:01
Hey VidFamne, I took your script and recoded it,
it is now 10 times faster uses 6 times more
memory per IPLookUp,

and you can update the GeoIP CVS file yourself.

GeoIP-0.2 (http://lua.uknnet.com/attachment.php?attachmentid=122&sid=)


P.S. When I did the testing, I noticed that
your script returns an error on certain IP's
that happens when instead of an GeoIPRangeFile
only "" is returned in function tSearch.
This might help
tSearchCountry = function(num)
    tGeoIpRange = {}
    local tGeoIpRangefile = f.tSearch(num)
    if tGeoIpRangefile ~= "" then
dofile(tGeoIpRangefile)
    end
    local C = ""
    local CC = ""
    local low=1
    local mid = 0
    local high=table.getn(tGeoIpRange)

    while low <= high  do
        mid = math.floor((low+high)/2)
            if  tGeoIpRange[mid][1] <= num and num <= tGeoIpRange[mid][2]  then
                C = tGeoIpRange[mid][4]
                CC = tGeoIpRange[mid][3]
            break end
                if tGeoIpRange[mid][1] > num then
                high = mid-1
                else low = mid+1
                end
    end
    tGeoIpRange = nil
    collectgarbage()
    return C,CC
end,
Title:
Post by: VidFamne on 25 June, 2005, 13:18:56
Sweet  :))
Nice coding Mogli - Chill
Title:
Post by: Mogli on 25 June, 2005, 16:54:43
thx :),
I like the readout from the CVS file,
I think there is no computer language that makes IO
so simple as LUA
Title:
Post by: the_pest on 30 June, 2005, 13:18:46
I like this script, but... in hub was 275 users online and script says that i have 325 user from my country in tha hub (i had about 50 users of my kind) :)  Scripts restart help but i can't do it every day... :(
Title:
Post by: Mogli on 02 July, 2005, 13:49:23
Yup you are right,
I think it happens when, the UserDisconnect is not
passed to the Scripts for some reason,

download here GeoIP-0.4 (http://lua.uknnet.com/attachment.php?attachmentid=132&sid=)
Title:
Post by: Mogli on 02 July, 2005, 18:51:04
okey I think I found the bugger,

I used this script

inum = 0

function NewUserConnected( user )
inum = inum + 1
if inum == 2 then
inum = 0
SendToAll( "Force Disconnect T1" )
user:Disconnect()
end
end

and this

function NewUserConnected()

SendToAll( "connected T2" )
end

function UserDisconnected()

SendToAll( "disconnected T2" )
end

now I connected with a client

these where the reults
[18:39] connected T2
[18:39] disconnected T2
[18:39] Force Disconnect T1
[18:39] connected T2

so I think Ptokax is going wrong here,
when a other script disconnects a user during NewUserConnected()
at least, the second script won't notice.
Damn and now I rescripted the script, hmm...
and thing is with that bug, the new method will go wrong too
Title:
Post by: PPK on 02 July, 2005, 23:00:48
QuoteOriginally posted by Mogli
so I think Ptokax is going wrong here,
when a other script disconnects a user during NewUserConnected()
at least, the second script won't notice.
In PtokaX is everything ok, if user is disconnected in NewUserConnected then is not added to hub and not fire UserDiscronnected -> UserDisconnected for this user only slow hub without any good reason.
Is easy to fix, geoip script must run last, and any script before with NewUserConnected must return 1 if disconnect user ;)
Title:
Post by: the_pest on 03 July, 2005, 12:34:40
QuoteOriginally posted by PPK
Is easy to fix, geoip script must run last, and any script before with NewUserConnected must return 1 if disconnect user ;)
unfortunately not. my GeoIP is last and every disconnectig, kicking or baning script listed before has return 1 :(
Title:
Post by: Mogli on 03 July, 2005, 12:50:25
Same here I changed the test script to return 1 on
force disconnect but nothing, also there is no note
about that in the scripting interface, saying return one
on userconnected will stop the hub from processing.
Title:
Post by: Mogli on 05 July, 2005, 16:36:56
New Version,
added 2 requests and optimised the OnlineUser
for the New Ptokax Release,
The Script should run as last script, or
after the last script that may disconnect a user
during NewUserConnected(), but as last
you are safe
Check the ChageLog in the script, for more info :)

GeoIP-0.5 (http://lua.uknnet.com/attachment.php?attachmentid=136&sid=)
Title:
Post by: Psycho_Chihuahua on 07 July, 2005, 13:44:32
[13:42] ...\0.3.3.1d.nt.dbg\scripts\GeoIP-0.5.lua:684: bad argument #1 to `open' (string expected, got nil)

running as only script on 0.3.3.1d Debug

First at hubstart the csv readout starts, then CPU Activity goes up to 100% and the hub does not react for approx 1 minute after that this error
running on windows 2003 with Sempron 3000+ and 1gig ram
Title:
Post by: Mogli on 08 July, 2005, 09:59:31
ah thx,
I missed that will fix it,
or if you don't want to wait then
replace
self:Save(  )  with this one in GeoIP:Main()
self:SaveDB( self._db, "IP-Bot/GeoIPDB.txt" )

and check for the first GeoIP:Save(... )  and replace by
GeoIP:SaveDB( ). else just wait a while I'll fix it and post
the working script then, I didn't notice, cause I didn't try to update the Range :S
Title:
Post by: Mogli on 08 July, 2005, 14:36:37
updated version
GeoIP-0.5a (http://lua.uknnet.com/attachment.php?attachmentid=137&sid=)
Title:
Post by: Mogli on 18 July, 2005, 12:00:32
New Version, see the Changelog for details,
and Note that you have to delete 2 files
cause these need to be updated one is

IP-Bot/CountryList.txt
and
IP-Bot/GeoIPDB.txt

the update will not take long a few seconds maximum

GeoIP-0.6 (http://lua.uknnet.com/attachment.php?attachmentid=144&sid=)
Title:
Post by: Psycho_Chihuahua on 18 July, 2005, 13:09:35
Gr8 Work Mogli/Chill  :D

Could you post it in the Script Db as well? Addy in my Sig ;)

Thnx a lot m8
Title:
Post by: nEgativE on 14 September, 2005, 16:07:35
Hi, where can i get Script Db for this script ? :) tks in advance. Mogli

Vidfamne, tell me, what is the latest version of your script ? Tks also.
Title:
Post by: Psycho_Chihuahua on 14 September, 2005, 16:19:55
QuoteOriginally posted by Luso
Hi, where can i get Script Db for this script ?

Quote--// "This product runs with GeoIP data created by MaxMind, available from http://maxmind.com/" //--

Download the latest GeoIP Country CSV Format (http://www.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip)
Title: Seculite
Post by: Bobby1999 on 14 September, 2005, 18:59:20
Any chance Mogli/Chill your gonna do a new lua 5 Seculite?
Title:
Post by: Mogli on 17 September, 2005, 13:54:20
Thx Psycho_Chihuahua :)
just one thing I'd like to add to update the

Database, you must deleted 2 files
1. GeoIPCountryWhois.csv  whitch you will replace by the new one
2. GeoIPDB.txt whitch will be newly created after script restart

I just forgot to also delete the second file

Bobby1999 about SecuLite, I am not quite sure,
if its only a specific function you'd like then just PM me,
but to convert the whole script might take a bit longer.

Anyways here is a new GeoIP version,
fixed a mistake and updated the shown statsdate

GeoIP-0.6a (http://lua.uknnet.com/attachment.php?attachmentid=171&sid=)
Title:
Post by: Psycho_Chihuahua on 17 September, 2005, 18:51:36
QuoteOriginally posted by Mogli

Thx Psycho_Chihuahua :)
No Problem m8, was easy to answer  :]



And as Usual  :D  here the Germanized Version

GeoIP-0.6a German (http://ptokax.psycho-chihuahua.net/Scripts/Deutsch/GeoIP-0.6a-German.rar)
Title: Seculite
Post by: Bobby1999 on 17 September, 2005, 22:45:06
I just liked the whole script ,but nps if its to much work :)))
Having run the latest geoIP
I like the inbuilt whois function of Seculite:)
Title:
Post by: the_pest on 20 September, 2005, 13:54:26
Add "no country limits for operators" to next version :)
Title: hmmm
Post by: Hades on 21 September, 2005, 08:35:16
looks like r click meny doesn't work :D
Title:
Post by: Mogli on 21 September, 2005, 13:42:09
the_pest:
I'll make an option for OP's to bypass
any check.

Hades:
Have you made any chages for this variable?
GeoIP._ShowPrefix
if not, then it sometimes can be that
a script that runs after GeoIP erases the clients right click menu.
Else maybe some more details would be helpfull.
Title: hmmm
Post by: Hades on 22 September, 2005, 03:54:45
geo-ip script runs as last one in my hub
however i didn't set prefix is this why?
Where i set the prefix also if this is not the problem may be hawks terminator has conflict ?It has own rclikc menu??
Title:
Post by: Mogli on 22 September, 2005, 10:40:36
No you are doing it all right,
if you haven't changed anything and the script runs as
last then you should be able to get the rightclick menue,
and as the script runs last the terminator script
cannot clear the right click menue.
But you can try to stop all other scripts, then reconnect
and check if you can get the right click menue.
If then start the other script again one by one,
and reconnect to see if you suddenly don't see the
rightclick menue anymore.
But if you cannot get the menue to work anyhow,
then I have no clue  ?(
Title: well tried
Post by: Hades on 23 September, 2005, 05:07:23
r click menu exists with or without terminator active and it's clickable.
Even appropriate command shows on mchaT but without prefix and doesn't do a thing.
I tried typing them manually in mchat with all prefixes i could possibly come up with so i think last geoip ver has commands problem - they won't work:P or may be i have to edit a few lines but have no clue wchich ones...:((
Title:
Post by: Psycho_Chihuahua on 23 September, 2005, 10:27:38
well its working fine here
Title:
Post by: Mogli on 29 September, 2005, 17:45:41
New Version,
its smaller and faster :)

GeoIP-0.7 (http://lua.uknnet.com/attachment.php?attachmentid=172&sid=)
Title:
Post by: SilvaO on 04 October, 2005, 10:30:32
Hi Mogli!
Is it possible to see all ips from eats country?
Is there a command to do that?
Title:
Post by: Mogli on 04 October, 2005, 14:17:03
Not yet,
I guess it could be added,
but tell me what do you need it for?
Title:
Post by: bastya_elvtars on 04 October, 2005, 15:49:16
QuoteOriginally posted by SilvaO
Hi Mogli!
Is it possible to see all ips from eats country?
Is there a command to do that?

It may be resource-intensive, maybe you should use the CSV directly.
Title:
Post by: SilvaO on 04 October, 2005, 17:00:41
QuoteOriginally posted by SilvaO
Hi Mogli!
Is it possible to see all ips from eats country?
Is there a command to do that?

QuoteOriginally posted by Mogli
Not yet,
I guess it could be added,
but tell me what do you need it for?

Ok!
Here in Portugal we have a limit about download traffic exp. National 20 GB of downloads, International 2 GB of downloads sow I like to know the traffic stats in my hub to bloke it, sow this way I  do not have to pay more, I like to have traffic control

PS. GeoIP it is a wonderful script , please continue with this out standing script.

Thank you SilvaO
Title:
Post by: Mogli on 04 October, 2005, 20:26:08
QuoteOriginally posted by SilvaO
Ok!
Here in Portugal we have a limit about download traffic exp. National 20 GB of downloads, International 2 GB of downloads sow I like to know the traffic stats in my hub to bloke it, sow this way I  do not have to pay more, I like to have traffic control

PS. GeoIP it is a wonderful script , please continue with this out standing script.

Thank you SilvaO

Now that is something, and always found my ISP shitty ;),
Well you could add Portugal to the Allowed countries and
remove All, but this could only minimalize the traffic a bit,
cause everybody is able to connect to your IP, I guess
these bytes can't be stoped by script, but I suppose
they are less than a passive searchreply or a huge userlist, check the rightclick menue for
Allowedcountries and let me know if it suits your needs
Title:
Post by: SilvaO on 06 October, 2005, 12:59:08
Thank you Mogli, works 100%
Title:
Post by: Mogli on 18 November, 2005, 15:13:43
-- V 0.7a
-- Top online Countries added ( Idea from UwV )
-- Added Saving All Stats to file ( requested by UwV )


GeoIP-0.7a (http://lua.uknnet.com/attachment.php?attachmentid=192&sid=)
Title: no requests ...
Post by: UwV on 18 November, 2005, 15:22:07
part 1--// geo-html-addon.v.1.7
--
--// GeoIP version  0.7a hmtl addon,  for: *Chilla tha spliff killa*  by: UwV (based most code on Mutor's webpack)
--// thanks for all the lessons sir Mowgli !!!
--
--// and thanks to Mutor to
--
--// Dependencies :
--// 1. Ptokax 0.3.3.21
--// 2. you need to have Mowgli's GeoIP-.lua  ( v.0.7a or higher) to run this.
--
--//  "This product runs with GeoIP-0.7a created by Chilla, available from http://board.univ-angers.fr"
--// You may use/copy/edit this code, but you may never compile one single bit of it
--// Open code rocks, I am not ashaimed of my sloppy coding :), I like it
--// Try to compile your words and then try to make yourself understood
--// Open Code is like sharing thaughts, and as we know sharing is caring, feels good
--//  "That product runs with GeoIP data created by MaxMind, available from http://maxmind.com/"

GenerateEvery = 2 -- minutes between page generation

--// set "filepath/name.html" for .html's, table headers & page tops
htmlfile1 = frmHub:GetPtokaXLocation().."html/webstats/geo-ip-onlinecountrys.html"
top1 = "GeoIP-LUA Live Online Country's for:"
header1l = "Rank" header1m = "Nr." header1r = "Country"

htmlfile2 = frmHub:GetPtokaXLocation().."html/webstats/geo-ip-connectionhistory.html"
top2 = "GeoIP-LUA Country Connection Count for:"
header2l = "Ranking" header2m = "Nr." header2r = "Country"

htmlfile3 = frmHub:GetPtokaXLocation().."html/webstats/geo-ip-onlinecountryhistory.html"
top3 = "GeoIP-LUA Top online Country History for:"
header3l = "Ranked" header3m = "Nr." header3r = "Countrys"

color1 = "#FF0023"
color2 = "#FFFF23"
color3 = "#23FF23"
--------- end user settings -------------------------------------
Title:
Post by: UwV on 18 November, 2005, 15:22:57
part 2
--// script start

dofile("IP-Bot/GeoIPFullStats.txt")
THEhub, daversion = getHubVersion()

function Main()
local fileinFolder = io.open( htmlfile1, "r" )
if not fileinFolder then
os.execute( "mkdir \""..frmHub:GetPtokaXLocation().."html/webstats" )
end
SetTimer(60000*GenerateEvery)
StartTimer()
OnTimer()
end

function OnTimer()
SaveOnlineHtml(htmlfile1, header1l, header1m, header1r)
SaveConnectHtml(htmlfile2,header2l, header2m, header2r)
SaveTopHtml(htmlfile3, header3l, header3m, header3r)
end

function SaveOnlineHtml(htmlfile, header1, header2, header3)
local totalonline = 0
local File = io.open(htmlfile, "w")
if File then
diff = nil
local t1 = os.clock()
File:write("\\\r\n \ GeoIP.lua  by: Mowgli for "..THEhub.." "..daversion..", Stats Provided by: -=D*S*N=-  DEEP SPACE NETWORK                    .\r\n\\r\n\\r\n")
File:write("\r\n\t\t\\\\"..top1.."\\\\"..frmHub:GetHubName().."\\\r\n\t\t")
File:write("\\r\n\t\t\t\\r\n")
File:write("\t\t\t\t\\
\\"..header1.."\\\\\\•\ \\"..header2.."\\\•\\\\\\\"..header3.."\\\\\\r\n")
for i,v in GeoIPOnlineCountries do
totalonline = totalonline + v[2]
File:write( "\t\t\t\t\\
\" ..i.. ".\t \\  \\•\ \"..v[2].." \•\\\"..v[1].."\\\\r\n")
end
File:write("\t\t\t\t\\
\Antennae Online\\  \\"..totalonline.." \ \\\"..os.date("%m/%d/%y  %I:%M %p ").."\\\r\n")
local diff = os.clock() - t1
File:write("\t\t\t\t\\
 \\ \\ \\\\r\n")
File:write("\t\t\t\t\\
\ Page last updated on:\\\ \\"..os.date("%m/%d/%y  %I:%M %p ").."\\\\r\n")
File:write("\t\t\t\t\\
\ Page generated in: \\\"..string.format("%.5f", diff ).."\\\ secs. by \LUA script \!!\\\\r\n")
File:write("\t\t\t\t\\
 \\ \\ \\\\r\n")
File:write("\t\t\t\\r\n\t\t\\r\n\t\\r\n\")
File:close()
else
File:write("")
end
end

function SaveConnectHtml(htmlfile, header1, header2, header3)
local totalconnects = 0
local File = io.open(htmlfile, "w")
if File then
diffa = nil
local t1a = os.clock()
File:write("\\\r\n \ GeoIP.lua  by: Mowgli for "..THEhub.." "..daversion..", Stats Provided by: -=D*S*N=-  DEEP SPACE NETWORK                    .\r\n\\r\n\\r\n")
File:write("\r\n\t\t\\\\"..top2.."\\\\"..frmHub:GetHubName().."\\\r\n\t\t")
File:write("\\r\n\t\t\t\\r\n")
File:write(" \t\t\t\t\\
\\\"..header1.."\\\ \ \•\ \\"..header2.."\\ \•\ \\\\\\"..header3.."\\\\\\r\n")
for i,v in GeoIPConnectCountries do
totalconnects = totalconnects + v[2]
File:write( "\t\t\t\t\\
\" ..i.. ".\t \\  \\•\ \"..v[2].." \•\\\"..v[1].."\\\\r\n" )
end
File:write( " \t\t\t\t\\
\Total Connections:\\ \"..totalconnects.."\ \\GeoIP started: "..GeoIPStatsDate.."\\\\r\n" )
local diffa = os.clock() - t1a
File:write("\t\t\t\t\\
 \\ \\ \\\\r\n")
File:write("\t\t\t\t\\
\ Page last updated on:\\\ \\"..os.date("%m/%d/%y  %I:%M %p ").."\\\\r\n")
File:write("\t\t\t\t\\
\ Page generated in: \\\"..string.format("%.5f", diffa ).."\\\ secs. by \LUA script \!!\\\\r\n")
File:write("\t\t\t\t\\
 \\ \\ \\\\r\n")
File:write("\t\t\t\\r\n\t\t\\r\n\t\\r\n\")
File:close()
else
File:write("")
end
end

function SaveTopHtml(htmlfile, header1, header2, header3)
local totalconnects = 0
local File = io.open(htmlfile, "w")
if File then
diffb = nil
local t1b = os.clock()
File:write("\\\r\n \ GeoIP.lua  by: Mowgli for "..THEhub.." "..daversion..", Stats Provided by: -=D*S*N=-  DEEP SPACE NETWORK                    .\r\n\\r\n\\r\n")
File:write("\r\n\t\t\\\\"..top3.."\\\\"..frmHub:GetHubName().."\\\r\n\t\t")
File:write("\\r\n\t\t\t\\r\n")
File:write(" \t\t\t\t\\
\\\"..header1.."\\\ \ \•\ \\"..header2.."\\ \•\ \\\\\\"..header3.."\\\\\\r\n")
for i,v in GeoIPMaxConnectedCountries do
totalconnects = totalconnects + v[2]
File:write( "\t\t\t\t\\
\" ..i.. ".\t \\  \\•\ \"..v[2].." \•\\\"..v[1].."\\\\r\n" )
end
local diffb = os.clock() - t1b
File:write("\t\t\t\t\\
 \\ \\ \\\\r\n")
File:write("\t\t\t\t\\
\ Page last updated on:\\\ \\"..os.date("%m/%d/%y  %I:%M %p ").."\\\\r\n")
File:write("\t\t\t\t\\
\ Page generated in: \\\"..string.format("%.5f", diffb ).."\\\ secs. by \LUA script \!!\\\\r\n")
File:write("\t\t\t\t\\
 \\ \\ \\\\r\n")
File:write("\t\t\t\\r\n\t\t\\r\n\t\\r\n\")
File:close()
else
File:write("")
end
end