Jump to content

Question

Posted

Hello, i made a code and basically capture tokens from bypass using StringTokenizer tk = new StringTokenizer(command, " ");

and the bypass is like

%objectId%_something $var1 $var2 $var3 

 

the problem is that i use 3 boxes to fill (3 variables) and if a player inside box he use space to write 2 words it capture the 2nd word as another token so it end up like

4 token instead of 3.

 

How can i avoid this? Like if a player writes in box "Something Something" this will be captured as 1 token instead of 2 tokens ?

 

Thanks a lot.

Recommended Posts

  • 0
Posted (edited)

Did you try it? It's not working + eclipse can't compile this character.

use type casting

(char)161
Edited by melron
  • 0
Posted

Can you give an example or tell us how this one will help this problem?

 

This guy didnt want to cancel the proccess when one more token found , contrary he want the unexpected tokens as one string with spaces inside.

i believe trim is useless, correct me if im wrong

Yes, this will fix the problem.

Example:

TextBox 1: asd

TextBox 2: sss ddd

TextBox 3: ddd 2 uuu

 

Bypass will look like this: "npc_%objectId%_test asd ¡ sss ddd ¡ ddd 2 uuu".

.trim() is needed so spaces at the beginning and at the end of the token will be removed, for example "asd " will be turned into "asd", " sss ddd " into "sss ddd".

  • 0
Posted

The bypass command line have limited length. Use RequestBBSwrite packet. He don't have problems with spaces, etc.

And how ill use the bbswrite? Cause i changed bypass to bypass -h still when i write bigger than 15 char in box it no accept it.

  • 0
Posted

And how ill use the bbswrite? Cause i changed bypass to bypass -h still when i write bigger than 15 char in box it no accept it.

 

You need to learn the Community Board style for inputs form. They uses another link style for buttons.

  • 0
Posted

You need to learn the Community Board style for inputs form. They uses another link style for buttons.

yea that what im asking lel,, the style in request bypass is example bypass -h blabla

 

in community is ?

  • 0
Posted

yea that what im asking lel,, the style in request bypass is example bypass -h blabla

 

in community is ?

 

Open commynity Mail section and you find the answer. Don't be lazy.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...