ScriptUO
Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: _C2_ on November 06, 2010, 06:54:05 PM
-
looking for a little help on strings. i have never spent a ton of time with them and am more than rusty from what i use to be able to do with them...
looking for ideas on how to handle the new bobbers with the characters name in them.
I tried doing event property and then looking for #charname in property but that did not work at all when a character had two parts to their name. The space does not show up the same way in the #property.
So, that leaves me to think i need to use strings to rework the name or pull the name part.
Currently, i have the user set %namepart by editting a few of the letters in their name. ex if the name was Uber Noober... they would set %namepart uber or set %namepart noob
Problem is many forget and then the script doesn't work for them becasue it doesnt see their name part in the bobber and it tries replacing them all over and over.
so setting strings could take a name like uber noober and make it into this... uber_noober which could be seen in #property or even taking the a section of the name... the tricky part is some names are shorter than others and/or many folks have lady/lord titles.
Any ideas or sample code would be appreciated and earn credits in code.
-
if oober , #spc , noober in #property? Try that.
-
if oober , #spc , noober in #property? Try that.
that would be great for just me but I am looking for it to support all users. What i have now works great for me too but users have to edit it in a section still. i want users to have that as hands off
-
if oober , #spc , noober in #property? Try that.
that would be great for just me but I am looking for it to support all users. What i have now works great for me too but users have to edit it in a section still. i want users to have that as hands off
Open their title menu and clear it? :)
-
Here's something I whipped up which removes the Lord/Lady part of the name, then changes the spaces to underscores:
sub ConvertSpacesToUnderscores
set %name #charname
str count %name #spc
if #strRES = 0
{
return
}
if Lord in %name || Lady in %name
{
str del %name 1 5 ; removes the first 5 chars, ie. Lord_ or Lady_
set %name #strRES
}
str count %name #spc
if #strRES = 0
{
return
}
set %loop #strRES
for %i 1 %loop
{
str Pos %name #spc
set %InsSpot #strRES
set %DelSpot %InsSpot + 1
str Ins %name _ %InsSpot ; #strRes = HELILO
set %name #strRES
str Del %name %DelSpot 1 ; #strRes = HEO
set %name #strRES
}
return
Hopefully that works or at least helps you out!!!
-
that is basically what i am talking about! that takes care of names with spaces. i will look at that more tomorrow evening. It could be used in a script to eliviate users need to add parts of their names