PtokaX forum

Archive => Archived 5.1 boards => Request for scripts => Topic started by: TrIp-iN-SuN on 18 August, 2006, 16:05:44

Title: need help find script GeoIp To LUA 5.1
Post by: TrIp-iN-SuN on 18 August, 2006, 16:05:44
same one can to convert geoip from lua5.0 to lua 5.1 or make new one?
Title: Re: need help find script GeoIp To LUA 5.1
Post by: [HE]Newbie on 18 August, 2006, 20:53:02
You can convert it yourself probably, with Mutor's Lua50to51 script, if you have any problems just post it here but i think its fair that you try it your own

Greetz [NL][Newbie][NL]
Title: Re: need help find script GeoIp To LUA 5.1
Post by: TrIp-iN-SuN on 19 August, 2006, 12:55:12
i try and it's don't work i get this error
Syntax ...s and Settings\TrIp-iN-SuN\Desktop\Copy of Psy Mission\scripts\geoip.lua:1: 'end' expected near '<eof>'

in that script
Code (lua) Select
function Main()
    nr = 10 --<------Numbers of "Toppers" You want to show
    f = {}
    tCnumb = {}
    CountryCode = "ALL"--<--- the default value
    OpConnected = NewUserConnected
    OpDisconnected = UserDisconnected
   ) dofile("Files/Func/fFunc.lua")
   ) dofile("Files/Func/pCommand.lua")
   ) dofile("Files/Saves/Cnumb.txt")
        if frmHub:GetUsersCount() == 0 then
        tCnumb={}
        end
end

function OnExit()
    return f.save("Files/Saves/Cnumb.txt", tCnumb)
end

function ChatArrival(User, msg)
    local _,_,cmd,arg = string.find( msg, "^%b<>%s(%S+)%s?(%S*)|$" )
        if cmd and pCommand[cmd] then return pCommand[cmd](User, arg) end
end

function NewUserConnected(User)
    return f.Newcon(User)
end

function UserDisconnected(User)
    return f.UserDisc(User)
end

Title: Re: need help find script GeoIp To LUA 5.1
Post by: Herodes on 19 August, 2006, 13:03:18
Why don't you point the file-script you want to convert ?
Title: Re: need help find script GeoIp To LUA 5.1
Post by: Alexinno on 19 August, 2006, 13:11:11
I think GeoIP-0.7a.lua works with Px Lua 5.1.1 too , you could try it ;)
Title: Re: need help find script GeoIp To LUA 5.1
Post by: Psycho_Chihuahua on 19 August, 2006, 13:33:09
Quote from: TrIp-iN-SuN on 19 August, 2006, 12:55:12
Syntax ...s and Settings\TrIp-iN-SuN\Desktop\Copy of Psy Mission\scripts\geoip.lua:1: 'end' expected near '<eof>'

that means there is an 'end' missing in the script
Title: Re: need help find script GeoIp To LUA 5.1
Post by: UwV on 19 August, 2006, 14:37:24
i dont remeber me changing anything in this version .. but here you go..
Code (lua) Select


--// GeoIP V 0.7a by Mogli //--
--// Rescripted Version of GeoIP from VidFamne //--

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

--// 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 //--


--// INSTALLATION //--
-- This script must run as last script, and all other scripts, must return 1 after user:Disconnect() in NewUserConnected()

--// CHANGELOG //--

-- V 0.7a
-- Top online Countries added ( Idea from UwV )
-- Added Saving All Stats to file ( requested by UwV )

-- V 0.7 ( NOTE, due to changes please delete the file "GeoIPDB.txt", then restart scripts )
-- Removed TSDB, without memory boost but way better perfomance :)
-- Rewritten IPBot to speed up loading and saving and keep up performance

-- V 0.6b
-- Added option for OPs/Masters to be immune and bypass any security check, by default enabled to set immune profiles check for GeoIP._ImmuneProfs
-- Added showing of countrycode at get country by nick and by ip
-- Some grammar updates and visual updates in the edit section

-- V 0.6a 12.09.05
-- Fixed error on IP's that where not in the db, check the IPBot for details ( thx for mentioning it Mike )
-- Date now shows like "September the 11th '05"

-- V 0.6 - 18.7.05
-- NOTE: Due to changes you need to deleted these files "GeoIPDB.txt" and "CountryList.txt", and then restart scripts
-- Added, option to set UserLimit for 'Other', meaning that all other countries, not in the list are considered 'Other', cmd: countrylimit Other <limit>
-- Added CountryCode to DB, and option to force user to have [cc]nick as their nick, requested by the_pest, check for GeoIP._forcecc
-- Fixed some stupid errors

-- V 0.5a - 6.7.05
-- Optimised Parsing of MaxMind GeoIP DB, since file has binary format

-- V 0.5 -  5.7.05
-- Optimised Online User Table, script needs to run as last script and other scripts before GeoIP, must return 1 if it disconnects  a user during NewUserConnected
-- Added Userlimit/Country, reuqested by the_pest, when limit is 0 then it is removed
-- Command get UserCountry, will now only check the onlinelookuptable, for that user ( faster )
-- Added Option to set Command Prefixes, requested by UwV

-- V 0.4 -  2.7.05
-- Fixed: Online user listing, keep onlineuser lookuptable idea by UwV :), should be more acurate maby wrong by one or two, but not growing
-- and one can store the country, so it must not be searched again on disconnect :), little speed tweaking
-- added Disconnect if not in GeoIP DB, check for 'GeoIP._DisconnectOnNotGeoIP', by default it is disabled, enable it, if you use GeoIP to only let in certain countries
-- added testing sequence, set dotest in Main to 1 e.g.  dotest = 1
-- added table for Countries, so list only is updated once on script start ( may take some while loading, but only once, then it reads from file CountryList.txt )

-- V 0.3 - 27.6.2005
-- Fixed: Showonline, when country has 0 users it is removed from list
-- Added Saving Of Stats and command to clear stats
-- Added Max Online Stats
-- Master: Command: Add/Del Allow Countries (Only by Countryname and not by Countrycode)
-- Master: Command: Add/Del Disallow Countries (Only by Countryname and not by Countrycode)
-- Master: Command: List Available Countries

-- V 0.2
-- Stripped from VidFamnes GeoIP

-- // Stats //--

-- Tested on 1 GHz ( Bot is now almost 20 times faster )
-- GeoIP-0.7: CVS: Added Ranges: 74040
-- GeoIP-0.7: CVS: Time used: 6.3910 seconds   avg; 0.0001
-- GeoIP-0.7: Tested 1000 UserConnects & Disconnects in 0.06300 secs. avg: 0.00006
-- IP-Bot: Tested 100000 Lookups in 4.62500 secs. avg: 0.00005
-- Load Ranges: 0.875

-- GeoIP-0.6: Tested 1000 UserConnects in 1.07800 secs. avg: 0.00108 on 2.0 GHz mem 6900 kb
-- GeoIP-0.5b: Tested 1000 UserConnects in 0.98400 secs. avg: 0.00098 on 2.0 GHz mem 6900 kb
-- GeoIP-0.5a: Tested 1000 UserConnects in 0.98400 secs. avg: 0.00098 on 2.0 GHz mem 6547 kb
-- GeoIP-0.5a: CVS: Added Ranges: 74161
-- GeoIP-0.5a: CVS: Time used: 7.8750 seconds   avg; 0.0001 on 2.0 GHz
-- GeoIP-0.5: Tested 1000 UserConnects in 0.56300 secs. avg: 0.00056 on 2.4 GHz, Mem: 6546 kb
-- GeoIP-0.4: Tested 1000 Connects in 0.62500 secs. avg: 0.00063 on 2.4 GHz



incase i did change somehting ..
well .. get attachment since the scripts is too big for posting..
Title: Re: need help find script GeoIp To LUA 5.1
Post by: modular on 19 August, 2006, 18:47:55
Quote from: UwV on 19 August, 2006, 14:37:24
i dont remeber me changing anything in this version .. but here you go..

you bloody hippie  being all nice and all    ;)  ... 
Title: Re: need help find script GeoIp To LUA 5.1
Post by: TrIp-iN-SuN on 20 August, 2006, 14:55:57
how i changed too all users allwoed to enter becose no one can't to enter to hub?
Title: Re: need help find script GeoIp To LUA 5.1
Post by: UwV on 20 August, 2006, 15:19:47
Quote from: modular on 19 August, 2006, 18:47:55
you bloody hippie  being all nice and all    ;)  ... 

Quote from: TrIp-iN-SuN on 20 August, 2006, 14:55:57
how i changed too all users allwoed to enter becose no one can't to enter to hub?
nice but not that nice  modular
and not a hippie, a freak maybe but not a hippie ..     ;)   
well TrIp-iN-SuN i guess you are missing some files etc. and you need to get the rest of the geo ip script somewhere on this board .. look for : GeoIP V 0.7a by Mogli
Title: Re: need help find script GeoIp To LUA 5.1
Post by: Psycho_Chihuahua on 20 August, 2006, 17:40:56
it can be found in the scriptdb --> http://scriptdb.ptokax.ath.cx (new addy ;) )
Title: Re: need help find script GeoIp To LUA 5.1
Post by: TrIp-iN-SuN on 21 August, 2006, 00:46:41
to umv i have this virion but don't find where i can open to all users
Title: Re: need help find script GeoIp To LUA 5.1
Post by: UwV on 21 August, 2006, 00:50:57
as far as i know it is open to all users by default .. try a fresh instal of the script and all files.