|
||
|
|
#1 (permalink) |
|
Forum Novice
Join Date: Jun 2005
Location: Turkey
Age: 24
Posts: 105
|
I work on a script which included textbox but i want some chars or word in the textbox give a warning if this is a easyuo script i was used
Code:
if ( "idontwant" in textbox ) doaction
__________________
:confused: Why Dark Jedis Use Light Saber :confused: |
|
|
|
|
|
#2 (permalink) |
|
Forum Expert
|
That's because in C# the "in" keyword is meant to only be used as part of a foreach statement, not to test if a value is a part of a sequence. Also, when using the TextBox class, you cannot treat instances of it as a String, you need to use the Text property (so, textbox.Text, instead of textbox).
Now, what you're looking for is something along the lines of the Contains() method of the String class, which finds a given substring in the string. So to find a substring in the text of a textbox, it would be of the form Code:
textbox.Text.Contains("substring")
|
|
|
|
|
|
#4 (permalink) |
|
Forum Expert
Join Date: Nov 2003
Location: Illinois, USA
Age: 21
Posts: 2,911
|
in gumps sent to the client? I dont think gumps are able to do anything put output and receive input. So you would have to check if what they enters contains the criteria once they submit it and if it contains it, do whatever you need to do.
|
|
|
|
|
|
#6 (permalink) |
|
ConnectUO Creator
Join Date: Jan 2004
Location: In your mom
Age: 27
Posts: 4,760
|
if( textbox.Text.IndexOf( "words or char u dont want" ) != -1 )
DoAction();
__________________
Jeff Boulanger ConnectUO - Core Developer Want to help make ConnectUO better? Click here to submit your ideas/requests Use your talent to compete against other community members in RunUO hosted coding competitions If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team. Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO |
|
|
|
|
|
#7 (permalink) |
|
Forum Novice
Join Date: Jun 2005
Location: Turkey
Age: 24
Posts: 105
|
Thanx Jeff but i cant use this in a gump.
I need this for use at password change gump my players made a mistake use turkish chars in password and client does not support to write and people cant login to server..
__________________
:confused: Why Dark Jedis Use Light Saber :confused: |
|
|
|
|
|
#8 (permalink) | |
|
ConnectUO Creator
Join Date: Jan 2004
Location: In your mom
Age: 27
Posts: 4,760
|
Quote:
__________________
Jeff Boulanger ConnectUO - Core Developer Want to help make ConnectUO better? Click here to submit your ideas/requests Use your talent to compete against other community members in RunUO hosted coding competitions If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team. Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO |
|
|
|
|
|
|
#9 (permalink) |
|
Forum Expert
Join Date: Nov 2003
Location: Illinois, USA
Age: 21
Posts: 2,911
|
Ok, never used gumps before in my life, but use the concept of what Jeff said, not the exact code. In your script though, it would be in the OnResponse function and would be similar to this (I think lol):
PHP Code:
![]() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|