PtokaX forum

Stuff => Offtopic => Topic started by: Hades on 13 March, 2004, 01:17:29

Title: help vith vb!!!
Post by: Hades on 13 March, 2004, 01:17:29
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!!
Title:
Post by: pHaTTy on 13 March, 2004, 02:10:47
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
Title:
Post by: plop on 13 March, 2004, 03:26:51
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
Title:
Post by: pHaTTy on 13 March, 2004, 06:15:17
well i know vb, but i dont know nmdc scripting

ie userlist etc
Title: lol
Post by: Hades on 13 March, 2004, 22:56:04
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???
Title:
Post by: Odin on 13 March, 2004, 23:59:48
A great resource when it comes to VB script is DC++ The New Decade (http://dc.ww-ei.com/)

Try post Ur request there...
Title: tiaa
Post by: Hades on 14 March, 2004, 02:57:25
this link does't give me obvious vb scripting category:((
Title:
Post by: plop on 14 March, 2004, 04:13:28
QuoteOriginally posted by Hades
this link does't give me obvious vb scripting category:((
check there forum, it's there.

plop
Title:
Post by: HaArD on 14 March, 2004, 05:21:06
http://dc.ww-ei.com/index.php?act=SF&f=5
Title:
Post by: [NL]Pur on 14 March, 2004, 11:34:59
why not just go to the much more powerfull ptokax :)
and use the LUA geoip script  ^.^
Title: Hmmm PLOP
Post by: Hades on 15 March, 2004, 03:49:40
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?
Title:
Post by: plop on 15 March, 2004, 10:02:42
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
Title:
Post by: [NL]Pur on 15 March, 2004, 10:51:00
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.