Skip to content

Commit 3f8cc5a

Browse files
authoredJan 28, 2022
Added UO Razor Script (#3309)
1 parent bcb2e2c commit 3f8cc5a

14 files changed

+502
-2
lines changed
 

‎components.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎components.json

+4
Original file line numberDiff line numberDiff line change
@@ -1377,6 +1377,10 @@
13771377
"alias": ["uscript", "uc"],
13781378
"owner": "RunDevelopment"
13791379
},
1380+
"uorazor": {
1381+
"title": "UO Razor Script",
1382+
"owner": "jaseowns"
1383+
},
13801384
"uri": {
13811385
"title": "URI",
13821386
"alias": "url",

‎components/prism-uorazor.js

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
Prism.languages.uorazor = {
2+
'comment-hash': {
3+
pattern: /#.*/,
4+
alias: 'comment',
5+
greedy: true
6+
},
7+
'comment-slash': {
8+
pattern: /\/\/.*/,
9+
alias: 'comment',
10+
greedy: true
11+
},
12+
'string': {
13+
pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
14+
inside: {
15+
'punctuation': /^['"]|['"]$/
16+
},
17+
greedy: true
18+
},
19+
'source-layers': {
20+
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,
21+
alias: 'function'
22+
},
23+
'source-commands': {
24+
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/,
25+
alias: 'function'
26+
},
27+
'tag-name': {
28+
pattern: /(^\{%-?\s*)\w+/,
29+
lookbehind: true,
30+
alias: 'keyword'
31+
},
32+
'delimiter': {
33+
pattern: /^\{[{%]-?|-?[%}]\}$/,
34+
alias: 'punctuation'
35+
},
36+
'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/,
37+
'keyword': /\b(?:and|as|break|continue|else|elseif|endfor|endif|endwhile|for|if|loop|not|or|replay|stop|while)\b/,
38+
'boolean': /\b(?:false|null|true)\b/,
39+
'number': /\b0x[\dA-Fa-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][-+]?\d+)?/,
40+
'operator': [
41+
{
42+
pattern: /(\s)(?:and|b-and|b-or|b-xor|ends with|in|is|matches|not|or|same as|starts with)(?=\s)/,
43+
lookbehind: true
44+
},
45+
/[=<>]=?|!=|\*\*?|\/\/?|\?:?|[-+~%|]/
46+
],
47+
'punctuation': /[()\[\]{}:.,]/
48+
};

‎components/prism-uorazor.min.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎examples/prism-uorazor.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<h2>Full example</h2>
2+
<pre><code>
3+
# UO Razor Script Highlighting by Jaseowns
4+
// These two are comments
5+
// Example script:
6+
setvar "my_training_target"
7+
while skill "anatomy" &lt; 100
8+
useskill "anatomy"
9+
wft 500
10+
target "my_training_target"
11+
wait 2000
12+
endwhile
13+
</code></pre>

‎plugins/show-language/prism-show-language.js

+1
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@
239239
"tsconfig": "TSConfig",
240240
"uscript": "UnrealScript",
241241
"uc": "UnrealScript",
242+
"uorazor": "UO Razor Script",
242243
"uri": "URI",
243244
"url": "URL",
244245
"vbnet": "VB.Net",

‎plugins/show-language/prism-show-language.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
false
2+
true
3+
4+
----------------------------------------------------
5+
6+
[
7+
["boolean", "false"],
8+
["boolean", "true"]
9+
]
10+
11+
----------------------------------------------------
12+
13+
Checks for boolean values
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
setvar "my_training_target"
2+
while skill "anatomy" < 100
3+
useskill "anatomy"
4+
wft 500
5+
target "my_training_target"
6+
wait 2000
7+
endwhile
8+
9+
----------------------------------------------------
10+
11+
[
12+
["source-commands", "setvar"],
13+
["string", [
14+
["punctuation", "\""],
15+
"my_training_target",
16+
["punctuation", "\""]
17+
]],
18+
19+
["keyword", "while"],
20+
["function", "skill"],
21+
["string", [
22+
["punctuation", "\""],
23+
"anatomy",
24+
["punctuation", "\""]
25+
]],
26+
["operator", "<"],
27+
["number", "100"],
28+
29+
["source-commands", "useskill"],
30+
["string", [
31+
["punctuation", "\""],
32+
"anatomy",
33+
["punctuation", "\""]
34+
]],
35+
36+
["source-commands", "wft"],
37+
["number", "500"],
38+
39+
["source-commands", "target"],
40+
["string", [
41+
["punctuation", "\""],
42+
"my_training_target",
43+
["punctuation", "\""]
44+
]],
45+
46+
["source-commands", "wait"],
47+
["number", "2000"],
48+
49+
["keyword", "endwhile"]
50+
]
51+
52+
----------------------------------------------------
53+
54+
Checks for each type of syntax breakdown
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
alliance
2+
attack
3+
cast
4+
clearall
5+
clearignore
6+
clearjournal
7+
clearlist
8+
clearsysmsg
9+
createlist
10+
createtimer
11+
dclick
12+
dclicktype
13+
dclickvar
14+
dress
15+
dressconfig
16+
drop
17+
droprelloc
18+
emote
19+
getlabel
20+
guild
21+
gumpclose
22+
gumpresponse
23+
hotkey
24+
ignore
25+
lasttarget
26+
lift
27+
lifttype
28+
menu
29+
menuresponse
30+
msg
31+
org
32+
organize
33+
organizer
34+
overhead
35+
pause
36+
poplist
37+
potion
38+
promptresponse
39+
pushlist
40+
removelist
41+
removetimer
42+
rename
43+
restock
44+
say
45+
scav
46+
scavenger
47+
script
48+
setability
49+
setlasttarget
50+
setskill
51+
settimer
52+
sysmsg
53+
targetloc
54+
targetrelloc
55+
targettype
56+
undress
57+
unignore
58+
unsetvar
59+
useobject
60+
useonce
61+
usetype
62+
virtue
63+
waitforgump
64+
waitformenu
65+
waitforprompt
66+
waitforstat
67+
waitforsysmsg
68+
waitfortarget
69+
walk
70+
wfsysmsg
71+
whisper
72+
yell
73+
74+
----------------------------------------------------
75+
76+
[
77+
["source-commands", "alliance"],
78+
["source-commands", "attack"],
79+
["source-commands", "cast"],
80+
["source-commands", "clearall"],
81+
["source-commands", "clearignore"],
82+
["source-commands", "clearjournal"],
83+
["source-commands", "clearlist"],
84+
["source-commands", "clearsysmsg"],
85+
["source-commands", "createlist"],
86+
["source-commands", "createtimer"],
87+
["source-commands", "dclick"],
88+
["source-commands", "dclicktype"],
89+
["source-commands", "dclickvar"],
90+
["source-commands", "dress"],
91+
["source-commands", "dressconfig"],
92+
["source-commands", "drop"],
93+
["source-commands", "droprelloc"],
94+
["source-commands", "emote"],
95+
["source-commands", "getlabel"],
96+
["source-commands", "guild"],
97+
["source-commands", "gumpclose"],
98+
["source-commands", "gumpresponse"],
99+
["source-commands", "hotkey"],
100+
["source-commands", "ignore"],
101+
["source-commands", "lasttarget"],
102+
["source-commands", "lift"],
103+
["source-commands", "lifttype"],
104+
["source-commands", "menu"],
105+
["source-commands", "menuresponse"],
106+
["source-commands", "msg"],
107+
["source-commands", "org"],
108+
["source-commands", "organize"],
109+
["source-commands", "organizer"],
110+
["source-commands", "overhead"],
111+
["source-commands", "pause"],
112+
["source-commands", "poplist"],
113+
["source-commands", "potion"],
114+
["source-commands", "promptresponse"],
115+
["source-commands", "pushlist"],
116+
["source-commands", "removelist"],
117+
["source-commands", "removetimer"],
118+
["source-commands", "rename"],
119+
["source-commands", "restock"],
120+
["source-commands", "say"],
121+
["source-commands", "scav"],
122+
["source-commands", "scavenger"],
123+
["source-commands", "script"],
124+
["source-commands", "setability"],
125+
["source-commands", "setlasttarget"],
126+
["source-commands", "setskill"],
127+
["source-commands", "settimer"],
128+
["source-commands", "sysmsg"],
129+
["source-commands", "targetloc"],
130+
["source-commands", "targetrelloc"],
131+
["source-commands", "targettype"],
132+
["source-commands", "undress"],
133+
["source-commands", "unignore"],
134+
["source-commands", "unsetvar"],
135+
["source-commands", "useobject"],
136+
["source-commands", "useonce"],
137+
["source-commands", "usetype"],
138+
["source-commands", "virtue"],
139+
["source-commands", "waitforgump"],
140+
["source-commands", "waitformenu"],
141+
["source-commands", "waitforprompt"],
142+
["source-commands", "waitforstat"],
143+
["source-commands", "waitforsysmsg"],
144+
["source-commands", "waitfortarget"],
145+
["source-commands", "walk"],
146+
["source-commands", "wfsysmsg"],
147+
["source-commands", "whisper"],
148+
["source-commands", "yell"]
149+
]
150+
151+
----------------------------------------------------
152+
153+
Checks for commands.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# This is a comment
2+
// so is this
3+
4+
----------------------------------------------------
5+
6+
[
7+
["comment-hash", "# This is a comment"],
8+
["comment-slash", "// so is this"]
9+
]
10+
11+
----------------------------------------------------
12+
13+
Checks for comments.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
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
2+
3+
----------------------------------------------------
4+
5+
[
6+
["function", "atlist"],
7+
["function", "close"],
8+
["function", "closest"],
9+
["function", "count"],
10+
["function", "counter"],
11+
["function", "counttype"],
12+
["function", "dead"],
13+
["function", "dex"],
14+
["function", "diffhits"],
15+
["function", "diffmana"],
16+
["function", "diffstam"],
17+
["function", "diffweight"],
18+
["function", "find"],
19+
["function", "findbuff"],
20+
["function", "finddebuff"],
21+
["function", "findlayer"],
22+
["function", "findtype"],
23+
["function", "findtypelist"],
24+
["function", "followers"],
25+
["function", "gumpexists"],
26+
["function", "hidden"],
27+
["function", "hits"],
28+
["function", "hp"],
29+
["function", "hue"],
30+
["function", "human"],
31+
["function", "humanoid"],
32+
["function", "ingump"],
33+
["function", "inlist"],
34+
["function", "insysmessage"],
35+
["function", "insysmsg"],
36+
["function", "int"],
37+
["function", "invul"],
38+
["function", "lhandempty"],
39+
["function", "list"],
40+
["function", "listexists"],
41+
["function", "mana"],
42+
["function", "maxhits"],
43+
["function", "maxhp"],
44+
["function", "maxmana"],
45+
["function", "maxstam"],
46+
["function", "maxweight"],
47+
["function", "monster"],
48+
["function", "mounted"],
49+
["function", "name"],
50+
["function", "next"],
51+
["function", "noto"],
52+
["function", "paralyzed"],
53+
["function", "poisoned"],
54+
["function", "position"],
55+
["function", "prev"],
56+
["function", "previous"],
57+
["function", "queued"],
58+
["function", "rand"],
59+
["function", "random"],
60+
["function", "rhandempty"],
61+
["function", "skill"],
62+
["function", "stam"],
63+
["function", "str"],
64+
["function", "targetexists"],
65+
["function", "timer"],
66+
["function", "timerexists"],
67+
["function", "varexist"],
68+
["function", "warmode"],
69+
["function", "weight"]
70+
]
71+
72+
----------------------------------------------------
73+
74+
Checks for functions.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
and
2+
as
3+
break
4+
continue
5+
else
6+
elseif
7+
endfor
8+
endif
9+
for
10+
if
11+
loop
12+
not
13+
or
14+
replay
15+
stop
16+
17+
----------------------------------------------------
18+
19+
[
20+
["keyword", "and"],
21+
["keyword", "as"],
22+
["keyword", "break"],
23+
["keyword", "continue"],
24+
["keyword", "else"],
25+
["keyword", "elseif"],
26+
["keyword", "endfor"],
27+
["keyword", "endif"],
28+
["keyword", "for"],
29+
["keyword", "if"],
30+
["keyword", "loop"],
31+
["keyword", "not"],
32+
["keyword", "or"],
33+
["keyword", "replay"],
34+
["keyword", "stop"]
35+
]
36+
37+
----------------------------------------------------
38+
39+
Checks for keywords.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
backpack
2+
gloves
3+
self
4+
ARMS
5+
BLUE
6+
BRACELET
7+
CANCEL
8+
CLEAR
9+
CLOAK
10+
CRIMINAL
11+
EARRINGS
12+
ENEMY
13+
FACIALHAIR
14+
FRIEND
15+
FRIENDLY
16+
GRAY
17+
GREY
18+
GROUND
19+
HAIR
20+
HEAD
21+
INNERLEGS
22+
INNERTORSO
23+
INNOCENT
24+
LEFTHAND
25+
MIDDLETORSO
26+
MURDERER
27+
NECK
28+
NONFRIENDLY
29+
ONEHANDEDSECONDARY
30+
OUTERLEGS
31+
OUTERTORSO
32+
PANTS
33+
RED
34+
RIGHTHAND
35+
RING
36+
SHIRT
37+
SHOES
38+
TALISMAN
39+
WAIST
40+
41+
----------------------------------------------------
42+
43+
[
44+
["source-layers", "backpack"],
45+
["source-layers", "gloves"],
46+
["source-layers", "self"],
47+
["source-layers", "ARMS"],
48+
["source-layers", "BLUE"],
49+
["source-layers", "BRACELET"],
50+
["source-layers", "CANCEL"],
51+
["source-layers", "CLEAR"],
52+
["source-layers", "CLOAK"],
53+
["source-layers", "CRIMINAL"],
54+
["source-layers", "EARRINGS"],
55+
["source-layers", "ENEMY"],
56+
["source-layers", "FACIALHAIR"],
57+
["source-layers", "FRIEND"],
58+
["source-layers", "FRIENDLY"],
59+
["source-layers", "GRAY"],
60+
["source-layers", "GREY"],
61+
["source-layers", "GROUND"],
62+
["source-layers", "HAIR"],
63+
["source-layers", "HEAD"],
64+
["source-layers", "INNERLEGS"],
65+
["source-layers", "INNERTORSO"],
66+
["source-layers", "INNOCENT"],
67+
["source-layers", "LEFTHAND"],
68+
["source-layers", "MIDDLETORSO"],
69+
["source-layers", "MURDERER"],
70+
["source-layers", "NECK"],
71+
["source-layers", "NONFRIENDLY"],
72+
["source-layers", "ONEHANDEDSECONDARY"],
73+
["source-layers", "OUTERLEGS"],
74+
["source-layers", "OUTERTORSO"],
75+
["source-layers", "PANTS"],
76+
["source-layers", "RED"],
77+
["source-layers", "RIGHTHAND"],
78+
["source-layers", "RING"],
79+
["source-layers", "SHIRT"],
80+
["source-layers", "SHOES"],
81+
["source-layers", "TALISMAN"],
82+
["source-layers", "WAIST"]
83+
]
84+
85+
----------------------------------------------------
86+
87+
Checks for source layers.

0 commit comments

Comments
 (0)
Please sign in to comment.