Voled 183 Опубликовано 26 сентября, 2012 (изменено) Я особо не разбираюсь в скриптах ) Ошибка Error on: D:\server\gameserver\data\scripts\custom\9215_statystikaServera\__init__.py.error.log Line: -1 - Column: -1 Traceback (innermost last): (no code object) at line 0 SyntaxError: ('Lexical error at line 1, column 1. Encountered: "\\u00ff" (255), after : ""', ('__init__.py', 1, 1, '\xFFimport sys')) Там пытался изменить немного под себя , не получилось почему то создать в другой теме , да и сам скрипт почему то тоже не смог суда всунуть. Изменено 26 сентября, 2012 пользователем Voled Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
Voled 183 Опубликовано 26 сентября, 2012 (изменено) import sys from java.util import Iterator from com.l2jfrozen.gameserver.model.quest import State from com.l2jfrozen.gameserver.model.quest import QuestState from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest from com.l2jfrozen.util.database import L2DatabaseFactory from java.lang import System import time qn = "9215_statystikaServera" MARKET = 70011 id_many = 57 prise_castle = 300 prise_epicrb = 300 prise_pl_lvl = 300 prise_pl_pvp = 300 prise_pl_pk = 300 prise_pl_time = 300 prise_cl_lvl = 300 prise_cl_repa = 300 prise_cl_pl = 300 col_pl = "50" col_cl = "50" qwertr = 0 kolon = 0 sortType = 0 rty = 0 rtyu = 1 class Quest (JQuest) : def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) def onAdvEvent (self,event,npc,player): global qwertr, kolon, rty, rtyu st = player.getQuestState(qn) if event == "castle" : if st.getQuestItemsCount(id_many) >= prise_castle: st.takeItems(id_many,prise_castle) htmltext = u"<html><title>\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430</title><body><center><br><br><table width=\"230\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><a action=\"bypass -h Quest 9215_statystikaServera list_players\">\u0418\u0433\u0440\u043e\u043a\u0438</a></a></td><td><a action=\"bypass -h Quest 9215_statystikaServera list_clans\">\u041a\u043b\u0430\u043d\u044b</a></td><td><font color=CCFF33>[\u0417\u0430\u043c\u043a\u0438]</font></td><td><a action=\"bypass -h Quest 9215_statystikaServera epicrb\">\u0415\u043f\u0438\u043a \u0420\u0411</a></td></tr></table>------------------------------------------------------------------" htmltext += u"<table width=300><tr><td><font color=f0197a>\u2116</font></td><td><font color=3cd7f0>\u0417\u0430\u043c\u043e\u043a</font></td><td><font color=f0fab1>\u041d\u0430\u043b\u043e\u0433</font></td><td><font color=3ce773>\u0412\u043b\u0430\u0434\u0435\u0435\u0442</font></td></tr>" con=L2DatabaseFactory.getInstance().getConnection() sql=con.prepareStatement("SELECT id,name,siegeDate,taxPercent,(SELECT clan_name FROM `clan_data` WHERE hasCastle=id) AS owner FROM `castle` ORDER BY id") rs = sql.executeQuery() while (rs.next()) : id=rs.getString("id") id=str(id) name=rs.getString("name") name=str(name) siegeDate=rs.getString("siegeDate") # siegeDate= (siegeDate/1000) # siegeDate= time.localtime(siegeDate) owner1=rs.getString("owner") owner1=str(owner1) taxPercent=rs.getString("taxPercent") taxPercent=str(taxPercent) htmltext += "<tr><td><font color=f0197a>"+id+"</font></td><td><font color=3cd7f0>"+name+"</font></td><td><font color=f0fab1>"+taxPercent+"%</font></td><td><font color=3ce773>"+owner1+"</font></td></tr>" htmltext += "</table>------------------------------------------------------------------</center></body></html>" con.close() else: htmltext = "NoMany.htm" elif event == "list_players" : htmltext = "list_players.htm" elif event == "list_clans" : htmltext = "list_clans.htm" elif event == "epicrb" : if st.getQuestItemsCount(id_many) >= prise_epicrb: st.takeItems(id_many,prise_epicrb) htmltext = u"<html><title>\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430</title><body><center><br><br><table width=\"230\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><a action=\"bypass -h Quest 9215_statystikaServera list_players\">\u0418\u0433\u0440\u043e\u043a\u0438</a></a></td><td><a action=\"bypass -h Quest 9215_statystikaServera list_clans\">\u041a\u043b\u0430\u043d\u044b</a></td><td><a action=\"bypass -h Quest 9215_statystikaServera castle\">\u0417\u0430\u043c\u043a\u0438</a></td><td><font color=CCFF33>[\u0415\u043f\u0438\u043a \u0420\u0411]</font></td></tr></table>------------------------------------------------------------------" htmltext += u"<table width=300><tr><td><font color=f07ee5>\u2116</font></td><td><font color=05f3ea>\u0411\u043e\u0441</font></td><td><font color=7e8781>\u041b\u0432\u043b</font></td><td><font color=7ed607>\u0421\u0442\u0430\u0442\u0443\u0441</font></td></tr>" pos = 0 con=L2DatabaseFactory.getInstance().getConnection() sql=con.prepareStatement("SELECT `grandboss_data`.`boss_id`, `grandboss_data`.`status`, npc.level, npc.name FROM `grandboss_data` LEFT JOIN `npc` ON `grandboss_data`.`boss_id` = `npc`.`id` ORDER BY `grandboss_data`.`status` ASC , `npc`.`level` DESC") rs = sql.executeQuery() while (rs.next()) : name=rs.getString("name") name=str(name) level=rs.getString("level") level=str(level) status=rs.getString("status") pos = pos + 1 posstr = str(pos) if status == "0": status = u"<font color=7ee30f>\u0416\u0438\u0432</font>" else: status = u"<font color=f00000>\u0421\u0434\u043e\u0445</font>" htmltext += "<tr><td><font color=f07ee5>"+posstr+"</font></td><td><font color=05f3ea>"+str(name)+"</font></td><td><font color=7e8781>"+str(level)+"</font></td><td>"+status+"</td></tr>" htmltext += "</table>------------------------------------------------------------------</center></body></html>" con.close() else: htmltext = "NoMany.htm" elif event.startswith("show_"): wamrs = str(event.replace("show_", "")) if wamrs == "onlin": prise = prise_pl_lvl sortType = str("ORDER BY `sp` DESC") razdel = u"<table width=\"230\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><font color=\"LEVEL\">[Онлайн]</font></td><td><a action=\"bypass -h Quest 9215_statystikaServera show_pvp\">PVP</a></td><td><a action=\"bypass -h Quest 9215_statystikaServera show_pk\">PK</a></td><td><a action=\"bypass -h Quest 9215_statystikaServera show_time\">\u0412\u0440\u0435\u043c\u044f \u0432 \u0438\u0433\u0440\u0435</a></td></tr></table>------------------------------------------------------------------" kolon = 0 qwertr = 1 elif wamrs == "pvp": prise = prise_pl_pvp sortType = str("ORDER BY `pvpkills` DESC") razdel = u"<table width=\"230\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><a action=\"bypass -h Quest 9215_statystikaServera show_onlin\">Онлайн</a></td><td><font color=\"LEVEL\">[PVP]</font></td><td><a action=\"bypass -h Quest 9215_statystikaServera show_pk\">PK</a></td><td><a action=\"bypass -h Quest 9215_statystikaServera show_time\">\u0412\u0440\u0435\u043c\u044f \u0432 \u0438\u0433\u0440\u0435</a></td></tr></table>------------------------------------------------------------------" kolon = 0 elif wamrs == "pk": prise = prise_pl_pk sortType = str("ORDER BY `pkkills` DESC") razdel = u"<table width=\"230\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><a action=\"bypass -h Quest 9215_statystikaServera show_onlin\">Онлайн</a></td><td><a action=\"bypass -h Quest 9215_statystikaServera show_pvp\">PVP</a></td><td><font color=\"LEVEL\">[PK]</font></td><td><a action=\"bypass -h Quest 9215_statystikaServera show_time\">\u0412\u0440\u0435\u043c\u044f \u0432 \u0438\u0433\u0440\u0435</a></td></tr></table>------------------------------------------------------------------" kolon = 0 elif wamrs == "onlin2": prise = prise_pl_pvp sortType = str("ORDER BY `online` DESC") razdel = u"<table width=\"230\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><font color=\"LEVEL\">[PVP]</font></td><td><a action=\"bypass -h Quest 9215_statystikaServera show_pk\">PK</a></td><td><a action=\"bypass -h Quest 9215_statystikaServera show_time\">\u0412\u0440\u0435\u043c\u044f \u0432 \u0438\u0433\u0440\u0435</a></td></tr></table>------------------------------------------------------------------" qwertr = 1 elif wamrs == "time": prise = prise_pl_time sortType = str("ORDER BY `onlinetime` DESC") razdel = u"<table width=\"230\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><a action=\"bypass -h Quest 9215_statystikaServera show_onlin\">Онлайн</a></td><td><a action=\"bypass -h Quest 9215_statystikaServera show_pvp\">PVP</a></td><td><a action=\"bypass -h Quest 9215_statystikaServera show_pk\">PK</a></td><td><font color=\"LEVEL\">[\u0412\u0440\u0435\u043c\u044f \u0432 \u0438\u0433\u0440\u0435]</font></td></tr></table>------------------------------------------------------------------" kolon = 0 pos = 0 if st.getQuestItemsCount(id_many) >= prise: st.takeItems(id_many,prise) htmltext = u"<html><title>\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430</title><body><center><br><br><center><table width=\"230\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><font color=CCFF33>[\u0418\u0433\u0440\u043e\u043a\u0438]</font></a></td><td><a action=\"bypass -h Quest 9215_statystikaServera list_clans\">\u041a\u043b\u0430\u043d\u044b</a></td><td><a action=\"bypass -h Quest 9215_statystikaServera castle\">\u0417\u0430\u043c\u043a\u0438</a></td><td><a action=\"bypass -h Quest 9215_statystikaServera epicrb\">\u0415\u043f\u0438\u043a \u0420\u0411</a></td></tr></table>" htmltext += "------------------------------------------------------------------" htmltext += razdel conq=L2DatabaseFactory.getInstance().getConnection() if rtyu < 1 : sqlq=conq.prepareStatement("SELECT level FROM `characters` WHERE (accesslevel<1 and online>0)") else : sqlq=conq.prepareStatement("SELECT level FROM `characters` WHERE (accesslevel<400 and online>0)") rs = sqlq.executeQuery() while (rs.next()) : kolen=rs.getString("level") kolon = kolon + 1 conq.close() htmltext += u"<table width=300> <tr><td><center><font color=FF0000>Game:"+str(kolon)+"</font></center></td></tr></table>------------------------------------------------------------------" if qwertr == 0 : htmltext += u"<table width=300><tr><td><font color=f1c900>\u2116</font></td><td><font color=00dfe8>Name</font></td><td><font color=5ef28b>Class</font></td><td>Time </td><td><font color=cfb464>PvP/PK</font></td></tr>" else : htmltext += u"<table width=300><tr><td><font color=f1c900>\u2116</font></td><td><font color=00dfe8>Name</font></td><td><font color=5ef28b>Class</font></td><td>Time </td><td><font color=cfb464>PvP/PK</font></td></tr>" con=L2DatabaseFactory.getInstance().getConnection() if qwertr == 0 : if rty < 1 : sql=con.prepareStatement("SELECT karma,level,onlinetime,char_name,pvpkills,pkkills,(SELECT ClassName FROM char_templates WHERE char_templates.ClassId=characters.classid) AS class FROM `characters` WHERE (accesslevel<1) "+sortType+" LIMIT "+col_pl+"") else : sql=con.prepareStatement("SELECT karma,level,onlinetime,char_name,pvpkills,pkkills,(SELECT ClassName FROM char_templates WHERE char_templates.ClassId=characters.classid) AS class FROM `characters` WHERE (accesslevel<400) "+sortType+" LIMIT "+col_pl+"") else : if rty < 1 : sql=con.prepareStatement("SELECT karma,level,onlinetime,char_name,pvpkills,pkkills,(SELECT ClassName FROM char_templates WHERE char_templates.ClassId=characters.classid) AS class FROM `characters` WHERE (accesslevel<1) and online>0 LIMIT "+col_pl+"") else : sql=con.prepareStatement("SELECT karma,level,onlinetime,char_name,pvpkills,pkkills,(SELECT ClassName FROM char_templates WHERE char_templates.ClassId=characters.classid) AS class FROM `characters` WHERE (accesslevel<400) and online>0 LIMIT "+col_pl+"") rs = sql.executeQuery() while (rs.next()) : char_name=rs.getString("char_name") char_name=str(char_name) onlinetime=rs.getString("onlinetime") onlinetime=int(onlinetime) onlinetime = (onlinetime/60/60/24) char_pkkills=rs.getString("pkkills") char_pkkills=str(char_pkkills) char_pvpkills=rs.getString("pvpkills") char_pvpkills=str(char_pvpkills) char_level=rs.getString("level") char_level=str(char_level) char_class=rs.getString("class") char_class=str(char_class) pos = pos + 1 posstr = str(pos) if qwertr == 0 : htmltext += "<tr><td><font color=f1c900>"+posstr+"</font></td><td><font color=00dfe8>"+char_name+"</font></td><td><font color=5ef28b>"+char_class+"</font></td><td>"+str(onlinetime)+u" \u0434.</td><td><font color=cfb464>"+char_pvpkills+"/"+char_pkkills+"</font></td></tr>" else : htmltext += "<tr><td><font color=f1c900>"+posstr+"</font></td><td><font color=00dfe8>"+char_name+"</font></td><td><font color=5ef28b>"+char_class+"</font></td><td>"+str(onlinetime)+u" \u0434.</td><td><font color=cfb464>"+char_pvpkills+"/"+char_pkkills+"</font></td></tr>" htmltext += "</table>------------------------------------------------------------------</center></body></html>" qwertr = 0 con.close() else: htmltext = "NoMany.htm" elif event.startswith("show2_"): wamrs = str(event.replace("show2_", "")) if wamrs == "lvl": prise = prise_cl_lvl sortTypeClan = str("ORDER BY `clan_level` DESC") razdel = u"<table width=\"230\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><font color=\"LEVEL\">[\u041b\u0435\u0432\u0435\u043b]</font></td><td><a action=\"bypass -h Quest 9215_statystikaServera show2_repa\">\u0420\u0435\u043f\u0443\u0442\u0430\u0446\u0438\u044f</a></td><td><a action=\"bypass -h Quest 9215_statystikaServera show2_players\">\u0418\u0433\u0440\u043e\u043a\u0438</a></td></tr></table>------------------------------------------------------------------" elif wamrs == "repa": prise = prise_cl_repa sortTypeClan = str("ORDER BY `reputation_score` DESC") razdel = u"<table width=\"230\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><a action=\"bypass -h Quest 9215_statystikaServera show2_lvl\">\u041b\u0435\u0432\u0435\u043b</a></td><td><font color=\"LEVEL\">[\u0420\u0435\u043f\u0443\u0442\u0430\u0446\u0438\u044f]</font></td><td><a action=\"bypass -h Quest 9215_statystikaServera show2_players\">\u0418\u0433\u0440\u043e\u043a\u0438</a></td></tr></table>------------------------------------------------------------------" elif wamrs == "players": prise = prise_cl_pl sortTypeClan = str("ORDER BY `players` DESC") razdel = u"<table width=\"230\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><a action=\"bypass -h Quest 9215_statystikaServera show2_lvl\">\u041b\u0435\u0432\u0435\u043b</a></td><td><a action=\"bypass -h Quest 9215_statystikaServera show2_repa\">\u0420\u0435\u043f\u0443\u0442\u0430\u0446\u0438\u044f</a></td><td><font color=\"LEVEL\">[\u0418\u0433\u0440\u043e\u043a\u0438]</font></td></tr></table>------------------------------------------------------------------" pos = 0 if st.getQuestItemsCount(id_many) >= prise: st.takeItems(id_many,prise) htmltext = u"<html><title>\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430</title><body><center><br><br><center><table width=\"230\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><a action=\"bypass -h Quest 9215_statystikaServera list_players\">\u0418\u0433\u0440\u043e\u043a\u0438</a></td><td><font color=CCFF33>[\u041a\u043b\u0430\u043d\u044b]</font></td><td><a action=\"bypass -h Quest 9215_statystikaServera castle\">\u0417\u0430\u043c\u043a\u0438</a></td><td><a action=\"bypass -h Quest 9215_statystikaServera epicrb\">\u0415\u043f\u0438\u043a \u0420\u0411</a></td></tr></table>" htmltext += "------------------------------------------------------------------" htmltext += razdel htmltext += u"<table width=300><tr><td>\u2116</td><td><font color=f2b88f>\u041a\u043b\u0430\u043d</font></td><td><font color=539f65>\u041b\u0432\u043b</font></td><td><font color=53bcee>\u0420\u0435\u043f\u0443\u0442\u0430\u0446\u0438\u044f</font></td><td><font color=8fd96f>\u041b\u0438\u0434\u0435\u0440</font></td><td><font color=ffe967>\u0418\u0433\u0440\u043e\u043a\u043e\u0432</font></td><td><font color=87ffff>Ally</font></td></tr>" con=L2DatabaseFactory.getInstance().getConnection() sql=con.prepareStatement("SELECT clan_name,clan_level,reputation_score,ally_name,(SELECT char_name FROM `characters` WHERE characters.obj_Id=clan_data.leader_id) AS leader,(SELECT COUNT(*) FROM characters WHERE characters.clanid=clan_data.clan_id) as players FROM `clan_data` "+sortTypeClan+" LIMIT "+col_pl+"") rs = sql.executeQuery() while (rs.next()) : clan_name=rs.getString("clan_name") clan_name=str(clan_name) clan_level=rs.getString("clan_level") clan_level=str(clan_level) reputation_score=rs.getString("reputation_score") reputation_score=str(reputation_score) ally_name=rs.getString("ally_name") ally_name=str(ally_name) leader=rs.getString("leader") leader=str(leader) players=rs.getString("players") players=str(players) pos = pos + 1 posstr = str(pos) htmltext += "<tr><td>"+posstr+"</td><td><font color=f2b88f>"+clan_name+"</font></td><td><font color=539f65>"+clan_level+"</font></td><td><font color=53bcee>"+reputation_score+"</font></td><td><font color=8fd96f>"+leader+"</font></td><td><font color=ffe967>"+players+"</font></td><td><font color=87ffff>"+ally_name+"</font></td></tr>" htmltext += "</table>------------------------------------------------------------------</center></body></html>" con.close() else: htmltext = "NoMany.htm" return htmltext def onTalk (self,npc,player): st = player.getQuestState(qn) npcId = npc.getNpcId() if npcId == MARKET: htmltext = "privetstvie.htm" return htmltext QUEST = Quest(9215,qn,"custom") QUEST.addStartNpc(MARKET) QUEST.addTalkId(MARKET) Вот только в отдельном сообщении получилось вставить Изменено 26 сентября, 2012 пользователем Voled Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
Voled 183 Опубликовано 27 сентября, 2012 Up Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты