generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: String Manipulation

Previous Thread :: Next Thread 
ilikepie71 is not online. ilikepie71
Joined: 30 May 2009
Total Posts: 71
29 Jul 2012 03:00 AM
When using gmatch to find a pattern in a string, I know "%D" gets any character that's non-digit.
How would you get any character that's not a magic character like ^ or @?
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
29 Jul 2012 03:03 AM
I think... Hmm.. That's a hard one, maybe %a and %d.
Report Abuse
ilikepie71 is not online. ilikepie71
Joined: 30 May 2009
Total Posts: 71
29 Jul 2012 03:10 AM
I'm creating an anti-insert script to prevent people from inserting objects via ToolBox; I've seen some free models that do this, but I don't like the way they do it, since they create an if statement for every single possible object possible. So I compiled all the possible objects's Names in a string value (using a script of course) and the Names are separated by a ^.

houseInteriorKitchenOven^houseInteriorCountersBtm^houseInteriorSink
is a part of the string value

Some of the names contain underscores and stuff, so just searching for alphanumeric characters wouldn't work.
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
29 Jul 2012 03:11 AM
Don't use free models then...
Report Abuse
ilikepie71 is not online. ilikepie71
Joined: 30 May 2009
Total Posts: 71
29 Jul 2012 03:19 AM
I'm not, that's why I'm trying to figure out how to capture all characters in a string that are non-magic characters.

Here's a section of my script


local NotAllowed = {}


for name in script.RestrictedItems.Value:gmatch("%P+") do
table.insert(NotAllowed,name)
end

--

And here's a part of RestrictedItems.Value

^houseInteriorBathroomMirror^castleSteeple^castleSteeple^Superball

It doesn't work with items with underscores in their name like Spikes_Simple
So the question is how to capture everything but that ^ character.
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
29 Jul 2012 03:20 AM
Oh I get it, but I think you can use two at a time, I'm not entirely sure, though.
Report Abuse
ilikepie71 is not online. ilikepie71
Joined: 30 May 2009
Total Posts: 71
29 Jul 2012 01:40 PM
I'ma bump this since I started this thread when everyone else was sleeping.
Report Abuse
ilikepie71 is not online. ilikepie71
Joined: 30 May 2009
Total Posts: 71
29 Jul 2012 01:56 PM
Are underscores white space or punctuation?
Report Abuse
B3tturTh3nU is not online. B3tturTh3nU
Joined: 18 Jun 2008
Total Posts: 6574
29 Jul 2012 02:03 PM
I'm pretty sure they're not considered either of those.

You don't end your sentences like this, do you_
And_using_them_as_spaces_is_just_silly.
Report Abuse
ilikepie71 is not online. ilikepie71
Joined: 30 May 2009
Total Posts: 71
29 Jul 2012 02:12 PM
So what are they?
Report Abuse
DXPower is not online. DXPower
Joined: 21 Oct 2008
Total Posts: 2866
29 Jul 2012 02:26 PM
"Any non-magic character (not one of ^$()%.[]*+-?), represents itself in a pattern." -The wiki

Well, based on that, you can't do what you are attempting to do. Sorry. :(
Time to update this siggy, to this: !
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image