New release imminent, and magic

mikec

Master Of All That I Survey
Administrator
Jul 12, 2014
296
152
28
Los Angeles, California, USA
Just a heads up. I closed a bunch of issues, and finished the new command parsing. It works really well. Many other bugs have been fixed. But I am really proud of the command parser. You no longer need to put names of players and items in quotes, but you can if you want to. Type all in lower case, or caps lock ON. Makes no difference, it is case-insensitive. You can even mis-spell item names and player names, and if you got most of it right, it will still locate the correct player or item. If you can't remember whether a blueprint is "BP" or "Blueprint" just type either one, the parser knows what goes with what. As you can see in the examples below, you need to spell a player's name about 60% right to make sure it matches. Or put it in quotes. You can also just eliminate spaces from a player's name instead of quoting. Works just as well.

Code:
/give blueprntz 556 ammo 556 )))00)
quantity = 556
testStr = ammo )))00), bestName = Рачок))))00)
itemName = 556 Ammo Blueprint

/give hanky christmas poo  556 ammo bp
quantity = 1
testStr = hanky christmas poo, bestName = Hanky The Christmas Poo
itemName = 556 Ammo Blueprint

/give hanky christmas poo  556 ammo bp 556
quantity = 556
testStr = hanky christmas poo, bestName = Hanky The Christmas Poo
itemName = 556 Ammo Blueprint

/give empty shutgun casing raven moon
quantity = 1
testStr = casing raven moon, bestName = Aria Ravenmoon
itemName = Empty 556 Casing

/give empty shutgun shell raven moon
quantity = 1
testStr = shell raven moon, bestName = Aria Ravenmoon
itemName = Empty Shotgun Shell

/give mt shutgun shell raven moon
quantity = 1
testStr = shell raven moon, bestName = Aria Ravenmoon
itemName = Empty Shotgun Shell

/give mt shutgun shell ria raven moon
quantity = 1
testStr = ria raven moon, bestName = Aria Ravenmoon
itemName = Empty Shotgun Shell

/give 556 ammo bp 556 ria raven moon
quantity = 556
testStr = ria raven moon, bestName = Aria Ravenmoon
itemName = 556 Ammo Blueprint

/give hankypoo  "556 ammo bp" 556
quantity = 556
testStr = hankypoo, bestName = hunkill
itemName = 556 Ammo Blueprint

/give hanky poo  "556 ammo bp" 556
quantity = 556
testStr = hanky, bestName = hunkill
itemName = 556 Ammo Blueprint

/give "hanky poo"  "556 ammo bp" 556
quantity = 556
testStr = hanky poo, bestName = Hanky The Christmas Poo
itemName = 556 Ammo Blueprint

/give 9000 kills  "556 ammo bp" 556
quantity = 556
testStr = kills, bestName = SkillDic
itemName = 556 Ammo Blueprint

/give "9000 kills"  "556 ammo bp" 556
quantity = 556
testStr = 9000 kills, bestName = Over9000 Hippie kills
itemName = 556 Ammo Blueprint

/give "9000 kills"  "556 ammo" 556 blueprnt
quantity = 556
testStr = 9000 kills, bestName = Over9000 Hippie kills
itemName = 556 Ammo Blueprint

/give blueprntz 556 ammo 556 kazuma
quantity = 556
testStr = ammo kazuma, bestName = DeathGodKazuma
itemName = 556 Ammo Blueprint

/give blueprntz 556 ammo 556 endan spu
quantity = 556
testStr = endan, bestName = Sandman
itemName = 556 Ammo Blueprint

/give blueprntz 556 ammo 556 "endan spu"
quantity = 556
testStr = endan spu, bestName = Endangered SpyCrab
itemName = 556 Ammo Blueprint

/give blueprntz 556 ammo 556 fag o tron
quantity = 556
testStr = tron, bestName = TRONO
itemName = 556 Ammo Blueprint

/give blueprntz 556 ammo 556 "fag o tron"
quantity = 556
testStr = fag o tron, bestName = Faggottron3000
itemName = 556 Ammo Blueprint
 

mikec

Master Of All That I Survey
Administrator
Jul 12, 2014
296
152
28
Los Angeles, California, USA
For some reason the word "explosives" causes chat.say to throw an exception but "explosive" does not? WTF.

[DEBUG] [CHAT-CMD] "MC MC" executed "/i explosives 2"

Error: chat.say - Exception has been thrown by the target of an invocation.

[DEBUG] [CHAT-CMD] "MC MC" executed "/i explosives blueprint"

Error: chat.say - Exception has been thrown by the target of an invocation.

[DEBUG] [CHAT-CMD] "MC MC" executed "/i explosiv blue"

[DEBUG] [MatchItemName] self=explosiv blue matches=Explosive Charge, Explosives, Metal Window Bars, Rad Suit Helmet, Invisible Helmet, Cloth Boots, Small Water Bottle, Rad Suit Boots, Empty Shotgun Shell, Invisible Boots, Empty 556 Casing, Bolt Action Rifle, Large Wood Storage, 9mm Pistol, Anti-Radiation Pills, Cooked Chicken Breast, Invisible Pants, Wood Storage Box, Low Quality Metal, 556 Ammo, Flashlight Mod, Wood Foundation, Handmade Lockpick, Blood Draw Kit

[DEBUG] [SpawnItemCommand] terms=explosiv,blue, itemName=Explosive Charge Blueprint, quantity=1

[DEBUG] [CHAT-CMD] "MC MC" executed "/i \"explosive blueprint\""

Error: chat.say - Exception has been thrown by the target of an invocation.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,065
4,486
113
At your house.
github.com
For some reason the word "explosives" causes chat.say to throw an exception but "explosive" does not? WTF.

[DEBUG] [CHAT-CMD] "MC MC" executed "/i explosives 2"

Error: chat.say - Exception has been thrown by the target of an invocation.

[DEBUG] [CHAT-CMD] "MC MC" executed "/i explosives blueprint"

Error: chat.say - Exception has been thrown by the target of an invocation.

[DEBUG] [CHAT-CMD] "MC MC" executed "/i explosiv blue"

[DEBUG] [MatchItemName] self=explosiv blue matches=Explosive Charge, Explosives, Metal Window Bars, Rad Suit Helmet, Invisible Helmet, Cloth Boots, Small Water Bottle, Rad Suit Boots, Empty Shotgun Shell, Invisible Boots, Empty 556 Casing, Bolt Action Rifle, Large Wood Storage, 9mm Pistol, Anti-Radiation Pills, Cooked Chicken Breast, Invisible Pants, Wood Storage Box, Low Quality Metal, 556 Ammo, Flashlight Mod, Wood Foundation, Handmade Lockpick, Blood Draw Kit

[DEBUG] [SpawnItemCommand] terms=explosiv,blue, itemName=Explosive Charge Blueprint, quantity=1

[DEBUG] [CHAT-CMD] "MC MC" executed "/i \"explosive blueprint\""

Error: chat.say - Exception has been thrown by the target of an invocation.
Just a small note for you.

If you use a chatevent and you make the new text to be an empty string you also get an error.
 

mikec

Master Of All That I Survey
Administrator
Jul 12, 2014
296
152
28
Los Angeles, California, USA
Right now, I am taking the best match, no matter how close it is. But I could use a cut-off, something like 50% similar or so, and if nothing is a better match than that I could come back with "No player found with that name" or "No item known by that name." Or I could just return the best match, and if you were too lazy, you could get an item you didn't want, or player you didn't mean to get.

But if you type in at least 60% or more of the name correctly, and what you typed is close in length to what you wanted, it's going to find the exact match. The corner cases are "Explosive" and "Explosives" and their blueprints, but even those are handled by simply typing the full name (once I fix the exception, of course).
 

Snake

Moderator
Moderator
Jul 13, 2014
288
174
28
Right now, I am taking the best match, no matter how close it is. But I could use a cut-off, something like 50% similar or so, and if nothing is a better match than that I could come back with "No player found with that name" or "No item known by that name." Or I could just return the best match, and if you were too lazy, you could get an item you didn't want, or player you didn't mean to get.

But if you type in at least 60% or more of the name correctly, and what you typed is close in length to what you wanted, it's going to find the exact match. The corner cases are "Explosive" and "Explosives" and their blueprints, but even those are handled by simply typing the full name (once I fix the exception, of course).
That's the issue I posted some time ago. chat.say exceptions don't give any helpfull info :(
 

mikec

Master Of All That I Survey
Administrator
Jul 12, 2014
296
152
28
Los Angeles, California, USA
Just a small note for you.

If you use a chatevent and you make the new text to be an empty string you also get an error.
I think you are right. I need to check for empty string 1st and bail out without doing anything. I thought it should be ok, since an empty Chat string should also mean ChatArguments the array has zero elements. I check for the minimum required arguments 1st thing already.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,065
4,486
113
At your house.
github.com
I think you are right. I need to check for empty string 1st and bail out without doing anything. I thought it should be ok, since an empty Chat string should also mean ChatArguments the array has zero elements. I check for the minimum required arguments 1st thing already.
Hmm
 
  • Winner
Reactions: MasterPeace