Skip to content

little command help

Featured Replies

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

			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

  • Author

fixed tnx pirama lock topic 

  • SweeTs locked this topic
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.