Jump to content
  • 0

Question

Posted (edited)

how to make  after string targetName get nextToken from list switch. I try enything and is not come to list. i am not good in java 

and i ask if someone can help tnx

			else if (comnd.startsWith("MatchingInvite"))
			{				
				try
				{
					String targetName = comnd.substring(20);
					String type = st1.nextToken();
					switch(type)
					{
						case "FKeepers":
							RuleSet = 1;
							System.out.print("im here " + RuleSet);
							break;
						case "Random":
							RuleSet = 2;
							System.out.print("im here " + RuleSet);
							break;
						case "RanSpoil":
							RuleSet = 3;
							System.out.print("im here " + RuleSet);
							break;
						case "ByTurn":
							RuleSet = 4;
							System.out.print("im here " + RuleSet);
							break;
						case "ByTurnSpoil":
							RuleSet = 5;
							System.out.print("im here " + RuleSet);
							break;
					}

					System.out.println("Command is " + st1.nextToken());
					
					PcInstance receiver = World.getInstance().getPlayer(targetName);

and bypass

MatchingList.append("<td align=center><combobox width=99 height=21 var=\"loot\" list=\"FKeepers;Random;RanSpoil;ByTurn;ByTurnSpoil;\"></td>");
MatchingList.append("<td align=right FIXWIDTH=73><button action=\"bypass MatchingInvite " + activeChar.getName() +" $loot\" value=\"Invite\" width=50 height=21 back=\"L2UI_CH3.smallbutton1_down\" fore=\"L2UI_CH3.smallbutton1\"></td>");

 

Project l2jAcis

Edited by tazerman2

2 answers to this question

Recommended Posts

  • 0
Posted (edited)
			StringTokenizer st = new StringTokenizer(command, " ");
			String comnd = st.nextToken();
			if (comnd.equals("MatchingInvite"))
			{				
					String targetName = st.nextToken();
					String type = st1.nextToken();
					
					System.out.println("Main Command is " + st);
					System.out.println("Command is " + comnd);
					System.out.println("TargetName is " + targetName);
					System.out.println("Type is " + type);
					
					switch(type)
					{
						case "FKeepers":
							RuleSet = 1;
							System.out.print("im here " + RuleSet);
							break;
						case "Random":
							RuleSet = 2;
							System.out.print("im here " + RuleSet);
							break;
						case "RanSpoil":
							RuleSet = 3;
							System.out.print("im here " + RuleSet);
							break;
						case "ByTurn":
							RuleSet = 4;
							System.out.print("im here " + RuleSet);
							break;
						case "ByTurnSpoil":
							RuleSet = 5;
							System.out.print("im here " + RuleSet);
							break;
						default:
							return;
					}
					
					PcInstance receiver = World.getInstance().getPlayer(targetName);
			}

java read automatic the  st.nextToken() on the call step

and you call it on system.out

Edited by pirama
Guest
This topic is now closed to further replies.


×
×
  • Create New...