PvP Pk List on python

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
Violence
Posts: 44
Joined: Sat Oct 27, 2012 1:45 pm

PvP Pk List on python

Post by Violence »

L2J Revision 6089:
L2JDP Revision 9842:

problem with script code ...

Code: Select all

            if event == "01":             con = L2DatabaseFactory.getInstance().getConnection()             total_asesinados = 0             htmltext_ini = "<html><head><title>PG-L2 PK INFO</title></head><body><table width=300><tr><td><font color =\"FF00FF\">Pos.</td><td><center><font color =\"FFFF00\">*** Player ***</color></center></td><td><center>*** Kill's ***</center></td></tr>"             htmltext_info =""             color = 1             pos = 0             pks = con.prepareStatement("SELECT char_name,pkkills FROM characters WHERE pkkills>0 and accesslevel=0 order by pkkills desc limit 50")             rs = pks.executeQuery()             while (rs.next()) :               char_name = rs.getString("char_name")               char_pkkills = rs.getString("pkkills")               total_asesinados = total_asesinados + int(char_pkkills)               pos = pos + 1               posstr = str(pos)               if color == 1:                  color_text = "<font color =\"00FFFF\">"                  color = 2                  htmltext_info = htmltext_info + "<tr><td><center><font color =\"FF00FF\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td><td><center>" + char_pkkills + "</center></td></tr>"               elif color == 2:                  color_text = "<font color =\"FF0000\">"                  color = 1                  htmltext_info = htmltext_info + "<tr><td><center><font color =\"FF00FF\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td><td><center>" + char_pkkills + "</center></td></tr>"             htmltext_end = "</table><center><font color=\"FFFFFF\">" + "A Total of " + str(total_asesinados) + " Pk's.</center></body></html>"             htmltext_pklist = htmltext_ini + htmltext_info + htmltext_end             L2DatabaseFactory.close(con)             return htmltext_pklist
Attrubute error: class 'com.l2jserver.l2databasefactory' has no attribute 'close'

[P/s] It seems to have seen a couple of similar topics on the forum, but they are yet to me did not help , and sorry for my bad english i'm use google translator.
[P.S] Sorry for my bad English
xban1x
L2j Veteran
L2j Veteran
Posts: 1228
Joined: Thu Jan 17, 2013 9:46 am

Re: PvP Pk List on python

Post by xban1x »

viewtopic.php?f=13&t=20806 - rather use this, although it could be a bit better.
Post Reply