Added UO Razor Script (#3309)

This commit is contained in:
Jason Ramsey 2022-01-28 10:13:21 -06:00 committed by GitHub
parent bcb2e2c82c
commit 3f8cc5a0dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 502 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@ -1377,6 +1377,10 @@
"alias": ["uscript", "uc"],
"owner": "RunDevelopment"
},
"uorazor": {
"title": "UO Razor Script",
"owner": "jaseowns"
},
"uri": {
"title": "URI",
"alias": "url",

View File

@ -0,0 +1,48 @@
Prism.languages.uorazor = {
'comment-hash': {
pattern: /#.*/,
alias: 'comment',
greedy: true
},
'comment-slash': {
pattern: /\/\/.*/,
alias: 'comment',
greedy: true
},
'string': {
pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
inside: {
'punctuation': /^['"]|['"]$/
},
greedy: true
},
'source-layers': {
pattern: /\b(?:arms|backpack|blue|bracelet|cancel|clear|cloak|criminal|earrings|enemy|facialhair|friend|friendly|gloves|gray|grey|ground|hair|head|innerlegs|innertorso|innocent|lefthand|middletorso|murderer|neck|nonfriendly|onehandedsecondary|outerlegs|outertorso|pants|red|righthand|ring|self|shirt|shoes|talisman|waist)\b/i,
alias: 'function'
},
'source-commands': {
pattern: /\b(?:alliance|attack|cast|clearall|clearignore|clearjournal|clearlist|clearsysmsg|createlist|createtimer|dclick|dclicktype|dclickvar|dress|dressconfig|drop|droprelloc|emote|getlabel|guild|gumpclose|gumpresponse|hotkey|ignore|lasttarget|lift|lifttype|menu|menuresponse|msg|org|organize|organizer|overhead|pause|poplist|potion|promptresponse|pushlist|removelist|removetimer|rename|restock|say|scav|scavenger|script|setability|setlasttarget|setskill|settimer|setvar|sysmsg|target|targetloc|targetrelloc|targettype|undress|unignore|unsetvar|useobject|useonce|useskill|usetype|virtue|wait|waitforgump|waitformenu|waitforprompt|waitforstat|waitforsysmsg|waitfortarget|walk|wfsysmsg|wft|whisper|yell)\b/,
alias: 'function'
},
'tag-name': {
pattern: /(^\{%-?\s*)\w+/,
lookbehind: true,
alias: 'keyword'
},
'delimiter': {
pattern: /^\{[{%]-?|-?[%}]\}$/,
alias: 'punctuation'
},
'function': /\b(?:atlist|close|closest|count|counter|counttype|dead|dex|diffhits|diffmana|diffstam|diffweight|find|findbuff|finddebuff|findlayer|findtype|findtypelist|followers|gumpexists|hidden|hits|hp|hue|human|humanoid|ingump|inlist|insysmessage|insysmsg|int|invul|lhandempty|list|listexists|mana|maxhits|maxhp|maxmana|maxstam|maxweight|monster|mounted|name|next|noto|paralyzed|poisoned|position|prev|previous|queued|rand|random|rhandempty|skill|stam|str|targetexists|timer|timerexists|varexist|warmode|weight)\b/,
'keyword': /\b(?:and|as|break|continue|else|elseif|endfor|endif|endwhile|for|if|loop|not|or|replay|stop|while)\b/,
'boolean': /\b(?:false|null|true)\b/,
'number': /\b0x[\dA-Fa-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][-+]?\d+)?/,
'operator': [
{
pattern: /(\s)(?:and|b-and|b-or|b-xor|ends with|in|is|matches|not|or|same as|starts with)(?=\s)/,
lookbehind: true
},
/[=<>]=?|!=|\*\*?|\/\/?|\?:?|[-+~%|]/
],
'punctuation': /[()\[\]{}:.,]/
};

1
components/prism-uorazor.min.js vendored Normal file
View File

@ -0,0 +1 @@
Prism.languages.uorazor={"comment-hash":{pattern:/#.*/,alias:"comment",greedy:!0},"comment-slash":{pattern:/\/\/.*/,alias:"comment",greedy:!0},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,inside:{punctuation:/^['"]|['"]$/},greedy:!0},"source-layers":{pattern:/\b(?:arms|backpack|blue|bracelet|cancel|clear|cloak|criminal|earrings|enemy|facialhair|friend|friendly|gloves|gray|grey|ground|hair|head|innerlegs|innertorso|innocent|lefthand|middletorso|murderer|neck|nonfriendly|onehandedsecondary|outerlegs|outertorso|pants|red|righthand|ring|self|shirt|shoes|talisman|waist)\b/i,alias:"function"},"source-commands":{pattern:/\b(?:alliance|attack|cast|clearall|clearignore|clearjournal|clearlist|clearsysmsg|createlist|createtimer|dclick|dclicktype|dclickvar|dress|dressconfig|drop|droprelloc|emote|getlabel|guild|gumpclose|gumpresponse|hotkey|ignore|lasttarget|lift|lifttype|menu|menuresponse|msg|org|organize|organizer|overhead|pause|poplist|potion|promptresponse|pushlist|removelist|removetimer|rename|restock|say|scav|scavenger|script|setability|setlasttarget|setskill|settimer|setvar|sysmsg|target|targetloc|targetrelloc|targettype|undress|unignore|unsetvar|useobject|useonce|useskill|usetype|virtue|wait|waitforgump|waitformenu|waitforprompt|waitforstat|waitforsysmsg|waitfortarget|walk|wfsysmsg|wft|whisper|yell)\b/,alias:"function"},"tag-name":{pattern:/(^\{%-?\s*)\w+/,lookbehind:!0,alias:"keyword"},delimiter:{pattern:/^\{[{%]-?|-?[%}]\}$/,alias:"punctuation"},function:/\b(?:atlist|close|closest|count|counter|counttype|dead|dex|diffhits|diffmana|diffstam|diffweight|find|findbuff|finddebuff|findlayer|findtype|findtypelist|followers|gumpexists|hidden|hits|hp|hue|human|humanoid|ingump|inlist|insysmessage|insysmsg|int|invul|lhandempty|list|listexists|mana|maxhits|maxhp|maxmana|maxstam|maxweight|monster|mounted|name|next|noto|paralyzed|poisoned|position|prev|previous|queued|rand|random|rhandempty|skill|stam|str|targetexists|timer|timerexists|varexist|warmode|weight)\b/,keyword:/\b(?:and|as|break|continue|else|elseif|endfor|endif|endwhile|for|if|loop|not|or|replay|stop|while)\b/,boolean:/\b(?:false|null|true)\b/,number:/\b0x[\dA-Fa-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][-+]?\d+)?/,operator:[{pattern:/(\s)(?:and|b-and|b-or|b-xor|ends with|in|is|matches|not|or|same as|starts with)(?=\s)/,lookbehind:!0},/[=<>]=?|!=|\*\*?|\/\/?|\?:?|[-+~%|]/],punctuation:/[()\[\]{}:.,]/};

View File

@ -0,0 +1,13 @@
<h2>Full example</h2>
<pre><code>
# UO Razor Script Highlighting by Jaseowns
// These two are comments
// Example script:
setvar "my_training_target"
while skill "anatomy" &lt; 100
useskill "anatomy"
wft 500
target "my_training_target"
wait 2000
endwhile
</code></pre>

View File

@ -239,6 +239,7 @@
"tsconfig": "TSConfig",
"uscript": "UnrealScript",
"uc": "UnrealScript",
"uorazor": "UO Razor Script",
"uri": "URI",
"url": "URL",
"vbnet": "VB.Net",

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,13 @@
false
true
----------------------------------------------------
[
["boolean", "false"],
["boolean", "true"]
]
----------------------------------------------------
Checks for boolean values

View File

@ -0,0 +1,54 @@
setvar "my_training_target"
while skill "anatomy" < 100
useskill "anatomy"
wft 500
target "my_training_target"
wait 2000
endwhile
----------------------------------------------------
[
["source-commands", "setvar"],
["string", [
["punctuation", "\""],
"my_training_target",
["punctuation", "\""]
]],
["keyword", "while"],
["function", "skill"],
["string", [
["punctuation", "\""],
"anatomy",
["punctuation", "\""]
]],
["operator", "<"],
["number", "100"],
["source-commands", "useskill"],
["string", [
["punctuation", "\""],
"anatomy",
["punctuation", "\""]
]],
["source-commands", "wft"],
["number", "500"],
["source-commands", "target"],
["string", [
["punctuation", "\""],
"my_training_target",
["punctuation", "\""]
]],
["source-commands", "wait"],
["number", "2000"],
["keyword", "endwhile"]
]
----------------------------------------------------
Checks for each type of syntax breakdown

View File

@ -0,0 +1,153 @@
alliance
attack
cast
clearall
clearignore
clearjournal
clearlist
clearsysmsg
createlist
createtimer
dclick
dclicktype
dclickvar
dress
dressconfig
drop
droprelloc
emote
getlabel
guild
gumpclose
gumpresponse
hotkey
ignore
lasttarget
lift
lifttype
menu
menuresponse
msg
org
organize
organizer
overhead
pause
poplist
potion
promptresponse
pushlist
removelist
removetimer
rename
restock
say
scav
scavenger
script
setability
setlasttarget
setskill
settimer
sysmsg
targetloc
targetrelloc
targettype
undress
unignore
unsetvar
useobject
useonce
usetype
virtue
waitforgump
waitformenu
waitforprompt
waitforstat
waitforsysmsg
waitfortarget
walk
wfsysmsg
whisper
yell
----------------------------------------------------
[
["source-commands", "alliance"],
["source-commands", "attack"],
["source-commands", "cast"],
["source-commands", "clearall"],
["source-commands", "clearignore"],
["source-commands", "clearjournal"],
["source-commands", "clearlist"],
["source-commands", "clearsysmsg"],
["source-commands", "createlist"],
["source-commands", "createtimer"],
["source-commands", "dclick"],
["source-commands", "dclicktype"],
["source-commands", "dclickvar"],
["source-commands", "dress"],
["source-commands", "dressconfig"],
["source-commands", "drop"],
["source-commands", "droprelloc"],
["source-commands", "emote"],
["source-commands", "getlabel"],
["source-commands", "guild"],
["source-commands", "gumpclose"],
["source-commands", "gumpresponse"],
["source-commands", "hotkey"],
["source-commands", "ignore"],
["source-commands", "lasttarget"],
["source-commands", "lift"],
["source-commands", "lifttype"],
["source-commands", "menu"],
["source-commands", "menuresponse"],
["source-commands", "msg"],
["source-commands", "org"],
["source-commands", "organize"],
["source-commands", "organizer"],
["source-commands", "overhead"],
["source-commands", "pause"],
["source-commands", "poplist"],
["source-commands", "potion"],
["source-commands", "promptresponse"],
["source-commands", "pushlist"],
["source-commands", "removelist"],
["source-commands", "removetimer"],
["source-commands", "rename"],
["source-commands", "restock"],
["source-commands", "say"],
["source-commands", "scav"],
["source-commands", "scavenger"],
["source-commands", "script"],
["source-commands", "setability"],
["source-commands", "setlasttarget"],
["source-commands", "setskill"],
["source-commands", "settimer"],
["source-commands", "sysmsg"],
["source-commands", "targetloc"],
["source-commands", "targetrelloc"],
["source-commands", "targettype"],
["source-commands", "undress"],
["source-commands", "unignore"],
["source-commands", "unsetvar"],
["source-commands", "useobject"],
["source-commands", "useonce"],
["source-commands", "usetype"],
["source-commands", "virtue"],
["source-commands", "waitforgump"],
["source-commands", "waitformenu"],
["source-commands", "waitforprompt"],
["source-commands", "waitforstat"],
["source-commands", "waitforsysmsg"],
["source-commands", "waitfortarget"],
["source-commands", "walk"],
["source-commands", "wfsysmsg"],
["source-commands", "whisper"],
["source-commands", "yell"]
]
----------------------------------------------------
Checks for commands.

View File

@ -0,0 +1,13 @@
# This is a comment
// so is this
----------------------------------------------------
[
["comment-hash", "# This is a comment"],
["comment-slash", "// so is this"]
]
----------------------------------------------------
Checks for comments.

View File

@ -0,0 +1,74 @@
atlist close closest count counter counttype dead dex diffhits diffmana diffstam diffweight find findbuff finddebuff findlayer findtype findtypelist followers gumpexists hidden hits hp hue human humanoid ingump inlist insysmessage insysmsg int invul lhandempty list listexists mana maxhits maxhp maxmana maxstam maxweight monster mounted name next noto paralyzed poisoned position prev previous queued rand random rhandempty skill stam str targetexists timer timerexists varexist warmode weight
----------------------------------------------------
[
["function", "atlist"],
["function", "close"],
["function", "closest"],
["function", "count"],
["function", "counter"],
["function", "counttype"],
["function", "dead"],
["function", "dex"],
["function", "diffhits"],
["function", "diffmana"],
["function", "diffstam"],
["function", "diffweight"],
["function", "find"],
["function", "findbuff"],
["function", "finddebuff"],
["function", "findlayer"],
["function", "findtype"],
["function", "findtypelist"],
["function", "followers"],
["function", "gumpexists"],
["function", "hidden"],
["function", "hits"],
["function", "hp"],
["function", "hue"],
["function", "human"],
["function", "humanoid"],
["function", "ingump"],
["function", "inlist"],
["function", "insysmessage"],
["function", "insysmsg"],
["function", "int"],
["function", "invul"],
["function", "lhandempty"],
["function", "list"],
["function", "listexists"],
["function", "mana"],
["function", "maxhits"],
["function", "maxhp"],
["function", "maxmana"],
["function", "maxstam"],
["function", "maxweight"],
["function", "monster"],
["function", "mounted"],
["function", "name"],
["function", "next"],
["function", "noto"],
["function", "paralyzed"],
["function", "poisoned"],
["function", "position"],
["function", "prev"],
["function", "previous"],
["function", "queued"],
["function", "rand"],
["function", "random"],
["function", "rhandempty"],
["function", "skill"],
["function", "stam"],
["function", "str"],
["function", "targetexists"],
["function", "timer"],
["function", "timerexists"],
["function", "varexist"],
["function", "warmode"],
["function", "weight"]
]
----------------------------------------------------
Checks for functions.

View File

@ -0,0 +1,39 @@
and
as
break
continue
else
elseif
endfor
endif
for
if
loop
not
or
replay
stop
----------------------------------------------------
[
["keyword", "and"],
["keyword", "as"],
["keyword", "break"],
["keyword", "continue"],
["keyword", "else"],
["keyword", "elseif"],
["keyword", "endfor"],
["keyword", "endif"],
["keyword", "for"],
["keyword", "if"],
["keyword", "loop"],
["keyword", "not"],
["keyword", "or"],
["keyword", "replay"],
["keyword", "stop"]
]
----------------------------------------------------
Checks for keywords.

View File

@ -0,0 +1,87 @@
backpack
gloves
self
ARMS
BLUE
BRACELET
CANCEL
CLEAR
CLOAK
CRIMINAL
EARRINGS
ENEMY
FACIALHAIR
FRIEND
FRIENDLY
GRAY
GREY
GROUND
HAIR
HEAD
INNERLEGS
INNERTORSO
INNOCENT
LEFTHAND
MIDDLETORSO
MURDERER
NECK
NONFRIENDLY
ONEHANDEDSECONDARY
OUTERLEGS
OUTERTORSO
PANTS
RED
RIGHTHAND
RING
SHIRT
SHOES
TALISMAN
WAIST
----------------------------------------------------
[
["source-layers", "backpack"],
["source-layers", "gloves"],
["source-layers", "self"],
["source-layers", "ARMS"],
["source-layers", "BLUE"],
["source-layers", "BRACELET"],
["source-layers", "CANCEL"],
["source-layers", "CLEAR"],
["source-layers", "CLOAK"],
["source-layers", "CRIMINAL"],
["source-layers", "EARRINGS"],
["source-layers", "ENEMY"],
["source-layers", "FACIALHAIR"],
["source-layers", "FRIEND"],
["source-layers", "FRIENDLY"],
["source-layers", "GRAY"],
["source-layers", "GREY"],
["source-layers", "GROUND"],
["source-layers", "HAIR"],
["source-layers", "HEAD"],
["source-layers", "INNERLEGS"],
["source-layers", "INNERTORSO"],
["source-layers", "INNOCENT"],
["source-layers", "LEFTHAND"],
["source-layers", "MIDDLETORSO"],
["source-layers", "MURDERER"],
["source-layers", "NECK"],
["source-layers", "NONFRIENDLY"],
["source-layers", "ONEHANDEDSECONDARY"],
["source-layers", "OUTERLEGS"],
["source-layers", "OUTERTORSO"],
["source-layers", "PANTS"],
["source-layers", "RED"],
["source-layers", "RIGHTHAND"],
["source-layers", "RING"],
["source-layers", "SHIRT"],
["source-layers", "SHOES"],
["source-layers", "TALISMAN"],
["source-layers", "WAIST"]
]
----------------------------------------------------
Checks for source layers.