Jump to content
  • 0

[Help] Can Lock This


Question

Posted

Hi all, i'm getting trouble in installing this Npc found in web ( i found 3 or 4 of them, all substantially equal)... can somebody write a guide for a poor noob like me? XD

13 answers to this question

Recommended Posts

  • 0
Posted

i create npc with ID 50300... i put the 50300.htm in HTML.. and i put the 50300_PKlist containing 1.htm and init.py file in gameserver - data- script - custom ... after that, i edit the data / script.properties and add the line in custom... start gameserver -->

 

 

Error on: C:\Users\Nicho\Desktop\L2j Server\gameserver\data\scripts\custom\50300_PKlist\__init__.py.error.log

Line: -1 - Column: -1

 

Traceback (innermost last):

  File "__init__.py", line 11, in ?

ImportError: no module named l2jfree

 

 

 

 

 

 

sorry for my BAD english :S

  • 0
Posted

in other words? :D

 

At begining, take a look at sticked guides related with L2J core, modifing, compiling etc.

 

You will understand most important things.

  • 0
Posted

pape90,

 

First of all what source code are you being using for your server?

L2jServer,L2jFree??

 

Secondly,could you please send me this part of your code?

 

importsm.jpg

 

- Rev

 

 

  • 0
Posted

I tried to modify the init.py.. now no error, but when i select pvp or pk list, a long script error window appears.

Here's the init.py file ( i have l2jserver)

 

 

# *************************
# PKlist Online
# Por ->K<-
# Mi primer gran programa en Python, 4 de Julio del 2008
# Este Script es para mostrar Online y por orden, los PKs del server.
# El problema que viene luego es la longitud del HTML, uno demasiado grande crasheara al cliente.
# *************************

import sys
from java.util                                   import Iterator
from com.l2jserver.util                    import Rnd
from com.l2jserver.gameserver.model.quest           import State
from com.l2jserver.gameserver.model.quest           import QuestState
from com.l2jserver.gameserver.model.quest.jython    import QuestJython as JQuest
from com.l2jserver.gameserver.network.serverpackets import CreatureSay
from com.l2jserver                                 import L2DatabaseFactory

print "importing custom: 50300_PKlist"

# ***************************************
# Inicializacion de Variables del Quest *
# ***************************************

NPC=[50300]
Precio_ID   = 57

QuestId     = 50300
QuestName   = "PKlist"
QuestDesc   = "custom"
InitialHtml = "1.htm"

# ************************
# Creando la Clase Quest *
# ************************

class Quest (JQuest) :

def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)

# ***********************
# Si hablas con el NPC: *
# ***********************
def onTalk (self,npc,player):
	return InitialHtml
# ***********************

# *****************************************************
# Ahora gobernamos los eventos que vienen desde el HTML
# *****************************************************
def onEvent(self,event,st):
	htmltext = event
	cantidad_pago = st.getQuestItemsCount(Precio_ID)

	# *********
	# PK info *
	# *********

	if event == "1" and cantidad_pago >= 3000 :
		st.takeItems(Precio_ID,3000)
		total_asesinados = 0
		htmltext_ini = "<html><head><title>Pk Info Online</title></head><body><table width=300><tr><td><font color =\"FF00FF\">Pos.</td><td><center><font color =\"FFFF00\">*** Player ***</color></center></td><td><center>*** Kills ***</center></td></tr>"
		htmltext_info =""			
		color = 1
		pos = 0
		con = L2DatabaseFactory.getInstance().getConnection(None)
		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
		con.close()
		return htmltext_pklist
	elif event == "1" and cantidad_pago < 3000 :
		htmltext = "<html><head><title>PK info Online</title></head><body><font color =\"FF0000\">Primero pagame...!! son 3000 adenas.</body></html>"
		return htmltext

	# **********
	# PvP info *
	# **********

	if event == "2" and cantidad_pago >= 3000 :
		st.takeItems(Precio_ID,3000)
		total_asesinados = 0
		htmltext_ini = "<html><head><title>PvP info Online</title></head><body><table width=300><tr><td><font color =\"FF00FF\">Pos.</td><td><center><font color =\"FFFF00\">*** Player ***</color></center></td><td><center>*** Kills ***</center></td></tr>"
		htmltext_info =""			
		color = 1
		pos = 0
		con = L2DatabaseFactory.getInstance().getConnection(None)
		pks = con.prepareStatement("SELECT char_name,pvpkills FROM characters WHERE pvpkills>0 and accesslevel=0 order by pvpkills desc limit 50")
		rs = pks.executeQuery()
		while (rs.next()) :
			char_name = rs.getString("char_name")
			char_pkkills = rs.getString("pvpkills")
			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) + " Kills.</center></body></html>"
		htmltext_pklist = htmltext_ini + htmltext_info + htmltext_end
		con.close()
		return htmltext_pklist
	elif event == "2" and cantidad_pago < 3000 :
		htmltext = "<html><head><title>PK info Online</title></head><body><font color =\"FF0000\">Primero pagame...!! son 3000 adenas.</body></html>"
		return htmltext

	# *************
	# Adenas info *
	# *************

	if event == "3" and cantidad_pago >= 100000 :
		st.takeItems(Precio_ID,100000)
		total_cantidad = 0
		htmltext_ini = "<html><head><title>Adena info Online</title></head><body><table width=300><tr><td><font color =\"FF00FF\">Pos.</td><td><center><font color =\"FFFF00\">*** Name ***</color></center></td><td><center>*** Adenas ***</center></td></tr>"
		htmltext_info =""			
		color = 1
		pos = 0
		con = L2DatabaseFactory.getInstance().getConnection(None)
		pks = con.prepareStatement("SELECT count,owner_id FROM items WHERE item_id=57 order by count desc limit 50")
		rs = pks.executeQuery()
		while (rs.next()) :
			cantidad = rs.getString("count")
			pj_id = rs.getString("owner_id")
			total_cantidad = total_cantidad + long(cantidad)
			pos = pos + 1
			posstr = str(pos)
			charname = con.prepareStatement("SELECT char_name FROM characters WHERE charId=" + pj_id)
			rs2 = charname.executeQuery()
			while (rs2.next()) :
				char_name = rs2.getString("char_name")
			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>" + cantidad + "</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>" + cantidad + "</center></td></tr>"
		htmltext_end = "</table><center><font color=\"FFFFFF\">" + "Los TOPS suman " + str(total_cantidad) + " adenas.</center></body></html>"
		htmltext_pklist = htmltext_ini + htmltext_info + htmltext_end
		con.close()
		return htmltext_pklist
	elif event == "3" and cantidad_pago < 3000 :
		htmltext = "<html><head><title>Adenas info Online</title></head><body><font color =\"FF0000\">Primero pagame...!! son 100k adenas.</body></html>"
		return htmltext


# *************************************************
# Insertando Quest en la lista de Quest disponibles
# *************************************************

QUEST       = Quest(QuestId,str(QuestId) + "_" + QuestName,QuestDesc)


for npcId in NPC:
QUEST.addStartNpc(npcId)
QUEST.addTalkId(npcId)

  • 0
Posted

First of all, next time put your code in quote/code block (I did it for you now)

 

Secondly, we need error logs to find out what can be wrong.

  • 0
Posted

Resolved. Error in importing, sorry for newbyeness and thx for the patience :D

 

 

Topic locked.

Guest
This topic is now closed to further replies.


  • Posts

    • 🔥 L2NeverPain – Opening this Friday! 🔥 The gates open 12 December 2025 – 20:00 (GMT+2). Prepare your squads, set your macros, and get ready for true StuckSub PvP.   Main +2 Sub. Balanced fights. Fresh start. Be there from the first minute.   🛡️Clan Leaders: You can register your clan on discord clan-register channel   🌐https://l2neverpain.com/ 🌐https://discord.gg/kNP3UXgkmN
    • Dear partners! At the moment we are in great need of the following positions: — Snapchat old and new accounts | With snapscores | Geo: Europe/USA | Full access via email/phone number — Reddit old (brute or hacked origin, self-registered) accounts with post and comment karma from 100 to 100,000+ | Full email access included — LinkedIn old accounts with real connections | Geo: Europe/USA | Full email access + active 2FA password — Instagram old accounts (2010–2023) | Full email access (possibly with active 2FA password) — Facebook old accounts (2010–2023) | Full email access (possibly with active 2FA password) | With friends or without friends | Geo: Europe/USA/Asia — Threads accounts | Full email access (possibly with active 2FA password) — TikTok/Facebook/Google ADS Agency advertising accounts — Email accounts: mail.ru, yahoo.com, gazeta.pl, gmx.ch / gmx.de / gmx.net (BUT NOT gmx.com) — Google ADS Manual Farm accounts (verified via email and phone number) | GEO: USA/Europe, mostly USA. — WhatsApp OLD Accounts — Twitter accounts with followers and posts (old accounts) Contact us via the details below. We will be glad to cooperate! We are also ready to consider other partnership and collaboration options. Active links to our projects: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Dear partners! At the moment we are in great need of the following positions: — Snapchat old and new accounts | With snapscores | Geo: Europe/USA | Full access via email/phone number — Reddit old (brute or hacked origin, self-registered) accounts with post and comment karma from 100 to 100,000+ | Full email access included — LinkedIn old accounts with real connections | Geo: Europe/USA | Full email access + active 2FA password — Instagram old accounts (2010–2023) | Full email access (possibly with active 2FA password) — Facebook old accounts (2010–2023) | Full email access (possibly with active 2FA password) | With friends or without friends | Geo: Europe/USA/Asia — Threads accounts | Full email access (possibly with active 2FA password) — TikTok/Facebook/Google ADS Agency advertising accounts — Email accounts: mail.ru, yahoo.com, gazeta.pl, gmx.ch / gmx.de / gmx.net (BUT NOT gmx.com) — Google ADS Manual Farm accounts (verified via email and phone number) | GEO: USA/Europe, mostly USA. — WhatsApp OLD Accounts — Twitter accounts with followers and posts (old accounts) Contact us via the details below. We will be glad to cooperate! We are also ready to consider other partnership and collaboration options. Active links to our projects: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • why is he still not banned? scammer
    • Complete verification on the services you need and unlock new earning opportunities. Use our newest service in the store: Learn more Active links: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. We would like to present to you the current list of promotions and special offers for purchasing products and services of our service: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 on your store balance or a 10–20% discount — just write your username after registering on our website using the following template: "SEND ME BONUS, MY USERNAME IS..." – you need to post this in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock