Jump to content
  • 0

__init__.py.error.log


Question

Posted

I get the following error:

 

Error on: C:\Lineage Server\Epilogue Server\gameserver\data\scripts\custom\7206_CustomInfo\__init__.py.error.log

Line: -1 - Column: -1

 

Traceback (innermost last):

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

ImportError: no module named net

 

My init file looks as follows:

 

#Jython-based Top PvP Manger
import sys
from java.util                                   import Iterator
from net.sf.l2j.gameserver.model.quest           import State
from net.sf.l2j.gameserver.model.quest           import QuestState
from net.sf.l2j.gameserver.model.quest.jython    import QuestJython as JQuest
from net.sf.l2j.gameserver.network.serverpackets import CreatureSay
from net.sf.l2j                                  import L2DatabaseFactory

# ***************************************
# Info of custom quest                  *
# ***************************************

qn = "7206_CustomInfo"

NPCS = [7206]
Precio_ID   = 57

QuestId     = 7206
QuestName   = "CustomInfo"
QuestDesc   = "custom"
InitialHtml = "1.htm"

# ***************************************
# Jython Code                           *
# ***************************************



class Quest (JQuest) :

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

def onTalk (self,npc,player):
	return InitialHtml

def onEvent(self,event,st):
	htmltext = event
	cantidad_pago = st.getQuestItemsCount(Precio_ID)

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

	if event == "1" :
		total_asesinados = 0
		htmltext_ini = "<html><head><title>TOP PK</title></head><body><table width=300><tr><td><font color =\"FF0000\"><center>Pos.</center></td><td><center><font color =\"FF0000\">Player name</color></center></td><td><center>Kills</center></td></tr>"
		htmltext_info =""			
		color = 1
		pos = 0
		con = L2DatabaseFactory.getInstance().getConnection()
		pks = con.prepareStatement("SELECT char_name,pkkills FROM characters WHERE pkkills>0 and accesslevel=0 order by pkkills desc limit 15")
		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 =\"FFFFFF\">"
				color = 2
				htmltext_info = htmltext_info + "<tr><td><center><font color =\"FFFFFF\"><center>" + posstr + "</center></td><td><center>" + color_text + char_name +"</center></td><td><center>" + char_pkkills + "</center></td></tr>"
			elif color == 2:
				color_text = "<font color =\"23ADC2\">"
				color = 1
				htmltext_info = htmltext_info + "<tr><td><center><font color =\"23ADC2\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td><td><center>" + char_pkkills + "</center></td></tr>"
		htmltext_end = "</table></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" :
		total_asesinados = 0
		htmltext_ini = "<html><head><title>TOP PvP</title></head><body><table width=300><tr><td><font color =\"FF0000\"><center>Pos.</center></td><td><center><font color =\"FF0000\">Player name</color></center></td><td><center>Kills</center></td></tr>"
		htmltext_info =""			
		color = 1
		pos = 0
		con = L2DatabaseFactory.getInstance().getConnection()
		pks = con.prepareStatement("SELECT char_name,pvpkills FROM characters WHERE pvpkills>0 and accesslevel=0 order by pvpkills desc limit 15")
		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 =\"FFFFFF\">"
				color = 2
				htmltext_info = htmltext_info + "<tr><td><center><font color =\"FFFFFF\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td><td><center>" + char_pkkills + "</center></td></tr>"
			elif color == 2:
				color_text = "<font color =\"23ADC2\">"
				color = 1
				htmltext_info = htmltext_info + "<tr><td><center><font color =\"23ADC2\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td><td><center>" + char_pkkills + "</center></td></tr>"
		htmltext_end = "</table></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" :
		total_cantidad = 0
		htmltext_ini = "<html><head><title>Top Adena</title></head><body><table width=300><tr><td><font color =\"FF0000\"><center>Pos.</center></td><td><center><font color =\"FF0000\">Player name</color></center></td><td><center>Adenas</center></td></tr>"
		htmltext_info =""			
		color = 1
		pos = 0
		con = L2DatabaseFactory.getInstance().getConnection()
		pks = con.prepareStatement("SELECT count,owner_id FROM items WHERE item_id=57 order by count desc limit 20")
		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 =\"FFFFFF\">"
				color = 2
				htmltext_info = htmltext_info + "<tr><td><center><font color =\"FFFFFF\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td><td><center>" + cantidad + "</center></td></tr>"
			elif color == 2:
				color_text = "<font color =\"23ADC2\">"
				color = 1
				htmltext_info = htmltext_info + "<tr><td><center><font color =\"23ADC2\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td><td><center>" + cantidad + "</center></td></tr>"
		htmltext_end = "</table></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

 

		# *************
	# Nobless info *
	# *************

	if event == "4" :
		total_asesinados = 0
		htmltext_ini = "<html><head><title>Top Nobless order by PvP</title></head><body><table width=300><tr><td><center><font color =\"FF0000\">Pos.</td></center><td><center><font color =\"FF0000\">Player name</color></center></td></tr>"
		htmltext_info =""			
		color = 1
		pos = 0
		con = L2DatabaseFactory.getInstance().getConnection()
		pks = con.prepareStatement("SELECT char_name,pkkills,nobless FROM characters WHERE pkkills>0 and accesslevel=0 order by pkkills desc limit 10")
		rs = pks.executeQuery()
		while (rs.next()) :
			char_name = rs.getString("char_name")
			char_pkkills = rs.getString("nobless")
			pos = pos + 1
			posstr = str(pos)
			if color == 1:
				color_text = "<font color =\"FFFFFF\">"
				color = 2
				htmltext_info = htmltext_info + "<tr><td><center><font color =\"FFFFFF\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td></tr>"
			elif color == 2:
				color_text = "<font color =\"23ADC2\">"
				color = 1
				htmltext_info = htmltext_info + "<tr><td><center><font color =\"23ADC2\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td></tr>"
		htmltext_end = "</table></body></html>"
		htmltext_pklist = htmltext_ini + htmltext_info + htmltext_end
		con.close()
		return htmltext_pklist
	elif event == "4" 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

	# **********
	# Clan Top *
	# **********

	if event == "5" :
		total_asesinados = 0
		htmltext_ini = "<html><head><title>TOP Clan</title></head><body><table width=300><tr><td><font color =\"FF0000\"><center>Pos.</center></td><td><center><font color =\"FF0000\">Clan name</color></center></td><td><center>Level</center></td></tr>"
		htmltext_info =""			
		color = 1
		pos = 0
		con = L2DatabaseFactory.getInstance().getConnection()
		pks = con.prepareStatement("SELECT clan_name,clan_level,reputation_score FROM clan_data WHERE clan_level>0 order by clan_level desc limit 10")
		rs = pks.executeQuery()
		while (rs.next()) :
			char_name = rs.getString("clan_name")
			char_pkkills = rs.getString("clan_level")
			total_asesinados = total_asesinados + int(char_pkkills)
			pos = pos + 1
			posstr = str(pos)
			if color == 1:
				color_text = "<font color =\"FFFFFF\">"
				color = 2
				htmltext_info = htmltext_info + "<tr><td><center><font color =\"FFFFFF\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td><td><center>" + char_pkkills + "</center></td></tr>"
			elif color == 2:
				color_text = "<font color =\"23ADC2\">"
				color = 1
				htmltext_info = htmltext_info + "<tr><td><center><font color =\"23ADC2\">" + posstr + "</td><td><center>" + color_text + char_name +"</center></td><td><center>" + char_pkkills + "</center></td></tr>"
		htmltext_end = "</table></body></html>"
		htmltext_pklist = htmltext_ini + htmltext_info + htmltext_end
		con.close()
		return htmltext_pklist
	elif event == "5" 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


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

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

 

I cant find the problem :/

Thanks for any help received.

13 answers to this question

Recommended Posts

  • 0
Posted

from net.sf.l2j.gameserver.model.quest          import State

from net.sf.l2j.gameserver.model.quest          import QuestState

from net.sf.l2j.gameserver.model.quest.jython    import QuestJython as JQuest

from net.sf.l2j.gameserver.network.serverpackets import CreatureSay

from net.sf.l2j                                  import L2DatabaseFactory

 

if i remember for epilogue is com.sf.l2j or something like this

  • 0
Posted

from net.sf.l2j.gameserver.model.quest          import State

from net.sf.l2j.gameserver.model.quest          import QuestState

from net.sf.l2j.gameserver.model.quest.jython    import QuestJython as JQuest

from net.sf.l2j.gameserver.network.serverpackets import CreatureSay

from net.sf.l2j                                  import L2DatabaseFactory

 

if i remember for epilogue is com.sf.l2j or something like this

U're wrong ... for epilogue is com.l2jserver
  • 0
Posted

change this

 

from java.util                                   import Iterator
from net.sf.l2j.gameserver.model.quest           import State
from net.sf.l2j.gameserver.model.quest           import QuestState
from net.sf.l2j.gameserver.model.quest.jython    import QuestJython as JQuest
from net.sf.l2j.gameserver.network.serverpackets import CreatureSay
from net.sf.l2j                                  import L2DatabaseFactory

 

for this

 

from java.util                                   import Iterator
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

 

 

  • 0
Posted

Thank you and i'll try it asap :)

 

 

EDIT:

 

CAnt seem to get it going but i try to figure it out and learn a bit more about qusts :)

  • 0
Posted

Which means that you are using this version. So the imports have to stay as "net.sf.l2j" and not "com.l2jserver". BUT! The Error log says: "ImportError: no module named net". This means that you are using another Gracia Final Pack. The only thing you'll have to do, will be to change the imports depending on the imports of your serverpack.

Guest
This topic is now closed to further replies.


  • Posts

    • Thnx for share, i can't pm u for password  
    • I'm looking for the best current files that are up to date for the year 2025, not files that are stuck in 2020.
    • EXOPLANET 2.0     GRAND OPENING 09.05.2025 We are thrilled to announce the upcoming launch of a brand new server. This isn’t just a copy of the previous server – it’s the next step in the development of Exoplanet. Based on our past experience, we’re bringing you a server that is faster, more stable, and more fun than ever before.     GRAND OPENING:  09.05.2025 at 20:00 GMT+1 BETA TEST:   04.05.2025    Client: High Five Rates: x10   Website: https://l2exoplanet.net Facebook: https://www.facebook.com/L2-Exoplanet-106811564103836 Discord: https://discord.gg/4fzhW7ZSPc         Game Rates    Experience: x10  Skill Points: x10  Adena: x8  Drop: x8  Spoil: x8  Quest: x5  Raid Boss Drop: x5  Fame: x2  Epaulette: x8  Manor: x8      Safe Enchant: +3  Maximum Enchant: +16  Normal Scroll Chance: 60%  Blessed Scroll Chance: 63%  Attribute Stone Chance: 50%  Attribute Crystal Chance: 30%      Game Settings    Multibox - 3 game clients per HWID  Autoloot  Autolearn Skills Auto Farm  NPC Buffer   Buff Slots (24+4/12)  Buff Duration (2h)  Olympiad Period 7days (new heroes appear every monday)  Seven Signs Period  Class Transfer for Adena  Max Sub-Class 3  Sub-Class Max Level 85  Essence Interface  Champions System  Vote Reward System  Dayli Reward System  PC Points Reward (500PC = 1 Donate Coin)      Epic Bosses Respawn Times     Queen Ant:  24 Hours +/- 4 Hours   Beleth: 3 Days +/- 8 Hours   Baium: 3 Days +/- 8 Hours   Antharas: 4 Days +/- 8 Hours   Valakas:  5 Days +/- 8 Hours     Instance Info     Normal Freya = 6 Players   Hard Freya = 12 Players   Frintezza = 6 Players   Zaken 83 Day = 6 Players   Zaken 60 Day = 6 Players   Zaken Nightly = 9 Players   Tiat = 6 Players   Beleth = 12 Players
    • EXOPLANET 2.0     GRAND OPENING 09.05.2025 We are thrilled to announce the upcoming launch of a brand new server. This isn’t just a copy of the previous server – it’s the next step in the development of Exoplanet. Based on our past experience, we’re bringing you a server that is faster, more stable, and more fun than ever before.     GRAND OPENING:  09.05.2025 at 20:00 GMT+1 BETA TEST:   04.05.2025    Client: High Five Rates: x10   Website: https://l2exoplanet.net Facebook: https://www.facebook.com/L2-Exoplanet-106811564103836 Discord: https://discord.gg/4fzhW7ZSPc         Game Rates    Experience: x10  Skill Points: x10  Adena: x8  Drop: x8  Spoil: x8  Quest: x5  Raid Boss Drop: x5  Fame: x2  Epaulette: x8  Manor: x8      Safe Enchant: +3  Maximum Enchant: +16  Normal Scroll Chance: 60%  Blessed Scroll Chance: 63%  Attribute Stone Chance: 50%  Attribute Crystal Chance: 30%      Game Settings    Multibox - 3 game clients per HWID  Autoloot  Autolearn Skills Auto Farm  NPC Buffer   Buff Slots (24+4/12)  Buff Duration (2h)  Olympiad Period 7days (new heroes appear every monday)  Seven Signs Period  Class Transfer for Adena  Max Sub-Class 3  Sub-Class Max Level 85  Essence Interface  Champions System  Vote Reward System  Dayli Reward System  PC Points Reward (500PC = 1 Donate Coin)      Epic Bosses Respawn Times     Queen Ant:  24 Hours +/- 4 Hours   Beleth: 3 Days +/- 8 Hours   Baium: 3 Days +/- 8 Hours   Antharas: 4 Days +/- 8 Hours   Valakas:  5 Days +/- 8 Hours     Instance Info     Normal Freya = 6 Players   Hard Freya = 12 Players   Frintezza = 6 Players   Zaken 83 Day = 6 Players   Zaken 60 Day = 6 Players   Zaken Nightly = 9 Players   Tiat = 6 Players   Beleth = 12 Players      
  • Topics

×
×
  • Create New...