Jump to content
  • 0

Aplei Erotisei pou mporei na einai kai Ma____a ;)


Question

Posted

Opos anafera kai sto Subject mporei na einai kai malakia auto pou leo alla den ksero as mpo sto erotima pou thelo na kano Thelo na valo sto server mou ena Vote Reward to thema einai pos o server den einai me Compile kai Eclipse oste na mporo na peraso Java mesa kai ta sxetika Kai eroto mipos ginete na to kano me script i kati tetio as poume kai an nai kserei kaneis link oste na mporeso na paro mia ikonona to pos ginete kai an ginete fisika...............

10 answers to this question

Recommended Posts

  • 0
Posted

oxi den ginete

axaxaxxaa re mlk psa3e prota kai meta mila omgggggggg

 

package custom.VoteEngine;

import java.io.*;
import java.net.*;
import java.util.Collection;
import java.util.logging.Level;
import java.util.logging.Logger;

import net.sf.l2j.gameserver.Announcements;
import net.sf.l2j.gameserver.ThreadPoolManager;
import net.sf.l2j.gameserver.model.L2World;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;

public class AutoVoteRewardHandler
{
protected static final Logger _log = Logger.getLogger(AutoVoteRewardHandler.class.getName());
//URL from your server site at HopZone.net
//Example: http://l2.hopzone.net/lineage2/moreinfo/YourServer/ID.html
private final static String _url = "http://l2.hopzone.net/lineage2/moreinfo/L2WorldPvP/74078.html";//Add your URL from HopZone here!
//Reward all online players each '_votesRequiredForReward' votes.
private final int _votesRequiredForReward = 1;//
//Initial check, time in minutes:
//Default: 1 minute
private final int initialCheck = 1;
//Delay interval, time in minutes (do not set it too low):
//Default: 10 minutes
private final int delayForCheck = 1;

//Item Id, Amount.
private final static int[][] ITEMs =
{
	{ 5575, 10 }, //10 Event - Apiga(s)
	{ 57, 1000000 }, //1 million Adena
};

//Do not change
private int _lastVoteCount = 0;

private AutoVoteRewardHandler()
{
	_log.info("[AutoVoteRewardHandler]: Vote Reward System Initiated.");
	ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new AutoReward(), initialCheck * 60000, delayForCheck * 60000);
}

private class AutoReward implements Runnable
{
	public void run()
	{
		int votes = getVotes();
		int rewardedPlayers = 0;
		if (votes > -1)
		{
			if  ((getLastVoteCount() != 0) && (votes >= (getLastVoteCount() + _votesRequiredForReward)))
			{
				Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values();
				for (L2PcInstance player : pls)
				{
					if ((player != null) && !player.getClient().isDetached())
					{
						for (int[] reward : ITEMs)
						{
							if (player.getInventory().validateCapacityByItemId(reward[0]))
							{
								player.addItem("reward", reward[0], reward[1], player, true);
							}
						}
						rewardedPlayers++;
					}
				}
				setLastVoteCount(getLastVoteCount() + _votesRequiredForReward);
			}
			else if (getLastVoteCount() == 0)
			{
				setLastVoteCount(votes);
			}
			_log.info("[AutoVoteRewardHandler]: Server Votes: " + votes + ", Rewarded players: " + rewardedPlayers);
			Announcements.getInstance().announceToAll("Server Votes: " + votes + " | Next Reward on " + (getLastVoteCount() + _votesRequiredForReward) + " votes!");
		}
		else
		{
			_log.log(Level.WARNING, "[AutoVoteRewardHandler]: Error retreiving server votes count!");
		}
	}
}

private static int getVotes()
{
       		InputStreamReader isr = null;
	BufferedReader in = null;
	int votes = -1;
	try
	{
	URLConnection conn = new URL(_url).openConnection();
	conn.addRequestProperty("User-Agent", "Mozilla/4.76");
	isr = new InputStreamReader(conn.getInputStream());
         	in = new BufferedReader(isr);
		String inputLine;
		while (((inputLine = in.readLine()) != null) && (votes == -1))
		{
			if (inputLine.contains("moreinfo_total_rank_text"))
			{
				try
				{
					votes = Integer.valueOf(inputLine.split(">")[2].replace("</div", ""));
				}
				catch (Exception e)
				{
				}
			}
		}
		in.close();
	}
	catch (Exception e)
	{
		_log.log(Level.WARNING, "[AutoVoteRewardHandler]: " + e.getMessage(), e);
	}
	return votes;
}

private void setLastVoteCount(int voteCount)
{
	_lastVoteCount = voteCount;
}

private int getLastVoteCount()
{
	return _lastVoteCount;
}

public static AutoVoteRewardHandler getInstance()
{
	return SingletonHolder._instance;
}

@SuppressWarnings("synthetic-access")
private static class SingletonHolder
{
	protected static final AutoVoteRewardHandler _instance = new AutoVoteRewardHandler();
}

public static void main(String[] args)
{
	//System.out.println("Server votes: " + getVotes());//Just a test.
	AutoVoteRewardHandler.getInstance();
}
}

 

ama exi problima pesto m ;)

  • 0
Posted

axaxaxxaa re mlk psa3e prota kai meta mila omgggggggg

dostou lisi mafou ise toso eksipnos ektos apo to spam pou kanis lei Vote Reward xoris java code les na ginete

kai katarxin apagorebonte ta pre pack

  • 0
Posted

dostou lisi mafou ise toso eksipnos ektos apo to spam pou kanis lei Vote Reward xoris java code les na ginete

kai katarxin apagorebonte ta pre pack

nai?? des ligw pio pano 10xrone ma8e ta vasika meta mila
  • 0
Posted

axaxaxxaa re mlk psa3e prota kai meta mila omgggggggg

 

package custom.VoteEngine;

import java.io.*;
import java.net.*;
import java.util.Collection;
import java.util.logging.Level;
import java.util.logging.Logger;

import net.sf.l2j.gameserver.Announcements;
import net.sf.l2j.gameserver.ThreadPoolManager;
import net.sf.l2j.gameserver.model.L2World;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;

public class AutoVoteRewardHandler
{
protected static final Logger _log = Logger.getLogger(AutoVoteRewardHandler.class.getName());
//URL from your server site at HopZone.net
//Example: http://l2.hopzone.net/lineage2/moreinfo/YourServer/ID.html
private final static String _url = "http://l2.hopzone.net/lineage2/moreinfo/L2WorldPvP/74078.html";//Add your URL from HopZone here!
//Reward all online players each '_votesRequiredForReward' votes.
private final int _votesRequiredForReward = 1;//
//Initial check, time in minutes:
//Default: 1 minute
private final int initialCheck = 1;
//Delay interval, time in minutes (do not set it too low):
//Default: 10 minutes
private final int delayForCheck = 1;

//Item Id, Amount.
private final static int[][] ITEMs =
{
	{ 5575, 10 }, //10 Event - Apiga(s)
	{ 57, 1000000 }, //1 million Adena
};

//Do not change
private int _lastVoteCount = 0;

private AutoVoteRewardHandler()
{
	_log.info("[AutoVoteRewardHandler]: Vote Reward System Initiated.");
	ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new AutoReward(), initialCheck * 60000, delayForCheck * 60000);
}

private class AutoReward implements Runnable
{
	public void run()
	{
		int votes = getVotes();
		int rewardedPlayers = 0;
		if (votes > -1)
		{
			if  ((getLastVoteCount() != 0) && (votes >= (getLastVoteCount() + _votesRequiredForReward)))
			{
				Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values();
				for (L2PcInstance player : pls)
				{
					if ((player != null) && !player.getClient().isDetached())
					{
						for (int[] reward : ITEMs)
						{
							if (player.getInventory().validateCapacityByItemId(reward[0]))
							{
								player.addItem("reward", reward[0], reward[1], player, true);
							}
						}
						rewardedPlayers++;
					}
				}
				setLastVoteCount(getLastVoteCount() + _votesRequiredForReward);
			}
			else if (getLastVoteCount() == 0)
			{
				setLastVoteCount(votes);
			}
			_log.info("[AutoVoteRewardHandler]: Server Votes: " + votes + ", Rewarded players: " + rewardedPlayers);
			Announcements.getInstance().announceToAll("Server Votes: " + votes + " | Next Reward on " + (getLastVoteCount() + _votesRequiredForReward) + " votes!");
		}
		else
		{
			_log.log(Level.WARNING, "[AutoVoteRewardHandler]: Error retreiving server votes count!");
		}
	}
}

private static int getVotes()
{
       		InputStreamReader isr = null;
	BufferedReader in = null;
	int votes = -1;
	try
	{
	URLConnection conn = new URL(_url).openConnection();
	conn.addRequestProperty("User-Agent", "Mozilla/4.76");
	isr = new InputStreamReader(conn.getInputStream());
         	in = new BufferedReader(isr);
		String inputLine;
		while (((inputLine = in.readLine()) != null) && (votes == -1))
		{
			if (inputLine.contains("moreinfo_total_rank_text"))
			{
				try
				{
					votes = Integer.valueOf(inputLine.split(">")[2].replace("</div", ""));
				}
				catch (Exception e)
				{
				}
			}
		}
		in.close();
	}
	catch (Exception e)
	{
		_log.log(Level.WARNING, "[AutoVoteRewardHandler]: " + e.getMessage(), e);
	}
	return votes;
}

private void setLastVoteCount(int voteCount)
{
	_lastVoteCount = voteCount;
}

private int getLastVoteCount()
{
	return _lastVoteCount;
}

public static AutoVoteRewardHandler getInstance()
{
	return SingletonHolder._instance;
}

@SuppressWarnings("synthetic-access")
private static class SingletonHolder
{
	protected static final AutoVoteRewardHandler _instance = new AutoVoteRewardHandler();
}

public static void main(String[] args)
{
	//System.out.println("Server votes: " + getVotes());//Just a test.
	AutoVoteRewardHandler.getInstance();
}
}

 

ama exi problima pesto m ;)

Ekana tis alages sto script gia na mporesei na einai simvato me to pack mou kai to perasa sto server stin ekseis thesi c:\gameserver\data\scripts\custom\9678_Vote Engine kai kano rr ton server kai perno to ekseis minima

Error on: C:\L2jServer_Rev_8018\gameserver\data\scripts\custom\9678_Vote Engine\__init__.py.error.log
Line: -1 - Column: -1

Traceback (innermost last):
  (no code object) at line 0
SyntaxError: ('invalid syntax', ('__init__.py', 4, 9, 'package custom.VoteEngine;'))

i alages pou ekana se auto pou mou estiles einai i ekseis

package custom.VoteEngine;

import sys
from java.lang import System
from java.util import Iterator
from com.l2jserver import Config
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.instancemanager import QuestManager
from com.l2jserver import L2DatabaseFactory
from com.l2jserver.gameserver.datatables import SkillTable
from com.l2jserver.gameserver.datatables import ItemTable
from com.l2jserver.gameserver.model.actor.instance import L2PcInstance
from com.l2jserver.gameserver.model.actor.instance import L2PetInstance
from com.l2jserver.gameserver.model.actor.instance import L2SummonInstance
from com.l2jserver.gameserver.network.serverpackets import SetSummonRemainTime
from com.l2jserver.gameserver.network.serverpackets import SetupGauge

public class AutoVoteRewardHandler
{
protected static final Logger _log = Logger.getLogger(AutoVoteRewardHandler.class.getName());
//URL from your server site at HopZone.net
//Example: http://l2.hopzone.net/lineage2/moreinfo/YourServer/ID.html
private final static String _url = "http://l2.hopzone.net/vote.php?site=89392";//Add your URL from HopZone here!
//Reward all online players each '_votesRequiredForReward' votes.
private final int _votesRequiredForReward = 1;//
//Initial check, time in minutes:
//Default: 1 minute
private final int initialCheck = 1;
//Delay interval, time in minutes (do not set it too low):
//Default: 10 minutes
private final int delayForCheck = 1;

//Item Id, Amount.
private final static int[][] ITEMs =
{
	{ 9627, 2}, //2 Giant Codex Mastery(s)
	{ 20214, 20000 }, // Twenty Thousand GodenAdena
};

//Do not change
private int _lastVoteCount = 0;

private AutoVoteRewardHandler()
{
	_log.info("[AutoVoteRewardHandler]: Vote Reward System Initiated.");
	ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new AutoReward(), initialCheck * 60000, delayForCheck * 60000);
}

private class AutoReward implements Runnable
{
	public void run()
	{
		int votes = getVotes();
		int rewardedPlayers = 0;
		if (votes > -1)
		{
			if  ((getLastVoteCount() != 0) && (votes >= (getLastVoteCount() + _votesRequiredForReward)))
			{
				Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values();
				for (L2PcInstance player : pls)
				{
					if ((player != null) && !player.getClient().isDetached())
					{
						for (int[] reward : ITEMs)
						{
							if (player.getInventory().validateCapacityByItemId(reward[0]))
							{
								player.addItem("reward", reward[0], reward[1], player, true);
							}
						}
						rewardedPlayers++;
					}
				}
				setLastVoteCount(getLastVoteCount() + _votesRequiredForReward);
			}
			else if (getLastVoteCount() == 0)
			{
				setLastVoteCount(votes);
			}
			_log.info("[AutoVoteRewardHandler]: Server Votes: " + votes + ", Rewarded players: " + rewardedPlayers);
			Announcements.getInstance().announceToAll("Server Votes: " + votes + " | Next Reward on " + (getLastVoteCount() + _votesRequiredForReward) + " votes!");
		}
		else
		{
			_log.log(Level.WARNING, "[AutoVoteRewardHandler]: Error retreiving server votes count!");
		}
	}
}

private static int getVotes()
{
       		InputStreamReader isr = null;
	BufferedReader in = null;
	int votes = -1;
	try
	{
	URLConnection conn = new URL(_url).openConnection();
	conn.addRequestProperty("User-Agent", "Mozilla/4.76");
	isr = new InputStreamReader(conn.getInputStream());
         	in = new BufferedReader(isr);
		String inputLine;
		while (((inputLine = in.readLine()) != null) && (votes == -1))
		{
			if (inputLine.contains("moreinfo_total_rank_text"))
			{
				try
				{
					votes = Integer.valueOf(inputLine.split(">")[2].replace("</div", ""));
				}
				catch (Exception e)
				{
				}
			}
		}
		in.close();
	}
	catch (Exception e)
	{
		_log.log(Level.WARNING, "[AutoVoteRewardHandler]: " + e.getMessage(), e);
	}
	return votes;
}

private void setLastVoteCount(int voteCount)
{
	_lastVoteCount = voteCount;
}

private int getLastVoteCount()
{
	return _lastVoteCount;
}

public static AutoVoteRewardHandler getInstance()
{
	return SingletonHolder._instance;
}

@SuppressWarnings("synthetic-access")
private static class SingletonHolder
{
	protected static final AutoVoteRewardHandler _instance = new AutoVoteRewardHandler();
}

public static void main(String[] args)
{
	//System.out.println("Server votes: " + getVotes());//Just a test.
	AutoVoteRewardHandler.getInstance();
}
}

Ksereis ti mporei na einai ???

  • 0
Posted

c:\gameserver\data\scripts\custom\9678_Vote Engine

 

VoteEngine einai oxi afto pou vazis lol

 

ta import einai afta

 

import net.sf.l2j.gameserver.Announcements;

import net.sf.l2j.gameserver.ThreadPoolManager;

import net.sf.l2j.gameserver.model.L2World;

import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;

 

ec ti evales?? exis 10 import pou den exoun kanena noima

  • 0
Posted

ok kalos pes pos vazw oti kaneis post diladei auto

import java.io.*;
import java.net.*;
import java.util.Collection;
import java.util.logging.Level;
import java.util.logging.Logger;

import net.sf.l2j.gameserver.Announcements;
import net.sf.l2j.gameserver.ThreadPoolManager;
import net.sf.l2j.gameserver.model.L2World;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;

ekei pou perasa egw auta

import sys
from java.lang import System
from java.util import Iterator
from com.l2jserver import Config
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.instancemanager import QuestManager
from com.l2jserver import L2DatabaseFactory
from com.l2jserver.gameserver.datatables import SkillTable
from com.l2jserver.gameserver.datatables import ItemTable
from com.l2jserver.gameserver.model.actor.instance import L2PcInstance
from com.l2jserver.gameserver.model.actor.instance import L2PetInstance
from com.l2jserver.gameserver.model.actor.instance import L2SummonInstance
from com.l2jserver.gameserver.network.serverpackets import SetSummonRemainTime
from com.l2jserver.gameserver.network.serverpackets import SetupGauge

sosta !

kai kati akoma prein kano oti kano na anafero pos to pack pou exw einai l2jserver Freya an kano katei lathos sorry apla kai egw piramata kano gia na katafero auto pou proanafera sto post pou ekana tora an katei den gini tote kalei kardia se osous help kai se osous den help :)

  • 0
Posted

kita perimene an se help alos exw varefi na e3igo ta idia ama den 3eris na alazis 4 impot katse ma8e egw sou edosa etimo java pou doulevi se acis 100% twra kane oti 8es ;)

 

tespa na parto kai pes m twra

 

package custom.VoteEngine;

import java.io.*;
import java.net.*;
import java.util.logging.Level;
import java.util.logging.Logger;

import com.l2jserver.gameserver.Announcements;
import com.l2jserver.gameserver.ThreadPoolManager;
import com.l2jserver.gameserver.model.L2World;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;

public class AutoVoteRewardHandler
{
protected static final Logger _log = Logger.getLogger(AutoVoteRewardHandler.class.getName());
//URL from your server site at HopZone.net
//Example: http://l2.hopzone.net/lineage2/moreinfo/YourServer/ID.html
private final static String _url = "http://l2.hopzone.net/lineage2/moreinfo/L2WorldPvP/74078.html";//Add your URL from HopZone here!
//Reward all online players each '_votesRequiredForReward' votes.
private final int _votesRequiredForReward = 1;//
//Initial check, time in minutes:
//Default: 1 minute
private final int initialCheck = 1;
//Delay interval, time in minutes (do not set it too low):
//Default: 10 minutes
private final int delayForCheck = 1;

//Item Id, Amount.
private final static int[][] ITEMs =
{
	{ 5575, 10 }, //10 Event - Apiga(s)
	{ 57, 1000000 }, //1 million Adena
};

//Do not change
private int _lastVoteCount = 0;

private AutoVoteRewardHandler()
{
	_log.info("[AutoVoteRewardHandler]: Vote Reward System Initiated.");
	ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new AutoReward(), initialCheck * 60000, delayForCheck * 60000);
}

private class AutoReward implements Runnable
{
	public void run()
	{
		int votes = getVotes();
		int rewardedPlayers = 0;
		if (votes > -1)
		{
			if  ((getLastVoteCount() != 0) && (votes >= (getLastVoteCount() + _votesRequiredForReward)))
			{
				L2PcInstance[] pls = L2World.getInstance().getAllPlayers().values();
				for (L2PcInstance player : pls)
				{
					if ((player != null) && !player.getClient().isDetached())
					{
						for (int[] reward : ITEMs)
						{
							if (player.getInventory().validateCapacityByItemId(reward[0]))
							{
								player.addItem("reward", reward[0], reward[1], player, true);
							}
						}
						rewardedPlayers++;
					}
				}
				setLastVoteCount(getLastVoteCount() + _votesRequiredForReward);
			}
			else if (getLastVoteCount() == 0)
			{
				setLastVoteCount(votes);
			}
			_log.info("[AutoVoteRewardHandler]: Server Votes: " + votes + ", Rewarded players: " + rewardedPlayers);
			Announcements.getInstance().announceToAll("Server Votes: " + votes + " | Next Reward on " + (getLastVoteCount() + _votesRequiredForReward) + " votes!");
		}
		else
		{
			_log.log(Level.WARNING, "[AutoVoteRewardHandler]: Error retreiving server votes count!");
		}
	}
}

private static int getVotes()
{
       		InputStreamReader isr = null;
	BufferedReader in = null;
	int votes = -1;
	try
	{
	URLConnection conn = new URL(_url).openConnection();
	conn.addRequestProperty("User-Agent", "Mozilla/4.76");
	isr = new InputStreamReader(conn.getInputStream());
         	in = new BufferedReader(isr);
		String inputLine;
		while (((inputLine = in.readLine()) != null) && (votes == -1))
		{
			if (inputLine.contains("moreinfo_total_rank_text"))
			{
				try
				{
					votes = Integer.valueOf(inputLine.split(">")[2].replace("</div", ""));
				}
				catch (Exception e)
				{
				}
			}
		}
		in.close();
	}
	catch (Exception e)
	{
		_log.log(Level.WARNING, "[AutoVoteRewardHandler]: " + e.getMessage(), e);
	}
	return votes;
}

private void setLastVoteCount(int voteCount)
{
	_lastVoteCount = voteCount;
}

private int getLastVoteCount()
{
	return _lastVoteCount;
}

public static AutoVoteRewardHandler getInstance()
{
	return SingletonHolder._instance;
}

@SuppressWarnings("synthetic-access")
private static class SingletonHolder
{
	protected static final AutoVoteRewardHandler _instance = new AutoVoteRewardHandler();
}

public static void main(String[] args)
{
	//System.out.println("Server votes: " + getVotes());//Just a test.
	AutoVoteRewardHandler.getInstance();
}
}

 

custom/VoteEngine/AutoVoteRewardHandler.java

  • 0
Posted

dostou lisi mafou ise toso eksipnos ektos apo to spam pou kanis lei Vote Reward xoris java code les na ginete

kai katarxin apagorebonte ta pre pack

 

ginete ;)

php scripted i apo dp an ipostirizei java files :)

  • 0
Posted

1) vl4d ftani na les se olous 10xrona

2) sou dixni kseka8ara oti dn einai net.sf.l2j ala einai com.l2server

3) to pack pou dixnis exi to L2World -->import com.l2jserver.gameserver.model.L2World;

eno sto pack pou 8eli na kani to pedi exi network -->

from com.l2jserver.gameserver.network.serverpackets

________________________________________________

 

file prepi na kseris oti to pack pou exis mpori na exi diaforetika tomea

px;

import net.sf.l2j.gameserver.Announcements;

import net.sf.l2j.gameserver.Announce.Announcements;

na diaxorizi se 2 i 3 tomea

otan fortonis to gameserver.bat vgale foto na doume pia tomea exi to pack...

Guest
This topic is now closed to further replies.
×
×
  • Create New...