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.


  • Posts

    • L2Avalon Mid-Rate Server: Dynamic and Exciting Gameplay Awaits! Greetings, adventurers! We are thrilled to introduce the L2Avalon Mid-Rate Server, designed with a perfect blend of challenge, innovation, and accessibility. With dynamic rates, tailored rewards, and a plethora of custom features, your journey in Aden will be more engaging than ever. Below are the highlights of what you can expect: Server Rates More details here Dynamic XP Rates: Scale from 30x (Lv 1-40) to 1x (Lv 78+) for balanced progression. Adena, Drop, Spoil: 5x for a rewarding grind. Raid XP/Drop: 10x to spice up boss hunts. GM Shop Full D and C-grade gear available in main city shops. Low B-grade items available in the Luxury Shop for crystals. Class System 1st and 2nd professions are FREE! 3rd profession requires 700 Halisha marks, with an added reward of GC upon completion. Raids & Epic Bosses Raid Respawn: 12+4 hours for more opportunities to engage. Epic Boss Schedule: Rotating timings keep encounters fresh. (Details here) Soul Shard System: Unique drops to enhance your gear. Learn more. Skills & Buffs Buff slots: 20+12 + 4 Divine slots for full control of your builds. 3rd Class Skills: Inspired by Essence, requiring Magic tablets from select areas. Class Balance Rework: Enhanced for better PvE/PvP gameplay. Custom 2-hour NPC Buffs: Save and load schemes with ease! Olympiad Detailed info here Held Thursday-Sunday weekly, featuring High Five arenas and buffer systems. Olympiad Jewels: Updated from later chronicles. Improved Hero Weapons: Now provide 30% PvP damage. Hero Skills: Fully functional on subclasses! Reworked Locations Primeval Isle Shop: Exchange zone drop items for top A weapon recipes, parts, and materials. Monastery of Silence: Collect Magic tablets on the first floor for 3rd class skills. Seven Signs The Seven Signs system is disabled, but you can access all Mammon services via Valar in Giran. Teleporters: Found in every town for Priest of Dawn/Dusk access. Instances & Quests Instances: Customized for level-specific rewards, from C-grade items to S-grade recipes and parts. (Details here). Quest System Rework: Enhanced to make your journey more immersive. Check here. Get ready to explore a world of endless possibilities with a community-focused server that values player feedback and innovation. Join the adventure on launch day and experience a truly improved Interlude experience! 🌟 Join our Discord for updates! L2Avalon.net
    • WTS ADENA ------ REBORN -SIGNATURE X1  1KK o more per day! OFFERT!!!   Discord:     susi007317
    • Over 800 accounts in stock! https://Smurfmania.com https://www.g2g.com/SmurfMania
    • Hi everyone, I need to make the amulets stackable, as well as the spellbooks, but I need to control their consumption. I have modified the item.xml like this for example:   <item id="8885" type="EtcItem" name="Amulet: Magnus' Chant"> <set name="material" val="PAPER" /> <set name="weight" val="120" /> <set name="price" val="120" /> <set name="is_stackable" val="true" /> </item> But I can see that within the spellbooks.xml it handles, I believe its consumption since I see the following for the same amulet:   <book skillId="1413" itemId="8885"/><!-- Amulet: Magnus' Chant --> My question is the following, how do I make sure that when these are stacked, they are not all consumed in a single use.  
  • Topics

×
×
  • Create New...