Can someone convert this so instead of giving me:
example:
Hades form United Stated
Guru from Russia
etc....
Will give me this:
There is 20 users from USA
40 from russia etc.
..........
Code is in vb script i know this is lua section but i'm sure u uyz know vb as well
'USERS' COUNTRIES by FLiXD
Dim GeoIP, oCountry, sUserName, sReply
Sub Main()
Set GeoIP = CreateObject("GeoIPCOM.GeoIP")
GeoIP.loadDataFile ("GeoIP.dat") '<- use full file path here if database is not in your DC Hub's folder
Set oCountry = CreateObject("Scripting.Dictionary")
For Each User in ColUsers
If Not oCountry.Exists(LCase(User.sName)) Then oCountry(LCase(User.sName))=Cstr(GeoIP.country_name_by_name(User.IP))
Next
End Sub
Sub OpConnected(curUser)
Call NewUserConnected(curUser)
End Sub
Sub NewUserConnected(curUser)
sUserName = CStr(curUser.sName)
If Not oCountry.Exists(LCase(sUserName)) Then oCountry(LCase(sUserName))=Cstr(GeoIP.country_name_by_name(curUser.IP))
End Sub
Sub DataArival(curUser, sCurData)
If Instr(sCurData, "<") And Instr(LCase(sCurData), "+country ") Then curUser.PrivateMessage "Country", Cstr(AfterFirst(sCurData, "+country "))+" is from "+oCountry(LCase(Cstr(AfterFirst(sCurData, "+country "))))
If Instr(sCurData, "<") And Instr(LCase(sCurData), "+countryall") Then Call CountryAll(curUser)
End Sub
Sub CountryAll(curUser)
sReply="Users by Country:"
For Each User In colUsers
If oCountry.Exists(LCase(User.sName)) Then sReply=sReply+vbCrLf+" ? "+Cstr(User.sName)+" is from "+Cstr(oCountry(LCase(User.sName)))
Next
curUser.SendChatMessage cstr(sBotName), Cstr(sReply)
End Sub
Function AfterFirst(sIn, sFirst)
AfterFirst = Right(sIn, Len(sIn) - InStr(1, sIn, sFirst) - (Len(sFirst) - 1))
End Function
.......
Thanx in advance!!
hmm well this is lua section, and its request for scripts not help, but ill move it to offtpopic, hmm ill have a think about it, not messed with vb for a while
QuoteOriginally posted by Hades
Code is in vb script i know this is lua section but i'm sure u uyz know vb as well
i'm proud 2 say that i don't know vb. lol
but there must be some1 around able 2 help you.
plop
well i know vb, but i dont know nmdc scripting
ie userlist etc
i got scared u deleted my post!!
Couldn,t find it:))
Pls help me here or may be someone knows link to alive vbscripting forum???
A great resource when it comes to VB script is DC++ The New Decade (http://dc.ww-ei.com/)
Try post Ur request there...
this link does't give me obvious vb scripting category:((
QuoteOriginally posted by Hades
this link does't give me obvious vb scripting category:((
check there forum, it's there.
plop
http://dc.ww-ei.com/index.php?act=SF&f=5
why not just go to the much more powerfull ptokax :)
and use the LUA geoip script ^.^
Lua Geo-Ip bot???
...
I posted 3 times in script request and never had any luck with it.
Does it exist??
Give me a working link!!
......
One more question by the way.
Is hultihub search working in ptokax 15.25 somehow can't get it to work!!
And does it connect searches or only chatts?
QuoteOriginally posted by Hades
Lua Geo-Ip bot???
...
I posted 3 times in script request and never had any luck with it.
Does it exist??
Give me a working link!!
......
i only know about a c++ version of this which can be found on sourceforge.net.
plop
my wrong sorry
i thought it was build already, i remember such thread on old lua forum.
But i can't find the script anywhere.